MyBB Community Forums

Full Version: A Fairly Simple Mod
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I need is a universal time. Basically, it displays GMT time on the forums without changing the user's settings.

Ok, well that sounded complicated. Here it is in simple terms.

1)There will be a little text after the Navigational Menu saying "The time in the world of Astra is [GMT -00 Time]
2)This will not change the user set timezones, but only show the current GMT -00 time after "The time in the world of Astra is.."

It sounds fairly simple right? I hope someone can whip something up for me Smile

But if someone wants to walk me through such a simple mod, they can do that too ;D I'm open for learning.
If you just need the GMT Time you could us the function gmdate();
For example, to get the time it would be
gmdate("H:i",time());
How would I go about inserting this into the custom skin? I'm fairly a newb, as the only PHP I know is PHP Includes and editing variables.
I'm just going to type this up in one minute, and not going to test it, so there could be a bug (let's see how I go Toungue):

<?php

if(!defined("IN_MYBB"))
	die("This file cannot be accessed directly.");

$plugins->add_hook("global_start", "gmtime_run");

function gmtime_info()
{
	return array(
		'name'			=> 'GMT Time',
		'description'	=> 'Evaluates GMT Time.',
		'website'		=> 'http://endlessparadigm.com/',
		'author'		=> 'ZiNgA BuRgA',
		'authorsite'	=> 'http://zingaburga.com/',
		'version'		=> '1.0'
	);
}

function gmtime_run()
{
	global $gmtime;
	$gmtime = gmdate("H:i",time());
}
?>
Copy the above into a text editor and save it as gmtime.php
Upload this as a plugin, then enable it.

After that, add {$gmtime} anywhere in your templates, when you want to show the GMT time.
I think it'll work but this is look too simple to make a plugin for that...
just edit the templates IMHO
ZiNga BuRgA Wrote:I'm just going to type this up in one minute, and not going to test it, so there could be a bug (let's see how I go Toungue):

<?php

if(!defined("IN_MYBB"))
	die("This file cannot be accessed directly.");

$plugins->add_hook("global_start", "gmtime_run");

function gmtime_info()
{
	return array(
		'name'			=> 'GMT Time',
		'description'	=> 'Evaluates GMT Time.',
		'website'		=> 'http://endlessparadigm.com/',
		'author'		=> 'ZiNgA BuRgA',
		'authorsite'	=> 'http://zingaburga.com/',
		'version'		=> '1.0'
	);
}

function gmtime_run()
{
	global $gmtime;
	$gmtime = gmdate("H:i",time());
}
?>
Copy the above into a text editor and save it as gmtime.php
Upload this as a plugin, then enable it.

After that, add {$gmtime} anywhere in your templates, when you want to show the GMT time.

But how would I make it say "The time in the world of Astra is..."

And yes I know it's simple, but I'm a 14 year old newb.
Where you add the {$gmtime} it's insert the GMT time, so you can just add before "The time in the world of Astra is...".
that all!

and if you're only 14 years old and you manage a site\forum ... U R lucky Smile
dvb Wrote:Where you add the {$gmtime} it's insert the GMT time, so you can just add before "The time in the world of Astra is...".
that all!

and if you're only 14 years old and you manage a site\forum ... U R lucky Smile

Yeah, I thought about that after I had some caffeine. Was in 5 in the morning when I replied. I understand the structure now and thanks for your help Mr. Z (your name's too hard).

And dvb, I've been making Freewebs sites since 9. I never really wanted to make a site, but this game I love has only one fansite - and it sucks in terms of management, community. There's flame, spam, and ego running around.

http://www.gunzfactor.com/forums/

Go into any of those threads and look at the spam. I strictly hate this site representing the game I love GunZ The Duel because the official forums have been down for 2 - 3 years now.

The only reason I made this site was to make this game's community nicer and give it a better resource - not the trash like GunZ Factor is.
I started coding at 11 - don't see how you couldn't at age 14.