Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to detect location on the board? index, forumdisplay, showthread etc?
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #1
How to detect location on the board? index, forumdisplay, showthread etc?
How to detect location on the board? index, forumdisplay, showthread etc?

how can i detect the page location ?

thank you
02-22-2015 12:23 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #2
RE: How to detect location on the board? index, forumdisplay, showthread etc?
Try

<if THIS_SCRIPT=='forumdisplay.php' then> Something</if>


[Image: leelink.gif]
MYBB1.6 & XThreads
02-22-2015 12:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #3
RE: How to detect location on the board? index, forumdisplay, showthread etc?
Hi, thanks

I tried this but no result

Code:
<if $nav=='index.php' then>


any help please

02-22-2015 02:45 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #4
RE: How to detect location on the board? index, forumdisplay, showthread etc?
Smile

That isnt going to work. The syntax is THIS_SCRIPT, not $nav. THIS_SCRIPT sort of says if the loaded page is one of those pages that you can see in your forum root (forumdisplay.php, member.php, showthread.php etc) then do what is inside the statement. $nav isnt one of your scripts, so THIS_SCRIPT == $nav would not work either.

Are you trying to hide the navigation on index only? Or add something to it?

If you are hiding, then you can just drop a style tag in the top of your index template. Alternatively, if you want to ADD something then see code below.

Try this in the header :

Code:
<if THIS_SCRIPT =='index.php' then>
<navigation> hello
</if>


If you add it correctly then on index ONLY the navigation has the word hello at the end of it.



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 02-23-2015 12:03 AM by leefish.)
02-22-2015 11:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #5
RE: How to detect location on the board? index, forumdisplay, showthread etc?

Code:
<if THIS_SCRIPT =='index.php' AND 'forumdisplay.php' OR 'thread.php' then>
<navigation> hello
</if>


can i use operands? AND, OR, ||

02-27-2015 11:17 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: How to detect location on the board? index, forumdisplay, showthread etc?

Code:
<if THIS_SCRIPT =='index.php' OR THIS_SCRIPT =='forumdisplay.php' OR THIS_SCRIPT =='thread.php' then>
<navigation> hello
</if>


A page can't be more than one page at the same time, so AND makes no sense here.


My Blog
02-28-2015 09:25 AM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #7
RE: How to detect location on the board? index, forumdisplay, showthread etc?
LOL it doesnt matter if a page can be more than one page at a time Tongue

what matters is the header and footer can be delivered to more than "one" page Tongue
02-28-2015 11:46 AM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #8
RE: How to detect location on the board? index, forumdisplay, showthread etc?
hey if I am in the headerinclude template

Code:
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1800"></script>


How do i detect if its the index or forumdisplay or showthread? so i can use jquery or not just jquery?

(This post was last modified: 09-22-2015 02:38 PM by ollie2015.)
09-22-2015 02:37 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: How to detect location on the board? index, forumdisplay, showthread etc?
jquery gets used a lot in MyBB. It is up to you if you want to stop loading things, and the syntax remains the same, just a lot longer.


In your headerinclude:

Code:
1
2
3
4
5
6
7
8
9
<if THIS_SCRIPT =='forumdisplay.php' OR 'showthread.php' then>
jquery active

<elseif THIS_SCRIPT =='index.php' then>
No jquery

<else THIS_SCRIPT =='member.php' then>
mootools
</if>



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 09-22-2015 06:16 PM by leefish.)
09-22-2015 06:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #10
RE: How to detect location on the board? index, forumdisplay, showthread etc?
thanks, i give it a shot
(This post was last modified: 09-23-2015 06:13 AM by ollie2015.)
09-23-2015 06:13 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: