Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
christianb
Worker
Worker



Joined: Nov 24, 2004
Posts: 131
Location: Batesville, AR

PostPosted: Tue Apr 19, 2005 8:06 am Reply with quote

Please move this to the appropriate forum if this isn't the correct one.

I'm using phpNuke 7.6 and have found that the guide on how to adjust server time is good, but parts are incorrect.
I've tested out every alphabetical variable a-Z and have adjusted to the best of my knowledge. This came about as a result of trying to use the % codes and something else showing up.
[ Only registered users can see links on this board! Get registered or login! ]

I've found these differences:

%A just shows "A"
%B just shows "B"
%c shows the current month in with either a space or a one preceeding the second digit (example: April is 4 while December is 12)
%C just shows "C"
%D is the same as %d and shows "th" on the end (example: 18th)
%g just shows "g"
%G just shows "G"
%h is the same as %I
%i shows minutes displayed in two-digit decimal format
%k (not listed) is the same as %H
%l (not listed - lowercase L) is the same as %I
%M - is the same as %b
%n shows "n"
%R shows "R"
%t shows "t"
%u (couldn't figure out)
%v same as %V
%W same as %A
%x same as %Y
%X same as %Y
%Z just shows "Z"

I don't know if anyone else has run into this or if it was just me, but I spent 2 hours working on this yesterday trying to figure out how to format a time. Sad
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Apr 19, 2005 9:02 am Reply with quote

Something else is wrong because that How To article is correct. If you look in your language/lang-english.php file, you will see these
define("_DATESTRING","%A, %B %d @ %H:%M:%S %Z");
define("_DATESTRING2","%A, %B %d");

And we know that it works. It could be that the manner in which you are calling it is incorrect.
 
View user's profile Send private message
christianb







PostPosted: Tue Apr 19, 2005 10:08 am Reply with quote

This is what is in my lang-english.php file (untouched). I have had no reason to mess with this - so this is from 7.6 or sentinel or something.

Code:
define("_DATESTRING","%A, %B %d @ %T %Z");

define("_DATESTRING2","%A, %B %d");


Code:
function translate($phrase) {

    switch($phrase) {
   case "xdatestring":   $tmp = "%A, %B %d @ %T %Z"; break;
   case "linksdatestring":   $tmp = "%d-%b-%Y"; break;
   case "xdatestring2":   $tmp = "%A, %B %d"; break;
   default:      $tmp = "$phrase"; break;
    }
    return $tmp;
}
 
christianb







PostPosted: Tue Apr 19, 2005 10:21 am Reply with quote

Also, where I am using it is in the forums block - if that makes a difference:

Code:
define("_BBFORUM_NEWTOPICS","Current Topics"); 

define("_BBFORUM_POSTER","Author");
define("_BBFORUM_VIEWS","Views");
define("_BBFORUM_REPLIES","Replies");
define("_BBFORUM_LASTPOSTER","Last Post By");
define("_BBFORUM_TOTTOPICS","Topics: ");
define("_BBFORUM_TOTPOSTS","Posts: ");
define("_BBFORUM_TOTVIEWS","Views: ");
define("_BBFORUM_TOTREPLIES","Replies: ");
define("_BBFORUM_FORUM","Enter Forum");
define("_BBFORUM_SEARCH","Search");
define("_BBFORUM_TITLE","Latest from");

if( eregi( "block-Forums_Centerv2.php", $_SERVER['PHP_SELF'])) {
   Header("Location: index.php");
   die();
}
global $prefix, $user_prefix, $db, $dbi, $sitename, $bgcolor1, $bgcolor2, $bgcolor3, $ThemeSel;



/*************************************/
/*                                   */
/* You Can Add More Themes Here      */
/*                                   */
/*************************************/
$table_bgcolor = $bgcolor1; /* background color for block */

switch($ThemeSel)
{
case "phpib2" :
   $table_bottom = "<tr><td height=\"28\" colspan=\"6\"  align=\"center\" class=\"catbottom\" background=\"themes/phpib2/forums/images/cellpic1.gif\">&</td></tr>";
   $table_top = "background=\"themes/phpib2/forums/images/cellpic3.gif\"  class=\"thcornerl\"><font color=\"#FFFF5D\"";
   $IconPath = "themes/phpib2/forums/images/folder_new.gif";
   $table_bgcolor = "#EAEDF4";
   break;
case "Helius" :
   $table_top = "background=\"themes/Helius/forums/images/bg_cat.gif\" class=\"thcornerl\"> <font color=\"#FFFF5D\"";
   $IconPath = "themes/Helius/forums/images/icon_newest_reply.gif";
   $table_bgcolor = "#EAEDF4";
   break;
case "fiappleblue210" :
   $table_top = "class=\"thcornerl\"> <font color=\"#FFFF5D\"";
   $IconPath = "themes/fiappleblue210/forums/images/folder.gif";
   $table_bgcolor = "#FFFFFF";
   break;
default :
   //$table_bottom = '';
   //$table_top    = '';
   $IconPath = "modules/Forums/templates/subSilver/images/icon_mini_message.gif";
}

/* Get darker color for $table_bgcolor */
$bgcolor5 = str_replace('#', '', $table_bgcolor);
$bgcolor5 =  sprintf("#%02X%02X%02X", (hexdec(substr($bgcolor5, 0, 2))* .98 ),(hexdec(substr($bgcolor5, 2, 2))* .98 ) , (hexdec(substr($bgcolor5, 4, 2))* .98 ));

/**********************************/
/*                                */
/* Configuration parameters       */
/*                                */
/**********************************/
// When set to 1 then Forums permissions which View and/or Read are NOT set to 'ALL' will NOT be displayed in the center block
$HideViewReadOnly = 1;
// Show only 5 last new topics
$Last_New_Topics  = 8;                           
// Icon that is displayed in Center Block in front of Topic

/**********************************/
/*                                */
/* Don't Edit Below !             */
/*                                */
/**********************************/
$border           = 0;
$cellspacing      = 0;
//$cellstyle        = "style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: dotted; border-bottom-width: 1\"";

/* Total Amount of Topics */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbtopics" );
$Amount_Of_Topics = $db->sql_numrows( $result );

/* Total Amount of Posts */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbposts" );
$Amount_Of_Posts = $db->sql_numrows( $result );

/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$result = $db->sql_query( "SELECT topic_views FROM ".$prefix."_bbtopics" );
while( list( $topic_views ) = $db->sql_fetchrow( $result ) )
{
   $Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}

/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$result = $db->sql_query( "SELECT topic_replies FROM ".$prefix."_bbtopics" );
while( list( $topic_replies ) = $db->sql_fetchrow( $result ) )
{
   $Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = $db->sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = sql_fetch_row( $result1, $dbi ) )
{
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {
      $result5 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
      list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result5 );
      if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
   }
   
   if( $topic_moved_id != 0 )
   {
     // Shadow Topic !!
      $skip_display = 1;
   }
   
   if( $skip_display == 0 )
   {
     $Count_Topics += 1;
      $result2 = $db->sql_query( "SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%a, %b %d at %I%:%i %p') as post_time FROM ".$prefix."_bbposts where post_id = '$topic_last_post_id'" );
      list( $topic_id, $poster_id, $post_time ) = $db->sql_fetchrow( $result2 );

      $result3 = $db->sql_query( "SELECT username, user_id FROM ".$user_prefix."_users where user_id='$poster_id'" );
      list( $uname, $uid ) = $db->sql_fetchrow( $result3 );
      $LastPoster = "<A HREF=\"forums.html?file=profile&mode=viewprofile&u=$uid\"STYLE=\"text-decoration: none\"> $uname </a>";
     
      $result4 = $db->sql_query( "SELECT username, user_id FROM ".$user_prefix."_users where user_id='$topic_poster'" );
      list( $uname, $uid ) = $db->sql_fetchrow( $result4 );
      $OrigPoster = "<A HREF=\"forums.html?file=profile&mode=viewprofile&u=$uid\"STYLE=\"text-decoration: none\"> $uname </a>";
   
      $TopicImage = "<img src=\"$IconPath\" border=\"0\" alt=\"\">";
      $TopicTitleShow = "<a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\">$topic_title</a>";

      $Topic_Buffer .= "<tr height=20 onmouseover=\"this.style.backgroundColor='$bgcolor5'\" onmouseout=\"this.style.backgroundColor=''\"><td $cellstyle>$TopicImage</td><td $cellstyle>$TopicTitleShow</td><td $cellstyle><div align=\"center\">$OrigPoster</div></td><td $cellstyle><div align=\"center\"><b>$topic_views</b></div></td><td $cellstyle><div align=\"center\"><b>$topic_replies</b></div></td><td $cellstyle align=\"center\">$LastPoster<br><font size=\"-2\"><i>$post_time</i></font></td></tr>";
   }
   
   if( $Last_New_Topics == $Count_Topics ) { break 1; }
   
}

/* Write Table to Screen */
$content  = "<table width=\"100%\" border=\"$border\"  cellspacing=\"$cellspacing\" bordercolor=\"$bgcolor4\" bgcolor=\"$table_bgcolor\">";

//$content .= "<tr><td width=\"100%\" height=\"28\" colspan=\"6\" align=\"center\" bgcolor=#7E98CB $table_top ><b>Categories</b></td></tr>";

//$content .= "<tr><td width=\"100%\" height=\"21\" colspan=\"6\" align=\"left\" bgcolor=$table_bgcolor>";

//$cat = sql_query("SELECT * FROM ".$prefix."_bbcategories", $dbi);
//while ($cat_row = sql_fetch_row($cat)) {
//   $cat_id = $cat_row[0];
//   $cat_title = $cat_row[1];
//   $content .= "<br><a href=\"forums.html?file=index&c=$cat_id\">$cat_title</a><br>";
//   $forum = sql_query("SELECT * FROM ".$prefix."_bbforums where cat_id='$cat_id'" , $dbi);
//   while ($forum_row = sql_fetch_row($forum)) {
//      $forum_id = $forum_row[0];
//      $forum_title = $forum_row[2];
//      $for_count ++;
//      $content .= "    <a href=\"forums.html?file=viewforum&f=$forum_id\">$forum_title</a>";
//   }
//}
//$content .= "</td></tr>";

