The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to set style depending on location on site?
Hi all,
Hopefully this is possible and simple as it's really important that we manage to get this done. We have a VB site running vbadvanced as the homepage/news section and then linking to our forums. We have the header and footer templates modified to put the right hand column down the side of the entire site on every page and use this column for our adverts. The code for the ads themselves are linked through a plugin we've set. The code looks like this: Code:
<!-- Right Column Code --> </td> <td width="120" valign="top" align="left">$advertcode</td> </tr> </table> </td></tr> </table> <!-- End Left Column Code --> Code:
ob_start(); include('urls/to/site/forums/adverts.php'); $advertcode= ob_get_contents(); ob_end_clean(); The problem we have now is that we need to differentiate between our forums pages and our other pages and display different advertising code depending on the two. What we basically need to do and what I hope is possible is that we can do the following: Code:
<!-- Right Column Code --> </td> <td width="120" valign="top" align="left"> IF location = forums ($advertcode) ELSE ($newadvertcode) </td> </tr> </table> </td></tr> </table> <!-- End Left Column Code --> Is this possible at all? It's quite urgent as we've just been informed that we need to make this change ASAP. Cheers for any help. Rob |
#2
|
||||
|
||||
At the top of your forumsdisplay.php file, it has something like this:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
Superb.
That doesn't quite do what I need but is certainly along the right lines. forumdisplay, showthread, newreply etc would all need to be included in the condition but something like THIS_SCRIPT == '(forumdisplay' OR 'showthread' OR etc etc) should work. I think I'm right in saying it's also possible to do it by forumid so I could display just certain ads in our "news" forums but not in the others, right? Ideally what I'd have is: Front page/vbadvanced modules Forum pages relating to forums 1 and 2. Forum pages relating to forums id 3-10 (for example) I think with a nested IF statement then I can both select the scripts as well as the forum ids. If anyone is able to post what code they should I should be using it'd be great but I think I can figure it out now. Thanks again. |
#4
|
||||
|
||||
I think this is kinda what you want, but I don't know what the THIS_SCRIPT display is for vbadvanced (I don't have it on my site):
PHP Code:
(This isn't tested and I'm no expert, so some tweaking may be necessary. ) |
#5
|
|||
|
|||
Thanks Lynne.
That's not quite what I need as there has to be an else statement in there(I don't think I explained myself as well as I could have done) but at least I understand what I need to do now. The THIS_SCRIPT for VBA is adv_index for the homepage by the way. Once I've tested it out I'll post what I ended up using. |
#6
|
||||
|
||||
Well, you probably want the else before the forum part, something like:
PHP Code:
|
#7
|
|||
|
|||
Quick question on syntax.
Why do you close off you're if statements after the first one? For example the closing / here: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|