MyBB Hacks

Full Version: Is it possible to do a url check?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:
<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>

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.
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
(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
Reference URL's