|
From: Jon O. <jon...@us...> - 2006-08-04 20:11:21
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5387/modules/mx_linkdb/linkdb/includes Modified Files: functions_linkdb.php Log Message: statistics Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** functions_linkdb.php 4 Aug 2006 16:31:34 -0000 1.17 --- functions_linkdb.php 4 Aug 2006 20:11:18 -0000 1.18 *************** *** 782,798 **** $filelist = false; - if ( empty( $cat_id ) ) - { - $cat_where = ''; - } - else - { - $cat_where = "AND f1.link_catid = $cat_id"; - } - $file_rowset = array(); $total_file = 0; // // Main query // --- 782,794 ---- $filelist = false; $file_rowset = array(); $total_file = 0; // + // Category SQL + // + $cat_where = empty( $cat_id ) ? "AND f1.link_catid IN (" . $this->gen_cat_ids( '0' ) . ")" : "AND f1.link_catid = $cat_id"; + + // // Main query // *************** *** 837,845 **** $db->sql_freeresult( $result ); ! $where_sql = ( !empty( $cat_id ) ) ? "AND link_catid = $cat_id" : ''; ! $sql = "SELECT COUNT(link_id) as total_links ! FROM " . LINKS_TABLE . " ! WHERE link_approved='1' ! $where_sql"; if ( !( $result = $db->sql_query( $sql ) ) ) --- 833,840 ---- $db->sql_freeresult( $result ); ! $sql = "SELECT COUNT(f1.link_id) as total_links ! FROM " . LINKS_TABLE . " AS f1 ! WHERE f1.link_approved='1' ! $cat_where"; if ( !( $result = $db->sql_query( $sql ) ) ) |