Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Message Board

  1. #1
    New Coder
    Join Date
    Nov 2004
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Message Board

    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:

    Code:
    // 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.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    // 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";

    "$question = ( to() ) ? be() : ~be();"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •