PDA

View Full Version : Hot Property / community builder registration as agent hack


dyvel
10-30-2006, 08:35 PM
Hi

Based on hot property agent hack I have updated the community builder hack to work with the latest version of community builder v. 1.0.1

I have tested it on joomla 1.0.11 and HP 0.98

Enjoy :)

syion
11-14-2006, 12:05 PM
What directory does this file go in?

Thanks for making the hack

Also do you still need to use the hp hack as well?

mpeetsma
07-09-2007, 08:18 PM
Just to give it back.
Modified for the Community Builder Version 1.0.2

just replace the one in your components->comprofiler directory with this one.. other hacks still apply.

julianojc
07-24-2007, 10:18 PM
Just to give it back.
Modified for the Community Builder Version 1.0.2

just replace the one in your components->comprofiler directory with this one.. other hacks still apply.


Find:

mosMakeHtmlSafe($row);
$row->id = 0;
$row->gid = $acl->get_group_id('Registered','ARO');
$row->usertype = 'Registered';

=====================================
Replace:

mosMakeHtmlSafe($row);
$row->id = 0;
$row->gid = $acl->get_group_id('Agent','ARO');
$row->usertype = 'Agent';

====================================
This will make to appear the Agent Menu. ;)

ssnobben
10-07-2007, 02:52 PM
Does anyone know how this work with CB 1.1 (Joomla 1.0.13) ?? :confused:

ssnobben
10-17-2007, 06:32 PM
Find:

mosMakeHtmlSafe($row);
$row->id = 0;
$row->gid = $acl->get_group_id('Registered','ARO');
$row->usertype = 'Registered';

=====================================
Replace:

mosMakeHtmlSafe($row);
$row->id = 0;
$row->gid = $acl->get_group_id('Agent','ARO');
$row->usertype = 'Agent';

====================================
This will make to appear the Agent Menu. ;)

any hack that work for the new CB 1.1 ?? any suggestions ?

lazysheepmedia
10-17-2007, 07:16 PM
will thsi not work then if you change the values Registered to Agent?

