Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 15 Sep 2012, 01:26
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Real name: Austin
Custom WOL for a Specific Mod

I'm trying to figure out a way to create a WOL option for a modification that already exists: http://www.vbulletin.org/forum/showthread.php?t=92203

Dream made a plugin that just tells "index.php?page=example" to look for a template called "page_example" and displays it. I would like to make a WOL that instead of saying the user is viewing the "Forum Index," but that they're viewing the "Example" page.

If anyone could help, let me know. Thanks!
Reply With Quote
  #2  
Old 21 Sep 2012, 22:35
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
This article has a section on adding a custom location: http://www.vbulletin.org/forum/showthread.php?t=228112

Edit: that's a vb4 article, but the location code will probably work in vb3.
Reply With Quote
  #3  
Old 22 Sep 2012, 02:19
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Real name: Austin
Does that still work the same way for existing locations? For instance, "index.php" already points to "Viewing Forum Index." Can I force "index.php?page=something" to point to "Viewing Something Page?"
Reply With Quote
  #4  
Old 22 Sep 2012, 02:38
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
It might. It doesn't look like index.php is handled in the existing code, so you should be able to check for $filename == 'index.php' and then use $values['page'] to check for the page.

Edit: Oh, I see you're saying it already says something for index.php. That's strange because I can't see where that's handled. So I'm not sure, but you could try to create a plugin that checks for index.php and see what happens.

OK, now I see why I missed it. The code uses $vbulletin->options['forumhome'] instead of using 'index.php' as a constant. So you're right, what's in that article won't work because index.php is already handled. But what I think you can do is create another plugin using hook online_location_preprocess and change $filename to something else, like:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then in the other plugins, check $filename for that value.

Or you could add the page name in the above plugin code like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Then in the other plugins you only need to look at $filename and not $values['page'].

Last edited by kh99; 22 Sep 2012 at 02:50.
Reply With Quote
  #5  
Old 24 Sep 2012, 03:49
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Real name: Austin
Ohhhhh. Very nice! Thank you! I didn't think about checking another condition.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:58.

Layout Options | Width: Wide Color: