MyBB Community Forums

Full Version: Integrate Comikaze into header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
Brand new to mybb, and just a novice to php in general, so please be gentle if you can help.

Right, so I've installed this comic thing and i want it displayed in the header on all pages between the "UserCP" and where the forum starts.
When i try to place
<div align="center">
	<p/><?=$comic->firstButton?>
	<?=$comic->prevButton?>
	<?=$comic->archiveButton?>
	<?=$comic->nextButton?>
	<?=$comic->latestButton?>

	<p/><table cellpadding="5">
		<tr>
			<td><?=$comic->comicImage?></td>
		</tr>
		<tr>
			<td align="center">
				<?=$comic->news_formatted?>
				<?=$ccm->getComicNewsPosts($comic->id)?>
			</td>
		</tr>
	</table>

inside the template called header, i only get errors.
Ive added the lines

require "../includes/init.php";
$comic = $ccm->getComic('latest');

in the top of index.php but i get nowhere.

I am aware that i'm doing something wrong, but i can't figure out what, or rather i don't understand the error i get wich is:
Fatal error: Call to a member function getComicNewsPosts() on a non-object

hope anyone can help.
Thanks.
Yo cannot put PHP in your templates.
You can add the php codes to global.php then use the variables in the header template.. however i can't help you in this as long as some Comikaze functions should be included in global.php (ex. getComicNewsPosts() ) and i don't know them, find them 1st.
thanks!
Figured out the bit about php in the templates, so ill go searching for some functions.