UDT - Count total active pages of your CMSMS site
Posted: Wed Feb 27, 2008 11:13 pm
After searching in forum I can't find a tag like this one.
It's a stupid tag, but sometimes could be useful.
Tag {total_pages_count}
Regards
blast
It's a stupid tag, but sometimes could be useful.
Tag {total_pages_count}
Code: Select all
// Count total active pages including mainpage, link
global $gCms;
$db = &$gCms->db;
$q = "SELECT COUNT(*) as cnt FROM " . cms_db_prefix() . "content WHERE (type='content' OR type='link') AND active = 1 OR default_content = 1 AND show_in_menu = 1";
$dbresult = $db->Execute( $q );
if( !$dbresult )
{
echo 'DB error: '. $db->ErrorMsg()."<br/>";
}
$count = $dbresult->FetchRow();
echo $count['cnt'];
blast