2018-01-31, 05:59 AM
Users can set their own time preference in their User CP settings. While that is fine there are certain functions of our forum that runs of the forums specific time set.
So what I'm trying to do is create a little variable which will display the forums time so that users can compare it to their own time.
So far I've done a little test page like so:
Works absolutely wonderful on that page. HOWEVER when I go to add this tid bit into the global.php file as this will be added to the footer next to their time (current time selected via User CP) it does not show. I've added it right before the end of the globabl file.
Any ideas as to why it's not working.
So what I'm trying to do is create a little variable which will display the forums time so that users can compare it to their own time.
So far I've done a little test page like so:
<?php
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'test.php');
$templatelist = "a_test_time";
require "./global.php";
add_breadcrumb("Post Totals Testing", "test.php");
date_default_timezone_set("America/Chicago");
$CaelesteTime = date("m-d-Y, h:i A");
eval("\$a_test_time = \"".$templates->get("a_test_time")."\";");
output_page($a_test_time);
?>
Works absolutely wonderful on that page. HOWEVER when I go to add this tid bit into the global.php file as this will be added to the footer next to their time (current time selected via User CP) it does not show. I've added it right before the end of the globabl file.
date_default_timezone_set("America/Chicago");
$CaelesteTime = date("m-d-Y, h:i A");
// Run hooks for end of global.php
$plugins->run_hooks('global_end');
Any ideas as to why it's not working.