Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Override Style on Custom Pages
tyrionlannister
Join Date: May 2007
Posts: 11

New York
by tyrionlannister tyrionlannister is offline 29 Jun 2007

I just spent a bit of time searching the forums for how to override a style on a custom page and I didn't find anything, so I thought I'd post this in case someone else searches for this in the future.

I spent some time reading through the vBulletin code and realized that regardless of which style variables you modify in your custom php page, they are redefined in init.php and global.php when you include global.php in your script. You can't add anything after global.php because the style has already been processed.

The only way it can be done without editing vBulleting files is through a hook.

Simply go to your AdminCP and click the "Add New Plugin" under the Plugins and Products manager. Since your custom page is a product (you should already have defined this), make sure to change the Product Name dropdown to whatever you've named it.

Select 'style_fetch' from the Hook Location dropdown, describe the plugin, and modify this based on your own code settings:


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


This will work for simple scripts, but you will run into problems if you are using the vBulletin database class or input cleaner to help determine whether the style should be overwritten.

In this case, you could code your logic into an include script which is only called if this is a custom page.

In your custom pages, you should have


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

And your hook code should read:


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


Last edited by tyrionlannister; 29 Jun 2007 at 04:01..
Views: 3538
Reply With Quote
Comments
  #2  
Old 21 Apr 2014, 23:54
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
I tried it on vb4, but didn't work... I wish it could though
__________________
Shoot me a PM if I didn't reply in your post when you needed help. I can't remember things easily
Reply With Quote
  #3  
Old 22 Apr 2014, 21:48
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
 
Join Date: Sep 2008
Real name: Michael Miller Jr
Cool

Originally Posted by fxdigi-cash View Post
I tried it on vb4, but didn't work... I wish it could though
Hmm not sure why it wouldn't unless the hook location is not present or similar but no I have not tested the above code I'm just going to say try this article and see if does the trick - it explains how to overwrite css based on certain conditions (or you can add-in/remove conditionals).

http://www.vbulletin.org/forum/showthread.php?t=3077394
__________________
Daddy Does Dios and Figs!
https://www.linkedin.com/in/thelastsuperman

Search - Use the search feature to find similar issues/answers.
Information - Include screenshots, copy/pasted error codes, url etc.
Fixed - Please return to your thread/post and let us know how it was fixed!
Thanks - For participating! Click the "Like" on a post if someone helped you!
Reply With Quote
  #4  
Old 22 Apr 2014, 22:53
tbworld tbworld is offline
 
Join Date: Oct 2008
Originally Posted by TheLastSuperman View Post
Hmm not sure why it wouldn't unless the hook location is not present or similar but no I have not tested the above code I'm just going to say try this article and see if does the trick - it explains how to overwrite css based on certain conditions (or you can add-in/remove conditionals).

http://www.vbulletin.org/forum/showthread.php?t=3077394
Hey buddy, for some reason the thread link is invalid.
Reply With Quote
  #5  
Old 29 Apr 2014, 23:00
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Originally Posted by TheLastSuperman View Post
Hmm not sure why it wouldn't unless the hook location is not present or similar but no I have not tested the above code I'm just going to say try this article and see if does the trick - it explains how to overwrite css based on certain conditions (or you can add-in/remove conditionals).

http://www.vbulletin.org/forum/showthread.php?t=3077394
Thanks, but yes the link is invalid as mentioned...!!

would you mind to provide the correct one?? Thanks

--------------- Added 29 Apr 2014 at 23:17 ---------------

can you kindly give an example, possibly I'm doing it wrong somewhere!!!

I tried changing the following though:

from this -->


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

to this:


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

and of course defined the script in the .php file like this:


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

Then not sure where to add the last code:


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

any idea???

--------------- Added 29 Apr 2014 at 23:44 ---------------

ok, here is the whole story of what I'm up to just to avoid the confusion...

I wanted to have two pages of FORUMHOME where I can display some forums in one and other forums in the other one. I created a copy of forum.php file and named it aforum.php "exact copy", but changed any FORUMHOME inside the code to match the new copy FORUMHOME2.

I then created a template in all styles called "FORUMHOME2" exact copy of "FORUMHOME"

I could see almost everything there except that some plugins don't know what "FORUMHOME2" is... so they don't work on that page...

now I wanted to change the style of the new page "FORUMHOME2" so I created the plugin based on this article


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


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

but still the style didn't work.... I think I missed something here!!!

any idea??
__________________
Shoot me a PM if I didn't reply in your post when you needed help. I can't remember things easily

Last edited by fxdigi-cash; 30 Apr 2014 at 00:01.
Reply With Quote
  #6  
Old 06 May 2014, 16:32
TTayfun's Avatar
TTayfun TTayfun is offline
 
Join Date: Aug 2011
Real name: MSc. Tayfun T.
thanks
__________________
vBulletin 3/4 Forum Kurulumu ve Yönetimi / XenForo Kurulum
ve IP Board Kurulum işleriniz için özel mesaj atabilirsiniz.
Reply With Quote
Reply



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

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 08:24.

Layout Options | Width: Wide Color: