Results 1 to 10 of 10

IF condition for certain pages?

This is a discussion on IF condition for certain pages? within the Off-Topic & Chit Chat forums, part of the Focus on Members category; I was wondering if there was an IF condition for this: I want an image on the homepage that says ...

  1. #1
    Senior Member Array
    Real Name
    .
    Join Date
    Jul 2006
    Posts
    386
    Liked
    3 times
    Blog Entries
    1

    IF condition for certain pages?

    I was wondering if there was an IF condition for this:
    I want an image on the homepage that says "forums" with a link to the forums and then an image on the forumhome that reads "Home" or "Homepage" and link back to the home directory. Both images would be in the same spot, I just want to interchange them when on different pages.

    Is there anyway I can do this?

  2. #2
    Senior Member Array
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    16 times
    Code:
    <if condition="THIS_SCRIPT == 'index'">
     
    Home Button Here
     
    <else />
     
    Forum Button Here
     
    </if>
    "index" is the name of vBulletin's forum home page.

    What is your Home page using? vBadvanced CMPS? If so, use this for better results:

    Code:
    <if condition="THIS_SCRIPT == 'adv_index'">
     
    Forum Button Here
     
    <else />
     
    Home Button Here
     
    </if>
    Last edited by Keith Cohen; 01-02-2007 at 11:54 PM.

  3. #3
    Senior Member Array
    Real Name
    .
    Join Date
    Jul 2006
    Posts
    386
    Liked
    3 times
    Blog Entries
    1
    Awesome, thanks a bunch Keith! I greatly appreciate it! Time to test it out!

  4. #4
    Senior Member Array
    Real Name
    .
    Join Date
    Jul 2006
    Posts
    386
    Liked
    3 times
    Blog Entries
    1
    Alright...I can't seem to get it to work. IDK if it's b/c I'm using CSS or not, but this is the code I'm using:

    Code:
    <if condition="THIS_SCRIPT == 'index'">
    <a href="/forums/" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_forums','','{IF}/misc/nav_forums_over.gif',1)"><img src="{IF}/misc/nav_forums.gif" name="nav_forums" id="nav_forums" alt="Se7enSins Forums" /></a>
    </ else>
    <a href="/" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_home','','{IF}/misc/nav_home_over.gif',1)"><img src="{IF}/misc/nav_home.gif" name="nav_home" id="nav_home" alt="Se7enSins Homepage" /></a>
    </if>
    Also, my cmps index is in my root directory and my forums index is in the forums directory...how would I indicate which index it is I'm referring to?

    Thanks again.

  5. #5
    Senior Member Array
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    16 times
    CMPS script name = adv_index

    vBulletin forum home script name = index

  6. #6
    Senior Member Array
    Real Name
    .
    Join Date
    Jul 2006
    Posts
    386
    Liked
    3 times
    Blog Entries
    1
    Yes, I know that...my cmps script is named index.php in my root folder. My forums script is named index.php in my forums folder.

    Sorry if I was unclear.

  7. #7
    Senior Member Array
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    16 times
    That's fine. The filename does not matter. THIS_SCRIPT is the internally defined names for each page, and they are the names I listed above.

  8. #8
    Senior Member Array
    Real Name
    .
    Join Date
    Jul 2006
    Posts
    386
    Liked
    3 times
    Blog Entries
    1
    Thanks for the help Keith. I'm still having a problem though. Both images/links show up on the forums and none show up on the homepage. This is what I have:
    Code:
    <if condition="THIS_SCRIPT == 'index'">
    <a href="/" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_home','','{IF}/misc/nav_home_over.gif',1)"><img src="{IF}/misc/nav_home.gif" name="nav_home" id="nav_home" alt="Se7enSins Homepage" /></a>
    </ else>
    <a href="/forums/" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_forums','','{IF}/misc/nav_forums_over.gif',1)"><img src="{IF}/misc/nav_forums.gif" name="nav_forums" id="nav_forums" alt="Se7enSins Forums" /></a>
    </if>
    Did I not do it right?

  9. #9
    Senior Member Array
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    16 times
    My mistake. The </ else> should be <else />

    (Fixed it above.)

  10. #10
    Senior Member Array
    Real Name
    .
    Join Date
    Jul 2006
    Posts
    386
    Liked
    3 times
    Blog Entries
    1
    Keith...you are DA MAN! I appreciate your help and your patience!

Similar Threads

  1. Sitemap alırken hata alıyorum :(
    By erhanerhan_5 in forum Türkçe
    Replies: 9
    Last Post: 11-15-2006, 08:44 AM
  2. i think something is wrong....
    By briansol in forum General Discussion
    Replies: 3
    Last Post: 08-20-2006, 06:10 PM
  3. Replies: 8
    Last Post: 08-15-2006, 04:10 AM
  4. Pagerank plays hard to get on my site?
    By dutchbb in forum General Discussion
    Replies: 8
    Last Post: 04-15-2006, 02:38 PM
  5. Compression Error
    By Lazer in forum Troubleshooting
    Replies: 19
    Last Post: 03-03-2006, 01:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •