Status
Not open for further replies.

vetsfast

Customer
Hey Ozzy its actually Rain. I just now noticed something I put in my template a couple weeks back has stopped working since 1.3.0.

In my header I added a pm count:
Code:
{vb:raw bbuserinfo.pmunread} New PMs. You have {vb:raw bbuserinfo.pmtotal} total out of {vb:raw GLOBALS.permissions.pmquota} allowed.

After 1.3.0 and with 1.3.0 enabled the pmquota no longer shows on the index/vba page only. It works fine on all other pages. Once the plugin is disabled the quota shows again.

Any help with this is appreciated. I am going through some of the options and then checking the hooks see if I can fix or narrow it down but I have no clue at this point.
 
Alright seems to be related to "Tab Perms vBAdvanced global_start" unchecking it allows it to work. The vbadvanced module has nothing to do with it it seems but I will take a look at the PHP see if I can solve or work around it and relay that to you for a better fix.

Okay so the code difference is this was added from 1.2.2 to 1.3.0:
Code:
	// ####################### START MODULE TEMPLATE ###########################	
	$date = date('Y');
		//require_once(DIR . '/dbtech/vbdonate_pro/actions/widget.php');
		$templater = vB_Template::create('dbtech_vbdonate_adv_portal_donate');
		$templater->register('output', $output);
		$templater->register('date', $date);
		$show['dbtech_vbdonate_adv_portal_donate'] = $templater->render();
	// ####################### END MODULE TEMPLATE #############################

Looking into that now, using the old file without that does not interfere.


Edit - Hmmm, I don't think we actually use this feature anyways? The whole thing? I am going to leave it out for the moment.
 
Last edited:
Yeah that is the $show for the module it's self, I dunno why that would interfere with the code you added, did you put that in the actual header template and if so where so I can test it out on my dev and try to see what the issue is.
 
Last edited:
Yeah its in the actual header template. Its currently on the end just past log out currently, moving it next to the inbox/notification code soon here.

EDIT - Alright so I finally uploaded the new xml for the donate module. I see I have to re enable Tab Perms vBAdvanced to make it work. Once I do this the new module shows and on the index or cmps_index the {vb:raw GLOBALS.permissions.pmquota} dissapears so instead of:

Welcome, RainMotorsports Inbox Control Panel Log Out 0 New PMs. You have 59 total out of 100 allowed.
I get:
Welcome, RainMotorsports Inbox Control Panel Log Out 0 New PMs. You have 59 total out of allowed.

I created a new page in vB Advanced and on that page as well it does not show. But all other pages work fine.
 
Last edited:
In case u work on the site I have commented out the code in global_start.php and moved the template code from dbtech_vbdonate_adv_portal_donate to adv_portal_donate.

While this works it bothers me a little as it was not needed in the past and this whole setup just for the line {vb:raw show.dbtech_vbdonate_adv_portal_donate} is otherwise not needed if the code is moved from that template to the template executing that.

I would not think it would screw with a global variable from registering but I am no vBulletin coder or themer. I went on vBulletin.org to solve why {vb:raw permissions.pmquota} did not display. They told me I need to register $permissions with the header template. I was pointed to a section that tells me you can't do this with stock template files so you have to do this whole preregister song and dance which I have no clue where to put since obviously I am not writing a plugin here I have no place to add it.

They did original tell me that since it is also a global variable to use {vb:raw GLOBALS.permissions.pmquota} and that was working until now.
 
The reason the template adv_portal_donate was changed to {vb:raw show.dbtech_vbdonate_adv_portal_donate} and the template dbtech_vbdonate_adv_portal_donate was added is to avoid the end users from having to uninstall the vBAdvanced module and re installing it.

Now why it is conflicting with the code you add I am not sure off the top of my head I will have to do some research, or perhaps Fillip H. will have a idea.
 
Alright well just let me know if u find something or nothing. The second best thing for me is a new method of getting pmquota into the header template.

in global.php permissions is declared $permissions = $vbulletin->userinfo['permissions']; which apparently makes the whole GLOBALS.permissions.pmquota work but if I knew how to preregister permissions with header then maybe permissions.pmquota would work on its own.
 
Well crisis averted! While id still say there is a bit of an issue there you will probably not run into another person having it.

GLOBALS.permissions.pmquota replaced with bbuserinfo.permissions.pmquota works just fine and I am no longer worried about it.
 
Ahh well that's good to know, did you revert the template edits you did in vBDonate and running it OOB now?
 
Ahh well that's good to know, did you revert the template edits you did in vBDonate and running it OOB now?

Not yet I will though. The reason I didn't is I made some changes, minimalizations to the template and I have to copy that back where it belongs.

Here is a little bit of what was given to me btw:
But the variable you want to use has to be available at that hook, and the timing of the call to the parse_templates hook can change. In the case of $permissions, that is set just after the global_start hook is called, so if some plugin using the global_start hook renders a template, parse_templates will be called but $permissions won't have been set yet so preRegistering it to a template won't work. (That's also why GLOBALS.permissions.pmquota stopped working - using preRegister() instead won't make any difference). But as I mentioned in the other thread, $permission is just a copy of $vbulletin->userinfo['permissions'], so if you use {vb:raw bbuserinfo.permissions.pmquota} in the template, that may work without any preRegistering.

I had tried changing the hook location or timing or whatever with no luck and that seems like what they are talking about. But as far as permissions as variable goes its pretty old school and once again I would not worry about it.
 
Status
Not open for further replies.

Legacy vBDonate

vBulletin 4.x.x
Seller
Mokonzi
Release date
Last update
Total downloads
875
Customer rating
0.00 star(s) 0 ratings
Back
Top