Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Is it possible to do a url check?
Ukshep Offline
Junior Member
**
Posts: 9
Joined: Oct 2014
Post: #1
Is it possible to do a url check?
I have a single threadlist forum, with 2 hidden forums and when i am in a thread in the hidden forums i can click the header image and can redirect to the forum threadlist of the thread i was viewing, using the code below.

BUT if i am already viewing the hidden forum threadslist and press the header image it takes me back to the main threadlist away from the hidden forum, So is it possible to use some code so that if im viewing the threadlist of fid-9 i can press the header image and the page will refresh to fid-9 etc etc

Code:
1
2
3
4
5
6
7
8
9
10
11
<if $fid == 8 then>
<div class="logo"><a href="{$mybb->settings['bburl']}/forumdisplay.php?fid=8"><img src="images/elegant/Header2.png"   title="{$mybb->settings['bbname']}" /></div></a></div>

<elseif $fid == 9 then>
<div class="logo"><a href="{$mybb->settings['bburl']}/forumdisplay.php?fid=9"><img src="images/elegant/Header2.png"   title="{$mybb->settings['bbname']}" /></div></a></div>

<else />

<div class="logo"><a href="{$mybb->settings['bburl']}"><img src="images/elegant/Header2.png"  title="{$mybb->settings['bbname']}" /></div></a></div>

</if>

11-15-2014 08:38 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #2
RE: Is it possible to do a url check?
IIRC in the header you will need to use {$mybb->input['fid']}, probably <?=($mybb->get_input('fid', 1))?> in 1.8 for security reasons, no sure if really necessary.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
11-16-2014 06:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: Is it possible to do a url check?
Try replacing your instances of $fid with ($fid ?: (THIS_SCRIPT=='forumdisplay.php' ? (int)$mybb->input['fid'] : 0))

Not tested, so IDK if it works.

(11-16-2014 06:19 PM)Sama34 Wrote:  IIRC in the header you will need to use {$mybb->input['fid']}, probably <?=($mybb->get_input('fid', 1))?> in 1.8 for security reasons, no sure if really necessary.
Unfortunately doesn't work for non-forumdisplay pages... :/
forumdisplay is actually special in that $fid isn't set in global.php

My Blog
(This post was last modified: 11-16-2014 08:07 PM by ZiNgA BuRgA.)
11-16-2014 07:48 PM
Find all posts by this user Quote this message in a reply
Ukshep Offline
Junior Member
**
Posts: 9
Joined: Oct 2014
Post: #4
RE: Is it possible to do a url check?
(11-16-2014 07:48 PM)ZiNgA BuRgA Wrote:  Try replacing your instances of $fid with ($fid ?: (THIS_SCRIPT=='forumdisplay.php' ? (int)$mybb->input['fid'] : 0))

Not tested, so IDK if it works.

(11-16-2014 06:19 PM)Sama34 Wrote:  IIRC in the header you will need to use {$mybb->input['fid']}, probably <?=($mybb->get_input('fid', 1))?> in 1.8 for security reasons, no sure if really necessary.
Unfortunately doesn't work for non-forumdisplay pages... :/
forumdisplay is actually special in that $fid isn't set in global.php

Seems to work perfectly Biggrin

thanks
11-16-2014 10:20 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: