...

View Full Version : Message Board



johnnybananas
12-30-2005, 06:58 AM
hey guys.

I uploaded this spiderDiscussion script to my server..

http://www.fromthedesk.com/script.php?id=2

I need some help coding the following 3 PHP code snippets into my board.

1. First, go to this link below ...

http://www.phpjunkyard.com/mboard/mboard.php

Once you are there, if you go down to the 2nd posting from the top beneath "Recent topics" header, you will see this posting


hi - prasanna 29/Dec/2005 (3)


Now what I am stuck at is how to code that 3 in brackets >> (3), showing the number of comments for that thread, to become visible and increment automatically with each subsequent post by a user. I want that.


2. Next, I would like the accurate time to be posted next to the topic >> hi - prasanna 29/Dec/2005 (3) resulting such as.. I.e. hi - prasanna 29/Dec/2005 (3) 9:59 PM

So far, I have this format below:



// get the date, time, year
$datetimeyear = date('l, F j, Y \a\t g:i A T');

// if an e-mail address is provided, include it in the "stamp"
if ($email != "") {
$stamp = "<a href=\"mailto:$email\"><i>$name</i></a> - $datetimeyear<br>\n";
}

// otherwise, just include the name and date, time, year
else {
$stamp = "<i>$name</i> - $datetimeyear\n";
}


The time works and all, however, I am on a virtual host account that resides in New York and the server time is 3 hours ahead of where I'm at -- California. So, instead of my users seeing 8:00pm local time, they see 11:00pm. I tried to figure it out here with no luck!! >> http://www.php.net/manual/en/function.date.php


3. Finally, is there a way to tally up the number of topics posted to the board to appear right next to the header "Recent topics" resulting such as.. I.e. Recent topics (I want number of topics posted to appear here)


Recent topics 45


Any suggestions are welcomed.

Velox Letum
12-30-2005, 09:10 AM
// hour offset...set difference from server time
$h_offset = -3;

// calculate offset from server time
$offset = -3600 * $h_offset;

// get the date, time, year
$datetimeyear = date('l, F j, Y \a\t g:i A T', time() - $offset);

// if an e-mail address is provided, include it in the "stamp"
if ($email != "") {
$stamp = "<a href=\"mailto:$email\"><i>$name</i></a> - $datetimeyear<br>\n";
}

// otherwise, just include the name and date, time, year
else {
$stamp = "<i>$name</i> - $datetimeyear\n";
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum