MyBB Community Forums

Full Version: $thread['fid'] problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.
I'm try write a +18 content Warning.


In header template I'm write

<if condition=$thread['fid']==36 or $thread['fid']==43 or $thread['fid']==44 or $thread['fid']==45 or $thread['fid']==46  or $thread['fid']==47 or $thread['fid']==48 or $thread['fid']==49 <then>

<script src="http://ajo.pl/js/jquery-1.3.2.min.js" type="text/javascript">
</script>
<script src="http://ajo.pl/js/jqModal.js" type="text/javascript">
</script>
<link href="http://ajo.pl/css/jqModal.css" type="text/css" rel="stylesheet">

</link>
<script>

$(document).ready(function() {

 var triggers = $('a.ex3bTrigger')[0];


 $('#ex3b').jqm({
 trigger: triggers,
 ajax: '/18.html',
 target: 'div.jqmAlertContent',
 modal: true,
 overlay: 90
 });

 if($.browser.msie) {
 $('div.jqmAlert .jqmClose')
 .hover(
 function(){ $(this).addClass('jqmCloseHover'); },
 function(){ $(this).removeClass('jqmCloseHover'); });
 }
 $('#ex3b').jqmShow();
 $('ex3bTrigger').trigger("click");
});

</script>
(alert) ...
<div id="ex3b" class="jqmAlert jqmID1" style="z-index: 3000; display: block;">
<div id="ex3b" class="jqmAlertWindow">
<div class="jqmAlertContent">
<h1 style="color: red;">Treść tylko dla dorosłych</h1>
Strona, którą chcesz odwiedzić została uznana przez administratora lub użytkowników za zawierającą treści przeznaczone wyłącznie dla osób pełnoletnich. Strona ta zawierać może w szczególności treści o tematyce erotycznej, a także treści drastyczne lub inne przeznaczone wyłącznie dla osób pełnoletnich. Decydując się na zapoznanie z treścią tej strony, czynisz to na własną odpowiedzialność.
<br/>
<br/>
Korzystanie ze strony zawierającej treści przeznaczone wyłącznie dla osób pełnoletnich następuje na ryzyko osoby decydującej się zapoznać z takimi treściami.
<br/>
<br/>
<strong>Oświadczam, że mam ukończone 18 lat, wchodzę na własną odpowiedzialność i zapoznałem się z regulaminem forum xxx.xxx , wyrażam zgodę na jego brzmienie i zobowiązuję się do jego przestrzegania.</strong>
<br/>
<br/>
<input type="checkbox" name="zap"/>
Zapamiętaj moje ustawienia
<h1>
</h1>
</div>
</div>
</div>

</if>


<!-- niżej -->

{$thread['fid']}


<!-- już -->

but $thread['fid'] not return any value and condition always is not fulfilled.
I'm try with reference.

<if condition=$mybb->thread['fid']==36 or $mybb->thread['fid']==43 or $mybb->thread['fid']==44 or $mybb->thread['fid']==45 or $mybb->thread['fid']==46  or $mybb->thread['fid']==47 or $mybb->thread['fid']==48 or $mybb->thread['fid']==49 <then>
</if>

but this return the same efect.


Sorry for my bad english.
I assume you have the PHP and Template Conditionals plugin installed ?
Use $mybb->input['fid'] instead of $thread['fid']
Thank you very much Wink