Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 1 Year, 8 Months ago Own Time/Current Time (Script)
#1
Solved: 1 Year, 8 Months ago
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:
<?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.
> SELECT finger FROM hand WHERE id='3'
Reply


Messages In This Thread
Own Time/Current Time (Script) - by isoldehn - 01-31-2018, 05:59 AM
RE: Own Time/Current Time (Script) - by isoldehn - 02-01-2018, 04:20 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)