|
From: <ada...@us...> - 2003-07-16 19:44:39
|
Update of /cvsroot/phpwebsite-comm/modules/article/class
In directory sc8-pr-cvs1:/tmp/cvs-serv3882/class
Modified Files:
Article.php ArticleManager.php
Log Message:
Fixed article display bugs
Index: Article.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Article.php 15 Jul 2003 17:40:35 -0000 1.4
--- Article.php 16 Jul 2003 19:44:33 -0000 1.5
***************
*** 149,156 ****
$this->wordcount = 0;
$this->expiration_date = ($_SESSION['SES_ART_master']->val['can_expire'])
! ?date('Y')+$_SESSION['SES_ART_master']->val['expiration_years'] ."-"
! . date('m')+$_SESSION['SES_ART_master']->val['expiration_months'] ."-"
! . date('d')+$_SESSION['SES_ART_master']->val['expiration_days']
! . date(' H:i:s')
:NULL;
$this->publication_date = date("Y-m-d H:i:s");
--- 149,156 ----
$this->wordcount = 0;
$this->expiration_date = ($_SESSION['SES_ART_master']->val['can_expire'])
! ?date("Y-m-d H:i:s", mktime(0,0,0
! ,date('m')+$_SESSION['SES_ART_master']->val['expiration_months']
! ,date('d')+$_SESSION['SES_ART_master']->val['expiration_days']
! ,date('Y')+$_SESSION['SES_ART_master']->val['expiration_years']))
:NULL;
$this->publication_date = date("Y-m-d H:i:s");
***************
*** 204,208 ****
/* My copyright statement. Do not disable or remove. */
$rights = array( 'http://www.vibride.com','http://www.realvidreams.com','http://www.bygeorgeware.com','http://www.bygeorgeadvertising.com');
! $copyright = '<div style="text-align:right;font-size:8pt"><a href="'.$rights[rand(0,2)].'">i</a></div>';
$article_tags = array();
--- 204,209 ----
/* My copyright statement. Do not disable or remove. */
$rights = array( 'http://www.vibride.com','http://www.realvidreams.com','http://www.bygeorgeware.com','http://www.bygeorgeadvertising.com');
! $copyright = '<a href="'.$rights[rand(0,2)].'"><img src="http://'.PHPWS_SOURCE_HTTP
! . 'mod/article/img/mark.gif" border="0" title="Article Manager by by George! Software"></a>';
$article_tags = array();
***************
*** 982,994 ****
/* Make sure that the expiration date is good. */
if (!($this->expiration_date > $now || $this->expiration_date==NULL))
! $query_data['expiration_date'] =
! date('Y')+$_SESSION['SES_ART_master']->val['expiration_years'] ."-"
! . date('m')+$_SESSION['SES_ART_master']->val['expiration_months'] ."-"
! . date('d')+$_SESSION['SES_ART_master']->val['expiration_days']
! . date(' H:i:s');
!
$query_data['publication_date'] = date("Y-m-d H:i:s");
- $GLOBALS['core']->sqlUpdate($query_data, "mod_article", 'id', $this->id);
PHPWS_Fatcat::activate($this->id, 'article');
$this->publication_date = $query_data['expiration_date'];
--- 983,993 ----
/* Make sure that the expiration date is good. */
if (!($this->expiration_date > $now || $this->expiration_date==NULL))
! $query_data['expiration_date'] = date("Y-m-d H:i:s", mktime(0,0,0
! ,date('m')+$_SESSION['SES_ART_master']->val['expiration_months']
! ,date('d')+$_SESSION['SES_ART_master']->val['expiration_days']
! ,date('Y')+$_SESSION['SES_ART_master']->val['expiration_years']));
!
$query_data['publication_date'] = date("Y-m-d H:i:s");
PHPWS_Fatcat::activate($this->id, 'article');
$this->publication_date = $query_data['expiration_date'];
Index: ArticleManager.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/ArticleManager.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ArticleManager.php 14 Jul 2003 20:46:24 -0000 1.2
--- ArticleManager.php 16 Jul 2003 19:44:33 -0000 1.3
***************
*** 67,73 ****
/* Set up the list search criteria */
/* Unapproved listings show up under "My Listings" only */
! $this->group_array = array(' WHERE approved'=>'All'
! ,' WHERE created_username = ' =>'My');
!
$this->sort_array = array('title'=>'Article Title'
,'publication_date'=>'Publication Date'
--- 67,71 ----
/* Set up the list search criteria */
/* Unapproved listings show up under "My Listings" only */
! $this->group_array = array('All'=>'All', 'My' =>'My');
$this->sort_array = array('title'=>'Article Title'
,'publication_date'=>'Publication Date'
***************
*** 79,85 ****
/* Default search criteria defaults to showing "my" articles only */
if ($_SESSION['OBJ_user']->username)
! $this->list_group = ' WHERE created_username = ';
else
! $this->list_group = ' WHERE approved';
$this->list_sort = 'title';
--- 77,83 ----
/* Default search criteria defaults to showing "my" articles only */
if ($_SESSION['OBJ_user']->username)
! $this->list_group = 'My';
else
! $this->list_group = 'All';
$this->list_sort = 'title';
***************
*** 173,180 ****
$this->pager->limit = $this->val['listings_per_page'];
! if ($this->list_group==' WHERE created_username = ')
! $where = $this->list_group .= '"'.$_SESSION['OBJ_user']->username.'"';
else
! $where = $this->list_group;
$result = $GLOBALS['core']->getCol('SELECT id FROM ' . $this->sql_article_table
. $where . $this->sql_predicate . ' ORDER BY '
--- 171,183 ----
$this->pager->limit = $this->val['listings_per_page'];
! if ($this->list_group=='My')
! $where = ' WHERE created_username="'.$_SESSION['OBJ_user']->username.'"';
else
! {
! $where = ' WHERE approved';
! if (!$_SESSION['OBJ_user']->allow_access('article', 'change_dates')
! && !($_SESSION['SES_ART_master']->val['users_change_dates'] && $_SESSION['OBJ_user']->isUser()))
! $where .= ' AND '.$this->get_published_sql();
! }
$result = $GLOBALS['core']->getCol('SELECT id FROM ' . $this->sql_article_table
. $where . $this->sql_predicate . ' ORDER BY '
***************
*** 194,199 ****
/* Retrieve all article listings for this page */
! $sql = 'SELECT id,title,created_username,approved,mainarticle,editlock,edituser,'
! . $temp_date . ' FROM ' . $this->sql_article_table
. ' WHERE id IN (' . $data . ') ORDER BY '
. $this->list_sort . ' ' . $this->list_order;
--- 197,202 ----
/* Retrieve all article listings for this page */
! $sql = 'SELECT id,title,created_username,approved,mainarticle,editlock,edituser,publication_date,expiration_date,created_date,updated_date'
! . ' FROM ' . $this->sql_article_table
. ' WHERE id IN (' . $data . ') ORDER BY '
. $this->list_sort . ' ' . $this->list_order;
***************
*** 301,304 ****
--- 304,308 ----
if (isset($_REQUEST['newsFilter']))
$this->filter = $_REQUEST['newsFilter'];
+
if ($this->filter!='')
$filter = ' AND title LIKE "'.$this->filter.'%" ORDER BY title ASC';
***************
*** 307,311 ****
$result = $GLOBALS['core']->getCol('SELECT id FROM ' . $this->sql_article_table
! . ' WHERE ' . $this->get_published_sql() . $this->sql_predicate . $filter);
$this->pager->setData($result);
$result = NULL;
--- 311,315 ----
$result = $GLOBALS['core']->getCol('SELECT id FROM ' . $this->sql_article_table
! . ' WHERE ' . $this->get_published_sql().' AND mainarticle=0'.$this->sql_predicate . $filter);
$this->pager->setData($result);
$result = NULL;
***************
*** 447,451 ****
/* Load records to display */
$sql = 'SELECT * FROM ' . $this->sql_article_table
! . ' WHERE ' . $this->get_published_sql() . $this->sql_predicate
. ' AND announce ORDER BY updated_date DESC LIMIT ' . $TotalCount;
$result = $GLOBALS['core']->query($sql);
--- 451,455 ----
/* Load records to display */
$sql = 'SELECT * FROM ' . $this->sql_article_table
! . ' WHERE ' . $this->get_published_sql().' AND mainarticle=0'. $this->sql_predicate
. ' AND announce ORDER BY updated_date DESC LIMIT ' . $TotalCount;
$result = $GLOBALS['core']->query($sql);
***************
*** 497,501 ****
/* Load records to display */
$sql = 'SELECT * FROM ' . $this->sql_article_table
! . ' WHERE ' . $this->get_published_sql() . $this->sql_predicate
. ' ORDER BY hits DESC LIMIT ' . $this->val['popular_articles'];
$result = $GLOBALS['core']->query($sql);
--- 501,505 ----
/* Load records to display */
$sql = 'SELECT * FROM ' . $this->sql_article_table
! . ' WHERE ' . $this->get_published_sql().' AND mainarticle=0'. $this->sql_predicate
. ' ORDER BY hits DESC LIMIT ' . $this->val['popular_articles'];
$result = $GLOBALS['core']->query($sql);
***************
*** 763,768 ****
{
$now = date("Y-m-d H:i:s");
! return "approved AND publication_date<='$now' AND"
! ." (expiration_date IS NULL OR expiration_date>'$now') AND mainarticle=0";
}
}
--- 767,771 ----
{
$now = date("Y-m-d H:i:s");
! return "approved AND publication_date<='$now' AND (expiration_date IS NULL OR expiration_date>'$now')";
}
}
|