View Full Version : Need if/else statement for urls
macker123
10-21-2004, 03:47 PM
I have done a ton of mods to the links directory to make it search engine friendly and am using an .htaccess file to make all my pages seems like they are static with keywords when in fact they are dynamic.
It works great, but screws up the relative linking of the Navigational menu when on the links pages, yet works fine for the forums.
So I want to create an if else statement for my "navbar_link" page.
I got this code from the forums, but it doesn't seem to work, can someone help.
For example on all ADV_BROWSE_LINKS pages I want to modify the urls a bit so I tried inserting this code into the "navbar_link" template, but it always reverts to didn't work even though I am indeed on the browse links page.
<if condition="$pages['name'] == 'ADV_LINKS_BROWSELINKS'">it worked <else /> it didn't </if>
Any help is appreciated.
Brian
10-21-2004, 04:06 PM
What about <if condition="THIS_SCRIPT == 'browselinks'"> ?
macker123
10-21-2004, 05:57 PM
What about <if condition="THIS_SCRIPT == 'browselinks'"> ?
Yes I got it to work with that.
<if condition="THIS_SCRIPT == 'browselinks'">
<td><span class="navbar">Viewing: <a href="/forum/links/" accesskey="1"> $vboptions[bbtitle]</a>
$navbits[breadcrumb]> $navbits[lastelement]</span></td>
<else />
<td><span class="navbar">Viewing: <a href="./" accesskey="1"> $vboptions[bbtitle]</a>
$navbits[breadcrumb]> $navbits[lastelement]</span></td>
</if>
What is the code so I can included multiple pages. Like an OR statement:
browselinks OR showlink for example
I tried this but it doesn't work:
<if condition="THIS_SCRIPT == 'browselinks' || 'showlink'">
Brian
10-21-2004, 05:59 PM
<if condition="THIS_SCRIPT == 'browselinks' OR THIS_SCRIPT == 'showlink'"> ;)
macker123
10-21-2004, 07:05 PM
<if condition="THIS_SCRIPT == 'browselinks' OR THIS_SCRIPT == 'showlink'"> ;)
Hmm not sure if it worked or not as I can't get this code to work. From what you have told me above about calling it as browselinks I would assume I could also call any other page like showlink, but that page doesn't call.
Here is my issue I simply want an if statement for all links pages and an else statement for anything else. Here is what I have as you can see the url is slightly different that is the only change.
<if condition="THIS_SCRIPT == 'browselinks' OR THIS_SCRIPT == 'showlink'">
<td><span class="navbar">Viewing: <a href="/forum/links/" accesskey="1"> $vboptions[bbtitle]</a>
$navbits[breadcrumb]> $navbits[lastelement]</span></td>
<else />
<td><span class="navbar">Viewing: <a href="./" accesskey="1"> $vboptions[bbtitle]</a>
$navbits[breadcrumb]> $navbits[lastelement]</span></td>
</if>
browselinks works fine showlink does not.
Brian
10-21-2004, 07:07 PM
Ahhh... I didn't realize that's not defined in showlink.php. If you'll open that file and look for this code (near the very top):
define('NO_REGISTER_GLOBALS', 1);
Right below it add this:
define('THIS_SCRIPT', 'showlink');
Then it should work. :)
lee wilde
01-20-2005, 01:30 AM
I have done a ton of mods to the links directory to make it search engine friendly and am using an .htaccess file to make all my pages seems like they are static with keywords when in fact they are dynamic.
This sounds great :) Would you mind letting us know the methods you have used to do these things?
Lee
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.