I finally managed to fix the hack for CB 1.0.2. If you like it bump up my Karma
..
NOTE: Please backup the files before attempting the fix
TODO: Make this work only with valid invites. Let me know if anyone needs that.
<ul>
<li> Step 1: Make changes to com_invite link
File: components/com_invite/invite.php: Line 170
It currently looks like
[code:1]
$link = sefRelToAbs($mosConfig_live_site . '/index.php?option=com_invite&task=register&email='.$e_add.'&ref_str='.$ref_str);
[/code:1]
Change it to
[code:1]
$link = sefRelToAbs($mosConfig_live_site . '/index.php?option=com_comprofiler&task=registers&email='.$e_add.'&ref_str='.$ref_str);
[/code:1]
</li>
<li> Step 2: Set the email in the registration Form
File: components/com_comprofiler/comprofiler.html.php
After Line 1208
[code:1]
<?php
$showemail = "";
if ($option == "com_invite"«») $showemail = $_GET;
elseif ($option == "com_comprofiler"«») {
if (isset($_GET)) $showemail = $_GET;
else if (isset($row->email)) $showemail = $row->email;
}
?>
[/code:1]
</li>
<li> Step 3: Add hidden com_invite fields to registration form
File: components/com_comprofiler/comprofiler.html.php
After line 1275: (just after other hidden fields)
[code:1]
<?php
if ((isset($_GET)) && (isset($_GET))) {?>
<input type="hidden" name="ref_str" value="<?php echo $_GET; ?>" />
<input type="hidden" name="ref_email" value="<?php echo $_GET; ?>" />
<?php
}
?>
[/code:1]
</li>
<li> Step 4: Add invite tracking handling to saveRegistration method()
File: components/com_comprofiler/comprofiler.php
Above Line:1241 (saveRegistration) method
Change:
[code:1]
echo $messagesToUser;
[/code:1]
to:
[code:1]
if ((isset($_POST)) && (isset($_POST))) {
//confirm invite
$ref_str = $_POST;
$ref_email = $_POST;
$sql = "update `#__invite_sent` set `joined` = '1' where `email` = '$ref_email' and `ref_str` = '$ref_str'";
$database->setQuery($sql);
$database->query();
$sql = "insert into `#__invite_joined` values ('', '$row->id', '$ref_email', '$ref_str')";
$database->setQuery($sql);
$database->query();
}
echo $messagesToUser;
[/code:1]
</li>
</ul>
Post edited by: vishalsood, at: 2007/01/05 15:31
Post edited by: vishalsood, at: 2007/01/05 20:28