View Full Version : Can't get $notifications_total variable.
Essencee
04-26-2009, 02:29 PM
Hello guys.
I am trying to edit "Cyb - PM System Enhancements" and add some part to it via the $notifications_total, but it seems that it's not working at all. My code is below:
if ((($vbulletin->userinfo['pmunread']>'0') AND ($vbulletin->options['cyb_pme_newpmsig_color']!='')) OR ($notifications_total > 0))
{
eval('$cybpmblink = "' . fetch_template('cyb_pme_blink') . '";');
$vbphrase[your_notifications] = $cybpmblink;
}
What can I do?
Thank you!
Lynne
04-26-2009, 03:06 PM
You need to make sure that $notifications_total has already been defined before you go use it in a plugin. So, you need to pick your plugin hook location to be after the variable is defined. Go find it in the code and then look at where your plugin is location and figure out if it's before or after the variable was defined and move it if necessary.
Essencee
04-26-2009, 03:25 PM
You need to make sure that $notifications_total has already been defined before you go use it in a plugin. So, you need to pick your plugin hook location to be after the variable is defined. Go find it in the code and then look at where your plugin is location and figure out if it's before or after the variable was defined and move it if necessary.
I didn't understand what you said.
Can you simplify it for me?
Thank you! :)
Lynne
04-26-2009, 03:44 PM
Hmmm, I don't know that I can simplify that much. Basically, you are trying to use a variable, $notifications_total, which is probably not defined. It's like doing algebra - you can do this:
a=1
b=2
what is a+b
but you can't do:
b=2
what is a+b
because a isn't defined.
You need to make sure $notifications_total is defined before you can go use it in an 'equation'.
Essencee
04-26-2009, 03:47 PM
Hmmm, I don't know that I can simplify that much. Basically, you are trying to use a variable, $notifications_total, which is probably not defined. It's like doing algebra - you can do this:
a=1
b=2
what is a+bbut you can't do:
b=2
what is a+bbecause a isn't defined.
You need to make sure $notifications_total is defined before you can go use it in an 'equation'.
Man, the $notifications_total variable is a base variable in vBulletin, I don't need to define it at all. It just brings me the number of notifications per user. Any help?
Lynne
04-27-2009, 02:38 AM
I'm sorry, I thought you were originally saying that $notifications_total was the problem (someone else had a similar problem recently), but I guess that isn't it. I must admit that I don't understand what you are trying to do here. I don't know what hook location you are using nor what output you are trying to achieve. Maybe an image would help out?
Essencee
04-27-2009, 10:22 AM
I'm sorry, I thought you were originally saying that $notifications_total was the problem (someone else had a similar problem recently), but I guess that isn't it. I must admit that I don't understand what you are trying to do here. I don't know what hook location you are using nor what output you are trying to achieve. Maybe an image would help out?
The mod blinks the title of "Your Notifications" when there are more than 0 (1 and more) new privare messages. I am trying to convert it that it will blink also for other notifications (new messages, posts etc...).
Lynne
04-27-2009, 02:44 PM
Well, I'll post the code I use on one of my mods to put in an extra line in the Notifications box and you can change it for your own needs.
location - notifications_list
if ($vbulletin->userinfo['ttdtrader_s'] >= '1') {
// add notification
$notifications['threadattention'] = array(
'phrase' => 'Threads Needing Attention',
'link' => 'verifythreads.php?' . $vbulletin->session->vars['sessionurl'] . 'do=list',
'order' => 12
);
.... my query to get the count ....
$vbulletin->userinfo['threadattention'] = intval($holdquery['count']);
}
You can, of course, use a phrase where it says 'phrase' up there, but I didn't for this. It was just a quick plugin I just wanted to work at the time. One of these days I'll fix it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.