From: Eloi G. <ada...@us...> - 2011-01-03 06:02:15
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv13381/class Modified Files: AM_Lists.php AM_Actions.php Article.php AM_Data.php Log Message: + Times viewed is now stored in the associated Key for an article Index: AM_Data.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Data.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AM_Data.php 2 Jan 2011 23:34:26 -0000 1.23 --- AM_Data.php 3 Jan 2011 06:02:05 -0000 1.24 *************** *** 32,36 **** $db->addColumn('updated_date'); $db->addColumn('allow_comments'); - $db->addColumn('hits'); $db->addColumn('expiration_date'); $db->addColumn('publication_date'); --- 32,35 ---- Index: AM_Lists.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Lists.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AM_Lists.php 18 Dec 2008 05:46:08 -0000 1.27 --- AM_Lists.php 3 Jan 2011 06:02:05 -0000 1.28 *************** *** 252,256 **** . dgettext('article', 'Approved').'? ' .(($approved)?dgettext('article', 'Yes'):dgettext('article', 'No')).'<br />' ! . dgettext('article', 'Views').': '.$hits.'<br />' // . dgettext('article', 'Language').': '.$GLOBALS['AMLang'][$language].'<br />' // . $available --- 252,256 ---- . dgettext('article', 'Approved').'? ' .(($approved)?dgettext('article', 'Yes'):dgettext('article', 'No')).'<br />' ! // Stored in the key class now . dgettext('article', 'Views').': '.key->times_viewed.'<br />' // . dgettext('article', 'Language').': '.$GLOBALS['AMLang'][$language].'<br />' // . $available Index: AM_Actions.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Actions.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AM_Actions.php 2 Jan 2011 23:34:26 -0000 1.19 --- AM_Actions.php 3 Jan 2011 06:02:05 -0000 1.20 *************** *** 66,70 **** $new_article->created_date = date("Y-m-d H:i:s"); $new_article->updated_date = date("Y-m-d H:i:s"); - $new_article->hits = 0; $new_article->approved = (!PHPWS_Settings::get('article', 'need_approval') || Current_User::allow('article', 'approve')) ?1:0; $new_article->version = -1; --- 66,69 ---- Index: Article.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Article.php 2 Jan 2011 23:34:26 -0000 1.64 --- Article.php 3 Jan 2011 06:02:05 -0000 1.65 *************** *** 20,24 **** * @param string summary : The Section that serves as summary for this article * @param int allow_comments : Whether users can submit & view comments - * @param int hits : Keeps track of how many times this article was accessed * @param int expiration_date : Date this article will become obsolete * A NULL value means that the article will never expire --- 20,23 ---- *************** *** 61,65 **** var $summary = ''; var $allow_comments; - var $hits = 0; var $expiration_date; var $publication_date; --- 60,63 ---- *************** *** 235,239 **** } - $article_tags['HITS'] = $this->hits; $article_tags['CREATED_DATE_LONG'] = PHPWS_AM_Data::get_long_date($this->created_date); $article_tags['UPDATED_DATE_LONG'] = PHPWS_AM_Data::get_long_date($this->updated_date); --- 233,236 ---- *************** *** 505,509 **** function get_summary_columns ($summary_column = true) { ! $arr = array('id', 'key_id', 'title', 'mainarticle', 'rank', 'created_username', 'created_id', 'updated_username', 'updated_id', 'created_date', 'updated_date', 'allow_comments', 'hits', 'expiration_date', 'publication_date', 'wordcount', 'pagecount', 'editlock', 'edituser', 'approved', 'version', 'announce', 'language', 'is_base_article', 'draft', 'active'); if ($summary_column) $arr[] = 'summary'; --- 502,506 ---- function get_summary_columns ($summary_column = true) { ! $arr = array('id', 'key_id', 'title', 'mainarticle', 'rank', 'created_username', 'created_id', 'updated_username', 'updated_id', 'created_date', 'updated_date', 'allow_comments', 'expiration_date', 'publication_date', 'wordcount', 'pagecount', 'editlock', 'edituser', 'approved', 'version', 'announce', 'language', 'is_base_article', 'draft', 'active'); if ($summary_column) $arr[] = 'summary'; *************** *** 547,552 **** * Saves this article to the database. * - * @author Adam Morton <ad...@NO...> - * @param bool $autodetect_id : If false, the article will be saved as a new article with the supplied id * @return array : On success, id & versionid of article; on failure, FALSE --- 544,547 ---- *************** *** 562,568 **** * and should be manually removed if you are sure no other article is using them. * - * @author Adam Morton <ad...@NO...> * @author Eloi George <el...@NO...> - * @param none * @return none --- 557,561 ---- *************** *** 821,842 **** /** - * Increments the article counter by one to keep track of article accesses - * - * @author Eloi George <el...@NO...> - - * @param none - * @return none - */ - function increment_counter($id=null) - { - if (!$id) - $id = $this->id; - $db = new PHPWS_DB('article'); - $db->addWhere('id', $id); - $db->addValue('hits', ++$this->hits); - $db->update(); - } - - /** * Updates both the current and unapproved version of an article * --- 814,817 ---- |