|
» Online Users: 94 |
| 0 members and 94 guests |
| No Members online |
| Most users ever online was 611, 03-21-2008 at 10:10 PM. |
|
» .::. |
Web Hosting - web hosting, dedicated servers and web design services
|
Online Degree - search for 1000+ online degrees, online colleges & online universities.
|
tattoo - we are a group of tattoo enthusiasts
|
Gexa Energy - your absolute best choice in electric service
|
|
|
|
|
|
|
|
|
Poker Chips - Clay and composite poker chips for home games.
|
|
|
About this Page This is a discussion on Center Forum Blocks & Local Time within the Nuke 6.5 to 6.9 - Blocks forums, part of the PHP-Nuke 6.5 to 6.9 category; The biggest complaint I get from visitors (and, believe me, if this is the worst then I can live with ... |
|
 |
 |
|
 |

07-10-2003, 10:51 PM
|
|
Junior Member
|
|
Join Date: Nov 2002
Location: Australia
Posts: 34
|
|
|
Center Forum Blocks & Local Time
The biggest complaint I get from visitors (and, believe me, if this is the worst then I can live with it  ) is the that the time showing in the center forum block is the server time. Now my server is in Texas, USA, and I'm near Sydney, Australia.
Has anyone worked out how to display local time on the block yet?
I think the time comes from this line of code:
|
Quote:
|
|
result3 = sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %H:%i') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
|
Cheers from Down Under,
Ron...
[edited for not being that important to be sticky
-Mighty_Y]
|

07-11-2003, 12:43 PM
|
|
Moderator
|
|
Join Date: Nov 2002
Posts: 737
|
|
|
The forum block time should be the same as whatever your default forum time is set to. You can change that through your forum admin cp under configuration. Your members can also adjust that time through their profile in the forums.
|

08-03-2003, 06:35 PM
|
|
Junior Member
|
|
Join Date: Nov 2002
Location: Australia
Posts: 34
|
|
|
Hi IACOJ,
My apologies for the delay in replying.
I have my forums set to my local time which is GMT+10 and all times on posts etc are correct. My forum block posts show the server time which is 15 hours behind my local time. When you click on the forum block posts and go to the forums the time in the forum for that post is local.
If anyone has a solution for this I would be grateful.
Thank you,
Ron...
|

08-03-2003, 07:07 PM
|
 |
Moderator
|
|
Join Date: Oct 2002
Location: UK
Posts: 473
|
|
|
I added + 18000 after (post_time as my site is 5 hours ahead of my server
18000 = 5x3600
work out your time difference and add that + or -
|

08-03-2003, 07:42 PM
|
|
Junior Member
|
|
Join Date: Nov 2002
Location: Australia
Posts: 34
|
|
Thank you, Dar63.
I am +15 hours ahead of my server and now my Forum block is showing local time. In the index.php file there is datetime(4) and if you change that to datetime(4)+15 that works. I had tried the same thing with the forum block but hadn't thought about trying seconds. My inexperience shows  ops:
This is the code for a similar block which shows the last ten comments on homepage articles. Would I be stretching the friendship if I asked you if a simple change is possible here to show local time? (The sad emoticons are there because there are colons in the code at those spots.)
|
Quote:
|
<?php
/**
This block shows the most recent comments on a PHP Nuke based website.
*/
/*
* You can adjust the number of comments to be displayed.
*/
$nr = 10;
/*
* Important: setting this to 1 requires a change in your webserver's configuration (a redirect from article/* to modules/php?name=News...)
*/
$shorturl = 0;
if (eregi("block-Recent_Comments.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $prefix, $dbi, $anonymous;
$a = 1;
$content = "";
$result2 = sql_query("select name,sid,date,subject from ".$prefix."_comments order by date DESC limit $nr", $dbi);
while (list($c_name, $sid, $c_date,$c_subject) = sql_fetch_row($result2, $dbi)) {
if ($a <= $nr) {
$title2 = ereg_replace("_", " ", $title);
if (!eregi("[a-z0-9]",$c_name)) $c_name = $anonymous;
$nicedate = formatTimestamp($c_date);
$c_subject = str_replace("Re:","",$c_subject);
if ($shorturl) {
$urlto = "article/$sid";
} else {
$urlto = "modules.php?name=News&file=article&sid=$s id";
}
$content .= "<a href=\"$urlto\" title=\"$nicedate\">$c_name</a>: $c_subject ";
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}) [0-9]{1,2}) [0-9]{1,2})", $c_date, $datetime);
$day = $datetime[3];
$month = $datetime[2];
$daytoday = date("d");
$monthtoday = date("m");
$hour = $datetime[4];
$minute = $datetime[5];
if (($day == $daytoday) && ($month == $monthtoday)) { //ignoring year here.
$content .= "<font class=\"tiny\">($hour:$minute)</font>
";
} else {
$content .= "<font class=\"tiny\">(". intval($day) . "/" . intval($month) . ")</font>
";
}
}
$a++;
}
?>
|
Thanks once again,
Ron...
|

08-03-2003, 07:50 PM
|
 |
Moderator
|
|
Join Date: Oct 2002
Location: UK
Posts: 473
|
|
|
|

08-03-2003, 07:57 PM
|
|
Junior Member
|
|
Join Date: Nov 2002
Location: Australia
Posts: 34
|
|
|
Thanks for that lead but I will have to check it out later as that site is not working, at least at the moment. Perhaps they are doing some work on it.
Cheers,
Ron....
|

08-03-2003, 08:07 PM
|
 |
Moderator
|
|
Join Date: Oct 2002
Location: UK
Posts: 473
|
|
|
|

08-03-2003, 08:16 PM
|
|
Junior Member
|
|
Join Date: Nov 2002
Location: Australia
Posts: 34
|
|
If I try to access http://phpnuke.nukecops.com I get the forums displayed but then nothing works (ie search, using a topic link such as the one you supplied etc). I get the same page that shows on a new installation of phpnuke before forums are setup - Information Page.
Thanks for all your time and help. I do appreciate it.
Regards,
Ron...
Later: wonder why I got *beep* for using the word d i s p l a y e d ?
|

08-03-2003, 08:55 PM
|
|
Senior Member
|
|
Join Date: Sep 2002
Posts: 2,905
|
|
|
Quote:
|
|
Later: wonder why I got *beep* for using the word d i s p l a y e d ?
|
y e d , the last three letter of "display e d " are a Foeign bad word. Not used hardly at all here, so I'll remove it from the list :-)
mikem
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|