{ $action = 'all'; } if ($action == 'published') $dataselect = 1; 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;
function listArticle($catid, $start = 0, $num = 20) { global $xoopsDB, $orderby, $xoopsConfig, $xoopsUser, $xoopsModule, $wfsConfig, $myts, $counter, $mydownloads_popular, $dataselect; global $wfsModule; // add $xt = new WfsCategory($catid); if (file_exists(XOOPS_ROOT_PATH . "/" . $wfsConfig['sgraphicspath'] . "/" . $xt->imgurl) && $xt->imgurl !='blank.gif' ) { $image = "<img src='" . XOOPS_URL . "/" . $wfsConfig['sgraphicspath'] . "/" . $xt->imgurl("S") . "'>"; } else { if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid()) && $xt->imgurl !='blank.gif') { // multi language // $image = "ERROR: Please check path/file for image"; $image = "<font color=red>"._WFS_ERROR_IMAGE."</font>"; } else { $image = ''; } } $title = $xt->title() ; $catdescription = $xt->catdescription('S'); echo "<table border='0' cellpadding='2' cellspacing='1' valign='top' align = 'center' width = '100%'>"; if ((!empty($xt->imgurl) && $xt->displayimg == 1)) { echo "<tr><td colspan='5' align='center'>".$image."</td></tr>\n"; } echo "<tr><td colspan='5' align='center'> </td></tr>\n"; echo "<tr><td colspan='5' align='center'><h3>".$title."</h3></td></tr>\n"; echo "<tr><td>"; // -- Skalpack2 [start] // easy to rename module and table // $jump = XOOPS_URL."/modules/wfsection/index.php?"; $jump = XOOPS_URL."/modules/$wfsModule/index.php?"; $tree = new wfsTree($xt->table, "id", "pid"); switch ($wfsConfig['aidxpathtype']) { case 1: // Local selectbox $tree->makeMyRootedSelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value"); break; case 2: // Linked path // BUG 217: category link is wrong // echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->id, "title", $jump)); echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->id, "title", $jump)); break; case 3: // Path and local select box // BUG 217: category link is wrong // echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->pid, "title", $jump)); echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->pid, "title", $jump)); // bug fix: it can't jump at Path and local select box // $tree->makeMySelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value"); $tree->makeMyRootedSelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value"); break; case 4: // None break; case 0: // Full selectbox default: $xt->makeSelBox(1, $xt->id, "pid", "location.href='{$jump}category='+this.options[this.selectedIndex].value").""; break; } // -- Skalpack2 [/end] echo "</td></td>"; echo "<tr><td colspan='5'><br />$catdescription<br /></td></tr>\n"; echo "<tr><td colspan='5'> </td></tr>\n"; echo "</table>\n"; $sarray = WfsArticle::getAllArticle($num, $start, $catid, $dataselect='4'); $articlecount = WfsArticle::countByCategory($catid); echo "<table border='0' cellpadding='2' cellspacing='1' width = '100%' class= 'outer'>"; If ($articlecount != 0) { echo "<tr align='left'>"; // These will always be shown echo "<td align='left' width = '30%' class='itemHead'><b>" . _WFS_ARTICLE . "</b></td>"; if ($wfsConfig['summary']) { echo "<td align='left' width = '50%' class='itemHead'><b>" . _WFS_SUMMARY . "</b></td>"; } // You can choose which of these to show if ($wfsConfig['showauthor']) echo "<td align='center' class='itemHead'><b>" . _WFS_AUTH . "</b></td>"; if ($wfsConfig['showhits']) echo "<td align='center' class='itemHead'><b>" . _WFS_HITS . "</b></td>"; if ($wfsConfig['showcomments']) { if ($wfsConfig['comments']) echo "<td align='center' class='itemHead'><b>" . _WFS_COMMENT . "</b></td>"; } if ($wfsConfig['showfile']) echo "<td align='center' class='itemHead'><b>" . _WFS_FILES . "</b></td>"; if ($wfsConfig['novote']) { if ($wfsConfig['showrated']) echo "<td align='center' class='itemHead'><b>" . _WFS_RATED . "</b></td>"; } if ($wfsConfig['novote']) { if ($wfsConfig['showvotes']) echo "<td align='center' class='itemHead'><b>" . _WFS_VOTES . "</b></td>"; } if ($wfsConfig['showupdated']) echo "<td align='center' class='itemHead'><b>" . _WFS_PUBLISHEDHOME . "</b></td>"; echo "</tr>\n"; foreach ($sarray as $article) { $counter = $article->counter(); $time = $article->created(); $stat = $article->changed(); $articlelink = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $article->articleid() . "'>"; if ($wfsConfig['picon']) { $articlelink .= "".$article->iconLink("S") . "</a>"; } else { $articlelink .= "".$article->textLink("S") . "</a>"; } $summary = $article->summary(); $published = formatTimestamp($article->published(), $wfsConfig['timestamp']); $counter = $article->counter(); if ($wfsConfig['comments']) $commentcount = $article->getCommentsCount(); $attachedfiles = $article->getFilesCount(); if ($article->uid > 0) { $user = new xoopsUser($article->uid); if (($wfsConfig['realname']) && $user->getvar('name')) { $username = $user->getvar('name'); } else { $username = $user->getvar('uname'); } $username = "******".XOOPS_URL."/userinfo.php?uid=".$article->uid()."'>".$username."</a>"; } else { $username = $GLOBALS['xoopsConfig']['anonymous']; } //$username = "******" . XOOPS_URL . "/userinfo.php?uid=" . $article->uid() . "'>" . $article->uname() . "</a>"; if ($wfsConfig['novote']) $rating = number_format($article->rating, 2); $groupid = $article->groupid; if ($wfsConfig['novote']) $votes = $myts->makeTboxData4Show($article->votes) ; $status = 1; $orderbyTrans = convertorderbytrans($orderby); if ($stat != $time) $status = 2; if (checkAccess($groupid)) { echo "<tr><td valign='top' class='even'>$articlelink"; if ($wfsConfig['noicons']) { popgraphic($counter); newdownloadgraphic($time, $status); } echo "</td>"; if ($wfsConfig['summary']) echo "<td valign='top' class='even'>$summary</td>"; if ($wfsConfig['showauthor']) echo "<td align='center' valign='top' class='even' nowrap='nowrap'>$username</td>"; if ($wfsConfig['showhits']) echo "<td align='center' valign='top' class='even'>$counter</td>"; //if ($wfsConfig['comments']) { if ($wfsConfig['showcomments']) { if ($wfsConfig['comments']) echo "<td align='center' valign='top' class='even'>$commentcount</td>"; } if ($wfsConfig['showfile']) echo "<td align='center' valign='top' class='even'>$attachedfiles</td>"; if ($wfsConfig['novote']) { if ($wfsConfig['showrated']) echo "<td align='center' valign='top' class='even'>$rating</td>"; if ($wfsConfig['showvotes']) echo "<td align='center' valign='top' class='even'>$votes</td>"; } if ($wfsConfig['showupdated']) { echo "<td align='center' nowrap='nowrap' valign='top' class='even'>$published</td></tr>\n"; } } } //end check access } echo "</table>\n"; if ($articlecount > $num) { echo "<table border='0' width='100%' cellpadding='0' cellspacing='0' align='center' valign='top'><tr><td align='center'>"; // take over the order to previos and next page // if ($articlecount < $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start - $num) . "'>" . _WFS_PREVPAGE . "</a> "; // if ($articlecount > $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start + $num) . "'>" . _WFS_NEXTPAGE . "</a> "; $orderbyOut = convertorderbyout($orderby); if ($articlecount < $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start - $num) . "&orderby=" . $orderbyOut . "'>" . _WFS_PREVPAGE . "</a> "; if ($articlecount > $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start + $num) . "&orderby=" . $orderbyOut . "'>" . _WFS_NEXTPAGE . "</a> "; // BUG 8186: page number is displayed too many // for($i = 0, $j = 1; $i <= $articlecount; $i += $num, $j++) for($i = 0, $j = 1; $i < $articlecount; $i += $num, $j++) { if (($i <= $start) && ($start < ($i + $num))) { echo $j . " "; } else { // take over the order to previos and next page // echo "<a href='index.php?category=" . $catid . "&start=" . ($i) . "'>" . ($j) . "</a> "; echo "<a href='index.php?category=" . $catid . "&start=" . ($i) . "&orderby=" . $orderbyOut . "'>" . ($j) . "</a> "; } } echo "</td></tr></table>\n"; } echo "<table cellpadding='2' cellspacing='1' width='100%'>"; if ($xt->catfooter) { echo "<tr><td><br />\n"; echo $xt->catfooter('S') . "<br /><br />\n"; echo "</td></tr>\n"; } echo "</table>\n"; echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; if (!$xt->catfooter) echo "<br />"; echo "<tr><td align='center' class='head' >[ <a href='javascript:history.back(1)'>" . _WFS_BACK2 . "</a> | <a href='./index.php'>" . _WFS_RETURN2INDEX . "</a> ]</a></td></tr>\n"; echo "</table>\n"; echo "<br />"; if (($articlecount > 0)) { echo "<table border='0' cellpadding='1' cellspacing='1' width='100%' class = 'outer'>"; echo "<tr><td align='center' class='even'>"; $orderbyTrans = convertorderbytrans($orderby); // BUG 7854: redundant samll tag // echo "<small><center>" . _WFS_SORTBY1 . " "; echo "<center>" . _WFS_SORTBY1 . " "; echo " " . _WFS_TITLE1 . " (<a href='index.php?category=$catid&orderby=titleA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href='index.php?category=$catid&orderby=titleD'><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; echo " " . _WFS_DATE1 . " (<a href='index.php?category=$catid&orderby=createdA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href='index.php?category=$catid&orderby=createdD'><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; echo " " . _WFS_WEIGHT . " (<a href='index.php?category=$catid&orderby=weight'>Reset</a>)"; if ($wfsConfig['novote']) { echo " " . _WFS_RATING1 . " (<a href='index.php?category=$catid&orderby=ratingA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href=index.php?category=$catid&orderby=ratingD><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; } echo " " . _WFS_POPULARITY1 . " (<a href='index.php?category=$catid&orderby=counterA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href='index.php?category=$catid&orderby=counterD'><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; echo "<br /><b><small>"; printf(_WFS_CURSORTBY1, $orderbyTrans); $orderby = convertorderbyout($orderby); echo "</small></b></center>"; echo "</td></tr></table>\n"; } }
function listArticle($catid, $start = 0, $num = 20) { global $xoopsDB, $xoopsConfig, $xoopsModule, $wfsConfig, $weight, $art; $xt = new WfsCategory($catid); $weight = array(); $art = array(); $sarray = WfsArticle::getAllArticle($num, $start, $catid, $dataselect='1'); // bug fix : can't display ten or more articles // $articlecount = WfsArticle::countByCategory($catid); echo "<form name='reaorder' METHOD='post'>"; echo "<table border='0' cellpadding='2' cellspacing='1' width = '100%' class = 'outer'>"; echo "<tr align='left'>"; echo "<td align='center' class='bg3' width = '3%'><b>"._AM_REORDERID."</b></td>"; echo "<td align='left' width = '30%'class='bg3'><b>" . _AM_REORDERTITLE . "</b></td>"; echo "<td align='left' width = '60%' class='bg3'><b>" . _AM_REORDERSUMMARY . "</b></td>"; echo "<td align='center' width = '17%' class='bg3'><b>" . _AM_REORDERWEIGHT . "</b></td>"; echo "</tr>"; // bug fix : can't display ten or more articles // if ($articlecount != 0) { if ($num != 0) { foreach ($sarray as $article) { $articlelink = ""; echo "<tr>"; echo "<td class='head'>$article->articleid</td>"; echo "<td class='even' nowrap='nowrap'><a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/index.php?op=edit&articleid=" . $article->articleid() . "'>" . $article->title() . "</a></td>"; echo "<input type='hidden' name='art[]' value='".$article->articleid."' />"; echo "<td align='left'class='odd'>".$article->summary."</td>"; echo "<td align='center' class='even'><input type='text' name='weight[]' value='".$article->weight."' size='5' maxlenght='5'></td>"; echo "</tr>"; } } else { echo "<tr>"; echo "<td colspan = 4 align = 'center' class='even'>No Articles within this section</td>"; echo "</tr>"; } echo " <tr><td> </td></tr> <tr><td class='foot' align='center' colspan='4'> <input type='hidden' name='op' value=reaorder /> <input type='submit' name='submit' value='"._SUBMIT."' /> </td></tr> "; echo "</table>"; echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; echo "<br />"; // multi language // echo "<tr><td align='center' class='head' >[ <a href='javascript:history.back(1)'><a href='./reorder.php'>Return to Category re-order</a> ]</a></td></tr>"; echo "<tr><td align='center' class='head' >[ <a href='javascript:history.back(1)'><a href='./reorder.php'>"._AM_CATEGORY_REORDER_RETURN."</a> ]</a></td></tr>"; echo "</table>"; echo "<br />"; }
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); $scount = count(WfsArticle::getAllArticle($wfsConfig['lastart'], 0, 0, $dataselect)); $totalcount = count(WfsArticle::getAllArticle(0, 0, 0, $dataselect)); echo "<div><h4>" . _AM_ARTICLEMANAGEMENT . "</h4></div>"; adminmenu(); echo "<table width='100%' border='0' cellpadding = '2' cellspacing='0' class='outer'>"; echo "<tr class = 'even'><td>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=all'>" . _AM_ALLARTICLES . "</a></div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=published'>" . _AM_PUBLARTICLES . "</a></div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=autoart'>" . _AM_AUTOARTICLES . "</a><div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=expired'>" . _AM_EXPIREDARTICLES . "</a><div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=autoexpire'>" . _AM_AUTOEXPIREARTICLES . "</a><div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=submitted'>" . _AM_SUBLARTICLES . "</a><div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=online'>" . _AM_ONLINARTICLES . "</a><div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=offline'>" . _AM_OFFLIARTICLES . "</a><div>"; echo "<div><a href='" . $HTTP_SERVER_VARS['PHP_SELF'] . "?action=noshowart'>" . _AM_NOSHOWARTICLES . "</a><div>"; echo "</td></tr></table><br>"; echo "<table width='100%' border='0' cellpadding ='2' cellspacing='1' class='outer'>";