» Log in
User Name:

Password:

Not a member yet?
Register Now!
» 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
Texas electricity - save on electric rates
Rimonabant
www.rimonabant-weight-loss.com
Football Betting - best nfl betting promotions at sportsbook.com.
Poker Chips - Clay and composite poker chips for home games.

Register Now! Contact Us

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 ...



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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 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]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-03-2003, 07:07 PM
dar63's Avatar
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 -
__________________
http://phpnuke-uk.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 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&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
  #6 (permalink)  
Old 08-03-2003, 07:50 PM
dar63's Avatar
Moderator
 
Join Date: Oct 2002
Location: UK
Posts: 473
Have a read of this

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

might help.
__________________
http://phpnuke-uk.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 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....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-03-2003, 08:07 PM
dar63's Avatar
Moderator
 
Join Date: Oct 2002
Location: UK
Posts: 473
It's fine here. :?

Try this one then

http://nukesupport.com/board/viewthr...ID=48&TID=8001
__________________
http://phpnuke-uk.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 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
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
How to set default language/time on forum userke Nuke 7.x - Themes 0 01-19-2005 05:24 AM
different colors in left,right and center blocks Ravera Nuke 7.x - General 1 07-12-2004 08:41 PM
Recent Posts Block - local time Lateron Nuke 6.5 to 6.9 - Blocks 4 06-20-2003 03:32 PM
center block time jeffk Nuke 6.5 to 6.9 - Blocks 3 06-20-2003 03:33 AM
Forum Center Block 6.5 FleaSOG Nuke 6.5 to 6.9 - Blocks 3 06-18-2003 02:34 PM


All times are GMT -5. The time now is 05:29 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.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