Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 10:51 am EST
Geeklog Forums
The text "1 comments"
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
I think he wants the stories to display "1 comment" instead of "1 comments" on the main page.
If that's the case, in lib-common.php, in COM_article, change the following:
{
$article->set_var( 'comments_url', $_CONF['site_url']
. '/article.php?story=' . $A['sid'] . '#comments' );
$article->set_var( 'comments_text', $A['comments'] . ' '
. $LANG01[3] );
$article->set_var( 'comments_count', $A['comments'] );
$article->set_var( 'lang_comments', $LANG01[3] );
$result = DB_query( "SELECT UNIX_TIMESTAMP(date) AS day,username FROM {$_TABLES['comments']},{$_TABLES['users']} WHERE {$_TABLES['users']}.uid = {$_TABLES['comments']}.uid AND sid = '{$A['sid']}' ORDER BY date desc LIMIT 1" );
$C = DB_fetchArray( $result );
$recent_post_anchortag = '<span class="storybyline">'
. $LANG01[27] . ': '
. strftime( $_CONF['daytime'], $C['day'] ) . ' '
. $LANG01[104] . ' ' . $C['username'] . '</span>';
$article->set_var( 'start_comments_anchortag', '<a href="'
. $_CONF['site_url'] . '/article.php?story=' . $A['sid']
. '#comments">' );
$article->set_var( 'end_comments_anchortag', '</a>' );
}
to
{
$article->set_var( 'comments_url', $_CONF['site_url']
. '/article.php?story=' . $A['sid'] . '#comments' );
if ($A['comments'] == 1)
{
$article->set_var( 'comments_text', $A['comments'] . ' comment' );
}
else
{
$article->set_var( 'comments_text', $A['comments'] . ' comments' );
}
$article->set_var( 'comments_count', $A['comments'] );
$article->set_var( 'lang_comments', $LANG01[3] );
$result = DB_query( "SELECT UNIX_TIMESTAMP(date) AS day,username FROM {$_TABLES['comments']},{$_TABLES['users']} WHERE {$_TABLES['users']}.uid = {$_TABLES['comments']}.uid AND sid = '{$A['sid']}' ORDER BY date desc LIMIT 1" );
$C = DB_fetchArray( $result );
$recent_post_anchortag = '<span class="storybyline">'
. $LANG01[27] . ': '
. strftime( $_CONF['daytime'], $C['day'] ) . ' '
. $LANG01[104] . ' ' . $C['username'] . '</span>';
$article->set_var( 'start_comments_anchortag', '<a href="'
. $_CONF['site_url'] . '/article.php?story=' . $A['sid']
. '#comments">' );
$article->set_var( 'end_comments_anchortag', '</a>' );
}
If that's the case, in lib-common.php, in COM_article, change the following:
Text Formatted Code
if( $A['comments'] > 0 ){
$article->set_var( 'comments_url', $_CONF['site_url']
. '/article.php?story=' . $A['sid'] . '#comments' );
$article->set_var( 'comments_text', $A['comments'] . ' '
. $LANG01[3] );
$article->set_var( 'comments_count', $A['comments'] );
$article->set_var( 'lang_comments', $LANG01[3] );
$result = DB_query( "SELECT UNIX_TIMESTAMP(date) AS day,username FROM {$_TABLES['comments']},{$_TABLES['users']} WHERE {$_TABLES['users']}.uid = {$_TABLES['comments']}.uid AND sid = '{$A['sid']}' ORDER BY date desc LIMIT 1" );
$C = DB_fetchArray( $result );
$recent_post_anchortag = '<span class="storybyline">'
. $LANG01[27] . ': '
. strftime( $_CONF['daytime'], $C['day'] ) . ' '
. $LANG01[104] . ' ' . $C['username'] . '</span>';
$article->set_var( 'start_comments_anchortag', '<a href="'
. $_CONF['site_url'] . '/article.php?story=' . $A['sid']
. '#comments">' );
$article->set_var( 'end_comments_anchortag', '</a>' );
}
to
Text Formatted Code
if( $A['comments'] > 0 ){
$article->set_var( 'comments_url', $_CONF['site_url']
. '/article.php?story=' . $A['sid'] . '#comments' );
if ($A['comments'] == 1)
{
$article->set_var( 'comments_text', $A['comments'] . ' comment' );
}
else
{
$article->set_var( 'comments_text', $A['comments'] . ' comments' );
}
$article->set_var( 'comments_count', $A['comments'] );
$article->set_var( 'lang_comments', $LANG01[3] );
$result = DB_query( "SELECT UNIX_TIMESTAMP(date) AS day,username FROM {$_TABLES['comments']},{$_TABLES['users']} WHERE {$_TABLES['users']}.uid = {$_TABLES['comments']}.uid AND sid = '{$A['sid']}' ORDER BY date desc LIMIT 1" );
$C = DB_fetchArray( $result );
$recent_post_anchortag = '<span class="storybyline">'
. $LANG01[27] . ': '
. strftime( $_CONF['daytime'], $C['day'] ) . ' '
. $LANG01[104] . ' ' . $C['username'] . '</span>';
$article->set_var( 'start_comments_anchortag', '<a href="'
. $_CONF['site_url'] . '/article.php?story=' . $A['sid']
. '#comments">' );
$article->set_var( 'end_comments_anchortag', '</a>' );
}
12
11
Quote
All times are EST. The time is now 10:51 am.
- 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