MyBB Community Forums

Full Version: field \ variable "fid"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I access to the field \ variable "fid" from tample

What needs to write code
Depends which template you're referring to. Variables can only be accessed in templates where they are set.
I want to get "fid" from "harder" tample , when forumdisplay.php use it,

I want to display a message according to the "fid" and so I need the value, how do you propose to do so.


http://furom/forumdisplay.php?fid=2
You should really only use the fid variable in any template relating to forumdisplay. Anyway, I believe it can be accessed via {$foruminfo['fid']} when in a forumdisplay template.
(2012-08-13, 03:44 PM)euantor Wrote: [ -> ]You should really only use the fid variable in any template relating to forumdisplay. Anyway, I believe it can be accessed via {$forum['fid']} when in a forumdisplay template.

I have need only the "fid" field.
var x ={$ forum ['fid']};
That I tried to print {$ forum ['fid']} with JavaS it did not give me the variable.

When going through a forum on "? Fid = 2" I have total know which forum will realize that two in this case.
Sorry, but I actually have no clue what you mean?
(2012-08-13, 04:06 PM)euantor Wrote: [ -> ]Sorry, but I actually have no clue what you mean?



When going through a forum on "? fid = 2" I have total know which forum will realize that two in this case.

I use only in "fid"
   VAR X = fid
And prints it on the screen undefined

Why
SO you're just wanting to print the FID of a forum via javascript? Try putting this in the forumdisplay template:

<script type="text/javascript">
var fid = {$foruminfo['fid']};
alert(fid);
</script>

When you then go to a forum there should be a popup with the FID in. I assume that's what you're meaning to do?
Thank you very


it work in {forumdisplay} Smile but not {header}

I want it to work well in {header}

What needs to write code

Thank you very


it work in {forumdisplay} Smile but not {header}

I want it to work well in {header}

What needs to write code
The variable isn't accessible in the header unfortunately due to the way variables actually work within PHP.
Pages: 1 2