Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
andrej
Hangin' Around


Joined: Sep 10, 2005
Posts: 48

PostPosted: Sat Jan 07, 2006 6:15 am Reply with quote

I have a scrolling forum block displaying the last 5 posts..
The problem is the server time is being displayed rather than my local time..
The code is as follows..

The thing is i have tried to put
putenv("TZ=Europe/Oslo");
at the beginning of the file, as this has worked for some other block, but not for this one.

What should i do ?

Code:


<?php



/************************************************************************/

/* Forums Block for phpBB 2.0.0 port to PHP Nuke 6.5b6+                 */

/* ====================================================                 */

/*                                                                      */

/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)         */

/* http://phpnuke.org                                                        */

/*                                                                        */

/* Version 1, modified by Sébastien Vaast                               */

/* http://membres.lycos.fr/projectpluto/                                */

/*                                                                      */

/* Updated by Tom Nitzschner 22/06/2002 to add the scrolling text       */

/*                                                                      */

/* Updated by Paul Laudanski 14 Jan 2003                                */

/* NukeCops.com  |  ComputerCops.biz                                        */

/*                                                                        */

/* Last Edited - 14 Jan 2003                                                      */

/*                                                                        */

/* This Block shows the last 10 topics where a message was posted,        */

/* along with the username of the last poster and the day and time        */

/* of the post.                                                                */

/* It will also show smileys in the topic titles thanks to the                */

/* smileys.php file found in Leo Tan Block Forums version                */

/* (http://www.cybercomp.d2g.com).                                        */

/*                                                                        */

/* This program is free software. You can redistribute it and/or modify */

/* it under the terms of the GNU General Public License as published by */

/* the Free Software Foundation; either version 2 of the License.       */

/************************************************************************/



if (eregi("block-Forums.php", $PHP_SELF)) {

    Header("Location: index.php");

    die();

}
putenv("TZ=Europe/Oslo");
//include_once ('blocks/smileys.php');

global $prefix, $dbi, $sitename, $user, $cookie, $group_id;

$count = 1;

$content = "<A name= \"scrollingCode\"></A>";

$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"250\" scrollamount= \"1\" scrolldelay= \"40\" onmouseover='this.stop()' onmouseout='this.start()'>";

$content .="<center><b>Zadnjih 5 sporočil na forumu</b></center>";

$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0  ORDER BY t.topic_last_post_id DESC LIMIT 5", $dbi);

$content .= "<br>";

while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id) = sql_fetch_row($result1, $dbi)) {


$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%d, %b %Y ob %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);

list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);



$result3 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);

list($username, $user_id)=sql_fetch_row($result3, $dbi);

$topic_title = substr("$topic_title", 0,18);

//$topic_title=parseEmoticons($topic_title);



// Remove the comment below to add the counter

//$content .="<STYLE=\"text-decoration: none\"><font color=\"#00DCFF\"><b>Message: $count<br></b>";



$content .= "<a href=\"forums.html?amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\"><b> $topic_title...</b></a><br><i>Zadnji prispevek <A HREF=\"profile-.html$user_id\"> $username </a> v <a href=\"forums.html?amp;file=viewforum&amp;f=$forum_id\">$forum_name</a> $post_time</i></font><br><br>";

$count = $count + 1;

}

$content .= "<br><center>[ <a href=\"forums.html\">$sitename ]</center>";

?>

 
View user's profile Send private message
Steptoe
Involved
Involved


Joined: Oct 09, 2004
Posts: 293

PostPosted: Sat Jan 07, 2006 1:57 pm Reply with quote

In practical terms Do u realy need the post time?
Date yes. Take the time out of the block.
This also allows a smaller block and keeps most posts on the same line.

_________________
My Spelling is NOT incorrect, it's Creative 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©