MyBB Community Forums

Full Version: Template Variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, I am slowley getting used to this wonderful board software, I am now going through the template system and it`s a little tricker than I first thought,

In my header template you have the following:

					<ul class="menu top_links">
						<a href="upload.php">Uploader</a>
						{$menu_portal}
						{$menu_search}
						{$menu_memberlist}
						{$menu_calendar}
						<li><a href="{$mybb->settings['bburl']}/misc.php?action=help" class="help">{$lang->toplinks_help}</a></li>
where are the variables defined? in the database?.. in phpbb you have language files and includes, so am trying to work out how to add extra things to the header, you can see in the code provided , I have added a link to my onsite image uploader, but would like this as a variable so it includes an image like the others (calendar, search etc)

Any guidance appreciated.
if you need image icon with the new link then you can add it with css style code for the link !
header link can be like below
<li><a href="upload.php" class="upload">Uploader</a></li>

upload class can be added to global.css stylesheet of the theme like below
.upload {background-image: url(path/to/iconimage);}

note: edit the stylesheet in forum admin panel (through themes section) AND in advanced edit mode (tab)

remember hard refreshing your browser [eg. press CTRL + F5] on a forum index after saving changes to the stylesheet

variables:
variables are defined in php files.
it would be better to not modify php files to just add links & images
If you want to create custom variables, then you would need to create a plugin, that way you're not modifying the core files (these files will get updated and you will lose all your precious data). Plugins are the best way to go about this, as you're the one managing them and keeping them up to date with the current version of MYBB
Consider the following:
http://mybbhacks.zingaburga.com/showthread.php?tid=464

But isn’t required for what you want to achieve as already mentioned by .m.