teddy
10-24-2007, 05:31 PM
the only modification I could find within the modified comprofiler.php was between a
if (!$row->store()) {
and a
if ( $row->id == 0 ) {
So try to integrate the previously added code into row 1260 (depends on your formatting I think) on CB 1.1's comprofiler.php code:

### START: Add new Agent to Hot Property ###

include( 'administrator/components/com_hotproperty/config.hotproperty.php' );

// Check if hp_default_company is set
if ( !is_numeric($hp_default_company) || $hp_default_company <= 0 ) {

// Use the latest company added to the database
$database->setQuery( "SELECT id FROM #__hp_companies ORDER BY id DESC LIMIT 1" );
$hp_default_company = $database->loadResult();

}

// Get Userid from #__users
$database->setQuery("SELECT id FROM #__users WHERE username='$row->username' LIMIT 1");
$userid = $database->loadResult();

// Insert into #__hp_agents
$database->setQuery("INSERT INTO #__hp_agents (user, name, email, need_approval, company) VALUES ('$userid', '$row->name', '$row->email', '".(($hp_auto_approve == '1') ? '0':'1')."', '".$hp_default_company."')");
$database->query();

### END: Add new Agent to Hot Property ###

Please, report back if you succeed or not

ssnobben
10-31-2007, 09:46 PM
Great if this works. Can anyone sum this up on one post how to do?

Thks.

ssnobben
12-11-2007, 01:34 AM
I dont know how to do this.

I have check the comprofiler php file but I cant find how to do this for the CB 1.1 version.

I want o n e CB reg form process for types like agent and other end users.

I want to use the CB log in or do I have to use the agent log in??

As now I have the CB register active and what I want is a way of selecting user type when registrating.

How can I do that if I also want to keep CB reg process? or should I have two different registrations? can anyone help with this so I understand how to do this correctly!

I have attached my comprofiler if someone want to check it...

Thanks!

lazysheepmedia
12-11-2007, 01:47 AM
Hi

If you need some help set me up an ftp account and I will try to help you

My experience tells me that it is better to take a look at the files rather that try and diagnose the problem from files sent

Regards

Mark

teddy
12-11-2007, 05:48 PM
let us know where was the issue!!

cyberzoul
01-13-2008, 05:20 PM
Does any one have CB 1.1 hack??

ssnobben
01-14-2008, 05:24 PM
Does any one have CB 1.1 hack??

I dont think so you have to fix on your self I believe.

I think the best would be if you can have agent and CB integrated reg process and let users decide if you want to reg as agent 1,2,3 or as CB user(s) then with more user types to choose from when registrate. Then you can also set up different subscription schemes for different users with AEC subscription component (www.globalnerd.org There is also a discussion going on now of replacing CB in the Globalnerd forum https://globalnerd.org/index.php?option=com_fireboard&Itemid=88&func=view&id=4937&catid=11)

Igorbimbich
01-14-2008, 06:05 PM
to begin, it would be nice to have this CB 1.1 hack working...
then I didn't understand your examples, ssnobben, would you try to explain better? Maybe there's already a solution we don't know about...

ssnobben
01-15-2008, 02:14 AM
to begin, it would be nice to have this CB 1.1 hack working...
then I didn't understand your examples, ssnobben, would you try to explain better? Maybe there's already a solution we don't know about...

Well I dont know bcs I have never heard anyone have this working with CB 1.1 and now J 1.0.14..so if there is anyone have this working pls tell us then!

gerritd
02-15-2008, 08:42 PM
Please help. Also need all new users to be added as agents. Can someone please post the correct comprofiler.php file for this. Thanks

ssnobben
04-06-2008, 03:07 PM
There will be a new J 1.5 Community Builder 1.2 ( CB ) soon http://www.joomlapolis.com/content/view/5147/37/ Hope this will work with the new HP 1.0 J 1.5 version too .:p

builder07
09-14-2008, 08:15 PM
In comprofile.php,

find (around line 1099):

$row->email = trim ( $row->email );

After, add;

### START: Add new Agent to Hot Property ###
$row->gid = $acl->get_group_id('Agent','ARO'); // Edited. - Hot Property (Auto Assign Agent)
### End: Add new Agent to Hot Property ###

Find (around line 1255):

if (!$row->store()) { // first store to get new user id if id is not set (needed for saveRegistrationPluginTabs)
echo "<script type=\"text/javascript\"> alert('store:".addslashes(unhtmlentities($row->getError()))."'); </script>\n";
registerForm( $option, $mosConfig_emailpass, stripslashes( $row->getError() ) ); // there is an addslashes in joomla 1.0.12
return;
}

after, add:

### START: Add new Agent to Hot Property ###

include( 'administrator/components/com_hotproperty/config.hotproperty.php' );
global $database;

// Check if hp_default_company is set
if ( !is_numeric($hp_default_company) || $hp_default_company <= 0 ) {

// Use the latest company added to the database
$database->setQuery( "SELECT id FROM #__hp_companies ORDER BY id DESC LIMIT 1" );
$hp_default_company = $database->loadResult();

}

// Get Userid from #__users
$database->setQuery("SELECT id FROM #__users WHERE username='$row->username' LIMIT 1");
$userid = $database->loadResult();

// Insert into #__hp_agents
$database->setQuery("INSERT INTO #__hp_agents (user, name, email, need_approval, company) VALUES ('$userid', '$row->name', '$row->email', '".(($hp_auto_approve == '1') ? '0':'1')."', '".$hp_default_company."')");
$database->query();

### END: Add new Agent to Hot Property ###

This works for me for CB 1.1 with Joomla 1.0.15 and HP.98 :). Please note that I have added the line global $database; to solve an error on setQuery.