Example #1
0
if ($action == 'submitted') $dataselect = 2;
if ($action == 'all') $dataselect = 3;
if ($action == 'online') $dataselect = 4;
if ($action == 'offline') $dataselect = 5;
if ($action == 'autoexpire') $dataselect = 6;
if ($action == 'autoart') $dataselect = 7;
if ($action == 'expired') $dataselect = 8;
if ($action == 'noshowart') $dataselect = 9;
xoops_cp_header();

    	$articlearray = WfsArticle::getAllArticle($wfsConfig['lastart'], $start, $xoopsOption, $dataselect);

// it will operate incorrectly, if there are many records.
//		$scount = count(WfsArticle::getAllArticle($wfsConfig['lastart'], 0, 0, $dataselect));
//		$totalcount = count(WfsArticle::getAllArticle(0, 0, 0, $dataselect));
		$totalcount = WfsArticle::getNumArticle($dataselect);

// unify a article menu and a title
		echo "<div><h4>"._AM_ARTICLEMANAGEMENT.": ";
		if ($action == 'all')        echo _AM_ALLARTICLES;
		if ($action == 'published')  echo _AM_PUBLARTICLES;
		if ($action == 'submitted')  echo _AM_SUBLARTICLES;
		if ($action == 'online')     echo _AM_ONLINARTICLES;
		if ($action == 'offline')    echo _AM_OFFLIARTICLES;
		if ($action == 'autoexpire') echo _AM_AUTOEXPIREARTICLES;
		if ($action == 'expired')    echo _AM_EXPIREDARTICLES;
		if ($action == 'autoart')    echo _AM_AUTOARTICLES;
		if ($action == 'noshowart')  echo _AM_NOSHOWARTICLES;
		echo "</h4></div>";

// display at first page
Example #2
0
function articlemenu() 
{
	global $xoopsDB, $xoopsModule;
	global $wfsTableBroken;

	include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/wfsarticle.php';

	$total_published  = WfsArticle::getNumArticle(1);
	$total_submitted  = WfsArticle::getNumArticle(2);
	$total_all        = WfsArticle::getNumArticle(3);
	$total_online     = WfsArticle::getNumArticle(4);
	$total_offline    = WfsArticle::getNumArticle(5);
	$total_autoexpire = WfsArticle::getNumArticle(6);
	$total_autoart    = WfsArticle::getNumArticle(7);
	$total_expired    = WfsArticle::getNumArticle(8);
	$total_noshowart  = WfsArticle::getNumArticle(9);                             
	                       		
	echo "<table width='100%' border='0' cellpadding = '2' cellspacing='0' class='outer'>";
	echo "<tr class = 'even'><td>";

	echo "<div><a href='allarticles.php?action=all'>"._AM_ALLARTICLES."</a> ($total_all)</div>";

	echo "<div><a href='allarticles.php?action=submitted'>"._AM_SUBLARTICLES."</a> ";
	if ($total_submitted) echo "<font color=red><b>($total_submitted)</b></font>";
	else                  echo "($total_submitted)";
	echo "<div>";

	echo "<div><a href='allarticles.php?action=published'>"._AM_PUBLARTICLES."</a> ($total_published)</div>";
	echo "<div><a href='allarticles.php?action=autoart'>"._AM_AUTOARTICLES."</a> ($total_autoart)<div>";
	echo "<div><a href='allarticles.php?action=expired'>"._AM_EXPIREDARTICLES."</a> ($total_expired)<div>";
	echo "<div><a href='allarticles.php?action=autoexpire'>"._AM_AUTOEXPIREARTICLES."</a> ($total_autoexpire)<div>";
	echo "<div><a href='allarticles.php?action=online'>"._AM_ONLINARTICLES."</a> ($total_online)<div>";
	echo "<div><a href='allarticles.php?action=offline'>"._AM_OFFLIARTICLES."</a> ($total_offline)<div>";
	echo "<div><a href='allarticles.php?action=noshowart'>"._AM_NOSHOWARTICLES."</a> ($total_noshowart)<div>";

	echo "</td></tr></table><br>";
}