set_prefix('lc'); // -- -- -- include_once(MAIN_SOURCE_PATH.'/modules/admin/inc/class.modules.php'); include_once(MAIN_SOURCE_PATH.'/modules/admin/inc/url.php'); include_once(MAIN_SOURCE_PATH.'/inc/class.comments.php'); $c_modules = array(); $count_all = $count_on_day = $count_wait = 0; $m = new modulesQuery('m'); $m -> get('m.m_path,m.m_name',false); while( $row = $m -> row() ){ $mod = modules::load_path($row['m_path']); // модуль загрузить не удалось if (false===$mod){ continue; $path = $mod -> path(); } // модуль не поддерживает работу с комментариями if ( false===$mod -> exists_comments() ){ continue; } include_once(MAIN_SOURCE_PATH.'/modules/'.$row['m_path'].'/inc/class.comments.php'); $class = $row['m_path'].'_comments_q'; $s = $class::create(); $count_all+=$s -> count_all(); $count_on_day+=$s -> count_on_day(); $count_wait+=$s -> count_wait(); } $t = new PHPTAL( false ); $t -> setSource(TMPL_COMMENTS_ADMIN_STAT); $t -> count_all = $count_all; $t -> count_on_day = $count_on_day; $t -> count_wait = $count_wait; $t -> comments_control_url = sys_url(URL_ADMIN_COMMENTS); $t -> comments_control_wait_url = sys_url(URL_ADMIN_COMMENTS_FILTER_URL,0,0,0,0,0); return $t -> execute(); } define("TMPL_COMMENTS_ADMIN_STAT", '

${B_COMMENTS_NAME}

${B_COMMENTS_ALL_ARTICLES}: ${count_all}

${B_COMMENTS_NEW_ON_DAY}: ${count_on_day}

${B_COMMENTS_WAIT}: ${count_wait}

'); ?>