From: <be...@us...> - 2012-06-10 04:01:28
|
Revision: 9628 http://xoops.svn.sourceforge.net/xoops/?rev=9628&view=rev Author: beckmi Date: 2012-06-10 04:01:22 +0000 (Sun, 10 Jun 2012) Log Message: ----------- Fixing Statistics in Dashboard Modified Paths: -------------- XoopsModules/news/branches/mamba/news/admin/index.php XoopsModules/news/branches/mamba/news/class/news_stories.php XoopsModules/news/branches/mamba/news/class/news_topics.php XoopsModules/news/branches/mamba/news/language/english/admin.php Modified: XoopsModules/news/branches/mamba/news/admin/index.php =================================================================== --- XoopsModules/news/branches/mamba/news/admin/index.php 2012-06-10 03:09:41 UTC (rev 9627) +++ XoopsModules/news/branches/mamba/news/admin/index.php 2012-06-10 04:01:22 UTC (rev 9628) @@ -82,7 +82,7 @@ } else { echo " <a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $newstory -> storyid() . "'>" . $title . "</a>\n"; } - echo "</td><td>" . $newstory->topic_title() . "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created(),$dateformat) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a></td><td align='center'><a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'><img src='" . $pathIcon16."/delete.png' title='"._AM_DELETE."'></a></td></tr>\n"; + echo "</td><td>" . $newstory->topic_title() . "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created(),$dateformat) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a></td><td align='center'><a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $newstory->storyid() . "'><img src='" . $pathIcon16."/edit.png' title='"._AM_EDIT."'></a><a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'><img src='" . $pathIcon16."/delete.png' title='"._AM_DELETE."'></a></td></tr>\n"; } echo '</table></div>'; @@ -686,7 +686,7 @@ $submenu=$topics_arr[$tmpcpt]['menu'] ? _YES : _NO; $class = ($class == 'even') ? 'odd' : 'even'; - $output = $output . "<tr class='".$class."'><td>" . $topics_arr[$tmpcpt]['topic_id'] . "</td><td align='left'>" . $topics_arr[$tmpcpt]['prefix'] . $myts->displayTarea($topics_arr[$tmpcpt]['topic_title']) . "</td><td align='left'>" . $parent . "</td><td>" . $submenu . "</td><td>" . $action_edit . $action_delete ."</td></tr>"; + $output = $output . "<tr class='".$class."'><td>" . $topics_arr[$tmpcpt]['topic_id'] . "</td><td align='left'>" . $topics_arr[$tmpcpt]['prefix'] . $myts->displayTarea($topics_arr[$tmpcpt]['topic_title']) . "</td><td align='left'>" . $parent . "</td><td align='center'>" . $submenu . "</td><td align='center'>" . $action_edit . $action_delete ."</td></tr>"; @@ -1572,13 +1572,32 @@ XOOPS_ROOT_PATH . '/uploads/news/file', XOOPS_ROOT_PATH . '/uploads/news/image', ); - + + $topicsHandler=& xoops_getmodulehandler('news_topics','news'); + $storiesHandler=& xoops_getmodulehandler('news_stories','news'); + //compte "total" $count_stories = $storiesHandler->getCount(); //compte "attente" $criteria = new CriteriaCompo(); - $criteria->add(new Criteria("menu", 1)); + $criteria->add(new Criteria("ihome", 1)); $stories_ihome = $storiesHandler->getCount($criteria); + + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("published", 0,'>')); + $stories_published = $storiesHandler->getCount($criteria); + + $storiesNeedApproval = $count_stories- $stories_published; + + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("expired", 0,'>')); + $criteria->add(new Criteria("expired", time(),'<')); + $stories_expired = $storiesHandler->getCount($criteria); + + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("expired", 0,'>')); + $criteria->add(new Criteria("expired", time(),'>')); + $storiesExpiredSoon = $storiesHandler->getCount($criteria); //compte "total" $count_topics = $topicsHandler->getCount(); @@ -1598,7 +1617,13 @@ $indexAdmin->addInfoBoxLine(_AM_NEWS_STATISTICS,_AM_NEWS_THEREARE_STORIES, $count_stories, $clr_count_stories); $indexAdmin->addInfoBoxLine(_AM_NEWS_STATISTICS,_AM_NEWS_THEREARE_STORIES_ONLINE, $stories_ihome, $clr_ihome_stories); + $indexAdmin->addInfoBoxLine(_AM_NEWS_STATISTICS,_AM_NEWS_THEREARE_STORIES_APPROVED, $stories_published, $clr_ihome_stories); + $indexAdmin->addInfoBoxLine(_AM_NEWS_STATISTICS,_AM_NEWS_THEREARE_STORIES_NEED_APPROVAL, $storiesNeedApproval, 'red'); + $indexAdmin->addInfoBoxLine(_AM_NEWS_STATISTICS,_AM_NEWS_THEREARE_STORIES_EXPIRED, $stories_expired, $clr_ihome_stories); + $indexAdmin->addInfoBoxLine(_AM_NEWS_STATISTICS,_AM_NEWS_THEREARE_STORIES_EXPIRED_SOON, $storiesExpiredSoon, $clr_ihome_stories); + + foreach (array_keys( $folder) as $i) { $indexAdmin->addConfigBoxLine($folder[$i], 'folder'); $indexAdmin->addConfigBoxLine(array($folder[$i], '777'), 'chmod'); Modified: XoopsModules/news/branches/mamba/news/class/news_stories.php =================================================================== --- XoopsModules/news/branches/mamba/news/class/news_stories.php 2012-06-10 03:09:41 UTC (rev 9627) +++ XoopsModules/news/branches/mamba/news/class/news_stories.php 2012-06-10 04:01:22 UTC (rev 9628) @@ -83,7 +83,7 @@ { function __construct(&$db) { - parent::__construct($db, "news_stories", "stories", "storyid", "uid"); + parent::__construct($db, "stories", "news_stories", "storyid", "uid"); } } ?> \ No newline at end of file Modified: XoopsModules/news/branches/mamba/news/class/news_topics.php =================================================================== --- XoopsModules/news/branches/mamba/news/class/news_topics.php 2012-06-10 03:09:41 UTC (rev 9627) +++ XoopsModules/news/branches/mamba/news/class/news_topics.php 2012-06-10 04:01:22 UTC (rev 9628) @@ -66,7 +66,7 @@ { function __construct(&$db) { - parent::__construct($db, "news_topics", "topics", "topic_id", "topic_pid"); + parent::__construct($db, "topics", "news_topics", "topic_id", "topic_pid"); } } Modified: XoopsModules/news/branches/mamba/news/language/english/admin.php =================================================================== --- XoopsModules/news/branches/mamba/news/language/english/admin.php 2012-06-10 03:09:41 UTC (rev 9627) +++ XoopsModules/news/branches/mamba/news/language/english/admin.php 2012-06-10 04:01:22 UTC (rev 9628) @@ -212,15 +212,17 @@ define("_AM_NEWS_CONFIG_PHP","Minimum PHP required: %s (your version is %s)"); define("_AM_NEWS_CONFIG_XOOPS","Minimum XOOPS required: %s (your version is %s)"); -define ("_AM_NEWS_STATISTICS", "Statistics News"); +define ("_AM_NEWS_STATISTICS", "News Statistics"); define ("_AM_NEWS_THEREARE_STORIES", "There are <span class='red bold'>%s</span> News in the database"); -define ("_AM_NEWS_THEREARE_STORIES_ONLINE", "There are <span class='red bold'>%s</span> News Online"); +define ("_AM_NEWS_THEREARE_STORIES_ONLINE", "There are <span class='red bold'>%s</span> News published in Home"); define ("_AM_NEWS_THEREARE_STORIES_FILES", "There are <span class='red bold'>%s</span> Stories_files in the database"); define ("_AM_NEWS_THEREARE_STORIES_FILES_ONLINE", "There are <span class='red bold'>%s</span> Stories_files online"); define ("_AM_NEWS_THEREARE_TOPICS", "There are <span class='red bold'>%s</span> Categories in the database"); -define ("_AM_NEWS_THEREARE_TOPICS_ONLINE", "There are <span class='red bold'>%s</span> Categories Online"); +define ("_AM_NEWS_THEREARE_TOPICS_ONLINE", "There are <span class='red bold'>%s</span> Categories visible in Menu"); define ("_AM_NEWS_THEREARE_STORIES_VOTEDATA", "There are <span class='red bold'>%s</span> Stories Viewed"); define ("_AM_NEWS_THEREARE_STORIES_IMPORTED", "There are <span class='red bold'>%s</span> Imported Stories"); define ("_AM_NEWS_THEREARE_STORIES_EXPORTED", "There are <span class='red bold'>%s</span> Stories exported"); - -?> \ No newline at end of file +define ("_AM_NEWS_THEREARE_STORIES_EXPIRED", "There are <span class='red bold'>%s</span> Expired News"); +define ("_AM_NEWS_THEREARE_STORIES_EXPIRED_SOON", "There are <span class='red bold'>%s</span> News to be Expired soon"); +define ("_AM_NEWS_THEREARE_STORIES_APPROVED", "There are <span class='red bold'>%s</span> Approved News"); +define ("_AM_NEWS_THEREARE_STORIES_NEED_APPROVAL", "There are <span class='red bold'>%s</span> News that need Approval"); \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |