Just a quick note...
For those of you who are using a table prefix for your VB installation, you'll need to adjust the code provided for your register.php.
instead of:
Code:
// ###################################################################
// # WELCOME PM HACK BY rob_daemon
// ###################################################################
$username = $_POST['username'];
// Process each one of the replacement vars
$vars = array(
'$bbtitle' => $vboptions['bbtitle'],
'$username' => $username,
'$email' => $email,
'$userid' => $userid
);
$pmoptions['regpmtext'] = $vboptions['regpmtext'];
$pmoptions['regpmtitle'] = $vboptions['regpmtitle'];
$pmoptions['regpmfrom'] = $vboptions['regpmfrom'];
// Now that we have the options, we need to process eaach of the
// vars we can use
foreach($vars AS $_key => $_value)
{
$pmoptions['regpmtext'] = str_replace($_key, $_value, $pmoptions['regpmtext']);
$pmoptions['regpmtitle'] = str_replace($_key, $_value, $pmoptions['regpmtitle']);
}
$get_pm_from = $DB_site->query_first("SELECT username,userid FROM user WHERE userid=$pmoptions[regpmfrom]");
// Send the new owner a PM
$DB_site->query(
"INSERT INTO pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
$get_pm_from[userid],
'$get_pm_from[username]',
'$pmoptions[regpmtitle]',
'" . addslashes($pmoptions['regpmtext']) . "',
'" . serialize(array($userid => $username)) . "',
0,
" . TIMENOW . ",
0,
0
)"
);
$pmtextid = $DB_site->insert_id();
$DB_site->query("UPDATE user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
$DB_site->query(
"INSERT INTO pm
(
pmtextid,
userid,
folderid,
messageread
)
VALUES
(
'$pmtextid',
'$userid',
'0',
'0'
)"
);
// ###################################################################
use this:
Code:
// ###################################################################
// # WELCOME PM HACK BY rob_daemon
// ###################################################################
$username = $_POST['username'];
// Process each one of the replacement vars
$vars = array(
'$bbtitle' => $vboptions['bbtitle'],
'$username' => $username,
'$email' => $email,
'$userid' => $userid
);
$pmoptions['regpmtext'] = $vboptions['regpmtext'];
$pmoptions['regpmtitle'] = $vboptions['regpmtitle'];
$pmoptions['regpmfrom'] = $vboptions['regpmfrom'];
// Now that we have the options, we need to process eaach of the
// vars we can use
foreach($vars AS $_key => $_value)
{
$pmoptions['regpmtext'] = str_replace($_key, $_value, $pmoptions['regpmtext']);
$pmoptions['regpmtitle'] = str_replace($_key, $_value, $pmoptions['regpmtitle']);
}
$get_pm_from = $DB_site->query_first("SELECT username,userid FROM " . TABLE_PREFIX . "user WHERE userid=$pmoptions[regpmfrom]");
// Send the new owner a PM
$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
$get_pm_from[userid],
'$get_pm_from[username]',
'$pmoptions[regpmtitle]',
'" . addslashes($pmoptions['regpmtext']) . "',
'" . serialize(array($userid => $username)) . "',
0,
" . TIMENOW . ",
0,
0
)"
);
$pmtextid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pm
(
pmtextid,
userid,
folderid,
messageread
)
VALUES
(
'$pmtextid',
'$userid',
'0',
'0'
)"
);
// ###################################################################
// # END WELCOME PM HACK
// ###################################################################
Other than that, Great hack!
[high]* Cloudrunner clicks install
[/high]
Thank you!
)O( Cloudrunner )O(