Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» .::.
tattoo fonts
http://www.checkoutmyink.com/category/tattoo-fonts-tattoo

Go Back   Nukemods Forum > PHP-Nuke 6.5 to 6.9 > Nuke 6.5 to 6.9 - Blocks

Reply
 
LinkBack Thread Tools Display Modes
Center Forum Blocks & Local Time
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 34
Join Date: Nov 2002
Location: Australia
Center Forum Blocks & Local Time - 07-10-2003, 11:51 PM

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]
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Moderator
 
Status: Offline
Posts: 737
Join Date: Nov 2002
07-11-2003, 01:43 PM

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.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 34
Join Date: Nov 2002
Location: Australia
08-03-2003, 07:35 PM

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...
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Moderator
 
dar63's Avatar
 
Status: Offline
Posts: 473
Join Date: Oct 2002
Location: UK
08-03-2003, 08:07 PM

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 -
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 34
Join Date: Nov 2002
Location: Australia
08-03-2003, 08:42 PM

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&amp;file=article&amp;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...
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#6 (permalink))
Moderator
 
dar63's Avatar
 
Status: Offline
Posts: 473
Join Date: Oct 2002
Location: UK
08-03-2003, 08:50 PM

Have a read of this

http://phpnuke.nukecops.com/modules....ewtopic&t=4318

might help.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#7 (permalink))
Junior Member
 
Status: Offline
Posts: 34
Join Date: Nov 2002
Location: Australia
08-03-2003, 08:57 PM

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....
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#8 (permalink))
Moderator
 
dar63's Avatar
 
Status: Offline
Posts: 473
Join Date: Oct 2002
Location: UK
08-03-2003, 09:07 PM

It's fine here. :?

Try this one then

http://nukesupport.com/board/viewthr...ID=48&TID=8001
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#9 (permalink))
Junior Member
 
Status: Offline
Posts: 34
Join Date: Nov 2002
Location: Australia
08-03-2003, 09:16 PM

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 ?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#10 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
08-03-2003, 09:55 PM

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
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
different colors in left,right and center blocks Ravera Nuke 7.x - General 2 05-06-2009 04:37 AM
How to set default language/time on forum userke Nuke 7.x - Themes 0 01-19-2005 06:24 AM
Recent Posts Block - local time Lateron Nuke 6.5 to 6.9 - Blocks 4 06-20-2003 04:32 PM
center block time jeffk Nuke 6.5 to 6.9 - Blocks 3 06-20-2003 04:33 AM
Forum Center Block 6.5 FleaSOG Nuke 6.5 to 6.9 - Blocks 3 06-18-2003 03:34 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31