PDA

View Full Version : variable not registering confused.


BBR-APBT
22 Dec 2009, 20:42
Ok I am re-working my mod for the member action dropdown.

I have this in hook global_start as that is the only one it shows at I tried global_complete

if ($vbulletin->options['new_enable_albums'])
{
$templater = vB_Template::create('bbr_memberaction_dropdown');
$templater->register('memberinfo', $memberinfo);
$template_hook['memberaction_dropdown_items'] .= $templater->render();
}


But this does not show the

{vb:raw memberinfo.userid}


Every thing else shows.

Lynne
22 Dec 2009, 20:55
What does the template look like?

BBR-APBT
22 Dec 2009, 20:56
What does the template look like?

<li class="left">
<a href="album.php?{vb:raw session.sessionurl}u={vb:raw memberinfo.userid}" rel="nofollow">
<img src="{vb:stylevar imgdir_siteicons}/photo.png" alt="" />
{vb:phrase bbr_show_all_albums}
</a>
</li>


Hey Lynn if you help me fix this, this basic code will work for your mod too with this new hook.

Lynne
22 Dec 2009, 21:32
So your results is a link but without the userid in it?

Wait a sec.... this is for the postbit, right? You can't go this in the global_start hook location for a postbit - this information isn't even available at that point. You need to use a location like postbit_display_complete.

BBR-APBT
22 Dec 2009, 21:39
Yes every thing but the userid is there.

No this is for all over the forum. The member action dropdown works on Forum Home, Showthread, In PM and I think on the blog etc. Go to your forum home page and click on a name under last post. So I want to make mine work on all of the member action dropdowns and not just the postbit. So thats why I used global_start it works every where. I tried global_complete, But it doesn't show at all.

In the member action dropdown template they use:
{vb:raw memberinfo.userid}

I don't get it.

Lynne
22 Dec 2009, 23:03
There is no way for it to work in all those places by using the global_start hook location. If you want it to work on the showthread page for the posts, you simple cannot do it at that location. You need to do it at one of the postbit_display_* locations.

For the lastpost on the forumdisplay page, you need to use the threadbit_display hook and set $memberinfo['userid'] to $thread['postuserid'], and then on the showthead page, you need to use one of the postbit_display_* locations and do a similar setting for the variable. And then for the index.php page (or forum.php page, whatever you want to call it), you have to look into where the lastpost is set there and do similar. You just can't do it with one plugin/hook location.

BBR-APBT
22 Dec 2009, 23:14
Well thats just stupid. Guess I will have like 4 pluigns for this one little edit.
Guess I will have to leave out blogs and CMS too.

Thanks Lynn.

I think they should of let us add to it global. Since it shows global.

It would be easier to just do a template edit. so it shows it all places.

How come we can't use what like they have in member_action_dropdown template.
{vb:raw memberinfo.userid}

It shows global.


Edit:
I could make a second member_action_dropdown template copy all their code into my new template add my code
and just use it so it shows every and one plugin to replace their template cache with my own.

But If I do that I might as well ask you if I can include your find all post mod and the ignore user in dropdown post mod from that other dude maybe even add other links that can be turned off.

I just got a idea for a nice mod where you can turn on and off links to add to the drop down.

I am now compiling a list of useful links that people may want to add to the dropdown.

The code will be different but can I use some of your ignore code.



EDIT:
This Is what I came up with.
http://www.vbulletin.org/forum/showthread.php?t=230901

Thanks again as always Lynne