MyBB Community Forums

Full Version: [Solved] Template Marker is not replaced {marker}
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

i'm trying to program a plugin for my mybb Page, but somehow it's now working.
The Plugin is named scrolling_gallery and this is the code:

        die('This file cannot be accessed directly.');


function scrolling_gallery(){
        global $mybb, $templates, $scrolling_gallery;
        $str = 'hello world';
         eval('$scrolling_gallery="' . $str . '";');

function scrolling_gallery_info()

        return array(
                "name"              => "Scrolling Gallery",
                "description"       => "Nothing interesting here",
                "website"           => "",
                "author"            => "Denis D",
                "authorsite"        => "Under Construction!",
                "version"           => "1.0.0",
                "compatibility"     => "18*",
                "guid"              => "",

In the template I have added {scrolling_gallery} and like I read, that should work.
But nothing happend...

MyBB Version :1.8.7

Someone an idea?


Maybe I clearify "nothing happened".
Nothing showed on the Page, where my default string should appear.
When I add a return-Statement, the site is blank "like i thought" (in this moment)
{$scrolling_gallery} should work on the index template
in general, $ is used for the variables
{$scrolling_gallery} will work.
Also tried {$scrolling_gallery}  but no changes.

But ".m." have said , it will only work on the index template, this also includes subtemplates?

The template "{$scrolling_gallery}" is called is named "header"

<script type="text/javascript">
lang.no_new_posts = "{$lang->no_new_posts}";
lang.click_mark_read = "{$lang->click_mark_read}";
// -->

<link href="css/lightbox.css" rel="stylesheet">

<div class="forum"><br />
it is coded to work on index related templates through index_start hook

to get it on the header, you have to use a global hook (eg. global_start)

see plugin hooks and plugins & hooks explained
Thank you very much .m.
Now I see, that I misunderstood the hooks Smile