Quote:
Originally Posted by BBR-APBT
Code:
$50postusername = $vbulletin->userinfo['username']
$pmdm->set('message', "congratulations $50postusername you have made your 50th post, we're all so prod of you keep on posting");
it may even be
Code:
$50postusername = $vbulletin->userinfo['username']
$pmdm->set('message', "congratulations " . $50postusername . " you have made your 50th post, we're all so prod of you keep on posting");
|
thank you!
but apparently using the line " $50postusername = $vbulletin->userinfo['username']; " makes the script to stop working, and i have tried with both possibilities you have posted in here, the one with the joined strings and the one with the direct variable this is my full code:
PHP Code:
if ($foruminfo['countposts'] AND $vbulletin->userinfo['posts'] + 1 == 50) {
$50postusername = $vbulletin->userinfo['username'];
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', 1);
$pmdm->set('fromusername', Administrator);
$pmdm->set('title', 'Congratulations');
$pmdm->set('message', "congratulations $50postusername you have made your 50th post, we're all so prod of you keep on posting");
$pmdm->set_recipients($vbulletin->userinfo['username'], $permissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->pre_save();
// process errors if there are any
$errors = array_merge($errors, $pmdm->errors);
if (!empty($errors))
{
$errorlist = '';
foreach ($pmdm->errors AS $index => $error)
{
$errorlist .= "<li>$error</li>";
}
}
else
{
// everything's good!
$pmdm->save();
}
}
im using the $pmdm->error() function too and its not giving me any error, its almost as if the script was dying because of the extra variable im setting in before reaching the end