[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.211,1.212
dhaun at geeklog.net
dhaun at geeklog.net
Fri Mar 28 13:19:58 EST 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv23517/public_html
Modified Files:
lib-common.php
Log Message:
The Sections block now uses the useroption.thtml and the new useroption_off.thtml template files.
Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.211
retrieving revision 1.212
diff -C2 -d -r1.211 -r1.212
*** lib-common.php 27 Mar 2003 09:37:35 -0000 1.211
--- lib-common.php 28 Mar 2003 18:19:56 -0000 1.212
***************
*** 1854,1859 ****
*
* Show the topics in the system the user has access to and prints them in HTML.
! * This function is used to show the topics in the sections block. Topics have
! * href and are seperated by line breaks.
*
* @param string $topic TopicID of currently selected
--- 1854,1858 ----
*
* Show the topics in the system the user has access to and prints them in HTML.
! * This function is used to show the topics in the sections block.
*
* @param string $topic TopicID of currently selected
***************
*** 1879,1894 ****
$nrows = DB_numRows( $result );
! // Give a link to the homepage here since a lot of people use this for
! // navigating the site
! // Note: We can't use $PHP_SELF here since the site may not be in the DocumentRoot
! preg_match( "/\/\/[^\/]*(.*)/", $_CONF['site_url'], $pathonly );
! if(( $HTTP_SERVER_VARS['SCRIPT_NAME'] <> $pathonly[1] . "/index.php" ) OR !empty( $topic ) OR ( $page > 1 ) OR $newstories )
! {
! $retval .= '<a href="' . $_CONF['site_url'] . '/index.php"><b>' . $LANG01[90] . '</b></a><br>';
! }
! else
{
! $retval .= $LANG01[90] . '<br>';
}
--- 1878,1910 ----
$nrows = DB_numRows( $result );
! $retval = '';
! $sections = new Template( $_CONF['path_layout'] );
! $sections->set_file( array( 'option' => 'useroption.thtml',
! 'inactive' => 'useroption_off.thtml' ));
! if( $_CONF['hide_home_link'] == 0 )
{
! // Give a link to the homepage here since a lot of people use this for
! // navigating the site
! // Note: We can't use $PHP_SELF here since the site may not be in the
! // DocumentRoot
!
! preg_match( "/\/\/[^\/]*(.*)/", $_CONF['site_url'], $pathonly );
! if(( $HTTP_SERVER_VARS['SCRIPT_NAME'] <> $pathonly[1] . "/index.php" )
! OR !empty( $topic ) OR ( $page > 1 ) OR $newstories )
! {
! $sections->set_var( 'option_url',
! $_CONF['site_url'] . '/index.php' );
! $sections->set_var( 'option_label', $LANG01[90] );
! $sections->set_var( 'option_count', '' );
! $retval .= $sections->parse( 'item', 'option' );
! }
! else
! {
! $sections->set_var( 'option_url', '' );
! $sections->set_var( 'option_label', $LANG01[90] );
! $sections->set_var( 'option_count', '' );
! $retval .= $sections->parse( 'item', 'inactive' );
! }
}
***************
*** 1899,1907 ****
if( $A['tid'] == $topic )
{
! $retval .= stripslashes( $A['topic'] );
if( $_CONF['showstorycount'] + $_CONF['showsubmissioncount'] > 0 )
{
! $retval .= ' (';
if( $_CONF['showstorycount'] )
--- 1915,1925 ----
if( $A['tid'] == $topic )
{
! $sections->set_var( 'option_url', '' );
! $sections->set_var( 'option_label', stripslashes( $A['topic'] ));
+ $countstring = '';
if( $_CONF['showstorycount'] + $_CONF['showsubmissioncount'] > 0 )
{
! $countstring .= '(';
if( $_CONF['showstorycount'] )
***************
*** 1909,1913 ****
$rcount = DB_query( "SELECT count(*) AS count FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date <= NOW()) AND (tid = '{$A['tid']}')" . COM_getPermSQL( 'AND' ));
$T = DB_fetchArray( $rcount );
! $retval .= $T['count'];
}
--- 1927,1931 ----
$rcount = DB_query( "SELECT count(*) AS count FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date <= NOW()) AND (tid = '{$A['tid']}')" . COM_getPermSQL( 'AND' ));
$T = DB_fetchArray( $rcount );
! $countstring .= $T['count'];
}
***************
*** 1916,1937 ****
if( $_CONF['showstorycount'] )
{
! $retval .= '/';
}
!
! $retval .= DB_count( $_TABLES['storysubmission'], 'tid', $A['tid'] );
}
! $retval .= ')';
}
!
! $retval .= '<br>' . LB;
}
else
{
! $retval .= '<a href="' . $_CONF['site_url'] . '/index.php?topic=' . $A['tid'] . '"><b>' . stripslashes( $A['topic'] ) . '</b></a> ';
if( $_CONF['showstorycount'] + $_CONF['showsubmissioncount'] > 0 )
{
! $retval .= '(';
if( $_CONF['showstorycount'] )
--- 1934,1958 ----
if( $_CONF['showstorycount'] )
{
! $countstring .= '/';
}
! $countstring .= DB_count( $_TABLES['storysubmission'],
! 'tid', $A['tid'] );
}
! $countstring .= ')';
}
! $sections->set_var( 'option_count', $countstring );
! $retval .= $sections->parse( 'item', 'inactive' );
}
else
{
! $sections->set_var( 'option_url', $_CONF['site_url']
! . '/index.php?topic=' . $A['tid'] );
! $sections->set_var( 'option_label', stripslashes( $A['topic'] ));
+ $countstring = '';
if( $_CONF['showstorycount'] + $_CONF['showsubmissioncount'] > 0 )
{
! $countstring .= '(';
if( $_CONF['showstorycount'] )
***************
*** 1939,1943 ****
$rcount = DB_query( "SELECT count(*) AS count FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date <= NOW()) AND (tid = '{$A['tid']}')" . COM_getPermSQL( 'AND' ));
$T = DB_fetchArray( $rcount );
! $retval .= $T['count'];
}
--- 1960,1964 ----
$rcount = DB_query( "SELECT count(*) AS count FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date <= NOW()) AND (tid = '{$A['tid']}')" . COM_getPermSQL( 'AND' ));
$T = DB_fetchArray( $rcount );
! $countstring .= $T['count'];
}
***************
*** 1946,1959 ****
if( $_CONF['showstorycount'] )
{
! $retval .= '/';
}
!
! $retval .= DB_count( $_TABLES['storysubmission'], 'tid', $A['tid'] );
}
! $retval .= ')';
}
!
! $retval .= '<br>' . LB;
}
}
--- 1967,1980 ----
if( $_CONF['showstorycount'] )
{
! $countstring .= '/';
}
! $countstring .= DB_count( $_TABLES['storysubmission'],
! 'tid', $A['tid'] );
}
! $countstring .= ')';
}
! $sections->set_var( 'option_count', $countstring );
! $retval .= $sections->parse( 'item', 'option' );
}
}
More information about the geeklog-cvs
mailing list