MyBB Community Forums

Full Version: Floating message for guests
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry if it's the wrong forum.

I'm trying to develop my first plug-in.
It's basically adds a piece of code into the header template;
Any direction?
Here is the shell:
<?php
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

	$plugins->run_hooks("global_start", "goFloating");
function  helloguest_info()
{
return array(
		"name"		=> "Hello Guest",
		"description"		=> "Display a floating message for guests.",
		"website"		=> "http://www.reshetgames.co.cc",
		"author"		=> "Gilad Naaman",
		"authorsite"		=> "http://www.reshetgames.co.cc",
		"version"		=> "1.0",
		"guid" 			=> "",
		"compatibility"	=> "*"
		);
}
function goFloating()
{
	
}
?>
I'm not sure where should I hook the plug-in (I want it to be displayed in all pages, so I guessed it should be on global), and I don't how to edit the templates.

Thanks for helping, and I would be happy to hear (or read) any tips you can give Smile

Edit: Okay, I saw the akismat plug-in:
	find_replace_templatesets("postbit", "#".preg_quote('{$post[\'button_spam\']}')."#i", '', 0);
I get the first parameter, it's the template name (Shocking...), what are the others?
Second - find, third - replace, fourth - bool (Do i want Ice-cream?)? (Just guessing...)

Would that work?
	find_replace_templatesets("header", "{$pending_joinrequests}", ' {$pending_joinrequests} <br /> <p>Test</p> ', 0);