NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 12-19-2008 11:32:33

Timestamps

Hi,

I need help adding Timestamps to my Scribble Board chat: http://moonshineoekaki.net/scribble/
I've added them, but I did it wrong :'D, instead of telling the time of post, it tells the time of day O_O 'S not what I was going for big_smile

Code:

// CUSTOM: PRINT DATE
{

    $chat_date_format = ' H:i';
 
    echo (date ($chat_date_format));
}

^ That's what I placed. T_T

Last edited by Rage Inflictor (12-20-2008 07:12:49)

Offline

#2 12-20-2008 07:20:57

Waccoon
Administrator

Re: Timestamps

Is this is for the chat room?

It will take some extra coding to do this, because we'll have to get a UNIX timestamp from each comment.  Here is a drop-in replacement for the Wacintaki chat system (from line 163):

Code:

        echo '                #'.$my_link;
    } else {
        $my_time = strtotime ($row['posttime']);
?>
                *<a onclick="openWindow('profile.php?user=<?=urlencode ($row['usrname']);?>', 400, 600); return false;" href="#"><?=w_html_chars($row['usrname']);?></a>(<?=date($datef['chat'], $my_time);?>)<?
    }

Offline

#3 12-20-2008 09:09:50

Re: Timestamps

big_smile Awesome, thank you <333 big_smile
I use the regular chat for the scribble board. big_smile

Offline

#4 12-21-2008 00:50:59

Waccoon
Administrator

Re: Timestamps

I'll be adding this feature to Wacintaki 1.4.2, and with improved layout.  To save space, it will only show the time for the current day, though.

Offline

#5 12-21-2008 10:55:22

Rage
Guest

Re: Timestamps

Cool 8D A different layout would be nice, rather than in between the names/comments. I used <sub> tags to make it blend less with comments big_smile

#6 12-21-2008 13:39:45

Re: Timestamps

Oh, have a small issue. I can't seem to get an infotable to work on my oekaki D: I get: Parse error: syntax error, unexpected '<' in /home/moonshin/public_html/resource/notice.php on line 43

Code:

<STYLE TYPE="text/css">p {align=justify}
</STYLE>



<center>
<table width="760" height="540" background="http://i216.photobucket.com/albums/cc269/Mikeuh/oekaki/bannerific2.png" border="0">


<tr><td height="357" colspan="1"></td></tr><tr>
<td width="40"></td><td valign="top"><p align="left">
<div style="width: 200; height: ; overflow: auto; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;">
</i>


<div style="font-size: 11px; font-family: arial; border: px solid; background-color: ######; color: ######; width:180px; height: 150px; overflow: auto;"> 
<font color="black" face=verdana font size=1px>

<center><b>Lucian's Links!</b> <blink>&hearts;</blink></center><br>

+ <a href="http://moonshineoekaki.net/scribble"target="_blank">Scribble Board</a><br><br>
+ <a href="http://moonshineoekaki.proboards.com/index.cgi"target="_blank">Forum</a><br><br>
+ <a href="http://moonshineoekaki.net/showrules.php"target="_blank">Rules!</a> & <a href="http://moonshineoekaki.net/faq.php"target="_blank">FAQ</a><br><br>
+ <b><u>Tutorials:</u></b> <a href="http://failedjuliet.deviantart.com/art/Yet-another-Shi-Painter-Tut-104164422"target="_blank">ShiPainter Tutorial by Karen,</a> <a href="http://www.alexhays.com/loomis/"target="_blank">Anatomy,</a> & <a href="http://www.cablenet.ne.jp/~japanime/tutorial/tutorial.html"target="_blank">Manga</a>
<br><br><marquee><b>Happy Holidays!</b></marquee>

<td width="1"></td><td valign="top"><p align="left">
<div style="width: ; height:100 ; overflow: auto; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;">
</i><font face=verdana font size=1px><center>

</font></div><center>

<div style="font-size: 11px; font-family: arial; border: px solid; background-color: ######; color: ######; width:350px; height: 150px; overflow: auto;">
<font color="black" face=verdana font size=1px><b><br>December's Theme: Pssh. Themes are for noobs.</b><br><br>
<b>December's Contest:</b> ....<br>
______________________________________________<br><br>
+ <b>Forum:</b> We now have a forum!! Refer to Lucian's links <blink>&hearts;</blink><br><br>
</div></center><br>
</td><td width="2"></td></tr>

</table>
<?php>

// Birthday announcement

$birthday_names = array();
$todaymonth = date ("m");
$todayday = date ("d");

$my_result = mysql_query ("SELECT usrname, age FROM {$OekakiPoteto_MemberPrefix}oekaki ORDER BY usrname");

if ($my_result && mysql_num_rows($my_result) > 0) {
    while ($my_row = mysql_fetch_array($my_result)) {
        $my_age = $my_row['age'];
        if (strpos($my_age, '-') !== FALSE && strpos($my_age, '?') === FALSE) {
            list ($byear, $bmonth, $bday) = explode ('-', $my_age);

            $my_bday_pass = FALSE;
            if ($todaymonth == '2' && $todayday == '29') {
                // Leap year birthday?
                if ($bmonth == $todaymonth) {
                    if ($bday == '28' || $bday == '29') {
                        $my_bday_pass = TRUE;
                    }
                }
            } elseif (($bday == $todayday) && ($bmonth == $todaymonth)) {
                $my_bday_pass = TRUE;
            }
            
            if ($my_bday_pass == TRUE) {
                $un = trim($my_row['usrname']);
                $un_url = urlencode($un);
                $un_html = w_html_chars($un);
                $un_years = get_age($my_age);

                $birthday_names[] = "<a href=\"profile.php?user={$un_url}\">{$un_html} ({$un_years})</a>";
            }
        }
    }
}

if (count ($birthday_names) > 0) {
    echo ('<p>');
    echo ("Birthday greetings to: " . make_list($birthday_names, ', '));
    echo ('</p>');
}

?>

</div>

That's the complete coding from my notice area. I want to add an infotable for the b-day announcement. It doesn't show up right with the default template.

Offline

#7 12-21-2008 19:20:02

Waccoon
Administrator

Re: Timestamps

Code:

<?php>

// Birthday announcement

replace with:

Code:

<?php

// Birthday announcement

PHP tags are actually XML declaration elements of the form:

Code:

<?language All Kinds Of Stuff Here ?>

...so you have to make sure the <?php is not accidentally closed.  The entire PHP code behaves like a single element, rather than having separate open and close elements, such as <php>Stuff</php>.  That's why the question marks are there.

Offline

#8 12-22-2008 05:06:59

Re: Timestamps

Thank you, but I got the same error D:



Code:

<div class="infotable">..........</div>

Offline

#9 12-23-2008 04:42:46

Waccoon
Administrator

Re: Timestamps

I didn't see an "infotable" in the code you posted on Dec 21st, and with the exception of <?php>, it parsed correctly.  Please post the code with the infotable already in place, and I'll be able to tell you where the parsing error is.

Offline

#10 12-30-2008 15:11:49

Re: Timestamps

Sorry, I've been out of town T_T
My friend found out what I was doing wrong, it works now <3 big_smile Thank you

Last edited by Rage Inflictor (12-31-2008 22:16:15)

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB