Welcome to Geeklog, Anonymous Monday, October 14 2024 @ 07:31 pm EDT
Geeklog Forums
Indicating recent comments
Status: offline
daveshorts
Forum User
Newbie
Registered: 09/23/03
Posts: 7
I was finding it difficult to find recent comments when in nested comment mode, so I added a couple of lines of code to put a red 'New' in the comment header if it is in the the new comments block.
Is this a sensible way of doing this, or any use to anyone?
to lib_common.php
**This line number may be wrong it should go before the $A['nice_date'] = strftime... line**
2910c2910,2911
<
---
> if( time()-$A['nice_date']<$_CONF['newcommentsinterval'] ){$isnew=" <font color='red'>New</font>";}
> else{$isnew='';}
2917c2918
< $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . '</td></tr>' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '</td></tr>' . LB
Is this a sensible way of doing this, or any use to anyone?
to lib_common.php
**This line number may be wrong it should go before the $A['nice_date'] = strftime... line**
2910c2910,2911
<
---
> if( time()-$A['nice_date']<$_CONF['newcommentsinterval'] ){$isnew=" <font color='red'>New</font>";}
> else{$isnew='';}
2917c2918
< $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . '</td></tr>' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '</td></tr>' . LB
8
9
Quote
Status: offline
daveshorts
Forum User
Newbie
Registered: 09/23/03
Posts: 7
hmmm I'm using Geeklog 1.3.8-1 on linux...
the graphic would be a good idea, and should be easy just change <font..>New</font> for <img ...>
It is possible I have screwed up the line numbers somehow... it should go before:
$A['nice_date'] = strftime( $_CONF['date'], $A['nice_date'] );
or you are comparing a text date with a numeric datestamp
the graphic would be a good idea, and should be easy just change <font..>New</font> for <img ...>
It is possible I have screwed up the line numbers somehow... it should go before:
$A['nice_date'] = strftime( $_CONF['date'], $A['nice_date'] );
or you are comparing a text date with a numeric datestamp
5
11
Quote
daveshorts
Anonymous
Just to improve things / make them more complex.
this will make the 'New's slowly become more dull as time goes on, so the new ones appear the brightest.
2910c2910,2911
---
> if( time()-$A['nice_date']New";}
> else{$isnew='';}
2917c2918
' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '' . LB
this will make the 'New's slowly become more dull as time goes on, so the new ones appear the brightest.
2910c2910,2911
---
> if( time()-$A['nice_date']New";}
> else{$isnew='';}
2917c2918
' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '' . LB
8
7
Quote
daveshorts
Anonymous
Sorry I meant
2910c2910,2911
---
> if( time()-$A['nice_date']New";}
> else{$isnew='';}
2917c2918
' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '' . LB
2910c2910,2911
---
> if( time()-$A['nice_date']New";}
> else{$isnew='';}
2917c2918
' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '' . LB
8
7
Quote
daveshorts
Anonymous
Ok I am really incompetent and should learn to use preview functions
<
---
> if( time()-$A['nice_date']<$_CONF['newcommentsinterval'] ){$isnew=" <font color='#".dechex(round(255*(1-(time()-$A['nice_date'])/$_CONF['newcommentsinterval']))^3)."0000'>New</font>";}> else{$isnew='';}
2917c2918
< $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . '</td></tr>' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '</td></tr>' . LB
Text Formatted Code
2910c2910,2911<
---
> if( time()-$A['nice_date']<$_CONF['newcommentsinterval'] ){$isnew=" <font color='#".dechex(round(255*(1-(time()-$A['nice_date'])/$_CONF['newcommentsinterval']))^3)."0000'>New</font>";}> else{$isnew='';}
2917c2918
< $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . '</td></tr>' . LB
---
> $retval .= ' ' . $LANG01[36] . ' ' . $A['nice_date'] . $isnew . '</td></tr>' . LB
9
9
Quote
All times are EDT. The time is now 07:31 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content