Not Solved field \ variable "fid"
#11
Not Solved
(2012-08-13, 06:22 PM)euantor Wrote: The variable isn't accessible in the header unfortunately due to the way variables actually work within PHP.


Tample {header} powered by tample forumdisplay
There is a method \ way to send the var fid from forumdisplay to {header}


<script type="text/javascript">
var fid = {$foruminfo['fid']};
alert(fid);
</script>
Reply
#12
Not Solved
The only way to make it accessible would be to modify the actual core files of MyBB.
Reply
#13
Not Solved
I use the fid in the header template. I think it is {$forum_cache['fid']} ? It will only work if it is set (you are in forum display or show thread) because global.php sets it to define the style to use (I think that is the reason, have no check to be sure).
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#14
Not Solved
(2012-08-13, 06:36 PM)euantor Wrote: The only way to make it accessible would be to modify the actual core files of MyBB.

Can I create a car's actual core files of MyBB or I have to ask for something in MYBB manager.
Reply
#15
Not Solved
Never thought to even look at doing that. You could try the above but it would be a good idea to use a template conditional to ensure the variable is available.
Reply
#16
Not Solved
(2012-08-13, 07:03 PM)euantor Wrote: Never thought to even look at doing that. You could try the above but it would be a good idea to use a template conditional to ensure the variable is available.



Can you help me, just for a single variable.

A) What kind of file .
B) where I place it.
Reply
#17
Not Solved
Take a look at what Omar posted - it should work if he says it's working for him.
Reply
#18
Not Solved
{$GLOBALS['forum']['fid']} does works for me, though I can't find where it is set in the global.php file.

I use Template Conditionals (I doubt you need this plugin for the variable to actually work):
<if $GLOBALS['forum']['fid'] && $GLOBALS['forum']['fid'] == 23 then>
you are seeing forum which ID is 23
</if>

Edit: Thinking about it, maybe it doesn't necessarily need to be set at global.php
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#19
Not Solved
(2012-08-13, 08:17 PM)Omar G. Wrote: {$GLOBALS['forum']['fid']} does works for me, though I can't find where it is set in the global.php file.

I use Template Conditionals (I doubt you need this plugin for the variable to actually work):
<if $GLOBALS['forum']['fid'] && $GLOBALS['forum']['fid'] == 23 then>
you are seeing forum which ID is 23
</if>

Edit: Thinking about it, maybe it doesn't necessarily need to be set at global.php

It doesn't need to be set in global.php so long as it'd declared as a global variable in forumdisplay.php. I would certainly recommend the use of the template conditionals plugin though as I'm assuming he'll be doing more than just printing the FID.
Reply
#20
Not Solved
euantor/Omar G.

Please Help
What steps are necessary
Add Template control panel in Home2 »Template Sets
Call "conditionals plugin" or this exists

I need var fid in {hedaers} , to Select ad to furom by fid !


i try {$forum_cache['fid']} dosnt work Confused
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)