//$content .= "<tr><td width=\"100%\" height=\"28\" colspan=\"6\" align=\"center\"
//bgcolor=#7E98CB $table_top ><b>Lastest Posts</b></td></tr>";

$content .= "<tr bgcolor=$bgcolor5><td></td><td align=\"center\">"._BBFORUM_NEWTOPICS."</td><td align=\"center\">"._BBFORUM_POSTER."</td><td align=\"center\">"._BBFORUM_VIEWS."</td><td align=\"center\">"._BBFORUM_REPLIES."</td><td align=\"center\">"._BBFORUM_LASTPOSTER."</td></tr>";
$content .= "$Topic_Buffer";
$content .= "<tr><td align=\"center\" colspan=\"6\">"._BBFORUM_TOTTOPICS."<b>$Amount_Of_Topics</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTPOSTS."<b>$Amount_Of_Posts</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTVIEWS."<b>$Amount_Of_Topic_Views</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTREPLIES."<b>$Amount_Of_Topic_Replies</b><b></center></td></tr>";
$content .= "<tr><td align=\"center\" colspan=\"6\">[ <a href=\"forums.html\">"._BBFORUM_FORUM."</a> ]&nbsp;&nbsp;&nbsp;[ <a href=\"modules.php?op=modload&name=Forums&file=search\">"._BBFORUM_SEARCH."</a> ]</center></td></tr>";
$content .= $table_bottom;
$content .= "</table>";

?>


the line that uses it:

Code:
$result2 = $db->sql_query( "SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%a, %b %d at %I%:%i %p') as post_time FROM ".$prefix."_bbposts where post_id = '$topic_last_post_id'" );


This can be viewed here: [ Only registered users can see links on this board! Get registered or login! ]
 
christianb







PostPosted: Tue Apr 19, 2005 10:32 am Reply with quote

According to the HOW-TO article, it suggests this:

Quote:
To reflect the new time zone that may be implied by the hardcoded time offset, you would also want to change the _DATESTRING definition in your language file, e.g. language/lang-english.php:

Code:
define("_DATESTRING","%A, %B %d @ %T %Z");


The thing is... its already changed to that - which I did not do.
 
Raven







PostPosted: Tue Apr 19, 2005 2:01 pm Reply with quote

The reason it's already change is more than likely it's been changed since that How To was written Smile
 
christianb







PostPosted: Tue Apr 19, 2005 2:26 pm Reply with quote

My question is this then... is there something wrong with my site that the HOW-TO % variables don't match with what is working for me? If its incorrect, I need to fix it. Or a better question might be: Should my site be using the same variables stated in the HOW-TO or am I looking at an issue with my website? I'm confused.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

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 ©