You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(120) |
Jun
(74) |
Jul
(97) |
Aug
(35) |
Sep
(35) |
Oct
(34) |
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(18) |
Feb
(8) |
Mar
(7) |
Apr
(23) |
May
(28) |
Jun
(31) |
Jul
(27) |
Aug
(34) |
Sep
(48) |
Oct
(511) |
Nov
(197) |
Dec
(333) |
2005 |
Jan
(212) |
Feb
(33) |
Mar
(94) |
Apr
(51) |
May
(16) |
Jun
|
Jul
(200) |
Aug
(43) |
Sep
(88) |
Oct
(60) |
Nov
(62) |
Dec
(41) |
2006 |
Jan
(94) |
Feb
(49) |
Mar
(54) |
Apr
|
May
(39) |
Jun
(39) |
Jul
(61) |
Aug
(36) |
Sep
(23) |
Oct
(76) |
Nov
(73) |
Dec
(32) |
2007 |
Jan
|
Feb
(87) |
Mar
|
Apr
(8) |
May
(36) |
Jun
(49) |
Jul
(54) |
Aug
(8) |
Sep
(50) |
Oct
(36) |
Nov
|
Dec
(3) |
2008 |
Jan
(133) |
Feb
(54) |
Mar
(39) |
Apr
(2) |
May
(6) |
Jun
(74) |
Jul
(97) |
Aug
(70) |
Sep
(12) |
Oct
(20) |
Nov
(64) |
Dec
(24) |
2009 |
Jan
(25) |
Feb
(49) |
Mar
(18) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(10) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ada...@us...> - 2003-07-16 19:44:39
|
Update of /cvsroot/phpwebsite-comm/modules/article In directory sc8-pr-cvs1:/tmp/cvs-serv3882 Modified Files: index.php Log Message: Fixed article display bugs Index: index.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 14 Jul 2003 20:38:34 -0000 1.2 --- index.php 16 Jul 2003 19:44:36 -0000 1.3 *************** *** 250,252 **** --- 250,255 ---- return; } + else + $_SESSION['SES_ART_master']->main_menu(); + ?> |
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')"; } } |
From: <ada...@us...> - 2003-07-15 17:40:41
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory sc8-pr-cvs1:/tmp/cvs-serv4592/class Modified Files: Article.php Log Message: Fixed article expiration bug Index: Article.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Article.php 14 Jul 2003 20:46:24 -0000 1.3 --- Article.php 15 Jul 2003 17:40:35 -0000 1.4 *************** *** 964,968 **** /* Setup the query data for the current article. Update info. */ $query_data['expiration_date'] = date('Y-m-d H:i:s'); ! $GLOBALS['core']->sqlUpdate($query_data, 'mod_article', 'id', $_SESSION['SES_ART_article']->id); PHPWS_Fatcat::deactivate($this->id, 'article'); $this->expiration_date = $query_data['expiration_date']; --- 964,968 ---- /* Setup the query data for the current article. Update info. */ $query_data['expiration_date'] = date('Y-m-d H:i:s'); ! $GLOBALS['core']->sqlUpdate($query_data, 'mod_article', 'id', $this->id); PHPWS_Fatcat::deactivate($this->id, 'article'); $this->expiration_date = $query_data['expiration_date']; |
From: <ada...@us...> - 2003-07-14 20:46:31
|
Update of /cvsroot/phpwebsite-comm/modules/article/inc In directory sc8-pr-cvs1:/tmp/cvs-serv28283/inc Modified Files: editconfig.php Log Message: General bugfixes, including resolution and optimization of various article deletion issues Index: editconfig.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/inc/editconfig.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editconfig.php 9 Jul 2003 20:24:26 -0000 1.1 --- editconfig.php 14 Jul 2003 20:46:25 -0000 1.2 *************** *** 66,70 **** /* listings_per_page */ $tags['LISTINGS_PER_PAGE'] = ! $GLOBALS['core']->formSelect('CONFIG_listings_per_page', range(0,50) , $this->val['listings_per_page'], NULL, NULL, NULL) . ' ' . $_SESSION['translate']->it('Number of listings to show per page under the Main Menu') --- 66,70 ---- /* listings_per_page */ $tags['LISTINGS_PER_PAGE'] = ! $GLOBALS['core']->formSelect('CONFIG_listings_per_page', range(1,50) , $this->val['listings_per_page'], NULL, NULL, NULL) . ' ' . $_SESSION['translate']->it('Number of listings to show per page under the Main Menu') *************** *** 151,156 **** $tags['DEFAULT_YEAR_COUNT'] = $_SESSION['translate']->it('Publication dates can be set up to [var1] year(s) from article creation.' , $GLOBALS['core']->formSelect('CONFIG_default_year_count', range(1,5) ! , $this->val['default_year_count'], NULL, NULL, NULL) ) ! . $_SESSION['OBJ_help']->show_link('article', 'default_year_count'); /* max_image_size */ --- 151,155 ---- $tags['DEFAULT_YEAR_COUNT'] = $_SESSION['translate']->it('Publication dates can be set up to [var1] year(s) from article creation.' , $GLOBALS['core']->formSelect('CONFIG_default_year_count', range(1,5) ! , $this->val['default_year_count'], NULL, NULL, NULL) ); /* max_image_size */ *************** *** 164,177 **** $tags['MAX_IMAGE_HEIGHT'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] pixels' , 'height' ! , $GLOBALS['core']->formTextField('CONFIG_max_image_height' ! , $this->val['max_image_height'], 4, 4)) ! . $_SESSION['OBJ_help']->show_link('article', 'max_image_height'); /* max_image_width */ $tags['MAX_IMAGE_WIDTH'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] pixels' , 'width' ! , $GLOBALS['core']->formTextField('CONFIG_max_image_width' ! , $this->val['max_image_width'], 4, 4)) ! . $_SESSION['OBJ_help']->show_link('article', 'max_image_width'); /* restricted_viewing */ --- 163,172 ---- $tags['MAX_IMAGE_HEIGHT'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] pixels' , 'height' ! , $GLOBALS['core']->formTextField('CONFIG_max_image_height', $this->val['max_image_height'], 4, 4)); /* max_image_width */ $tags['MAX_IMAGE_WIDTH'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] pixels' , 'width' ! , $GLOBALS['core']->formTextField('CONFIG_max_image_width', $this->val['max_image_width'], 4, 4)); /* restricted_viewing */ *************** *** 193,200 **** . $_SESSION['OBJ_help']->show_link('configmanager', 'make_metatags'); ! $tags['SAVE'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Save Settings'), 'ARTICLE_vars[config:save]') ! . $_SESSION['OBJ_help']->show_link('article', 'config_save'); ! $tags['RESET'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Reset Settings'), 'ARTICLE_vars[config:reset]') ! . $_SESSION['OBJ_help']->show_link('article', 'config_save'); $content[0] = $GLOBALS['core']->processTemplate($tags,'article','config.tpl'); --- 188,193 ---- . $_SESSION['OBJ_help']->show_link('configmanager', 'make_metatags'); ! $tags['SAVE'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Save Settings'), 'ARTICLE_vars[config:save]'); ! $tags['RESET'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Reset Settings'), 'ARTICLE_vars[config:reset]'); $content[0] = $GLOBALS['core']->processTemplate($tags,'article','config.tpl'); |
From: <ada...@us...> - 2003-07-14 20:46:29
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory sc8-pr-cvs1:/tmp/cvs-serv28283/class Modified Files: Article.php ArticleManager.php Section.php Log Message: General bugfixes, including resolution and optimization of various article deletion issues Index: Article.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Article.php 10 Jul 2003 18:12:05 -0000 1.2 --- Article.php 14 Jul 2003 20:46:24 -0000 1.3 *************** *** 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)].'">©</a></div>'; $article_tags = array(); --- 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(); *************** *** 337,352 **** /* if user can edit articles or can edit this article... */ ! if ($_SESSION['SES_ART_master']->can('edit',$this->created_username)) ! /* If someone else is editing this page... */ ! if ($this->isLocked(&$this->editlock, &$this->edituser)) ! $article_tags['EDIT'] = '['. $_SESSION['translate']->it('Locked') . ']'; ! else ! $article_tags['EDIT'] = '[<a href="index.php?module=article&edit='.$this->id ! .'" target="_blank">' . $_SESSION['translate']->it('Edit').'</a>]'; /* if user can delete articles or can delete this article... */ ! if ($_SESSION['SES_ART_master']->can('delete',$this->created_username)) ! $article_tags['DELETE'] = '[<a href="index.php?module=article&edit=delete&ARTICLE_id=' ! . $this->id.'" target="_blank">'.$_SESSION['translate']->it('Delete').' </a>]'; /* Show FatCat Category icons */ --- 337,352 ---- /* if user can edit articles or can edit this article... */ ! if ($_SESSION['SES_ART_master']->can('edit',$this->created_username)) ! /* If someone else is editing this page... */ ! if ($this->isLocked(&$this->editlock, &$this->edituser)) ! $article_tags['EDIT'] = '['. $_SESSION['translate']->it('Locked') . ']'; ! else ! $article_tags['EDIT'] = '[<a href="index.php?module=article&edit='.$this->id ! .'">' . $_SESSION['translate']->it('Edit').'</a>]'; /* if user can delete articles or can delete this article... */ ! if ($_SESSION['SES_ART_master']->can('delete',$this->created_username)) ! $article_tags['DELETE'] = '[<a href="index.php?module=article&edit=delete&ARTICLE_id=' ! . $this->id.'">'.$_SESSION['translate']->it('Delete').' </a>]'; /* Show FatCat Category icons */ *************** *** 377,381 **** , 'article', 'article/'.$this->template.'/content.tpl'); if ($GLOBALS['module'] != "home") $GLOBALS['CNT_article']['content'] .= $copyright; ! /* Article Comments */ if(isset($_SESSION['PHPWS_CommentManager']) && $this->allow_comments && !$this->mainarticle) --- 377,381 ---- , 'article', 'article/'.$this->template.'/content.tpl'); if ($GLOBALS['module'] != "home") $GLOBALS['CNT_article']['content'] .= $copyright; ! /* Article Comments */ if(isset($_SESSION['PHPWS_CommentManager']) && $this->allow_comments && !$this->mainarticle) *************** *** 801,826 **** if(isset($_SESSION['OBJ_fatcat'])) PHPWS_Fatcat::deleteModuleElements('article', $this->id); - /* Delete references to this article in the menu */ ! $result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url = "./index.php?module=article&view='.$this->id.'"', true); ! if(!is_array($result)) ! echo "NO MENU RECORDS FOUND!"; ! else { ! foreach($result as $value) { ! $children = $GLOBALS['core']->getAll('SELECT menu_item_id FROM mod_menuman_items WHERE menu_item_pid=' ! .$value['menu_item_id'].' and menu_item_id !='.$value['menu_item_id'], true); ! /* If this menu item has children, just point it to nowhere */ ! if(is_array($children)) { ! $isParent = TRUE; ! $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article" WHERE menu_item_id='.$value['menu_item_id'], true); } ! /* otherwise, delete it */ ! else ! $GLOBALS['core']->sqlDelete('mod_menuman_items', 'menu_item_id', $item['menu_item_id']); } - unset($_SESSION['OBJ_menuman']); } --- 801,828 ---- if(isset($_SESSION['OBJ_fatcat'])) PHPWS_Fatcat::deleteModuleElements('article', $this->id); /* Delete references to this article in the menu */ ! if($GLOBALS['core']->moduleExists('menuman')) { ! $result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url = "./index.php?module=article&view='.$this->id.'"', true); ! if(!is_array($result)) ! echo "NO MENU RECORDS FOUND!"; ! else { ! foreach($result as $value) { ! $children = $GLOBALS['core']->getAll('SELECT menu_item_id FROM mod_menuman_items WHERE menu_item_pid=' ! .$value['menu_item_id'].' and menu_item_id !='.$value['menu_item_id'], true); ! /* If this menu item has children, just point it to nowhere */ ! if(is_array($children)) ! { ! $isParent = TRUE; ! $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article" WHERE menu_item_id='.$value['menu_item_id'], true); ! } ! /* otherwise, delete it */ ! else ! $GLOBALS['core']->sqlDelete('mod_menuman_items', 'menu_item_id', $item['menu_item_id']); } ! unset($_SESSION['OBJ_menuman']); } } *************** *** 1091,1099 **** * @param id : Id of the article to show. */ ! function view_category_row ($id) ! { ! $this = new PHPWS_Article($id); ! $this->view(false); ! } } --- 1093,1101 ---- * @param id : Id of the article to show. */ ! function fatCatview ($id) ! { ! $this = new PHPWS_Article($id); ! return $this->view(false, true); ! } } Index: ArticleManager.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/ArticleManager.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ArticleManager.php 9 Jul 2003 20:24:24 -0000 1.1 --- ArticleManager.php 14 Jul 2003 20:46:24 -0000 1.2 *************** *** 287,291 **** * @return none */ ! function list_news () { /* Set up display variables */ --- 287,291 ---- * @return none */ ! function view_news () { /* Set up display variables */ *************** *** 295,299 **** { $this->pager = new PHPWS_Pager; ! $this->pager->setLinkBack('./index.php?module=article&disp=news'); $this->pager->makeArray(TRUE); $this->pager->limit = $this->val['listings_per_page']; --- 295,299 ---- { $this->pager = new PHPWS_Pager; ! $this->pager->setLinkBack('./index.php?module=article&view=news'); $this->pager->makeArray(TRUE); $this->pager->limit = $this->val['listings_per_page']; *************** *** 356,360 **** $content = $GLOBALS['core']->processTemplate($tags,'article','pager.tpl'); ! $GLOBALS['CNT_article_summaries']['content'] = $content . $GLOBALS['CNT_article_summaries']['content'] . $content; } --- 356,360 ---- $content = $GLOBALS['core']->processTemplate($tags,'article','pager.tpl'); ! $GLOBALS['CNT_article_summaries']['content'] = $content . '<br />' . $GLOBALS['CNT_article_summaries']['content'] . $content; } Index: Section.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Section.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Section.php 9 Jul 2003 20:24:24 -0000 1.1 --- Section.php 14 Jul 2003 20:46:24 -0000 1.2 *************** *** 211,225 **** $myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it("Start on new page?")) ! . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . "<br />"; $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_title') ! . $_SESSION['translate']->it('Section Title').':<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_title'); $myelements[0] .= $GLOBALS['core']->formTextField('SECT_title', htmlspecialchars($this->title), 55, 79) ! . $_SESSION['OBJ_help']->show_link('article', 'section_title') . '<br />'; ! $myelements[0] .= $_SESSION['translate']->it('Text').':<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text'); $myelements[0] .= $GLOBALS['core']->formTextArea("SECT_text", stripslashes($this->text), 20, 79) ! . $_SESSION['OBJ_help']->show_link('article', 'section_text') . '<br />'; /* If there is a current image, show it */ if($this->image['name']) --- 211,227 ---- $myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it("Start on new page?")) ! . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . '<br />'; $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_title') ! . $_SESSION['translate']->it('Section Title').':' ! . $_SESSION['OBJ_help']->show_link('article', 'section_title').'<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_title'); $myelements[0] .= $GLOBALS['core']->formTextField('SECT_title', htmlspecialchars($this->title), 55, 79) ! . '<br />'; ! $myelements[0] .= $_SESSION['translate']->it('Section Text').':' ! . $_SESSION['OBJ_help']->show_link('article', 'section_text') .'<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text'); $myelements[0] .= $GLOBALS['core']->formTextArea("SECT_text", stripslashes($this->text), 20, 79) ! . '<br />'; /* If there is a current image, show it */ if($this->image['name']) *************** *** 271,283 **** /* Enter alt text, link, & image_caption */ $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_alt') ! . $_SESSION['translate']->it('Short Image Description').': ' . $GLOBALS['core']->formTextField('SECT_alt', htmlspecialchars($this->image['alt']), 79, 255) ! . $_SESSION['OBJ_help']->show_link('article', 'section_image_desc') . '<br />'; $myelements[0] .= $_SESSION['translate']->it('This Image Links To') . '...: ' . $GLOBALS['core']->formTextField('SECT_link', htmlspecialchars($this->image['link']), 79, 255) ! . $_SESSION['OBJ_help']->show_link('article', 'section_image_link') . '<br />'; $myelements[0] .= $_SESSION['translate']->it('Link caption').': ' . $GLOBALS['core']->formTextField('SECT_image_caption', htmlspecialchars($this->image['caption']), 79, 255) ! . $_SESSION['OBJ_help']->show_link('article', 'section_image_caption') . '<br />'; } --- 273,288 ---- /* Enter alt text, link, & image_caption */ $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_alt') ! . $_SESSION['translate']->it('Short Image Description') .': ' ! . $_SESSION['OBJ_help']->show_link('article', 'section_image_desc') . $GLOBALS['core']->formTextField('SECT_alt', htmlspecialchars($this->image['alt']), 79, 255) ! . '<br />'; $myelements[0] .= $_SESSION['translate']->it('This Image Links To') . '...: ' + . $_SESSION['OBJ_help']->show_link('article', 'section_image_link') . $GLOBALS['core']->formTextField('SECT_link', htmlspecialchars($this->image['link']), 79, 255) ! . '<br />'; $myelements[0] .= $_SESSION['translate']->it('Link caption').': ' + . $_SESSION['OBJ_help']->show_link('article', 'section_image_caption') . $GLOBALS['core']->formTextField('SECT_image_caption', htmlspecialchars($this->image['caption']), 79, 255) ! . '<br />'; } *************** *** 329,333 **** $temp_name = NULL; ! if(!$this->title && !$this->text && !isset($_POST['SECT_title']) && !isset($_POST['SECT_text'])) { $_SESSION['SES_ART_master']->error['SECT_title'][] --- 334,339 ---- $temp_name = NULL; ! if(!$this->title && !$this->text && !isset($_POST['SECT_title']) && !isset($_POST['SECT_text']) ! && !$this->image['name'] && !isset($_POST['SECT_lib_image'])) { $_SESSION['SES_ART_master']->error['SECT_title'][] |
From: <ada...@us...> - 2003-07-14 20:46:29
|
Update of /cvsroot/phpwebsite-comm/modules/article/boost In directory sc8-pr-cvs1:/tmp/cvs-serv28283/boost Modified Files: install.sql Log Message: General bugfixes, including resolution and optimization of various article deletion issues Index: install.sql =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/boost/install.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install.sql 9 Jul 2003 20:24:22 -0000 1.1 --- install.sql 14 Jul 2003 20:46:21 -0000 1.2 *************** *** 54,58 **** INSERT INTO mod_article_sections VALUES ('Article Manager Demo Section', 'Welcome to Article Manager!\r\n\r\nThis article was automatically generated when you installed Article Manager.\r\n\r\nIf you want to see an overview of the features of this module, check out "<a href="index.php?module=article&view=2">Introduction to Article Manager</a>".\r\n\r\nTo get started using Article Manager, proceed to the <a href="index.php?module=article&disp=main_menu">administrative menu</a> or go the the <a href="index.php?module=article&disp=news">"News"</a> page that lists all articles on your site.\r\n\r\nAnd most importantly, have fun with it!\r\n<strong><font color="#FF0000">eloi</font></strong>', '', '', 0, 0, '', '', '', 'Centered Image', 0, 1); ! INSERT INTO mod_article_sections VALUES ('Features', '<b>NOTE:</b> <i>This introduction is for demo purposes only and is current as of the first release of Article Manager. For the most up-to-date version, look under the docs directory.</i>\r\n\r\nCustom articles - each section can look completely different\r\nDefine your own article and section templates\r\nAdmins can allow/deny ability to display external pages in an embedded frame\r\nUsers can add comments to your article\r\nUsers can view a list of the articles that they have created\r\nArticles keep track of how many times thay\'ve been viewed\r\nArticles can be set to start showing at a future date\r\nArticles can expire on specified dates\r\nArticles can be viewed in summary format with a link to the full article\r\nMULTI-ARTICLE STORIES with automatic navigation controls!\r\nOptimization: Images are stored in multiple directories for faster access\r\nA library of approved images can be easily maintained\r\nImages can be clickable links with alternate text and photo captions\r\nExpired articles can be accessed from a list and re-activated\r\nModule settings are easily changeable\r\nUser-submitted articles can require approval before activation\r\n"Also on this site.." Block\r\n"Previous n Articles" Block\r\n"Most Popular Articles" Block\r\nArticles can be set to not show up in the homepage summary listings\r\nArticles can be assigned to topic categories\r\nArticles can be viewed only by certain groups\r\nAll of your old Announcements & PageMaster Module content can be imported\r\nAutomatic rerouting of old mod.php, Announcements & PageMaster links\r\nDisplay a printable version\r\nNothing is saved to disk until you hit "Save Page"\r\n"Edit Locking" - Only 1 user can edit a page at a time\r\nA "News" page that displays all articles', '', '', 0, 0, '', '', '', 'Centered Image', 0, 5); INSERT INTO mod_article_sections VALUES ('The Main Menu', 'The main menu is the nerve center of the entire module. It allows you to do four basic tasks -- list articles, create a new article, change Article Manager configuration settings and manage the Image Library.', '', '', 0, 0, '', '', '', 'Centered Image', 1, 3); INSERT INTO mod_article_sections VALUES ('List Articles:', 'Here you can choose to view all approved articles on the site or just your articles ordered by Title or by the date of creation, publication, expiration, or the last update. This list can be viewed in ascending or descending order.\r\n\r\nEach article in the listing is accompanied by buttons allowing you to set it as the homepage, edit it, delete it, or immediately publish or expire it. Of course buttons or options can only be seen if you are authorized to use them.', '', '', 0, 0, '', '', '', 'Centered Image', 0, 2); --- 54,58 ---- INSERT INTO mod_article_sections VALUES ('Article Manager Demo Section', 'Welcome to Article Manager!\r\n\r\nThis article was automatically generated when you installed Article Manager.\r\n\r\nIf you want to see an overview of the features of this module, check out "<a href="index.php?module=article&view=2">Introduction to Article Manager</a>".\r\n\r\nTo get started using Article Manager, proceed to the <a href="index.php?module=article&disp=main_menu">administrative menu</a> or go the the <a href="index.php?module=article&disp=news">"News"</a> page that lists all articles on your site.\r\n\r\nAnd most importantly, have fun with it!\r\n<strong><font color="#FF0000">eloi</font></strong>', '', '', 0, 0, '', '', '', 'Centered Image', 0, 1); ! INSERT INTO mod_article_sections VALUES ('Features', '<b>NOTE:</b> <i>This introduction is for demo purposes only and is current as of the first release of Article Manager. For the most up-to-date version, look under the docs directory.</i>\r\n\r\nCustom articles - each section can look completely different\r\nDefine your own article and section templates\r\nAdmins can allow/deny ability to display external pages in an embedded frame\r\nUsers can add comments to your article\r\nUsers can view a list of the articles that they have created\r\nArticles keep track of how many times they\'ve been viewed\r\nArticles can be set to start showing at a future date\r\nArticles can expire on specified dates\r\nArticles can be viewed in summary format with a link to the full article\r\nMULTI-ARTICLE STORIES with automatic navigation controls!\r\nOptimization: Images are stored in multiple directories for faster access\r\nA library of approved images can be easily maintained\r\nImages can be clickable links with alternate text and photo captions\r\nExpired articles can be accessed from a list and re-activated\r\nModule settings are easily changeable\r\nUser-submitted articles can require approval before activation\r\n"Also on this site.." Block\r\n"Previous n Articles" Block\r\n"Most Popular Articles" Block\r\nArticles can be set to not show up in the homepage summary listings\r\nArticles can be assigned to topic categories\r\nArticles can be viewed only by certain groups\r\nAll of your old Announcements & PageMaster Module content can be imported\r\nAutomatic rerouting of old mod.php, Announcements & PageMaster links\r\nDisplay a printable version\r\nNothing is saved to disk until you hit "Save Page"\r\n"Edit Locking" - Only 1 user can edit a page at a time\r\nA "News" page that displays all articles', '', '', 0, 0, '', '', '', 'Centered Image', 0, 5); INSERT INTO mod_article_sections VALUES ('The Main Menu', 'The main menu is the nerve center of the entire module. It allows you to do four basic tasks -- list articles, create a new article, change Article Manager configuration settings and manage the Image Library.', '', '', 0, 0, '', '', '', 'Centered Image', 1, 3); INSERT INTO mod_article_sections VALUES ('List Articles:', 'Here you can choose to view all approved articles on the site or just your articles ordered by Title or by the date of creation, publication, expiration, or the last update. This list can be viewed in ascending or descending order.\r\n\r\nEach article in the listing is accompanied by buttons allowing you to set it as the homepage, edit it, delete it, or immediately publish or expire it. Of course buttons or options can only be seen if you are authorized to use them.', '', '', 0, 0, '', '', '', 'Centered Image', 0, 2); |
From: <ada...@us...> - 2003-07-14 20:46:28
|
Update of /cvsroot/phpwebsite-comm/modules/article/conf In directory sc8-pr-cvs1:/tmp/cvs-serv28283/conf Modified Files: fatcat.php Log Message: General bugfixes, including resolution and optimization of various article deletion issues Index: fatcat.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/conf/fatcat.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fatcat.php 9 Jul 2003 20:24:25 -0000 1.1 --- fatcat.php 14 Jul 2003 20:46:24 -0000 1.2 *************** *** 3,7 **** // You MUST use apostrophes. Quotation marks will not work $className = 'PHPWS_Article'; ! $methodName = 'view_category_row'; ?> --- 3,7 ---- // You MUST use apostrophes. Quotation marks will not work $className = 'PHPWS_Article'; ! $methodName = 'fatCatview'; ?> |
From: <ada...@us...> - 2003-07-14 20:43:06
|
Update of /cvsroot/phpwebsite-comm/modules/article/docs In directory sc8-pr-cvs1:/tmp/cvs-serv27236/docs Modified Files: LICENSE.txt Log Message: Clarification of text and included misplaced docs for George Brackett's wonderful template hacks Index: LICENSE.txt =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/docs/LICENSE.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LICENSE.txt 9 Jul 2003 20:24:25 -0000 1.1 --- LICENSE.txt 14 Jul 2003 20:43:02 -0000 1.2 *************** *** 9,13 **** This copyright must always display so that it can perform its function. Since this module is released under the LGPL, you can change the code if you want, but this copyright must still display in the same manner. If you want to change or remove the copyright string, contact me and I will sell you a copy of this module under a different license. ! These terms are covered in the license, but I understand that some folks choose to interpret the passage differently. For those people, let me make this clearer. Everything I just said is part of and supercedes the rest of the license terms specifed below. I'm not a lawyer, so if you feel that this invalidates the GNU license, then consider the above terms as constituting the entire license. --- 9,13 ---- This copyright must always display so that it can perform its function. Since this module is released under the LGPL, you can change the code if you want, but this copyright must still display in the same manner. If you want to change or remove the copyright string, contact me and I will sell you a copy of this module under a different license. ! These terms are covered in the license, but I understand that some folks choose to interpret the passage differently. For those people, let me make this clearer. Everything I just said is part of and supercedes the rest of the license terms specifed below. I'm not a lawyer, so if you feel that this invalidates the GNU license, then consider the above terms as superceding the entire license. |
From: <ada...@us...> - 2003-07-14 20:40:36
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/article/Dated In directory sc8-pr-cvs1:/tmp/cvs-serv26062/templates/article/Dated Modified Files: content.tpl Log Message: Added "Edit", "Delete", and "Print This Page" links to the bottom of all articles Index: content.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/templates/article/Dated/content.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** content.tpl 9 Jul 2003 20:24:28 -0000 1.1 --- content.tpl 14 Jul 2003 20:40:32 -0000 1.2 *************** *** 25,29 **** {CREATED_TEXT}<br /> {UPDATED_TEXT}<br /> ! {PRINT_ICON} </div> <!-- END DATEINFO --> --- 25,29 ---- {CREATED_TEXT}<br /> {UPDATED_TEXT}<br /> ! {EDIT} {DELETE} {PRINT_ICON} {EMAIL} </div> <!-- END DATEINFO --> |
From: <ada...@us...> - 2003-07-14 20:40:35
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/article/Byline In directory sc8-pr-cvs1:/tmp/cvs-serv26062/templates/article/Byline Modified Files: content.tpl Log Message: Added "Edit", "Delete", and "Print This Page" links to the bottom of all articles Index: content.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/templates/article/Byline/content.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** content.tpl 9 Jul 2003 20:24:28 -0000 1.1 --- content.tpl 14 Jul 2003 20:40:32 -0000 1.2 *************** *** 14,17 **** <div style="float: right; text-align: right;">{NEXT}</div> <div style="text-align: center;">{NAVBAR}</div> ! <br /><center>{NAVLIST}</center> <!-- END PAGETURN --> --- 14,24 ---- <div style="float: right; text-align: right;">{NEXT}</div> <div style="text-align: center;">{NAVBAR}</div> ! <br /> ! <center>{NAVLIST}</center> <!-- END PAGETURN --> + <!-- BEGIN OPTIONS --> + <div class="smalltext" style="clear : both;" align="right"> + <br /> + {EDIT} {DELETE} {PRINT_ICON} {EMAIL} + </div> + <!-- END OPTIONS --> |
From: <ada...@us...> - 2003-07-14 20:40:35
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/article/Blank In directory sc8-pr-cvs1:/tmp/cvs-serv26062/templates/article/Blank Modified Files: content.tpl Log Message: Added "Edit", "Delete", and "Print This Page" links to the bottom of all articles Index: content.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/templates/article/Blank/content.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** content.tpl 9 Jul 2003 20:24:27 -0000 1.1 --- content.tpl 14 Jul 2003 20:40:31 -0000 1.2 *************** *** 21,22 **** --- 21,28 ---- <br /><center>{NAVLIST}</center> <!-- END PAGETURN --> + <!-- BEGIN OPTIONS --> + <div class="smalltext" style="clear : both;" align="right"> + <br /> + {EDIT} {DELETE} {PRINT_ICON} {EMAIL} + </div> + <!-- END OPTIONS --> |
From: <ada...@us...> - 2003-07-14 20:38:40
|
Update of /cvsroot/phpwebsite-comm/modules/article In directory sc8-pr-cvs1:/tmp/cvs-serv25553 Modified Files: index.php Log Message: Decreased reliance on sessions Index: index.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.php 9 Jul 2003 20:24:26 -0000 1.1 --- index.php 14 Jul 2003 20:38:34 -0000 1.2 *************** *** 40,43 **** --- 40,48 ---- if (isset($_REQUEST['view'])) { + if ($_REQUEST['view']=='news') + { + $_SESSION['SES_ART_master']->view_news(); + return; + } $temp = new PHPWS_Article($_REQUEST['view']); $temp->view(); *************** *** 74,80 **** $_SESSION['SES_ART_master']->list_articles(); break; - case 'news': - $_SESSION['SES_ART_master']->list_news(); - break; } } --- 79,82 ---- *************** *** 108,135 **** $_SESSION['SES_ART_master']->list_articles(); break; ! case 'delete': ! $_SESSION['SES_ART_master']->main_menu(); ! $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['ARTICLE_id']); ! if ($user->can('delete',$_SESSION['SES_ART_article']->author)) ! $_SESSION['SES_ART_article']->delete_article(); ! $_SESSION['SES_ART_article']=null; ! $_SESSION['SES_ART_master']->list_articles(); break; ! case 'expire': ! $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) ! $_SESSION['SES_ART_article']->expire(); ! $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); break; ! case 'publish': ! $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) ! $_SESSION['SES_ART_article']->publish(); ! $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); --- 110,141 ---- $_SESSION['SES_ART_master']->list_articles(); break; ! case 'delete': ! if ($user->can('delete',$temp->author)) ! { ! $temp = new PHPWS_Article($_REQUEST['ARTICLE_id']); ! $temp->delete_article(); ! if (isset($_POST['yes'])) ! { ! $_SESSION['SES_ART_master']->main_menu(); ! $_SESSION['SES_ART_master']->list_articles(); ! } ! elseif (isset($_POST['no'])) ! $temp->view(); ! } break; ! case 'expire': ! $temp = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) ! $temp->expire(); $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); break; ! case 'publish': ! $temp = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) ! $temp->publish(); $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); *************** *** 139,143 **** if ($_SESSION['OBJ_user']->allow_access('article', 'set_mainarticle')) $_SESSION['SES_ART_master']->set_main_article(); - $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); --- 145,148 ---- |
From: <mh...@us...> - 2003-07-11 16:35:56
|
Update of /cvsroot/phpwebsite-comm/CVSROOT In directory sc8-pr-cvs1:/tmp/cvs-serv12994 Modified Files: avail Log Message: modified wiki module write access Index: avail =================================================================== RCS file: /cvsroot/phpwebsite-comm/CVSROOT/avail,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** avail 8 Jul 2003 19:38:05 -0000 1.14 --- avail 11 Jul 2003 16:35:49 -0000 1.15 *************** *** 6,10 **** avail|wendall911|modules/rssfeeds avail|gbrackett|modules/staffman ! avail|rylas|modules/wiki avail|spiggy|themes/jungle --- 6,10 ---- avail|wendall911|modules/rssfeeds avail|gbrackett|modules/staffman ! avail|adarkling|modules/wiki avail|spiggy|themes/jungle |
From: <ada...@us...> - 2003-07-10 20:29:43
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory sc8-pr-cvs1:/tmp/cvs-serv20543/class Modified Files: Article.php Log Message: Fixed bad deletion URL & got rid of some double-quotes. Index: Article.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Article.php 9 Jul 2003 20:24:24 -0000 1.1 --- Article.php 10 Jul 2003 18:12:05 -0000 1.2 *************** *** 347,351 **** /* if user can delete articles or can delete this article... */ if ($_SESSION['SES_ART_master']->can('delete',$this->created_username)) ! $article_tags['DELETE'] = '[<a href="index.php?module=article&edit=delete:' . $this->id.'" target="_blank">'.$_SESSION['translate']->it('Delete').' </a>]'; --- 347,351 ---- /* if user can delete articles or can delete this article... */ if ($_SESSION['SES_ART_master']->can('delete',$this->created_username)) ! $article_tags['DELETE'] = '[<a href="index.php?module=article&edit=delete&ARTICLE_id=' . $this->id.'" target="_blank">'.$_SESSION['translate']->it('Delete').' </a>]'; *************** *** 803,807 **** /* Delete references to this article in the menu */ ! $result = $GLOBALS['core']->getAll("SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url = './index.php?module=article&view=".$this->id."'", true); if(!is_array($result)) echo "NO MENU RECORDS FOUND!"; --- 803,807 ---- /* Delete references to this article in the menu */ ! $result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url = "./index.php?module=article&view='.$this->id.'"', true); if(!is_array($result)) echo "NO MENU RECORDS FOUND!"; *************** *** 810,858 **** foreach($result as $value) { ! $children = $GLOBALS['core']->getAll("SELECT menu_item_id FROM mod_menuman_items WHERE menu_item_pid='" ! .$value['menu_item_id']."' and menu_item_id != '".$value['menu_item_id']."'", true); /* If this menu item has children, just point it to nowhere */ if(is_array($children)) { $isParent = TRUE; ! $GLOBALS['core']->query("UPDATE mod_menuman_items SET menu_item_url='./index.php?module=article' WHERE menu_item_id=".$value['menu_item_id'], true); } /* otherwise, delete it */ else ! $GLOBALS['core']->sqlDelete("mod_menuman_items", "menu_item_id", $item['menu_item_id']); } unset($_SESSION['OBJ_menuman']); } ! $title = "<div class=\"errortext\">".$_SESSION['translate']->it("Article Deleted")."!</div>"; ! $content = $_SESSION['translate']->it("The [var1] <b>[var2]</b> has successfully been [var3]" , $_SESSION['translate']->it('article') , $this->title ! , "<b>".$_SESSION['translate']->it("deleted")."</b>!") ! . "<br /><br />"; if (isset($isParent)) ! $content .= $_SESSION['translate']->it("Some menu links could not be removed") . "."; else ! $content .= $_SESSION['translate']->it("All menu links removed") . "."; $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); } else if(isset($_POST['no'])) { ! $title = $_SESSION['translate']->it("Article Kept")."!"; ! $content = $_SESSION['translate']->it("The [var1] <b>[var2]</b> has successfully been [var3]" ! , $_SESSION['translate']->it('article'), $this->title, "<b>".$_SESSION['translate']->it("kept")."</b>!"); $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); } else { ! $title = "<div class=\"errortext\">".$_SESSION['translate']->it("Confirm Action")."!</div>"; ! $content = $_SESSION['translate']->it('Are you sure you want to [var1] "[var2]"?' ! , '<b>'.$_SESSION['translate']->it('delete').'</b>', '<b><u>$this->title</u></b><br /><br />'); $myform[0] = $GLOBALS['core']->formHidden('module', 'article'); ! $myform[0] .= $GLOBALS['core']->formHidden("ARTICLE_id", $this->id); ! $myform[0] .= $GLOBALS['core']->formHidden("MASTER_op", "Delete"); ! $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Yes'), "yes") . " "; ! $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('No'), "no"); $content .= $GLOBALS['core']->makeForm("ARTICLE_confirm_delete", "index.php", $myform, "post", 0, 0); --- 810,858 ---- foreach($result as $value) { ! $children = $GLOBALS['core']->getAll('SELECT menu_item_id FROM mod_menuman_items WHERE menu_item_pid=' ! .$value['menu_item_id'].' and menu_item_id !='.$value['menu_item_id'], true); /* If this menu item has children, just point it to nowhere */ if(is_array($children)) { $isParent = TRUE; ! $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article" WHERE menu_item_id='.$value['menu_item_id'], true); } /* otherwise, delete it */ else ! $GLOBALS['core']->sqlDelete('mod_menuman_items', 'menu_item_id', $item['menu_item_id']); } unset($_SESSION['OBJ_menuman']); } ! $title = '<div class="errortext">'.$_SESSION['translate']->it('Article Deleted').'!</div>'; ! $content = $_SESSION['translate']->it('The [var1] <b>[var2]</b> has successfully been [var3]' , $_SESSION['translate']->it('article') , $this->title ! , '<b>'.$_SESSION['translate']->it('deleted').'</b>!') ! . '<br /><br />'; if (isset($isParent)) ! $content .= $_SESSION['translate']->it('Some menu links could not be removed') . '.'; else ! $content .= $_SESSION['translate']->it('All menu links removed') . '.'; $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); } else if(isset($_POST['no'])) { ! $title = '<div class="errortext">'.$_SESSION['translate']->it('Article Kept').'!</div>'; ! $content = $_SESSION['translate']->it('The [var1] <b>[var2]</b> has successfully been [var3]' ! , $_SESSION['translate']->it('article'), $this->title, '<b>'.$_SESSION['translate']->it('kept').'</b>!'); $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); } else { ! $title = '<div class="errortext">'.$_SESSION['translate']->it('Confirm Action').'!</div>'; ! $content = $_SESSION['translate']->it('Are you sure you want to <b>[var1] "[var2]"</b>?' ! , $_SESSION['translate']->it('delete'), $this->title); $myform[0] = $GLOBALS['core']->formHidden('module', 'article'); ! $myform[0] .= $GLOBALS['core']->formHidden('ARTICLE_id', $this->id); ! $myform[0] .= $GLOBALS['core']->formHidden('edit', 'delete'); ! $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Yes'), 'yes') . ' '; ! $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('No'), 'no'); $content .= $GLOBALS['core']->makeForm("ARTICLE_confirm_delete", "index.php", $myform, "post", 0, 0); |
Update of /cvsroot/phpwebsite-comm/modules/article/templates/section In directory sc8-pr-cvs1:/tmp/cvs-serv30555/templates/section Added Files: Centered Image.tpl Image Block Left.tpl Image Block Right.tpl Image Wrap Left.tpl Image Wrap Right.tpl No Images.tpl Page Insertion (Fit Block).tpl Page Insertion (Fit Page).tpl Page Insertion (Max Page).tpl Page Insertion (Title is Size).tpl Text Only.tpl Log Message: Initial commit to CVS --- NEW FILE: Centered Image.tpl --- <!-- BEGIN IMAGE --> <div class="smalltext" align="center"> {IMAGE}<br /> {CAPTION} </div> <!-- END IMAGE --> <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> --- NEW FILE: Image Block Left.tpl --- <!-- BEGIN TABLE --> <table border="0" width="100%" cellpadding="4" cellspacing="0"> <tr valign="top"> <!-- BEGIN IMAGE --> <td style="text-align : center"> <br />{IMAGE} <div class="smalltext"> {CAPTION} </div> </td> <!-- END IMAGE --> <!-- BEGIN TITLE_TEXT --> <td> <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> </td> <!-- END TITLE_TEXT --> </tr> </table> <!-- END TABLE --> --- NEW FILE: Image Block Right.tpl --- <!-- BEGIN TABLE --> <table border="0" width="100%" cellpadding="4" cellspacing="0"> <tr valign="top"> <!-- BEGIN TITLE_TEXT --> <td> <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> </td> <!-- END TITLE_TEXT --> <!-- BEGIN IMAGE --> <td style="text-align : center"> <br />{IMAGE} <div class="smalltext"> {CAPTION} </div> </td> <!-- END IMAGE --> </tr> </table> <!-- END TABLE --> --- NEW FILE: Image Wrap Left.tpl --- <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN IMAGE --> <div style="float : left; margin-bottom : .5em; margin-right : 1em"> {IMAGE} <div class="smalltext" align="center"> {CAPTION} </div> </div> <!-- END IMAGE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> --- NEW FILE: Image Wrap Right.tpl --- <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN IMAGE --> <div style="float : right;margin-bottom : .5em; margin-left : 1em"> {IMAGE} <div class="smalltext" align="center"> {CAPTION} </div> </div> <!-- END IMAGE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> --- NEW FILE: No Images.tpl --- <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> --- NEW FILE: Page Insertion (Fit Block).tpl --- <!-- BEGIN PAGE INSERT --> <!-- BEGIN TABLE --> <table class="page" width="100%" cellpadding="4" cellspacing="0"> <tr> <!-- BEGIN IFRAME--> <td valign="top" align="left"> <iframe src="{TEXT}" width="100%"> Sorry! Your browser cannot display the page here." </iframe> </td> <!-- END IFRAME --> </tr> </table> <!-- END TABLE --> <script> function BrowserDetectLite() { var ua = navigator.userAgent.toLowerCase(); // browser name this.isGecko = (ua.indexOf('gecko') != -1); this.isMozilla = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length); this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); this.isIE = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); this.isOpera = (ua.indexOf("opera") != -1); this.isKonqueror = (ua.indexOf("konqueror") != -1); this.isIcab = (ua.indexOf("icab") != -1); this.isAol = (ua.indexOf("aol") != -1); this.isWebtv = (ua.indexOf("webtv") != -1); // spoofing and compatible browsers this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE); this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla); // browser version this.versionMinor = parseFloat(navigator.appVersion); // correct version number for NS6+ if (this.isNS && this.isGecko) { this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); } // correct version number for IE4+ else if (this.isIE && this.versionMinor >= 4) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); } // correct version number for Opera else if (this.isOpera) { if (ua.indexOf('opera/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) ); } } // correct version number for Konqueror else if (this.isKonqueror) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) ); } // correct version number for iCab else if (this.isIcab) { if (ua.indexOf('icab/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) ); } } // correct version number for WebTV else if (this.isWebtv) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) ); } this.versionMajor = parseInt(this.versionMinor); this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 ); // platform this.isWin = (ua.indexOf('win') != -1); this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) ); this.isMac = (ua.indexOf('mac') != -1); this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1) // specific browser shortcuts this.isNS4x = (this.isNS && this.versionMajor == 4); this.isNS40x = (this.isNS4x && this.versionMinor < 4.5); this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7); this.isNS4up = (this.isNS && this.versionMinor >= 4); this.isNS6x = (this.isNS && this.versionMajor == 6); this.isNS6up = (this.isNS && this.versionMajor >= 6); this.isIE4x = (this.isIE && this.versionMajor == 4); this.isIE4up = (this.isIE && this.versionMajor >= 4); this.isIE5x = (this.isIE && this.versionMajor == 5); this.isIE55 = (this.isIE && this.versionMinor == 5.5); this.isIE5up = (this.isIE && this.versionMajor >= 5); this.isIE6x = (this.isIE && this.versionMajor == 6); this.isIE6up = (this.isIE && this.versionMajor >= 6); this.isIE4xMac = (this.isIE4x && this.isMac); } var browser = new BrowserDetectLite(); function walkUp(node) { var currNode=node; var nextNode=node.parentNode; var rowHeight=0; var tableHeight=node.offsetHeight; var freeSpace=0; var totalTop=0; while(currNode != null) { if(currNode.nodeType == 1) { switch(currNode.tagName) { case "TR": rowHeight = currNode.offsetHeight; // remember break; case "TABLE": freeSpace += (rowHeight > tableHeight) ? rowHeight - tableHeight : 0; // accumulate tableHeight = currNode.offsetHeight; // remember totalTop += currNode.offsetTop; // accumulate break; case "TD": totalTop += currNode.offsetTop; default:; } // end switch } // end if currNode=currNode.parentNode; // walk up } // end while result = [totalTop,freeSpace]; return result; } function upsize(vsize) { var docIframes=document.getElementsByTagName('IFRAME'); var theIframe=docIframes[0]; switch(vsize) { case 0: // fit in current window result=walkUp(theIframe); if(browser.isIE6up && (document.childNodes.length > 1)) theIframe.height = document.documentElement.clientHeight - result[0] - 5; else if(browser.isIE5up) theIframe.height = document.body.clientHeight - result[0]; else if(browser.isNS6up || browser.isMozilla) theIframe.height = self.innerHeight - theIframe.offsetTop; scrollTo(0,0); break; case 1: // match current document body result=walkUp(theIframe); theIframe.height = theIframe.offsetHeight + result[1]; break; default: theIframe.height = vsize; } // end switch(vsize) // alert(browser.isMozilla); } /* end upsize() */ upsize(1); </script> <!-- END PAGE INSERT --> --- NEW FILE: Page Insertion (Fit Page).tpl --- <!-- BEGIN PAGE INSERT --> <!-- BEGIN TABLE --> <table class="page" width="100%" cellpadding="4" cellspacing="0"> <tr> <!-- BEGIN IFRAME--> <td valign="top" align="left"> <iframe src="{TEXT}" width="100%"> Sorry! Your browser cannot display the page here." </iframe> </td> <!-- END IFRAME --> </tr> </table> <!-- END TABLE --> <script> function BrowserDetectLite() { var ua = navigator.userAgent.toLowerCase(); // browser name this.isGecko = (ua.indexOf('gecko') != -1); this.isMozilla = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length); this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); this.isIE = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); this.isOpera = (ua.indexOf("opera") != -1); this.isKonqueror = (ua.indexOf("konqueror") != -1); this.isIcab = (ua.indexOf("icab") != -1); this.isAol = (ua.indexOf("aol") != -1); this.isWebtv = (ua.indexOf("webtv") != -1); // spoofing and compatible browsers this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE); this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla); // browser version this.versionMinor = parseFloat(navigator.appVersion); // correct version number for NS6+ if (this.isNS && this.isGecko) { this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); } // correct version number for IE4+ else if (this.isIE && this.versionMinor >= 4) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); } // correct version number for Opera else if (this.isOpera) { if (ua.indexOf('opera/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) ); } } // correct version number for Konqueror else if (this.isKonqueror) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) ); } // correct version number for iCab else if (this.isIcab) { if (ua.indexOf('icab/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) ); } } // correct version number for WebTV else if (this.isWebtv) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) ); } this.versionMajor = parseInt(this.versionMinor); this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 ); // platform this.isWin = (ua.indexOf('win') != -1); this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) ); this.isMac = (ua.indexOf('mac') != -1); this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1) // specific browser shortcuts this.isNS4x = (this.isNS && this.versionMajor == 4); this.isNS40x = (this.isNS4x && this.versionMinor < 4.5); this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7); this.isNS4up = (this.isNS && this.versionMinor >= 4); this.isNS6x = (this.isNS && this.versionMajor == 6); this.isNS6up = (this.isNS && this.versionMajor >= 6); this.isIE4x = (this.isIE && this.versionMajor == 4); this.isIE4up = (this.isIE && this.versionMajor >= 4); this.isIE5x = (this.isIE && this.versionMajor == 5); this.isIE55 = (this.isIE && this.versionMinor == 5.5); this.isIE5up = (this.isIE && this.versionMajor >= 5); this.isIE6x = (this.isIE && this.versionMajor == 6); this.isIE6up = (this.isIE && this.versionMajor >= 6); this.isIE4xMac = (this.isIE4x && this.isMac); } var browser = new BrowserDetectLite(); function walkUp(node) { var currNode=node; var nextNode=node.parentNode; var rowHeight=0; var tableHeight=node.offsetHeight; var freeSpace=0; var totalTop=0; while(currNode != null) { if(currNode.nodeType == 1) { switch(currNode.tagName) { case "TR": rowHeight = currNode.offsetHeight; // remember break; case "TABLE": freeSpace += (rowHeight > tableHeight) ? rowHeight - tableHeight : 0; // accumulate tableHeight = currNode.offsetHeight; // remember totalTop += currNode.offsetTop; // accumulate break; case "TD": totalTop += currNode.offsetTop; default:; } // end switch } // end if currNode=currNode.parentNode; // walk up } // end while result = [totalTop,freeSpace]; return result; } function upsize(vsize) { var docIframes=document.getElementsByTagName('IFRAME'); var theIframe=docIframes[0]; switch(vsize) { case 0: // fit in current window result=walkUp(theIframe); if(browser.isIE6up && (document.childNodes.length > 1)) theIframe.height = document.documentElement.clientHeight - result[0] - 5; else if(browser.isIE5up) theIframe.height = document.body.clientHeight - result[0]; else if(browser.isNS6up || browser.isMozilla) theIframe.height = self.innerHeight - theIframe.offsetTop; scrollTo(0,0); break; case 1: // match current document body result=walkUp(theIframe); theIframe.height = theIframe.offsetHeight + result[1]; break; default: theIframe.height = vsize; } // end switch(vsize) // alert(browser.isMozilla); } /* end upsize() */ upsize(0); </script> <!-- END PAGE INSERT --> --- NEW FILE: Page Insertion (Max Page).tpl --- <!-- BEGIN PAGE INSERT --> <!-- BEGIN TABLE --> <table class="page" width="100%" cellpadding="4" cellspacing="0"> <tr> <!-- BEGIN IFRAME--> <td valign="top" align="left"> <iframe src="{TEXT}" width="100%"> Sorry! Your browser cannot display the page here." </iframe> </td> <!-- END IFRAME --> </tr> </table> <!-- END TABLE --> <script> function BrowserDetectLite() { var ua = navigator.userAgent.toLowerCase(); // browser name this.isGecko = (ua.indexOf('gecko') != -1); this.isMozilla = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length); this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); this.isIE = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); this.isOpera = (ua.indexOf("opera") != -1); this.isKonqueror = (ua.indexOf("konqueror") != -1); this.isIcab = (ua.indexOf("icab") != -1); this.isAol = (ua.indexOf("aol") != -1); this.isWebtv = (ua.indexOf("webtv") != -1); // spoofing and compatible browsers this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE); this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla); // browser version this.versionMinor = parseFloat(navigator.appVersion); // correct version number for NS6+ if (this.isNS && this.isGecko) { this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); } // correct version number for IE4+ else if (this.isIE && this.versionMinor >= 4) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); } // correct version number for Opera else if (this.isOpera) { if (ua.indexOf('opera/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) ); } } // correct version number for Konqueror else if (this.isKonqueror) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) ); } // correct version number for iCab else if (this.isIcab) { if (ua.indexOf('icab/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) ); } } // correct version number for WebTV else if (this.isWebtv) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) ); } this.versionMajor = parseInt(this.versionMinor); this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 ); // platform this.isWin = (ua.indexOf('win') != -1); this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) ); this.isMac = (ua.indexOf('mac') != -1); this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1) // specific browser shortcuts this.isNS4x = (this.isNS && this.versionMajor == 4); this.isNS40x = (this.isNS4x && this.versionMinor < 4.5); this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7); this.isNS4up = (this.isNS && this.versionMinor >= 4); this.isNS6x = (this.isNS && this.versionMajor == 6); this.isNS6up = (this.isNS && this.versionMajor >= 6); this.isIE4x = (this.isIE && this.versionMajor == 4); this.isIE4up = (this.isIE && this.versionMajor >= 4); this.isIE5x = (this.isIE && this.versionMajor == 5); this.isIE55 = (this.isIE && this.versionMinor == 5.5); this.isIE5up = (this.isIE && this.versionMajor >= 5); this.isIE6x = (this.isIE && this.versionMajor == 6); this.isIE6up = (this.isIE && this.versionMajor >= 6); this.isIE4xMac = (this.isIE4x && this.isMac); } var browser = new BrowserDetectLite(); function fullScreen() { window.resizeTo(screen.width-10,screen.height-55); window.moveTo(5,5); } function walkUp(node) { var currNode=node; var nextNode=node.parentNode; var rowHeight=0; var tableHeight=node.offsetHeight; var freeSpace=0; var totalTop=0; while(currNode != null) { if(currNode.nodeType == 1) { switch(currNode.tagName) { case "TR": rowHeight = currNode.offsetHeight; // remember break; case "TABLE": freeSpace += (rowHeight > tableHeight) ? rowHeight - tableHeight : 0; // accumulate tableHeight = currNode.offsetHeight; // remember totalTop += currNode.offsetTop; // accumulate break; case "TD": totalTop += currNode.offsetTop; default:; } // end switch } // end if currNode=currNode.parentNode; // walk up } // end while result = [totalTop,freeSpace]; return result; } function upsize(vsize) { var docIframes=document.getElementsByTagName('IFRAME'); var theIframe=docIframes[0]; switch(vsize) { case 0: // fit in current window result=walkUp(theIframe); if(browser.isIE6up && (document.childNodes.length > 1)) theIframe.height = document.documentElement.clientHeight - result[0] - 5; else if(browser.isIE5up) theIframe.height = document.body.clientHeight - result[0]; else if(browser.isNS6up || browser.isMozilla) theIframe.height = self.innerHeight - theIframe.offsetTop; scrollTo(0,0); break; case 1: // match current document body result=walkUp(theIframe); theIframe.height = theIframe.offsetHeight + result[1]; break; default: theIframe.height = vsize; } // end switch(vsize) // alert(screen.width); } /* end upsize() */ fullScreen(); upsize(0); </script> <!-- END PAGE INSERT --> --- NEW FILE: Page Insertion (Title is Size).tpl --- <!-- BEGIN PAGE INSERT --> <!-- BEGIN TABLE --> <table class="page" width="100%" cellpadding="4" cellspacing="0"> <tr> <!-- BEGIN IFRAME--> <td valign="top" align="left"> <iframe src="{TEXT}" width="100%"> Sorry! Your browser cannot display the page here." </iframe> </td> <!-- END IFRAME --> </tr> </table> <!-- END TABLE --> <script> function BrowserDetectLite() { var ua = navigator.userAgent.toLowerCase(); // browser name this.isGecko = (ua.indexOf('gecko') != -1); this.isMozilla = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length); this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); this.isIE = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); this.isOpera = (ua.indexOf("opera") != -1); this.isKonqueror = (ua.indexOf("konqueror") != -1); this.isIcab = (ua.indexOf("icab") != -1); this.isAol = (ua.indexOf("aol") != -1); this.isWebtv = (ua.indexOf("webtv") != -1); // spoofing and compatible browsers this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE); this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla); // browser version this.versionMinor = parseFloat(navigator.appVersion); // correct version number for NS6+ if (this.isNS && this.isGecko) { this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); } // correct version number for IE4+ else if (this.isIE && this.versionMinor >= 4) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); } // correct version number for Opera else if (this.isOpera) { if (ua.indexOf('opera/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) ); } } // correct version number for Konqueror else if (this.isKonqueror) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) ); } // correct version number for iCab else if (this.isIcab) { if (ua.indexOf('icab/') != -1) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) ); } else { this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) ); } } // correct version number for WebTV else if (this.isWebtv) { this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) ); } this.versionMajor = parseInt(this.versionMinor); this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 ); // platform this.isWin = (ua.indexOf('win') != -1); this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) ); this.isMac = (ua.indexOf('mac') != -1); this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1) // specific browser shortcuts this.isNS4x = (this.isNS && this.versionMajor == 4); this.isNS40x = (this.isNS4x && this.versionMinor < 4.5); this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7); this.isNS4up = (this.isNS && this.versionMinor >= 4); this.isNS6x = (this.isNS && this.versionMajor == 6); this.isNS6up = (this.isNS && this.versionMajor >= 6); this.isIE4x = (this.isIE && this.versionMajor == 4); this.isIE4up = (this.isIE && this.versionMajor >= 4); this.isIE5x = (this.isIE && this.versionMajor == 5); this.isIE55 = (this.isIE && this.versionMinor == 5.5); this.isIE5up = (this.isIE && this.versionMajor >= 5); this.isIE6x = (this.isIE && this.versionMajor == 6); this.isIE6up = (this.isIE && this.versionMajor >= 6); this.isIE4xMac = (this.isIE4x && this.isMac); } var browser = new BrowserDetectLite(); function walkUp(node) { var currNode=node; var nextNode=node.parentNode; var rowHeight=0; var tableHeight=node.offsetHeight; var freeSpace=0; var totalTop=0; while(currNode != null) { if(currNode.nodeType == 1) { switch(currNode.tagName) { case "TR": rowHeight = currNode.offsetHeight; // remember break; case "TABLE": freeSpace += (rowHeight > tableHeight) ? rowHeight - tableHeight : 0; // accumulate tableHeight = currNode.offsetHeight; // remember totalTop += currNode.offsetTop; // accumulate break; case "TD": totalTop += currNode.offsetTop; default:; } // end switch } // end if currNode=currNode.parentNode; // walk up } // end while result = [totalTop,freeSpace]; return result; } function upsize(vsize) { var docIframes=document.getElementsByTagName('IFRAME'); var theIframe=docIframes[0]; switch(vsize) { case 0: // fit in current window result=walkUp(theIframe); if(browser.isIE6up && (document.childNodes.length > 1)) theIframe.height = document.documentElement.clientHeight - result[0] - 5; else if(browser.isIE5up) theIframe.height = document.body.clientHeight - result[0]; else if(browser.isNS6up || browser.isMozilla) theIframe.height = self.innerHeight - theIframe.offsetTop; scrollTo(0,0); break; case 1: // match current document body result=walkUp(theIframe); theIframe.height = theIframe.offsetHeight + result[1]; break; default: theIframe.height = vsize; } // end switch(vsize) // alert(browser.isMozilla); } /* end upsize() */ upsize({TITLE}); </script> <!-- END PAGE INSERT --> --- NEW FILE: Text Only.tpl --- <!-- BEGIN TITLE --> <h3>{TITLE}</h3> <!-- END TITLE --> <!-- BEGIN IMAGE --> <div style="float : right;margin-bottom : .5em; margin-left : 1em"> {IMAGE} <div class="smalltext" align="center"> {CAPTION} </div> </div> <!-- END IMAGE --> <!-- BEGIN TEXT --> {TEXT} <!-- END TEXT --> |
From: <ada...@us...> - 2003-07-09 20:24:32
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/edit In directory sc8-pr-cvs1:/tmp/cvs-serv30555/templates/edit Added Files: article.tpl settings.tpl title.tpl Log Message: Initial commit to CVS --- NEW FILE: article.tpl --- <div align="center">{LINK_BACK}</div> <!-- BEGIN TITLE --> <div class="bg_medium"> <b>{TITLE_LABEL} {TITLE}</b> </div> <!-- END TITLE --> <!-- BEGIN CONTENT --> {SUMMARY_LABEL}<br /> {SUMMARYTEXT}<br /> {SECTIONS}<br /> <!-- END CONTENT --> <!-- BEGIN FOOTER --> <div align="center" class="bg_medium"> <b>{PAGE_SETTINGS_LABEL}</b> </div> <div class="bg_light"> <!-- BEGIN SETTINGS --> {TEMPLATE_LABEL} {TEMPLATE}<br /> {COMMENTS_LABEL} {COMMENTS_YES} {COMMENTS_NO}<br /> {ANON_LABEL} {ANON_YES} {ANON_NO}<br /> {PUBLICATION_LABEL} {PUBLICATION_DATE}<br /> {EXPIRATION_LABEL} {EXPIRATION_DATE} {EXPIRATION_FLAG}<br /> <!-- END SETTINGS --> <table border="0" width="100%" cellpadding="4" cellspacing="0"> <tr> <td valign="top"> {CATEGORY_LABEL} <br /> {CATEGORY} <br /> </td> <td valign="top"> {GROUP_LABEL} <br /> {GROUP} <br /> </td> </tr> </table> <!-- BEGIN INFO --> <div align="center" class="bg_medium"> <b>{INFORMATION_LABEL}</b> </div> {CREATED_TEXT}<br /> {UPDATED_TEXT}<br /> </div> <!-- END INFO --> <center> {SAVE_WARNING} {SAVE_BUTTON} {CANCEL_BUTTON} <center> <!-- END FOOTER --> --- NEW FILE: settings.tpl --- <!-- BEGIN FOOTER --> <div align="center" class="bg_medium"> <b>{PAGE_SETTINGS_LABEL}</b> </div> <div class="bg_light"> <!-- BEGIN SETTINGS --> {TEMPLATE_LABEL} {TEMPLATE}<br /> {ANNOUNCE_LABEL}<br /> {COMMENTS_LABEL}<br /> {ANON_LABEL}<br /> {PUBLICATION_LABEL} {PUBLICATION_DATE}<br /> {EXPIRATION_LABEL} {EXPIRATION_DATE} {EXPIRATION_FLAG}<br /> <!-- END SETTINGS --> <table border="0" width="100%" cellpadding="4" cellspacing="0"> <tr> <td valign="top"> {CATEGORY_LABEL} <br /> {CATEGORY} <br /> </td> <td valign="top"> {GROUP_LABEL} <br /> {GROUP} <br /> </td> </tr> </table> <!-- BEGIN INFO --> <div align="center" class="bg_medium"> <b>{INFORMATION_LABEL}</b> </div> {CREATED_TEXT}<br /> {UPDATED_TEXT}<br /> </div> <!-- END INFO --> <center> {SAVE_WARNING} {SAVE_BUTTON} {CANCEL_BUTTON} <center> <!-- END FOOTER --> --- NEW FILE: title.tpl --- <div align="center">{LINK_BACK}</div> <!-- BEGIN TITLE --> <div class="bg_medium"> <b>{TITLE_LABEL} {TITLE}</b> </div> <!-- END TITLE --> <!-- BEGIN CONTENT --> {SUMMARY_LABEL}<br /> {SUMMARYTEXT}<br /> <!-- END CONTENT --> |
Update of /cvsroot/phpwebsite-comm/modules/article/templates In directory sc8-pr-cvs1:/tmp/cvs-serv30555/templates Added Files: config.tpl listing.tpl listing_row.tpl menu.tpl pager.tpl summary_view.tpl Log Message: Initial commit to CVS --- NEW FILE: config.tpl --- <!-- BEGIN CONTENT --> <b>{GEN_HEADER}</b> <br /> <br /> {SUMMARIES_ON_HOMEPAGE} <br /> {POPULAR_ARTICLES} <br /> {PREV_N_ARTICLES} <br /> {LISTINGS_PER_PAGE} <br /> {MAKE_METATAGS} <br /> {RESTRICTED_VIEWING} <br /> <br /> <b>{ARTICLE_HEADER}</b> <br /> <br /> {DEFAULT_ARTICLE_TEMPLATE} <br /> {DEFAULT_SECTION_TEMPLATE} <br /> {LOCK_EXPIRATION_TIME} <br /> {NEED_APPROVAL} <br /> {DEFAULT_ALLOW_COMMENTS} <br /> {DEFAULT_ALLOW_ANON} <br /> {CAN_EXPIRE} <br /> {EXPIRATION_LABEL} <br /> <br /> {DEFAULT_YEAR_COUNT} <br /> <br /> <b>{USERS_HEADER}</b>- {USERS_LABEL}: <br /> <br /> {USERS_CAN_SUBMIT} <br /> {USERS_SELECT_ARTICLE_TPL} <br /> {USERS_SELECT_SECTION_TPL} <br /> {USERS_ALLOW_COMMENTS} <br /> {USERS_CHANGE_DATES} <br /> {USER_IMAGES_IN_ARTICLE} <br /> {USER_UPLOAD_IMAGES} <br /> <br /> <b>{IMAGE_HEADER}</b> <br /> <br /> {MAX_IMAGE_SIZE} <br /> {MAX_IMAGE_HEIGHT} <br /> {MAX_IMAGE_WIDTH} <br /> <br /> <center> {SAVE}          {RESET} </center> <!-- END CONTENT --> --- NEW FILE: listing.tpl --- <!-- BEGIN CONTENT --> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="100%" class="bg_dark" align="center"> {TITLE} </td> <td class="bg_dark" nowrap> {HOME_FLAG} </td> <td class="bg_dark" align="center"> {DATE} </td> <td colspan="3" align="center" class="bg_dark"> {ACTION} </td> </tr> {LIST_ROWS} </table> <div class="smalltext" align="center"> {PAGE_BACKWARD_LINK} {SECTION_LINKS} {PAGE_FORWARD_LINK}<br /> {SECTION_INFO}<br /> {LIMIT_LINKS_LABEL}: {LIMIT_LINKS} </div> <!-- END CONTENT --> --- NEW FILE: listing_row.tpl --- <!-- BEGIN CONTENT --> <tr> <td width="100%"{BG}> {ARTICLE_TITLE} </td> <td align="center"{BG}> {HOME_FLAG} </td> <td align="center"{BG} nowrap> {DATE} </td> <td{BG}> {PUB_EXP} </td> <td{BG}> {EDIT} </td> <td{BG}> {DELETE} </td> </tr> <!-- END CONTENT --> --- NEW FILE: menu.tpl --- <!-- BEGIN CONTENT --> <center> {SEARCHQUERY} <br /> <br /> {BTN_CREATE} {BTN_CONFIG_EDIT} {BTN_IMG_LIB} </center> <!-- END CONTENT --> --- NEW FILE: pager.tpl --- <!-- BEGIN CONTENT --> <div class="smalltext" align="center"> {ALPHABET}<br /> {PAGE_BACKWARD_LINK} {SECTION_LINKS} {PAGE_FORWARD_LINK}<br /> {SECTION_INFO}<br /> {LIMIT_LINKS_LABEL}: {LIMIT_LINKS} </div> <!-- END CONTENT --> --- NEW FILE: summary_view.tpl --- <!-- BEGIN TITLE --> {TITLE_LINK} <div class="smalltext"> Posted by {CREATED_USER} on {CREATED_DATE} (Read: {HITS} times) </div> <!-- END TITLE --> <!-- BEGIN CONTENT --> <!-- BEGIN CATEGORIES --> <div style="float : right;"> {CATEGORY} </div> <!-- END CATEGORIES --> <!-- BEGIN SUMMARY --> <br /> {SUMMARYTEXT} <!-- END SUMMARY --> <div class="smalltext" style="clear : both;" align="right"> <br /> {READMORE} {MOREWORDS} - {MOREPAGES} {EDIT} {DELETE} {NUM_COMMENTS} {PRINT_ICON} {EMAIL} <br /> </div> <hr /> <br /> <!-- END CONTENT --> |
From: <ada...@us...> - 2003-07-09 20:24:31
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/article/Dated In directory sc8-pr-cvs1:/tmp/cvs-serv30555/templates/article/Dated Added Files: content.tpl title.tpl Log Message: Initial commit to CVS --- NEW FILE: content.tpl --- <!-- BEGIN NAVIGATION --> <div class="smalltext" align="right"> {NAVBAR} </div> <!-- END NAVIGATION --> <!-- BEGIN SUMMARY --> <div class="smalltext"> <i>{SUMMARYTEXT}</i> </div> <br /> <!-- END SUMMARY --> <!-- BEGIN CONTENT --> {BODYTEXT} <!-- END CONTENT --> <!-- BEGIN PAGETURN --> <br /> <br /> <div style="float: left; text-align: left;">{PREV}</div> <div style="float: right; text-align: right;">{NEXT}</div> <div style="text-align: center;">{NAVBAR}</div> <br /><center>{NAVLIST}</center> <!-- END PAGETURN --> <!-- BEGIN DATEINFO --> <div class="smalltext" align="right"> {CREATED_TEXT}<br /> {UPDATED_TEXT}<br /> {PRINT_ICON} </div> <!-- END DATEINFO --> --- NEW FILE: title.tpl --- {TITLE} |
From: <ada...@us...> - 2003-07-09 20:24:31
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/article/Byline In directory sc8-pr-cvs1:/tmp/cvs-serv30555/templates/article/Byline Added Files: content.tpl title.tpl Log Message: Initial commit to CVS --- NEW FILE: content.tpl --- <!-- BEGIN SUMMARY --> <div class="smalltext"> <i>{SUMMARYTEXT}</i> </div> <br /> <!-- END SUMMARY --> <!-- BEGIN CONTENT --> {BODYTEXT} <!-- END CONTENT --> <!-- BEGIN PAGETURN --> <br /> <br /> <div style="float: left; text-align: left;">{PREV}</div> <div style="float: right; text-align: right;">{NEXT}</div> <div style="text-align: center;">{NAVBAR}</div> <br /><center>{NAVLIST}</center> <!-- END PAGETURN --> --- NEW FILE: title.tpl --- {TITLE} <table class="smalltext" width="100%" border="0"> <tr> <td>by {CREATED_USER} on {CREATED_DATE}</td> <td><div align="right">{NAVBAR}</div></td> </tr> </table> |
From: <ada...@us...> - 2003-07-09 20:24:30
|
Update of /cvsroot/phpwebsite-comm/modules/article/templates/article/Blank In directory sc8-pr-cvs1:/tmp/cvs-serv30555/templates/article/Blank Added Files: content.tpl title.tpl Log Message: Initial commit to CVS --- NEW FILE: content.tpl --- <!-- BEGIN NAVIGATION --> <div class="smalltext" align="right"> {NAVBAR} </div> <!-- END NAVIGATION --> <!-- BEGIN SUMMARY --> <div class="smalltext"> <i>{SUMMARYTEXT}</i> </div> <br /> <!-- END SUMMARY --> <!-- BEGIN CONTENT --> {BODYTEXT} <!-- END CONTENT --> <!-- BEGIN PAGETURN --> <br /> <br /> <div style="float: left; text-align: left;">{PREV}</div> <div style="float: right; text-align: right;">{NEXT}</div> <div style="text-align: center;">{NAVBAR}</div> <br /><center>{NAVLIST}</center> <!-- END PAGETURN --> --- NEW FILE: title.tpl --- {TITLE} |
From: <ada...@us...> - 2003-07-09 20:24:30
|
Update of /cvsroot/phpwebsite-comm/modules/article In directory sc8-pr-cvs1:/tmp/cvs-serv30555 Added Files: index.php Log Message: Initial commit to CVS --- NEW FILE: index.php --- <?php /** * This is the index file for the article module. * * @author Eloi George <el...@NO...> * @module Article Manager */ /* Display the homepage if requested */ if($GLOBALS['module']=='home') { $_SESSION['SES_ART_master'] = new PHPWS_ArticleManager; $_SESSION['SES_ART_master']->show_mainarticle(); $_SESSION['SES_ART_master']->view_summaries(); $_SESSION['SES_ART_master']->view_popular(); return; } /* Script to reroute pagemaster pages... */ elseif ($GLOBALS['module']=='pagemaster' && !isset($_SESSION['SES_PM_master'])) { include (PHPWS_HOME_DIR . 'convert/reroute/pagemaster.AM'); $_REQUEST['view'] = $convert[$_REQUEST['PAGE_id']]; } /* Script to reroute announcements... */ elseif (($GLOBALS['module']=='announce') && !isset($_SESSION['SES_ANN_MANAGER'])) { include (PHPWS_HOME_DIR . 'convert/reroute/announce.AM'); $_REQUEST['view'] = $convert[$_REQUEST['ANN_id']]; } /* Don't process the rest if the request isn't for this module... */ elseif ($GLOBALS['module'] != 'article') return; /* Make sure the helper class is activated and up to date*/ if (!$_SESSION['SES_ART_master']) $_SESSION['SES_ART_master'] = new PHPWS_ArticleManager; $user = &$_SESSION['SES_ART_master']; /* Determine the command to be executed */ if (isset($_REQUEST['view'])) { $temp = new PHPWS_Article($_REQUEST['view']); $temp->view(); /* Increment the articleview counter */ $temp->increment_counter($_REQUEST['view']); unset($temp); return; } /* The rest of this module's functions are off-limits to non-users */ elseif (!$_SESSION['OBJ_user']->isUser()) { $GLOBALS['CNT_article']['title'] = 'Article Manager'; $GLOBALS['CNT_article']['content'] = $_SESSION['translate']->it('Members get to do fun stuff! Login or Register today!') . '<br />'; return; } /* Process any form button submissions */ if (isset($_REQUEST['ARTICLE_vars'])) { list($command,) = each($_REQUEST['ARTICLE_vars']); $pos = strpos($command, ':'); $_REQUEST[substr($command,0,$pos)] = substr($command,$pos+1); } /* Start processing module operation requests */ if (isset($_REQUEST['disp'])) { switch($_REQUEST['disp']) { case 'main_menu': $_SESSION['SES_ART_master']->main_menu(); case 'list': $_SESSION['SES_ART_master']->list_articles(); break; case 'news': $_SESSION['SES_ART_master']->list_news(); break; } } elseif (isset($_REQUEST['edit'])) { switch($_REQUEST['edit']) { case 'cancel': $_SESSION['SES_ART_article']->setEditLock(FALSE); $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); break; case 'create': $_SESSION['SES_ART_article'] = new PHPWS_Article(); if ($user->can('create')) $_SESSION['SES_ART_article']->edit_article(); break; case 'save': $_SESSION['SES_ART_master']->main_menu(); if ($user->can('create') || $user->can('edit',$_SESSION['SES_ART_article']->author)) { $_SESSION['SES_ART_article']->update_settings(); $_SESSION['SES_ART_article']->save(); $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_section']=null; } $_SESSION['SES_ART_master']->list_articles(); break; case 'delete': $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($user->can('delete',$_SESSION['SES_ART_article']->author)) $_SESSION['SES_ART_article']->delete_article(); $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->list_articles(); break; case 'expire': $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) $_SESSION['SES_ART_article']->expire(); $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); break; case 'publish': $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['ARTICLE_id']); if ($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) $_SESSION['SES_ART_article']->publish(); $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); break; case 'set_main': if ($_SESSION['OBJ_user']->allow_access('article', 'set_mainarticle')) $_SESSION['SES_ART_master']->set_main_article(); $_SESSION['SES_ART_article']=null; $_SESSION['SES_ART_master']->main_menu(); $_SESSION['SES_ART_master']->list_articles(); break; case 'save_title': if ($user->can('edit',$_SESSION['SES_ART_article']->author)) { $_SESSION['SES_ART_article']->update_title(); $_SESSION['SES_ART_article']->edit_article($_SESSION['SES_ART_section']->id); } break; /* If none of the above commands were given, edit the identified article */ default: $_SESSION['SES_ART_article'] = new PHPWS_Article($_REQUEST['edit']); if ($user->can('edit',$_SESSION['SES_ART_article']->author)) $_SESSION['SES_ART_article']->edit_article(); break; } return; } elseif (isset($_REQUEST['section'])) { switch($_REQUEST['section']) { case 'save': $_SESSION['SES_ART_section']->update(); break; case 'edit': $_SESSION['SES_ART_article']->edit_article($_REQUEST['SECT_id']); return; break; case 'remove': $_SESSION['SES_ART_article']->remove_section($_REQUEST['SECT_id']); break; case 'move_up': if ($_REQUEST['SECT_id']!=reset($_SESSION['SES_ART_article']->order)) $_SESSION['SES_ART_article']->move_section($_REQUEST['SECT_id'], true); break; case 'move_down': if ($_REQUEST['SECT_id']!=end($_SESSION['SES_ART_article']->order)) $_SESSION['SES_ART_article']->move_section($_REQUEST['SECT_id'], false); break; } $_SESSION['SES_ART_article']->update_title(); if ($_SESSION['SES_ART_error']) $_SESSION['SES_ART_article']->edit_article($_SESSION['SES_ART_section']->id); else $_SESSION['SES_ART_article']->edit_article(); return; } elseif (isset($_REQUEST['config'])) { $_SESSION['SES_ART_master']->main_menu(); switch($_REQUEST['config']) { case 'edit': if ($_SESSION['OBJ_user']->allow_access('article', 'global_config_prefs')) $_SESSION['SES_ART_master']->edit_configuration(); break; case 'save': if ($_SESSION['OBJ_user']->allow_access('article', 'global_config_prefs')) $_SESSION['SES_ART_master']->save_configuration(); $_SESSION['SES_ART_master'] = new PHPWS_ArticleManager; $_SESSION['SES_ART_master']->list_articles(); break; case 'reset': if ($_SESSION['OBJ_user']->allow_access('article', 'global_config_prefs')) $_SESSION['SES_ART_master']->reset_configuration(); $_SESSION['SES_ART_master'] = new PHPWS_ArticleManager; $_SESSION['SES_ART_master']->list_articles(); break; case 'image_library': if ($_SESSION['OBJ_user']->allow_access('article', 'images_in_library')) $_SESSION['SES_ART_master']->manage_library(); break; case 'save_library_item': if ($_SESSION['OBJ_user']->allow_access('article', 'images_in_library')) $_SESSION['SES_ART_master']->save_lib_item(); $_SESSION['SES_ART_master']->manage_library(); break; case 'delete_library_item': if ($_SESSION['OBJ_user']->allow_access('article', 'images_in_library')) $_SESSION['SES_ART_master']->del_lib_item($_POST['LIB_image']); $_SESSION['SES_ART_master']->manage_library(); break; case 'import_pagemaster': include(PHPWS_SOURCE_DIR . 'mod/article/inc/importPM.php'); break; case 'import_announce': include(PHPWS_SOURCE_DIR . 'mod/article/inc/importANN.php'); break; } return; } ?> |
From: <ada...@us...> - 2003-07-09 20:24:29
|
Update of /cvsroot/phpwebsite-comm/modules/article/inc In directory sc8-pr-cvs1:/tmp/cvs-serv30555/inc Added Files: editconfig.php importANN.php importPM.php saveconfig.php Log Message: Initial commit to CVS --- NEW FILE: editconfig.php --- <?php /** * This is the configuration editing file for the article module. * * Edits the module's default settings. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ /* Section Headers */ $tags['GEN_HEADER'] = $_SESSION['translate']->it('General Settings'); $tags['ARTICLE_HEADER'] = $_SESSION['translate']->it('Article Settings'); $tags['USERS_HEADER'] = $_SESSION['translate']->it('User Settings'); $tags['IMAGE_HEADER'] = $_SESSION['translate']->it('Image Settings'); /* Get the Default Page Template */ $article_tpl_array = $GLOBALS['core']->listTemplates('article',true,'article'); if (is_array($article_tpl_array)) { /* Sort the list */ asort($article_tpl_array); $tags['DEFAULT_ARTICLE_TEMPLATE'] = $GLOBALS['core']->formSelect('CONFIG_default_article_template', $article_tpl_array, $this->val['default_article_template'], true, NULL, NULL) . ' ' . $_SESSION['translate']->it('Default page template') . $_SESSION['OBJ_help']->show_link('article', 'article_template'); } /* Get the Default Section Template */ $sect_tpl_array = $GLOBALS['core']->listTemplates('article',false,'section'); if (is_array($sect_tpl_array)) { /* Strip the extensions off for readability */ $sect_tpl_array = str_replace('.tpl', NULL, $sect_tpl_array); /* Sort the list */ asort($sect_tpl_array); $tags['DEFAULT_SECTION_TEMPLATE'] = $GLOBALS['core']->formSelect('CONFIG_default_section_template', $sect_tpl_array, $this->val['default_section_template'], true, NULL, NULL) . ' ' . $_SESSION['translate']->it('Default section template') . $_SESSION['OBJ_help']->show_link('article', 'section_template'); } /* summaries_on_homepage */ $tags['SUMMARIES_ON_HOMEPAGE'] = $GLOBALS['core']->formSelect('CONFIG_summaries_on_homepage', range(0,50) , $this->val['summaries_on_homepage'], NULL, NULL, NULL) . ' ' . $_SESSION['translate']->it('Number of summaries to show on the Home Page') . $_SESSION['OBJ_help']->show_link('article', 'summaries_on_homepage'); /* popular_articles */ $tags['POPULAR_ARTICLES'] = $GLOBALS['core']->formSelect('CONFIG_popular_articles', range(0,50) , $this->val['popular_articles'], NULL, NULL, NULL) . ' ' . $_SESSION['translate']->it('Number of links in the "Popular Articles" Block') . $_SESSION['OBJ_help']->show_link('article', 'popular_articles'); /* prev_n_articles */ $tags['PREV_N_ARTICLES'] = $GLOBALS['core']->formSelect('CONFIG_prev_n_articles', range(0,50) , $this->val['prev_n_articles'], NULL, NULL, NULL) . ' ' . $_SESSION['translate']->it('Number of links in the "Previous Articles" Block') . $_SESSION['OBJ_help']->show_link('article', 'prev_n_articles'); /* listings_per_page */ $tags['LISTINGS_PER_PAGE'] = $GLOBALS['core']->formSelect('CONFIG_listings_per_page', range(0,50) , $this->val['listings_per_page'], NULL, NULL, NULL) . ' ' . $_SESSION['translate']->it('Number of listings to show per page under the Main Menu') . $_SESSION['OBJ_help']->show_link('article', 'listings_per_page'); /* need_approval */ $tags['NEED_APPROVAL'] = $GLOBALS['core']->formCheckBox('CONFIG_need_approval',1,$this->val['need_approval'],NULL ,$_SESSION['translate']->it('Articles need approval before publication')) . $_SESSION['OBJ_help']->show_link('configmanager', 'need_approval'); /* default_allow_comments */ $tags['DEFAULT_ALLOW_COMMENTS'] = $GLOBALS['core']->formCheckBox('CONFIG_default_allow_comments',1 ,$this->val['default_allow_comments'],NULL ,$_SESSION['translate']->it('Comments are allowed by default')) . $_SESSION['OBJ_help']->show_link('configmanager', 'default_allow_comments'); /* default_allow_anon */ $tags['DEFAULT_ALLOW_ANON'] = $GLOBALS['core']->formCheckBox('CONFIG_default_allow_anon',1 ,$this->val['default_allow_anon'],NULL ,$_SESSION['translate']->it('Comments by unregistered users are allowed by default')) . $_SESSION['OBJ_help']->show_link('configmanager', 'default_allow_anon'); $tags['USERS_LABEL'] = $_SESSION['translate']->it('Registered users can'); /* users_can_submit */ $tags['USERS_CAN_SUBMIT'] = $GLOBALS['core']->formCheckBox('CONFIG_users_can_submit',1 ,$this->val['users_can_submit'],NULL ,$_SESSION['translate']->it('Submit articles')) . $_SESSION['OBJ_help']->show_link('configmanager', 'users_can_submit'); /* users_select_article_tpl */ $tags['USERS_SELECT_ARTICLE_TPL'] = $GLOBALS['core']->formCheckBox('CONFIG_users_select_article_tpl',1 ,$this->val['users_select_article_tpl'],NULL ,$_SESSION['translate']->it('Select article templates')) . $_SESSION['OBJ_help']->show_link('configmanager', 'users_select_article_tpl'); /* users_select_section_tpl */ $tags['USERS_SELECT_SECTION_TPL'] = $GLOBALS['core']->formCheckBox('CONFIG_users_select_section_tpl',1 ,$this->val['users_select_section_tpl'],NULL ,$_SESSION['translate']->it('Select section templates')) . $_SESSION['OBJ_help']->show_link('configmanager', 'users_select_section_tpl'); /* users_allow_comments */ $tags['USERS_ALLOW_COMMENTS'] = $GLOBALS['core']->formCheckBox('CONFIG_users_allow_comments',1 ,$this->val['users_allow_comments'],NULL ,$_SESSION['translate']->it('Allow/Disallow comments')) . $_SESSION['OBJ_help']->show_link('configmanager', 'users_allow_comments'); /* users_change_dates */ $tags['USERS_CHANGE_DATES'] = $GLOBALS['core']->formCheckBox('CONFIG_users_change_dates',1 ,$this->val['users_change_dates'],NULL ,$_SESSION['translate']->it('Set Publication Dates')) . $_SESSION['OBJ_help']->show_link('configmanager', 'users_change_dates'); /* user_images_in_article */ $tags['USER_IMAGES_IN_ARTICLE'] = $GLOBALS['core']->formCheckBox('CONFIG_user_images_in_article',1 ,$this->val['user_images_in_article'],NULL ,$_SESSION['translate']->it('Place images in articles')) . $_SESSION['OBJ_help']->show_link('configmanager', 'user_images_in_article'); /* user_upload_images */ $tags['USER_UPLOAD_IMAGES'] = $GLOBALS['core']->formCheckBox('CONFIG_user_upload_images',1 ,$this->val['user_upload_images'],NULL ,$_SESSION['translate']->it('Upload images to the site')) . $_SESSION['OBJ_help']->show_link('configmanager', 'user_upload_images'); /* can_expire */ $tags['CAN_EXPIRE'] = $GLOBALS['core']->formCheckBox('CONFIG_can_expire',1 ,$this->val['can_expire'],NULL ,$_SESSION['translate']->it('Articles can expire on a predefined date')) . $_SESSION['OBJ_help']->show_link('configmanager', 'can_expire'); /* expiration_years */ /* expiration_months */ /* expiration_days */ $tags['EXPIRATION_LABEL'] = $_SESSION['translate']->it('The default expiration date is [var1] years, [var2] months, and [var3] days from article creation.' , $GLOBALS['core']->formSelect('CONFIG_expiration_years', range(0,5), $this->val['expiration_years'], NULL, NULL, NULL) , $GLOBALS['core']->formSelect('CONFIG_expiration_months', range(0,11), $this->val['expiration_months'], NULL, NULL, NULL) , $GLOBALS['core']->formSelect('CONFIG_expiration_days', range(0,31), $this->val['expiration_days'], NULL, NULL, NULL)) . $_SESSION['OBJ_help']->show_link('article', 'expiration_default'); /* default_year_count*/ $tags['DEFAULT_YEAR_COUNT'] = $_SESSION['translate']->it('Publication dates can be set up to [var1] year(s) from article creation.' , $GLOBALS['core']->formSelect('CONFIG_default_year_count', range(1,5) , $this->val['default_year_count'], NULL, NULL, NULL) ) . $_SESSION['OBJ_help']->show_link('article', 'default_year_count'); /* max_image_size */ $tags['MAX_IMAGE_SIZE'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] Kb' , 'filesize' , $GLOBALS['core']->formTextField('CONFIG_max_image_size' , $this->val['max_image_size'], 4, 4)) . $_SESSION['OBJ_help']->show_link('article', 'max_image_size'); /* max_image_height */ $tags['MAX_IMAGE_HEIGHT'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] pixels' , 'height' , $GLOBALS['core']->formTextField('CONFIG_max_image_height' , $this->val['max_image_height'], 4, 4)) . $_SESSION['OBJ_help']->show_link('article', 'max_image_height'); /* max_image_width */ $tags['MAX_IMAGE_WIDTH'] = $_SESSION['translate']->it('The maximum uploaded image [var1] allowed is [var2] pixels' , 'width' , $GLOBALS['core']->formTextField('CONFIG_max_image_width' , $this->val['max_image_width'], 4, 4)) . $_SESSION['OBJ_help']->show_link('article', 'max_image_width'); /* restricted_viewing */ $tags['RESTRICTED_VIEWING'] = $GLOBALS['core']->formCheckBox('CONFIG_restricted_viewing',1 ,$this->val['restricted_viewing'],NULL ,$_SESSION['translate']->it('Users can only see articles that belong to a group that they are members of')) . $_SESSION['OBJ_help']->show_link('configmanager', 'restricted_viewing'); /* lock_expiration_time */ $tags['LOCK_EXPIRATION_TIME'] = $_SESSION['translate']->it('The maximum time someone can spend editing an article is [var1] seconds' ,$GLOBALS['core']->formTextField('CONFIG_lock_expiration_time' , $this->val['lock_expiration_time'], 4, 4)) . $_SESSION['OBJ_help']->show_link('article', 'lock_expiration_time'); /* make_metatags */ $tags['MAKE_METATAGS'] = $GLOBALS['core']->formCheckBox('CONFIG_make_metatags',1 ,$this->val['make_metatags'],NULL ,$_SESSION['translate']->it('Let Article Manager automatically generate meta descriptions')) . $_SESSION['OBJ_help']->show_link('configmanager', 'make_metatags'); $tags['SAVE'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Save Settings'), 'ARTICLE_vars[config:save]') . $_SESSION['OBJ_help']->show_link('article', 'config_save'); $tags['RESET'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Reset Settings'), 'ARTICLE_vars[config:reset]') . $_SESSION['OBJ_help']->show_link('article', 'config_save'); $content[0] = $GLOBALS['core']->processTemplate($tags,'article','config.tpl'); $content[0] .= $GLOBALS['core']->formHidden('module', 'article'); $title = $_SESSION['translate']->it('Article Manager Configuration'); $content = $GLOBALS['core']->makeForm('ART_config', 'index.php', $content, 'post', 0, TRUE); $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); ?> --- NEW FILE: importANN.php --- <?php /* Security Check **********************************/ if(!$_SESSION['OBJ_user']->isDeity()) exit(); /***************************************************/ /* Include announce classes */ require_once(PHPWS_SOURCE_DIR . 'mod/announce/class/Announcement.php'); $ArticleM_path = PHPWS_HOME_DIR . 'images/article/ANN/'; $ANNOUNCE_path = PHPWS_HOME_DIR . 'images/announce/'; /* If you require your announcements to look different than your articles, * define a default announcement template here. * Make sure it does not have the ".tpl" extension. * ex: $DefaultPageTemplate = "Announcement"; */ $DefaultArticleTemplate = NULL; $DefaultSectionTemplate = NULL; /* Get all the pages from old database */ $page_result = $GLOBALS['core']->getAll('SELECT id FROM mod_announce ORDER BY dateUpdated', true); /* Check to see if any pages were found */ if(!$page_result) { echo 'No Announcements were found for conversion!<br />'; return; } foreach($page_result as $value) { /* Create an old page object to store data temporarily */ $old_ann = new PHPWS_Announcement($value['id']); /* Create a new page object to transfer old data into */ $_SESSION['SES_ART_article'] = new PHPWS_Article; /* Assign directly transferable data to class variables */ $_SESSION['SES_ART_article']->title = $old_ann->_subject; $_SESSION['SES_ART_article']->created_username = $old_ann->_userCreated; $_SESSION['SES_ART_article']->updated_username = $old_ann->_userUpdated; $_SESSION['SES_ART_article']->created_date = $old_ann->_dateCreated; $_SESSION['SES_ART_article']->updated_date = $old_ann->_dateUpdated; $_SESSION['SES_ART_article']->summary = $old_ann->_summary; $_SESSION['SES_ART_article']->allow_comments = $old_ann->_comments; $_SESSION['SES_ART_article']->allow_anonymous = $old_ann->_anonymous; $_SESSION['SES_ART_article']->hits = $old_ann->_hits; $_SESSION['SES_ART_article']->expiration_date = $old_ann->_expiration; $_SESSION['SES_ART_article']->publication_date = ($old_ann->_active)?$old_ann->_dateCreated :$old_ann->_expiration; $_SESSION['SES_ART_article']->approved = $old_ann->_approved; /* Set up page template if necessary */ if ($DefaultArticleTemplate) $_SESSION['SES_ART_article']->template = $DefaultArticleTemplate; /* Create a new section to transfer old data into */ $current_section = new PHPWS_Article_Section; if ($old_ann->_body) $current_section->text = $old_ann->_body; if ($DefaultSectionTemplate) $current_section->template = $DefaultSectionTemplate; /* Image Data Conversion */ if($old_ann->_image && is_file($ANNOUNCE_path.$old_ann->_image['name'])) { $current_section->image = $old_ann->_image; /* name, width, height & alt */ $current_section->image['directory'] = 'ANN/'; $current_section->image['link'] = $current_section->image['caption'] = ''; /* Image file copy */ $GLOBALS['core']->fileCopy($ANNOUNCE_path . $current_section->image['name'] , $ArticleM_path, $current_section->image['name'], 1, 1); } /* Add the section to the page */ $current_section->changed = true; $_SESSION['SES_ART_article']->sections[$current_section->id] = $current_section; $_SESSION['SES_ART_article']->order[] = $current_section->id; /* Save final page structure into database */ $_SESSION['SES_ART_article']->save(); /* Setup page id array for menu conversion use */ $page_ids[$value['id']] = $_SESSION['SES_ART_article']->id; }// END PAGE LOOP /* Convert Comments */ $page_result = $GLOBALS['core']->getAll('SELECT cid,itemId FROM mod_comments_data WHERE module="announce"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[$value['itemId']]; $GLOBALS['core']->query('UPDATE mod_comments_data SET module="article",itemId='.$newid.' WHERE cid='.$value['cid'], true); } /* Convert Menu */ $page_result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url LIKE "%ANN_user_op=view%"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[(int)substr(strrchr($value['menu_item_url'], '='), 1)]; $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article&ART=view:'.$newid.'" WHERE menu_item_id='.$value['menu_item_id'], true); } /* Convert FatCat */ $page_result = $GLOBALS['core']->getAll('SELECT element_id,module_id FROM mod_fatcat_elements WHERE module_title="announce"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[$value['module_id']]; $GLOBALS['core']->query('UPDATE mod_fatcat_elements SET module_title="article",module_id='.$newid.',link="index.php?module=article&view='.$newid.'" WHERE element_id='.$value['element_id'], true); } /* Convert Approval */ $page_result = $GLOBALS['core']->getAll('SELECT id,mod_title,mod_id FROM mod_approval_jobs WHERE mod_title="announce"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[$value['mod_id']]; $GLOBALS['core']->query('UPDATE mod_approval_jobs SET mod_title="article",mod_id=$newid WHERE id='.$value['id'], true); } /* Write routing map to disk (taken from function writeReroute in convert/db.php */ $directory = PHPWS_HOME_DIR . 'convert/reroute/'; if (!is_dir($directory) || !is_writable($directory)) { echo 'Unable to create reroute file in convert/reroute directory.'; return; } else { $file = "<?php \n"; foreach ($page_ids as $oldID=>$newID) $file .= "\$convert['". $oldID . "'] = ". $newID . ";\n"; $file .= "\n?>"; $GLOBALS['core']->writeFile($directory.'/announce.AM', $file, TRUE, TRUE); } echo "<h3>Announcements Conversion Complete!</h3>"; ?> --- NEW FILE: importPM.php --- <?php /* Security Check **********************************/ if(!$_SESSION['OBJ_user']->isDeity()) exit(); /***************************************************/ /* Include pagemaster classes */ require_once(PHPWS_SOURCE_DIR . 'mod/pagemaster/class/Page.php'); require_once(PHPWS_SOURCE_DIR . 'mod/pagemaster/class/Section.php'); $ArticleM_path = PHPWS_HOME_DIR . 'images/article/PM/'; include(PHPWS_SOURCE_DIR . 'mod/pagemaster/conf/config.php'); $PageM_path = PHPWS_HOME_DIR . $image_directory; /* Get all the pages from old database */ $page_result = $GLOBALS['core']->getAll('SELECT id FROM mod_pagemaster_pages ORDER BY updated_date', true); /* Check to see if any pages were found */ if(!$page_result) { echo count($page_result).'No PageMaster pages were found for conversion!<br />'; return; } foreach($page_result as $value) { /* Create an old page object to store data temporarily */ $old_page = new PHPWS_Page($value['id']); /* Create a new page object to transfer old data into */ $_SESSION['SES_ART_article'] = new PHPWS_Article; /* Assign directly transferable data to class variables */ $_SESSION['SES_ART_article']->title = $old_page->title; $_SESSION['SES_ART_article']->mainarticle = $old_page->mainpage; $_SESSION['SES_ART_article']->created_username = $old_page->created_username; $_SESSION['SES_ART_article']->updated_username = $old_page->updated_username; $_SESSION['SES_ART_article']->created_date = $old_page->created_date; $_SESSION['SES_ART_article']->updated_date = $old_page->updated_date; if ($old_page->active) $_SESSION['SES_ART_article']->publication_date = $old_page->created_date; else $_SESSION['SES_ART_article']->publication_date = $_SESSION['SES_ART_article']->expiration_date; $_SESSION['SES_ART_article']->approved = $old_page->approved; /* Loop through & convert all sections */ foreach($old_page->order as $x) { /* Check to see if this section was empty or not */ if(!$old_page->sections[$x]->title && !$old_page->sections[$x]->text && !$old_page->sections[$x]->image) continue; else { /* Create a new section to transfer old data into */ $current_section = new PHPWS_Article_Section; if ($old_page->sections[$x]->title) $current_section->title = $old_page->sections[$x]->title; if ($old_page->sections[$x]->text) $current_section->text = $old_page->sections[$x]->text; if ($old_page->sections[$x]->template=='image_center.tpl') $current_section->template = 'Centered Image'; elseif ($old_page->sections[$x]->template=='image_left.tpl') $current_section->template = 'Image Block Left'; elseif ($old_page->sections[$x]->template=='image_right.tpl') $current_section->template = 'Image Block Right'; elseif ($old_page->sections[$x]->template=='subtitle_and_text.tpl') $current_section->template = 'No Image'; elseif ($old_page->sections[$x]->template=='text_only.tpl') $current_section->template = 'Text Only'; elseif ($old_page->sections[$x]->template=='date_info_and_print.tpl') $_SESSION['SES_ART_article']->template = 'Dated'; elseif ($old_page->sections[$x]->template=='default.tpl') $current_section->template = 'Centered Image'; else $current_section->template = str_replace(".tpl", "", $old_page->sections[$x]->template); /* Image Data Conversion */ if($old_page->sections[$x]->image && is_file($PageM_path.$old_page->sections[$x]->image['name'])) { $current_section->image = $old_page->sections[$x]->image; /* name, width, height & alt */ $current_section->image['directory'] = 'PM/'; $current_section->image['link'] = $current_section->image['caption'] = ''; /* Image file copy */ $GLOBALS['core']->fileCopy($PageM_path . $current_section->image['name'] , $ArticleM_path, $current_section->image['name'], 1, 1); } /* Add the section to the page */ $current_section->changed = true; $_SESSION['SES_ART_article']->sections[$current_section->id] = $current_section; $_SESSION['SES_ART_article']->order[] = $current_section->id; } }// END SECTION LOOP /* Save final page structure into database */ $_SESSION['SES_ART_article']->save(); /* Setup page id array for menu conversion use */ $page_ids[$value['id']] = $_SESSION['SES_ART_article']->id; }// END PAGE LOOP /* Convert Comments */ $page_result = $GLOBALS['core']->getAll('SELECT cid,itemId FROM mod_comments_data WHERE module="pagemaster"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[$value['itemId']]; $GLOBALS['core']->query('UPDATE mod_comments_data SET module="article",itemId='.$newid.' WHERE cid='.$value['cid'], true); } /* Convert Menu */ $page_result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url LIKE "%PAGE_user_op=view_page%"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[substr(strrchr($value['menu_item_url'], '='), 1)]; if (is_numeric($newid)) $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article&view='.$newid.'" WHERE menu_item_id='.$value['menu_item_id'], true); } /* Convert FatCat */ $page_result = $GLOBALS['core']->getAll('SELECT element_id,module_id FROM mod_fatcat_elements WHERE module_title="pagemaster"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[$value['module_id']]; $GLOBALS['core']->query('UPDATE mod_fatcat_elements SET module_title="article",module_id='.$newid.',link="index.php?module=article&view='.$newid.'" WHERE element_id='.$value['element_id'], true); } /* Convert Approval */ $page_result = $GLOBALS['core']->getAll('SELECT id,mod_title,mod_id FROM mod_approval_jobs WHERE mod_title="pagemaster"', true); if($page_result) foreach($page_result as $value) { $newid = $page_ids[$value['mod_id']]; $GLOBALS['core']->query('UPDATE mod_approval_jobs SET mod_title="article",mod_id='.$newid.' WHERE id='.$value['id'], true); } /* Write routing map to disk (taken from function writeReroute in convert/db.php */ $directory = PHPWS_HOME_DIR . 'convert/reroute/'; if (!is_dir($directory) || !is_writable($directory)) { echo 'Unable to create reroute file in convert/reroute directory.'; return; } else { $file = "<?php \n"; foreach ($page_ids as $oldID=>$newID) $file .= "\$convert['". $oldID . "'] = ". $newID . ";\n"; $file .= "\n?>"; $GLOBALS['core']->writeFile($directory.'/pagemaster.AM', $file, TRUE, TRUE); } echo '<h3>PageMaster Conversion Complete!</h3>'; ?> --- NEW FILE: saveconfig.php --- <?php /** * This is the configuration save file for the article module. * * Saves the module's new default settings. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ $query_data['default_article_template'] = $_POST['CONFIG_default_article_template']; $query_data['default_section_template'] = $_POST['CONFIG_default_section_template']; $query_data['summaries_on_homepage'] = $_POST['CONFIG_summaries_on_homepage']; $query_data['prev_n_articles'] = $_POST['CONFIG_prev_n_articles']; $query_data['popular_articles'] = $_POST['CONFIG_popular_articles']; $query_data['listings_per_page'] = $_POST['CONFIG_listings_per_page']; $query_data['need_approval'] = ($_POST['CONFIG_need_approval'])?1:0; $query_data['default_allow_comments'] = ($_POST['CONFIG_default_allow_comments'])?1:0; $query_data['default_allow_anon'] = ($_POST['CONFIG_default_allow_anon'])?1:0; $query_data['users_can_submit'] = ($_POST['CONFIG_users_can_submit'])?1:0; $query_data['users_select_article_tpl'] = ($_POST['CONFIG_users_select_article_tpl'])?1:0; $query_data['users_select_section_tpl'] = ($_POST['CONFIG_users_select_section_tpl'])?1:0; $query_data['users_allow_comments'] = ($_POST['CONFIG_users_allow_comments'])?1:0; $query_data['users_change_dates'] = ($_POST['CONFIG_users_change_dates'])?1:0; $query_data['user_images_in_article'] = ($_POST['CONFIG_user_images_in_article'])?1:0; $query_data['user_upload_images'] = ($_POST['CONFIG_user_upload_images'])?1:0; $query_data['can_expire'] = ($_POST['CONFIG_can_expire'])?1:0; $query_data['expiration_years'] = $_POST['CONFIG_expiration_years']; $query_data['expiration_months'] = $_POST['CONFIG_expiration_months']; $query_data['expiration_days'] = $_POST['CONFIG_expiration_days']; $query_data['default_year_count'] = $_POST['CONFIG_default_year_count']; $query_data['max_image_size'] = (is_numeric($_POST['CONFIG_max_image_size'])) ?$_POST['CONFIG_max_image_size'] :$this->val['max_image_size']; $query_data['max_image_height'] = (is_numeric($_POST['CONFIG_max_image_height'])) ?$_POST['CONFIG_max_image_height'] :$this->val['max_image_height']; $query_data['max_image_width'] = (is_numeric($_POST['CONFIG_max_image_width'])) ?$_POST['CONFIG_max_image_width'] :$this->val['max_image_width']; $query_data['restricted_viewing'] = ($_POST['CONFIG_restricted_viewing'])?1:0; $query_data['lock_expiration_time'] = $_POST['CONFIG_lock_expiration_time']; $query_data['make_metatags'] = ($_POST['CONFIG_make_metatags'])?1:0; $GLOBALS['core']->sqlUpdate($query_data, "mod_article_config"); ?> |
From: <ada...@us...> - 2003-07-09 20:24:28
|
Update of /cvsroot/phpwebsite-comm/modules/article/docs In directory sc8-pr-cvs1:/tmp/cvs-serv30555/docs Added Files: INSTALL.txt INTRODUCTION.txt LICENSE.txt PAGE_INSERT_README.txt TEMPLATE.txt Log Message: Initial commit to CVS --- NEW FILE: INSTALL.txt --- Document - ArticleManager Installation Author - Eloi George <el...@by...> Updated - 3/28/2003 ----------------------------------------------------------------------------- LICENSE ----------------------------------------------------------------------------- LGPL Licence. See LICENSE.txt ----------------------------------------------------------------------------- INSTALLATION ----------------------------------------------------------------------------- To install Article Manager simply follow these steps: 1. Place the articlemanager files into the phpwebsite/mod/article/ directory. 2. Make sure the permissions on the phpwebsite/images/ directory allow the web server to write. 3. Open your browser and point it to your phpWebSite site. 4. Open the "Boost" module as an administrator or deity and select the "Install" button for ArticleManager. 5. Enjoy! ----------------------------------------------------------------------------- IMPORT DATA FROM PAGEMASTER or ANNOUNCE ----------------------------------------------------------------------------- IMPORTANT!: Back up your entire database first! The import script changes data for the menus, categories, approval and comments modules so that they'll automatically point to the new pages. There is no export script because the best way of reverting data is to restore the entire database from a recent backup. SUGGESTION: As with all data conversions, sometimes bad data can screw up the process. I've tried to account for all potential problems, but to be sure that everything is converted properly I suggest that you make a small change to your /core/Database.php file. Change line #461 from this: if($this->query($sql, FALSE, TRUE)){ to this: if($this->query($sql, FALSE, FALSE)){ So you can see any error messages that the database creates. If you want to keep track of when phpWS screws up, don't change it back. 1. Make the convert/reroute/ directory writable (apache.apache, nobody.nobody, 777). 2. Make sure the images/articlemanager/PM & images/articlemanager/ANN directories are writable (apache.apache, nobody.nobody, 777). 3. Log in as a Diety. 4. To import PageMaster, run www.yoursite.com/index.php?module=article&config=import_pagemaster 5. To import Announcements, run www.yoursite.com/index.php?module=article&config=import_announce 6. Log out & log back in so the menu data can be reset. 7. Change the write permissions on the convert/reroute directory to not writable. 8. Back up the files in the convert/reroute directory. They won't ever change again. ----------------------------------------------------------------------------- UNINSTALLING ARTICLE MANAGER ----------------------------------------------------------------------------- WARNING!! Running this file will result in loss of data! It is suggested you backup your phpwebsite/images/articlemanager/ directory and backup your database. I am not responsible for any loss of data nor is Appalachian State University, developers of phpWebsite. To Uninstall ArticleManager simply follow these steps: 1. Make sure the permissions on the phpwebsite/images/ directory allow the web server to write. 2. Open your browser and point it to your phpWebSite site. 3. Open the "Boost" module as an administrator or deity and select the "Uninstall" button for ArticleManager. 4. When asked if you are sure you wish to uninstall ArticleManager select "Yes". --- NEW FILE: INTRODUCTION.txt --- Introduction to Article Manager =============================== The ArticleManager module lets you create dynamic web articles that display your site's content the way -you- want it to be displayed! FEATURES ======== Custom articles - each section can look completely different Define your own article and section templates Admins can allow/deny ability to display external pages in an embedded frame Users can add comments to your article Users can view a list of the articles that they have created Articles keep track of how many times they've been viewed Articles can be set to start showing at a future date Articles can expire on specified dates Articles can be viewed in summary format with a link to the full article MULTI-ARTICLE STORIES with automatic navigation controls! Optimization: Images are stored in multiple directories for faster access A library of approved images can be easily maintained Images can be clickable links with alternate text and photo captions Expired articles can be accessed from a list and re-activated Module settings are easily changeable User-submitted articles can require approval before activation "Also on this site.." Block "Previous n Articles" Block "Most Popular Articles" Block Articles can be set to not show up in the homepage summary listings Articles can be assigned to topic categories Articles can be viewed only by certain groups All of your old Announcements & PageMaster Module content can be imported Automatic rerouting of old mod.php, Announcements & PageMaster links Display a printable version Nothing is saved to disk until you hit "Save Page" "Edit Locking" - Only 1 user can edit a page at a time A "News" page that displays all articles NOTE: The feature "Articles can be viewed only by certain groups" has been disabled pending the re-vamp of the FatCat module for phpWebsite version 0.93. THE MAIN MENU ============= The main menu is the nerve center of the entire module. It allows you to do four basic tasks -- list articles, create a new article, change Article Manager configuration settings and manage the Image Library. LIST ARTICLES: Here you can choose to view all approved articles on the site or just your articles ordered by Title or by the date of creation, publication, expiration, or the last update. This list can be viewed in ascending or descending order. Each article in the listing is accompanied by buttons allowing you to set it as the homepage, edit it, delete it, or immediately publish or expire it. Of course buttons or options can only be seen if you are authorized to use them. CREATE A NEW ARTICLE: See the next section "CREATING & EDITING ARTICLES". CHANGE CONFIGURATION SETTINGS: We've made module customization easier for you by allowing you to change the following default settings: The default page template The default section template The # of summaries that show up on the Home Page The # of summaries that show up on article summary listings The # of article listings that show up under the main menu Whether articles need approval before publication Whether articles can expire on a predefined date Default expiration date offsets (years, months, days) How many years in advance publication dates can be set Uploaded image size limits (filesize, height, width) Administrators can also decide whether users can: upload images include images in articles add comments to articles post comments without registering (Anonymous) create new articles edit/delete any, all, or just their own articles choose when their articles expire publish articles without admin approval change the module configuration Image Library Management Instead of taking the security risk of allowing users to upload images to the server, admin-approved images can be stored in and selected from the Image Library. After an image is uploaded to the library using the "Image Library Management" interface, it will appear on the list underneath that also gives you the opportunity to delete existing pictures. CREATING & EDITING ARTICLES =========================== Articles are basically made up of a title, article summary, and sections. Other information found on the article can include information on the author and the date created or edited. TITLE: All articles need titles! Enter one here. SUMMARY: Type in a SHORT description of the article here. When a list of articles is shown on the site, this will be displayed as a teaser to get the user to read more. SECTIONS: This is the meat of the article. A article can contain as few or as many sections as you like. When you create or start editing a article, all currently save sections are displayed as finished. After each section you will see buttons to edit that section or to move the section above or below its neighbors. Near the bottom of the article a new blank section is created for you with its own "Save" button. See "Editing Sections" for a description of how they work. CONFIGURATION OPTIONS: Category: The topic categories that this article falls under. Allow Comments: Whether users can add discussion or comments to this article Allow Anonymous Comments: Whether unregistered user can add comments (NOT RECOMMENDED!) Publication Date: A story can only be viewable on the site after it is published. You don't need to change this value. It is automatically set to the date this story was created. If you want this story to be invisible until a future date, then you can set it here. Expiration Date: A story can only remain on the site until it expires. You don't need to change this value. The site administrator has set a default period before stories expire. If you want this story to be deleted before or after this date, then you can set it here. WHAT DO I NEED CATEGORIES FOR? If this article is assigned to a category, ArticleManager can then work with other phpWebsite modules to group related articles together and give interested users suggestions on other articles to surf. ARTICLE INFORMATION: NOTE -- These items are not editable. Created By: Who created the article Updated By: the last person to edit the article Created On: When the article was created Updated On: When the article was last edited Save Article: Click this button when you're finished editing. If all information was entered in correctly, you'll be taken back to the main menu. Creating & Editing Sections Each section consists of a title and text (and sometimes an image). You can think of the title of a section as a subtitle of the article. Whenever you start editing a article or save a section, a new one is created for you. START ON NEW PAGE: This option enables multi-article stories. When enabled, this section will be the first of a new page. TITLE: Not necessary, but recommended. Enter the section title here. TEXT: Type in the section's text here. I'm not sure if there is a limit to how much text you can put here, but if you hit it, you'll know. Above this entry box is a text formatting bar that you can use to add html formatting to your text. You'll at least need to use the "new line" button to create line breaks. IMAGE: If you already added an image to this section, it's displayed here. If you are authorized, you will be given the options of uploading an image or selecting an existing image to display. UPLOAD A NEW IMAGE: This lets you upload an image that will be associated with this section. If you choose to use an image, you must also add a Short Image Description. SELECT AN IMAGE FROM THE LIBRARY: This site maintains a library of pre-approved images to use as an alternative to making, optimizing and uploading custom images. Just select the image you want to be associated with this section. If you choose to use an image, you must also add a Short Image Description. ALTERNATE TEXT (Short Image Description): REQUIRED! Enter a short description of the image that will display if a browser can't or won't show the image. LINK: Putting a link URL in here will turn the image into a clickable link. LINK (PHOTO) CAPTION: Sometimes you might want some text to appear above or below the image (eq: Photo Credits). Enter that text here. CONFIGURATION OPTIONS: Start on New Article: Whether this section starts a new article. See "MAKING MULTIPLE-ARTICLE STORIES". Template : Choose a display format for this section. SAVE SECTION: Click this button when you're finished editing. If all information was entered in correctly, the article will re-display with the section in its proper place. WHAT ARE TEMPLATES? Each section can be displayed in a different way -- with an image on the left, right, above the text, with a different-colored title, or even with all the text centered on the article! This is all controlled by templates that the administrator creates. All you have to do is select which display format you want to use for this section. If you want to read about creating or changing templates, see TEMPLATES.TXT. MAKING MULTIPLE-ARTICLE STORIES =============================== Although webarticle content should always be as short and concise as possible, sometimes your article needs to be spread across more that one article. Usually when this happens we create several similarly-titled articles with links to related content: How to Plan a Party: Getting Started How to Plan a Party: Choosing the Place How to Plan a Party: Picking the Music How to Plan a Party: Get the Word Out How to Plan a Party: Collect the Cash! Lease Negotiation Tactics How to get a DJ Advertisement Media Effectiveness Statistics Problem is, for each one of the "Planning the Party" articles, we have to create links to 4 other articles! What happens if we add a article? We have to add & change links in 6 articles! ENTER ARTICLEMANAGER! Whenever you want a section to start on a new page, just check the "Start on new page" box. ArticleManager will automagically divide your story into pages when it's displayed on your site. Each page's title will be the title of the first section on that page. So now your list of pages looks like this: How to Plan a Party Lease Negotiation Tactics How to get a DJ Advertisement Media Effectiveness Statistics and when you click on "How to Plan a Party", the bottom of the pages will look like this: Previous Page Next Page Page 1: Getting Started Page 2: Choosing the Place Page 3: Picking the Music Page 4: Get the Word Out Page 5: Collect the Cash! Since this is all basically one article, they will all have the same link (example:www.yoursite.com/index.php ?module=articlemanager &ART[view:article:2]). However, if you want to link directly to page 4 just add"&page_num=4" to the end of the url so it looks like this: www.yoursite.com/index.php ?module=articlemanager &ART[view:article:2]&page_num=4 If you click the Print Icon, the ENTIRE story will print out. Not just the current page. COOL TIP! If you want to see the entire article on one webpage, change the url to &page_num=all --- NEW FILE: LICENSE.txt --- EXPLANATION OF LICENSE (PREAMBLE): ================================== I just wanted to take a second to explain my interpretation of the terms of this license so that there'll be no misunderstandings later on. I'm new to this whole freeware thing. Frankly, I don't get how programmers can make money doing this. However, I'm willing to give it a shot. What I've done is inserted a copyright display of links that will show on every non-homepage generated by this module. I've made it really small so that noone but web spiders will really notice and use it. Now that I've told you where to look, you can't stop staring at it, can you? This copyright must always display so that it can perform its function. Since this module is released under the LGPL, you can change the code if you want, but this copyright must still display in the same manner. If you want to change or remove the copyright string, contact me and I will sell you a copy of this module under a different license. These terms are covered in the license, but I understand that some folks choose to interpret the passage differently. For those people, let me make this clearer. Everything I just said is part of and supercedes the rest of the license terms specifed below. I'm not a lawyer, so if you feel that this invalidates the GNU license, then consider the above terms as constituting the entire license. GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. phpWebSite Modules Copyright (C) 2003 Appalachian State University This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Appalachian State University, hereby disclaims all copyright interest in the phpWebSite Modules library written by Appalachian State University. --- NEW FILE: PAGE_INSERT_README.txt --- README FOR PAGE_INSERT George Brackett (gbr...@NO...) 5/27/03 -------------------------------- OVERVIEW -------------------------------- Page_insert is a set of templates for use with the PageMaster module of phpWebSite v 0.9+. These templates allow the insertion of any existing web page within the framework of a phpWS site. They are based on the showinmain module written for phpWS 0.8+ by Jim Flowers (jfl...@ez...). The page insert capability should work for later versions of Internet Explorer, Netscape Navigator, and Mozilla. -------------------------------- INSTALLATION -------------------------------- These templates should be installed within the theme directory for the theme(s) you are using. That is, for every theme you are offering to users, you should copy the three template files into the directory themes/your_theme/templates/pagemaster/ This will make the page_insert templates available to the PageMaster module when you are displaying the phpWS site using your_theme. Be sure to copy the files to all the themes you are making available, or errors will result. The three templates are as follows: page_insert_fit_page.tpl - This template inserts the full page into the pagemaster block. If the page being inserted is too large to fit on-screen, the phpWS window will acquire a scrollbar at right. page_insert_fit_block.tpl - This template inserts the page into the largest possible scrolling area that will fit within the current-sized pagemaster block. page_insert_title_is_size - This template inserts the page into a scrolling area of a fixed, specified height within the pagemaster block. -------------------------------- USE -------------------------------- After installing the templates in the theme(s) you wish to have the page insertion capability, insert a page this way: 1. Log in as a user with PageMaster access. Select PageMaster. 2. Create a new page. Give it a title. 3. Edit the page. a. In the first section, select one of the three page_insert templates from the drop-down template menu. b. If you chose page_insert_title_is_size, enter the height you want for the scrolling page display in the Section Subtitle blank. For example, to display the page in a scrolling area 500 pixels high, enter 500 in the Subtitle blank. c. Enter the URL of the page you want inserted as the text of the section. The URL can be a full URL (i.e., http://mysite.com) or a relative link to a file on your site (e.g., downloads/cool.html). 4. Save the section and the page. That's it! -------------------------------- HELP -------------------------------- I have tested page_insert on IE 5 Mac and Mozilla 1.3 Mac. PLEASE email me at the address above (without the NOSPAM, of course) if you find it DOES NOT WORK with your browser. That way I can warn users of incompatibilities, or find a fix. --- NEW FILE: TEMPLATE.txt --- Document - Templating with ArticleManager Author - Adam Morton <ad...@ja...> Author - Eloi George <el...@re...> Updated - 12/5/2002 Templating in articlemanager is set up to allow administrators to create unique and flexible articles without too much hassle. To get started with templating it is recommended that you take a look at the default templates provided with articlemanager to get a feel for how they work. I will try to address further details in this document. ------------------------------------------------------------------------------------------- TEMPLATE FILE PLACEMENT ------------------------------------------------------------------------------------------- First off the placement of template files is very important. Template files can be stored in 2 places: phpwebsite/themes/your_theme/templates/articlemanager/ -or- phpwebsite/mod/articlemanager/templates/ Different template files are used in the display of various articles in ArticleManager. They can be found in subdirectories, you can identify them by the following naming scheme: Article Edit Screen /templates/edit/article.tpl Section Edit Screen /templates/edit/section.tpl Summary Article Display Layout /templates/summary/default.tpl Full Article Display Layout /templates/article/*/title.tpl /templates/article/*/content.tpl Section Display Layout /templates/section/*/title.tpl /templates/section/*/content.tpl I suggest that you copy this directory structure and store your templates under your theme directory. This will allow you to create different looks for each theme's web articles. However, if you find that you are simply copying your templates from one theme to another and not changing them, you may want to go ahead and dump your templates in the same type of structure under the articlemanager/templates/ directory. Template files can be named anything you wish but they must be unique to the current theme. I would also suggest making them semi-intuitive so you know what the template is just by viewing the filename. The filename is used in selecting a template for a new section during article creation or editing. ------------------------------------------------------------------------------------------- TYPES OF TEMPLATE FILES ------------------------------------------------------------------------------------------- The article and section display templates are actually a set of different layouts you can choose from while designing your article. Each has a different display characteristic that is reflected in their names. These are the templates that come shipped with ArticleManager: ARTICLE TEMPLATES Blank Byline Dated SECTION TEMPLATES Centered Image Image Block Left Image Block Right Image Wrap Left Image Wrap Right No Image Text Only If you create your own versions of these templates, I suggest that you use the same names but place them in the appropriate /themes/your_theme/templates/articlemanager/ subdirectory. This way if you change to a different theme, the basic design of your sections will be preserved! ------------------------------------------------------------------------------------------- VARIABLES IN THE TEMPLATE FILE ------------------------------------------------------------------------------------------- When creating a new template file or editing an existing one, keep in mind that the templates are used on a per section basis, not a per article basis. Variables in the template files are replaced with data pertaining to the current section being processed. The usage of these variables is pretty simple, you surround the variable name with double brackets on each side and if the variable is recognized by articlemanager, it will replace it with the appropriate data. Here is an example: {TITLE}<br /> {TEXT} The above template will replace {TITLE} with the title for the current section being processed and {TEXT} with the text for the current section being processed. Below are lists of variables that can be used in the various templates: SECTION TEMPLATES ----------------- IMAGE = The image for the current section. CAPTION = The image caption for the current section. TITLE = The title for the current section. TEXT = The body text for the current section. PRINT_ICON = A linkable image for a printable view of the current article. The gif image for this icon must be stored in the "img" directory and must be named "print.gif". CREATED_DATE = The date the current article was created. CREATED_USER = The username of the user who created the current article. UPDATED_DATE = The date the current article was updated. UPDATED_USER = The username of the user who last updated the current article. FULL ARTICLE TEMPLATES ---------------------- TITLE = Page Title - Link to the full article SUMMARYTEXT = Article summary HITS = # of time article has been viewed CREATED_DATE = Date article was creastred UPDATED_DATE = Date article was last updated EXPIRATION_DATE = Date article will expire PUBLICATION_DATE = Date article was published (shown) CREATED_USER = Author's name UPDATED_USER = The last editor's name CREATED_TEXT = "Created By: CREATED_USER on created_date UPDATED_TEXT = "Last Updated By: UPDATED_USER on updated_date" PRINT_ICON = Icon link to a printable version of the article. The gif image for this icon must be stored in the "img" subdirectory and must be named "print.gif" BODYTEXT = The text of the current page of the article NAVLIST = Linkable list of all pages within the article NAVBAR = Linkable list of all page numbers within the article PREV = Link to go to the previous page in the article NEXT = Link to go to the next page in the article EMAIL = Icon link to email the article to a friend. Not enabled yet EDIT = Link to edit this article if user is authorized DELETE = Link to delete this article if user is authorized NUM_COMMENTS = # of comments on this article CATEGORY = Shows icons for the categories that this article belongs to ARTICLE SUMMARY TEMPLATE ------------------------ READMORE = "Read More" - Link to the full article LINK = Link to the full article with no text TITLE = Page Title - Link to the full article SUMMARYTEXT = Article summary HITS = # of time article has been viewed CREATED_DATE = Date article was creastred UPDATED_DATE = Date article was last updated EXPIRATION_DATE = Date article will expire PUBLICATION_DATE = Date article was published (shown) CREATED_USER = Author's name UPDATED_USER = The last editor's name CREATED_TEXT = "Created By: CREATED_USER on created_date UPDATED_TEXT = "Last Updated By: UPDATED_USER on updated_date" PRINT_ICON = Icon link to a printable version of the article. The gif image for this icon must be stored in the "img" subdirectory and must be named "print.gif" MOREWORDS = # of words in the article MOREPAGES = # of pages in this article EDIT = Link to edit this article if user is authorized DELETE = Link to delete this article if user is authorized NUM_COMMENTS = # of comments on this article CATEGORY = Shows icons for the categories that this article belongs to ARTICLE EDITITNG TEMPLATE ------------------------- TITLE_LABEL = "Title:" TITLE = Box for entering the title for the current article. LINK_BACK = Clickable link back to the Main Menu CATEGORY_LABEL = "Related Topics:" CATEGORY = The FatCat category selection box SUMMARY_LABEL = "Summary:" SUMMARYTEXT = Box for entering the article summary text SECTIONS = All sections for this article INFORMATION_LABEL = "Article Information" CREATED_TEXT = "Created By: created_username on created_date" UPDATED_TEXT = "Last Updated By: updated_username on updated_date" PAGE_SETTINGS_LABEL = "Article Settings" COMMENTS_LABEL = "Allow Comments: " COMMENTS_YES = Yes Selection Button COMMENTS_NO = No Selection Button ANON_LABEL = "Allow Comments by unregistered users:" ANON_YES = Yes Selection Button ANON_NO = No Selection Button PUBLICATION_LABEL = "Publish on:" PUBLICATION_DATE = Date selection boxes EXPIRATION_LABEL = "Expires on:" EXPIRATION_DATE = Date selection boxes EXPIRATION_FLAG = Checkbox for whether this article can expire or not PUBLICATION_TEXT = "Publication Date: publication_date" EXPIRATION_TEXT = "Expires on: expiration_date" TEMPLATE_LABEL = "Page Format:" TEMPLATE = Selection box to choose which template to use SAVE_WARNING = Reminder to save the Selection before you save the Article SAVE_BUTTON = Self-Explanatory CANCEL_BUTTON = Self-Explanatory |
Update of /cvsroot/phpwebsite-comm/modules/article/conf In directory sc8-pr-cvs1:/tmp/cvs-serv30555/conf Added Files: approval.php boost.php config.php controlpanel.php fatcat.php help.php layout.php module_rights.txt users.php Log Message: Initial commit to CVS --- NEW FILE: approval.php --- <?php if($_SESSION["OBJ_user"]->allow_access("article")) { if ($approvalChoice == "yes") PHPWS_ArticleManager::approve($id); elseif ($approvalChoice == "no") PHPWS_ArticleManager::refuse($id); elseif ($approvalChoice == "view") { $article = new PHPWS_Article($id); echo $article->view_article(); } } ?> --- NEW FILE: boost.php --- <?php /** * This is the Articlemaster mod_info file for Boost * * @version \$Id\$ * @author Eloi George <el...@NO...> * @module Article Manager */ $mod_title = "article"; $mod_pname = "Article Manager"; $mod_directory = "article"; $mod_filename = "index.php"; $mod_icon = "articlemanager.gif"; $admin_op = "&disp=main_menu"; $allow_view = "all"; $priority = 50; $admin_mod = 1; $active = "on"; $version = 1; $mod_class_files = array("ArticleManager.php", "Article.php", "Section.php",); $mod_sessions = array("SES_ART_master", "SES_ART_article", "SES_ART_section"); ?> --- NEW FILE: config.php --- <?php /** * This is the config file for the articlemanager module. Do not * change these values unless you are sure you know what you * are doing. * * @author Adam Morton <ad...@NO...> * @module articlemanager * @param string image_directory : The directory that articlemanager should store * and retrieve images from * @param string template_directory : The default templates directory for articlemanager. */ $this->image_directory = "images/article/"; $this->image_path = PHPWS_HOME_DIR . $this->image_directory; ?> --- NEW FILE: controlpanel.php --- <?php $image['name'] = 'articlemanager.gif'; $image['alt'] = 'Author: Eloi George'; $link[] = array ('label'=>'Article Manager', 'module'=>'article', 'url'=>'index.php?module=article&disp=main_menu', 'image'=>$image, 'admin'=>TRUE, 'description'=>'Go here to post articles, information & web pages.', 'tab'=>'content'); ?> --- NEW FILE: fatcat.php --- <?php // You MUST use apostrophes. Quotation marks will not work $className = 'PHPWS_Article'; $methodName = 'view_category_row'; ?> --- NEW FILE: help.php --- <?php /** * This is the ArticleManager help info file. It contains some basic help * items to start with. These items can be changed or removed via the * help module included with phpWebSite. * * @author Eloi George <el...@NO...> * @module Article Manager */ $article_title = "Article Title"; $article_title_content = "All articles need titles! Enter one here"; $article_summary = "Article Summary"; $article_summary_content = "Type in a SHORT description of the article here. When a list of articles is shown on the site, this will be displayed as a teaser to get the user to read more.<br /><br /> REMEMBER: It's just a teaser. Keep it short. And try not to use HTML."; $list_mainarticle = "Current Mainarticle"; $list_mainarticle_content = "This column will designate which article is currently set to be shown on your web site mainarticle. The current mainarticle is marked with a <font color=\"lime\"><b><i>CURRENT</i></b></font> flag."; $list_action = "Current Article Action"; $list_action_content = "These are actions you can perform on unsaved articles. The current actions are:<br /><br /> <b>Publish/Expire</b> - This button allows you to immediately PUBLISH (allow articles to be seen) or EXPIRE (remove articles from view without actually deleting them) the article. Publication & Expiration dates will be changed to accordingly.<br /> <b>Edit</b> - This allows you to edit am existing article.<br /> <b>Delete</b> - This allows you to remove a article from your database. You will be asked to confirm the deletion with a \"Yes\" or \"No\" answer."; $current_updated = "Updated Date"; $current_updated_content = "This is the date and user who last updated the article."; $section_new_page = "Start on New Page"; $section_new_page_content = "[Optional] This option enables multi-article stories. When checked, this section will be the first of a new page."; $section_title = "Section Subtitle"; $section_title_content = "This is the subtitle given to this section. HTML is allowed and encouraged."; $section_text = "Section Text"; $section_text_content = "This is the body text for this section. HTML is allowed and encouraged."; $section_image = "Section Image"; $section_image_content = "This lets you upload an image that will be associated with this section. If you choose to use an image, you must also add a \"Short Image Description\"."; $section_lib_image = "Section Library Image"; $section_lib_image_content = "This site maintains a library of pre-approved images to use as an alternative to making, optimizing and uploading custom images. Just select the image you want to be associated with this section. If you choose to use an image, you must also add a \"Short Image Description\"."; $section_image_desc = "Short Image Description"; $section_image_desc_content = "This is a short description of the image associated with this section. It is recommended that the description is no more than 5-6 words."; $section_image_link = "Image Link"; $section_image_link_content = "Putting a link URL in here will turn the image into a clickable link."; $section_image_caption = "Image Caption"; $section_image_caption_content = "Sometimes you might want some text to appear above or below the image (eq: Photo Credits). Enter that text here."; $section_template = "Section Template"; $section_template_content = "This is the template that will be applied to this section when it is viewed. \nMost templates have names that are fairly intuitive. \nIf you wish to create custom templates, please see the TEMPLATE_README included with ArticleManager."; $section_save = "Section Save"; $section_save_content = "This will save a new section or save changes made to an existing section."; $section_remove = "Section Remove"; $section_remove_content = "This option will remove a section from this article entirely. You will be asked to confirm the action."; $section_edit = "Section Edit"; $section_edit_content = "Select the \"Edit\" button to make changes to this section."; $section_move = 'Moving a Section'; $section_move_content = 'Sometimes you may want to move a section to another area on the same page. In stead of a lot of cutting and pasting, you can use the "Move Up" and "Move Down" buttons to shift this section by one space.'; $article_save = "Article Save"; $article_save_content = "This button will save a new article to the database and stamp it as saved. For existing articles it is used as a finishing step to make sure all changes are commited."; $article_info = "Article Information"; $article_info_content = "This is some extra information about this article. Included here is the created date/user and updated date/user. More information may be added here in later versions."; $article_announce = "Announce Article"; $article_announce_content = "This option lets you decide whether this article will show up on the homepage article summary listings.<br /><br />It can still show up everywhere else."; $article_allow_comments = "Allow Comments"; $article_allow_comments_content = "This option lets you decide whether users can add discussion or comments to this article."; $article_allow_anonymous = "Allow Anonymous Comments"; $article_allow_anonymous_content = "This option lets you decide whether unregistered users can add discussion or comments to this article. We recommend that you leave this on NO to discourage trolling posts."; $article_publication_date = "Date of Publication"; $article_publication_date_content = "A story can only be viewable on the site after it is published. You don't need to change this value. It is automatically set to the date this story was created. \nIf you want this story to be invisible until a future date, then you can set it here."; $article_expiration_date = "Date of Expiration"; $article_expiration_date_content = "A story can only remain on the site until it expires. You don't need to change this value. The site administrator has set a default period before stories expire. If you want this story to be deleted before or after this date, then you can set it here."; $article_expiration_flag = 'Never Expires'; $article_expiration_flag_content = 'Check this box if you want this article to never expire.'; $article_cancel = 'Cancel This Article'; $article_cancel_content = 'Pressing this button will take you back to the main menu. You will lose any changes you made.'; $save_title = 'Change Title & Summary Text'; $save_title_content = 'If you\'ve made any changes to the article title or summary, pressing this button will save them. Make sure that you save any editing you\'ve done to any sections first.'; $article_template = "Article Template"; $article_template_content = "This is the template that will be applied to this article when it is viewed. \nMost templates have names that are fairly intuitive. \nIf you wish to create custom templates, please see the TEMPLATE_README included with ArticleManager."; $categories = "Related Topics"; $categories_content = "An article can be assigned to various categories that it's subject matter fits into. This way you can easily see which articles are related to the one that you're viewing."; $authgroups = "Conditional Article Display"; $authgroups_content = "If your administrator has assigned you to groups, you can use this box to select which groups you want to be able to view your article. \nNote that you can only select from the groups that you are a member of."; $restricted_viewing = "Conditional Article Display"; $restricted_viewing_content = "If this is turned on, the user can only see those articles that belong to a group that they are a member of. \nIf an article is not owned by any groups (default setting), everyone can see it."; $summaries_on_homepage = 'Number of Article Summaries'; $summaries_on_homepage_content = 'This specifies the number of summaries of the most recent articles that will show on the home page.<br /><br />A value of 0 result in the box not being shown at all.'; $popular_articles = 'Number of Popular Articles'; $popular_articles_content = 'This specifies how many links to the most popular articles will be shown on the home page.<br /><br />A value of 0 result in the box not being shown at all.'; $prev_n_articles = 'Number of Previous Articles'; $prev_n_articles_content = 'This specifies how many links to the most recent articles will be shown on the home page.<br /><br />These links will not include the articles that are shown in the "Also on this Site" box. If the amount set for this is 10 and the 5 most recent articles are showing up in the Article Summaries Block, then links for the 6th to 16th most recent articles will be shown.<br /><br />A value of 0 result in the box not being shown at all.'; $listings_per_page = 'Default Number of Listings to Show per Page'; $listings_per_page_content = 'Here you can set the default amount of article listings that will show up under the administrative menu.'; $expiration_default = 'Default Expiration Date'; $expiration_default_content = 'Here you can specify how long an article will last in terms of days, months or years on your site.<br /><br />Tip: If you want them to last more that 5 years, save yourself some hassle and just uncheck the "Articles Can Expire" box.'; $can_expire = 'Articles can expire on a predefined date'; $can_expire = 'If this is unchecked, articles will never expire from the site.'; $max_image_size = 'Maximum Uploaded Image Size'; $max_image_size = 'Remember that bigger pictures = more page loading time and higher bandwitdh usage. They can also make your site look bad.<br /><br />Set this to a reasonable amount in Kilobytes to keep your users from uploading huge files.<br /><br />Keep in mind that the maximum efficient page size is 40 to 50 kilobytes, so if you expect to have 2 pictures per page, you may want to limit the maximum size to 15Kb.'; $restricted_viewing = 'Restricted Viewing'; $restricted_viewing = 'This feature is expected to start working in phpWebsite version 9.4.'; $make_metatags = 'Automatically Generate Meta Descriptions'; $make_metatags = 'Checking this box will let phpWebsite automatically change the browser title and description metatag to match the article title and summary.<br /><br />This may or may not work depending on which version of phpWebsite you are using.'; $lock_expiration_time = 'Lock Expiration Time'; $lock_expiration_time = 'Once someone starts editing an article, noone else can open it for editing until either they save it, press the "Cancel Editing" or "Back to Menu" buttons, or this amount of time has passed.'; ?> --- NEW FILE: layout.php --- <?php $layout_info[] = array ("content_var"=>"CNT_article" , "transfer_var"=>"body"); $layout_info[] = array ("content_var"=>"CNT_article_summaries", "theme_var"=>"body", "home_only"=>1); $layout_info[] = array ("content_var"=>"CNT_article_past", "theme_var"=>"right_col_mid", "home_only"=>1); $layout_info[] = array ("content_var"=>"CNT_article_popular", "theme_var"=>"right_col_mid", "home_only"=>1); ?> --- NEW FILE: module_rights.txt --- create_articles::Create Articles edit_articles::Edit Articles edit_own_article::Edit Own Articles delete_articles::Delete Articles delete_own_article::Delete Own Articles images_in_article::Place Images In Articles images_in_library::Place Images In Image Library upload_images::Upload Images choose_section_template::Choose Section Templates choose_article_template::Choose Article Templates insert_external_pages::Insert External Pages allow_comments::Allow/Disallow Comments allow_anon::Allow/Disallow Anonymous Comments change_dates::Change dates of Publication/Expiration set_mainarticle::Set Mainarticle global_article_prefs::Change Default Article Preferences --- NEW FILE: users.php --- <?php $default_admin_menu = "content"; $default_user_menu = "personal"; ?> |
From: <ada...@us...> - 2003-07-09 20:24:27
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory sc8-pr-cvs1:/tmp/cvs-serv30555/class Added Files: Article.php ArticleManager.php Section.php Log Message: Initial commit to CVS --- NEW FILE: Article.php --- <?php /** * This is the PHPWS_Article class. It handles saving, updating, and organization * of sections. It also contains functions that allow this article to be edited * and saved. * * @version \$Id\$ * * @author Eloi George <el...@NO...> * @basecode Adam Morton's PageMaster Module * @module Article Manager * @param int id : Database id of this article * @param string title : Title of this article * @param array sections : Array of sections controlled by this article (key=SECT_id, value=SECT_OBJ) * @param array order : Array denoting the order of the sections within this article (key=order 0,1,2..., value=SECT_id) * @param int sectionID : Generated alphabetical temporary section ids * @param array RemoveList : Generated array of sections to be deleted on article save * @param int mainarticle : Whether this article is the main article for this site or not * @param int rank : This article's priority position in a summary listing [...1061 lines suppressed...] return $timeleft; return FALSE; } /** * Displays this article's row in a fatCat category display * * * @author Eloi George <el...@NO...> * @module Article Manager * @param id : Id of the article to show. */ function view_category_row ($id) { $this = new PHPWS_Article($id); $this->view(false); } } ?> --- NEW FILE: ArticleManager.php --- <?php /** * This is the PHPWS_ArticleManager class. It controls interaction and * organization with PHPWS_Article objects. * * @version \$Id\$ * * @author Eloi George <el...@NO...> * @basecode Adam Morton's PageMaster Module * @module Article Manager * @param object homearticle : The current homearticle stored as a PHPWS_Article object. * @param int home_num : Number of summaries that will be displayed on the home page. * @param array articles : Array of article rows to be displayed. * @param string list_group : Specifies whether to show all stories or just the User's stories. * @param string list_sort : The field we'll use to sort the listing results. * @param string list_order : Specifies what to order the search results by. Ascending or Descending. * @param string group_array : Choices used to build the article listing query. * @param string sort_array : Choices used to build the article listing query. * @param string order_array : Choices used to build the article listing query. * @param string sql_article_table : SQL string fragment specifying what tables will be used. * @param string sql_predicate : ending SQL string fragment that can filter out all unauthorized records. * @param array error : Holds all Error Flags for the entire module. * @param array val : Configuration Variables from mod_article_config. * @param array image_directory : Current Root Image Directory from configuration file. * @param array image_path : Complete path to Root Image Directory from configuration file. * @param string filter : Letter that a list is being filtered by. * @param string current_user : Name of the user belonging to the current settings. */ class PHPWS_ArticleManager { var $homearticle; var $home_num; var $articles; var $list_group; var $list_sort; var $list_order; var $group_array; var $sort_array; var $order_array; var $sql_article_table; var $sql_predicate; var $error; var $val; var $image_directory; var $image_path; var $filter; /** * ArticleManager constructor. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function PHPWS_ArticleManager () { /* Load module default settings */ include(PHPWS_SOURCE_DIR . 'mod/article/conf/config.php'); $result = $GLOBALS['core']->quickFetch('SELECT * FROM mod_article_config', true); $this->val = $result; /* Set up sql code to retrieve pages available to this user */ /* This method of setting up the sql allows me to add group-based restrictions later */ $this->sql_article_table = $GLOBALS['core']->tbl_prefix.'mod_article AS A'; $this->sql_predicate = ""; /* 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' ,'expiration_date'=>'Expiration Date' ,'created_date'=>'Date Created' ,'updated_date'=>'Last Update'); $this->order_array = array('ASC'=>'Ascending', 'DESC'=>'Descending'); /* 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'; $this->list_order = "ASC"; } /** * Displays the main menu with main functions like "Set as Main", "New Article" and "List Articles" * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function main_menu () { $GLOBALS['CNT_article']['title'] = "Article Manager"; /* If search criteria are specified, set them */ if ($_POST['LIST_group']) { $this->list_group = $_POST['LIST_group']; $this->list_sort = $_POST['LIST_sort']; $this->list_order = $_POST['LIST_order']; } $tags['SEARCHQUERY'] = $_SESSION['translate']->it('Show me [var1] stuff ordered by [var2][var3]' , $GLOBALS['core']->formSelect('LIST_group', $this->group_array, $this->list_group, NULL, TRUE) , $GLOBALS['core']->formSelect('LIST_sort', $this->sort_array, $this->list_sort, NULL, TRUE) , $GLOBALS['core']->formSelect('LIST_order', $this->order_array, $this->list_order, NULL, TRUE)) . $GLOBALS['core']->formSubmit($_SESSION['translate']->it('List Articles'), 'ARTICLE_vars[disp:main_menu]'); if ($this->can("create")) $tags['BTN_CREATE'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Create New Article'), 'ARTICLE_vars[edit:create]'); if ($_SESSION['OBJ_user']->allow_access('article', 'global_article_prefs')) $tags['BTN_CONFIG_EDIT'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Edit Configuration'), 'ARTICLE_vars[config:edit]'); if ($_SESSION['OBJ_user']->allow_access('article', "images_in_library")) $tags['BTN_IMG_LIB'] = $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Image Library'), 'ARTICLE_vars[config:image_library]'); $content[0] = $GLOBALS['core']->processTemplate($tags,'article','menu.tpl'); $content[0] .= $GLOBALS['core']->formHidden('module', 'article'); $title = $_SESSION['translate']->it('Main Menu'); $content = $GLOBALS['core']->makeForm('ARTICLE_main_menu', 'index.php', $content, 'post', 0, 0); $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); } /** * Lists the articles stored in the database in user-selectable formats * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function list_articles () { /* Set up display variables */ $now = date('Y-m-d H:i:s'); if ($this->list_sort == 'title') { $temp_date_title = 'Date Published'; $temp_date = 'publication_date'; } else { $temp_date_title = $this->sort_array[$this->list_sort]; $temp_date = $this->list_sort; } /* Set up authorization flags for faster operation */ $Fedit = $_SESSION['translate']->it('Edit'); if($_SESSION['OBJ_user']->allow_access('article', 'set_mainarticle')) $Fset_main = $_SESSION['translate']->it('Set as Main'); if($_SESSION['OBJ_user']->allow_access('article', 'change_dates')) { $Fexpire = $_SESSION['translate']->it('Expire'); $Fpublish = $_SESSION['translate']->it('Publish'); } if($_SESSION['OBJ_user']->allow_access('article', 'delete_articles')) $Fdelete = $_SESSION['translate']->it('Delete'); /* If article row datum hasn't been retrieved/viewed yet... */ if(!isset($this->pager) || !isset($_REQUEST['PAGER_limit'])) { $this->pager = new PHPWS_Pager; $this->pager->setLinkBack('./index.php?module=article&disp=main_menu'); $this->pager->makeArray(TRUE); $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 ' . $this->list_sort . ' ' . $this->list_order); $this->pager->setData($result); $result = NULL; } $this->pager->pageData(); if (!$data = implode(',', $this->pager->getData())) { $_SESSION['OBJ_layout']->popbox($_SESSION['translate']->it('No Articles Found!') , $_SESSION['translate']->it('No matching articles were found in the database!') , NULL, 'CNT_article'); return; } /* 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; if(!($result = $GLOBALS['core']->getall($sql)) || $count=sizeof($result) < 1) return; /* Now create the Row HTML */ foreach($result as $value) { $row = array(); $GLOBALS['core']->toggle($bg, " class=\"bg_medium\""); $row['BG'] = $bg; /* If this page is viewable, allow the user to toggle the mainpage switch. */ if ($value['approved'] && $value['publication_date'] <= $now && ($value['expiration_date']==NULL || $value['expiration_date'] > $now)) $is_viewable = TRUE; else $is_viewable = FALSE; /* Set up title */ $tba = (!$value['approved']) ?" ((TBA))" :""; $row['ARTICLE_TITLE'] = '<a href=index.php?module=article&view='.$value['id'] .' id='.$value['id'].'>'. stripslashes($value['title']) . $tba.'</a>'; /* Set var to show whether this is the homepage article or not */ if($value['mainarticle']) $row['HOME_FLAG'] = '<font color="lime"><b><i>' . $_SESSION['translate']->it('CURRENT') . '</i></b></font>'; else if ($is_viewable && isset($Fset_main)) $row['HOME_FLAG'] = '<input type="submit" name="ARTICLE_vars[edit:set_main]" value="'.$Fset_main.'" />'; /* Set up date */ $row['DATE'] = substr($value[$temp_date],0,10); /* Set var to expire/publish the article */ if (isset($Fexpire)) $row['PUB_EXP'] = ($is_viewable) ?'<input type="submit" name="ARTICLE_vars[edit:expire]" value="'.$Fexpire.'" />' :'<input type="submit" name="ARTICLE_vars[edit:publish]" value="'.$Fpublish.'" />'; /* Set up Edit button */ if ($this->can("edit",$value['created_username'])) /* If someone else is not editing this page... */ if (!PHPWS_Article::isLocked(&$value['editlock'], &$value['edituser'])) $row['EDIT'] = '<input type="submit" name="ARTICLE_vars[edit:' .$value['id'].']" value="'.$Fedit.'" />'; else $row['EDIT'] = '['.$_SESSION['translate']->it('Locked').']'; /* Set up Delete button */ if (isset($Fdelete)) $row['DELETE'] = '<input type="submit" name="ARTICLE_vars[edit:delete]" value="'.$Fdelete.'" />'; $content[0] = $GLOBALS['core']->processTemplate($row,'article','listing_row.tpl') . $GLOBALS['core']->formHidden('module', 'article') . $GLOBALS['core']->formHidden('ARTICLE_id', $value['id']); $tags['LIST_ROWS'] .= $GLOBALS['core']->makeForm('ARTICLE_main_menu', 'index.php#'.$value['id'], $content, 'post', 0, 0); } /* Create Table HTML */ $tags['TITLE'] = $_SESSION['translate']->it('Title'); $tags['HOME_FLAG'] = $_SESSION['translate']->it('Homepage') . '?' . $_SESSION['OBJ_help']->show_link('article', 'list_mainarticle'); $tags['DATE'] = $_SESSION['translate']->it($temp_date_title); $tags['ACTION'] = $_SESSION['translate']->it('Action') . $_SESSION['OBJ_help']->show_link('article', 'list_action'); $tags['PAGE_BACKWARD_LINK'] = $this->pager->getBackLink(); $tags['PAGE_FORWARD_LINK'] = $this->pager->getForwardLink(); $tags['SECTION_LINKS'] = $this->pager->getSectionLinks(); $tags['SECTION_INFO'] = $this->pager->getSectionInfo() . $_SESSION['translate']->it('Articles'); $tags['LIMIT_LINKS'] = $this->pager->getLimitLinks(); $tags['LIMIT_LINKS_LABEL'] = $_SESSION['translate']->it('Rows to show per page: '); $content = $GLOBALS['core']->processTemplate($tags,'article','listing.tpl'); $_SESSION['OBJ_layout']->popbox($_SESSION['translate']->it('Current Articles') , $content, NULL, 'CNT_article'); } /** * Lists the articles stored in the database in a "News Page" * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function list_news () { /* Set up display variables */ $now = date('Y-m-d H:i:s'); /* If article row datum hasn't been retrieved/viewed yet... */ if(!isset($this->pager) || !isset($_REQUEST['PAGER_limit']) || isset($_REQUEST['newsFilter'])) { $this->pager = new PHPWS_Pager; $this->pager->setLinkBack('./index.php?module=article&disp=news'); $this->pager->makeArray(TRUE); $this->pager->limit = $this->val['listings_per_page']; if (isset($_REQUEST['newsFilter'])) $this->filter = $_REQUEST['newsFilter']; if ($this->filter!='') $filter = ' AND title LIKE "'.$this->filter.'%" ORDER BY title ASC'; else $filter = ' ORDER BY updated_date DESC'; $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; } $this->pager->pageData(); if ($data = implode(',', $this->pager->getData())) { /* Retrieve all article listings for this page */ $sql = 'SELECT * FROM ' . $this->sql_article_table . ' WHERE id IN (' . $data . ') ORDER BY updated_date DESC'; if(!$result = $GLOBALS['core']->query($sql)) return; while($summary=$result->fetchrow(DB_FETCHMODE_ASSOC)) { $temp = new PHPWS_Article($summary['id'], $summary); $temp->view(false); } unset($temp); unset($result); } else $GLOBALS['CNT_article_summaries']['content'] = '<br /><br />' . $_SESSION['translate']->it('No matching articles were found in the database!') . '<br /><br />'; /* Create NewsPage HTML */ $alphabet = PHPWS_User::alphabet(); $tags['ALPHABET'] = $GLOBALS['core']->moduleLink($_SESSION['translate']->it('ALL'), 'article', array('disp'=>'news', 'newsFilter'=>'') ) . " \n"; foreach ($alphabet as $alphachar) if ($alphachar!=$this->filter) $tags['ALPHABET'] .= $GLOBALS['core']->moduleLink($alphachar, 'article', array('disp'=>'news', 'newsFilter'=>$alphachar) ) . " \n"; else $tags['ALPHABET'] .= $alphachar . " \n"; $tags['PAGE_BACKWARD_LINK'] = $this->pager->getBackLink(); $tags['PAGE_FORWARD_LINK'] = $this->pager->getForwardLink(); $tags['SECTION_LINKS'] = $this->pager->getSectionLinks(); $tags['SECTION_INFO'] = $this->pager->getSectionInfo() . $_SESSION['translate']->it('Articles'); $tags['LIMIT_LINKS'] = $this->pager->getLimitLinks(); $tags['LIMIT_LINKS_LABEL'] = $_SESSION['translate']->it('Rows to show per page: '); $title = $_SESSION['translate']->it('All Articles'); if ($this->filter!='') $title .= $_SESSION['translate']->it(' Starting With `[var1]`', $this->filter); $GLOBALS['Layout_title'] = $title . ' - ' . $_SESSION['OBJ_layout']->page_title; $GLOBALS['CNT_article_summaries']['title'] = '<center><b>' . $title . '</b></center>'; $content = $GLOBALS['core']->processTemplate($tags,'article','pager.tpl'); $GLOBALS['CNT_article_summaries']['content'] = $content . $GLOBALS['CNT_article_summaries']['content'] . $content; } /** * Sets the main article in the database and in this PHPWS_ArticleManager class. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function set_main_article () { if($_POST['ARTICLE_id']) { $GLOBALS['core']->query('UPDATE mod_article SET mainarticle=0 WHERE mainarticle=1', true); $GLOBALS['core']->query('UPDATE mod_article SET mainarticle=1 WHERE id='.$_POST['ARTICLE_id'], true); } } /** * Simply displays the homepage article. * * @author Adam Morton <ad...@NO...> * @module Article Manager * @param none * @return none */ function show_mainarticle () { if ($row=$GLOBALS['core']->quickFetch('SELECT id from mod_article WHERE mainarticle = 1',TRUE)) { $temp = new PHPWS_Article($row['id']); $temp->view(); unset($temp); } } /** * Bridge function to the search module to allow articles to be searched * * This function is optimised to only conduct one query. * * @author Eloi George <el...@NO...> * @module Article Manager * @param string $where The "where" clause for the SQL statement. * @return array List of articles containing the search term. */ function search($where) { $returnArray = array(); $sql = 'SELECT A.id,A.title,A.summary FROM ' . $this->sql_article_table . ','.$GLOBALS['core']->tbl_prefix.'mod_article_sections AS S ' . $where . ' AND A.id=S.article_id AND '. $this->get_published_sql() . $this->sql_predicate . ' ORDER BY updated_date DESC'; $articleResult = $GLOBALS['core']->query($sql); while ($articleResult && $resultRow = $articleResult->fetchrow(DB_FETCHMODE_ASSOC)) { /* Only save/show the first occurence per article */ if (!isset($returnArray[$resultRow['id']])) $returnArray[$resultRow['id']] = '<b>' . $resultRow['title'] . '</b><br />' . $resultRow['summary'] . '...'; } return $returnArray; }// END FUNC searchArticles() /** * Displays summary listings of last n articles on the homepage. * * Also displays the "Past n Articles" Block & the "Popular Articles" Block. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function view_summaries () { $TotalCount = $this->val['summaries_on_homepage'] + $this->val['prev_n_articles']; /* Determine how many summaries we're going to show */ if ($TotalCount<1) return; $GLOBALS['CNT_article_summaries']['title'] .= '<center><b>' . $_SESSION['translate']->it('Also on this Site') . '...</b></center>'; /* 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); /* If there are summaries to display, display 'em */ if ($this->val['summaries_on_homepage']>0) for($i=0; $i < $this->val['summaries_on_homepage'] && $summary=$result->fetchrow(DB_FETCHMODE_ASSOC); $i++) { $temp = new PHPWS_Article($summary['id'], $summary); $temp->view(false); } /* If there are x articles before these, display the "Prev Articles" Block */ if ($this->val['prev_n_articles']>0) { for($i=0; $i < $this->val['prev_n_articles'] && $summary=$result->fetchrow(DB_FETCHMODE_ASSOC); $i++) { if ($i>0) $content .= '<br />'; $content .= date('F d', strtotime($summary['updated_date'])) . ' <br /><a href="index.php?module=article&view=' . $summary['id'] .'">' . $summary['title'] . "</a><br />\n"; } if (isset($content)) { $GLOBALS['CNT_article_past']['title'] = $_SESSION['translate']->it('Previous').' '.$this->val['prev_n_articles'] . ' ' . $_SESSION['translate']->it('Articles'); $GLOBALS['CNT_article_past']['content'] = &$content; } } /* Reset the variable used to hold the class */ unset($temp); } /** * Displays a block listing of the n most popular last n articles. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function view_popular () { if ($this->val['popular_articles']<1) return; /* 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); /* If there are summaries to display, display 'em */ $i = 0; while($summary=$result->fetchrow(DB_FETCHMODE_ASSOC)) { if ($i++ > 0) $content .= '<br />'; $content .= date('F d', strtotime($summary['updated_date'])) . ' <br /><a href="index.php?module=article&view=' . $summary['id'] .'">' . $summary['title'] . "</a><br />\n"; } if (isset($content)) { $GLOBALS['CNT_article_popular']['title'] = $_SESSION['translate']->it('Popular Articles'); $GLOBALS['CNT_article_popular']['content'] = &$content; } } /* Edits the module's default settings. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function edit_configuration () { include(PHPWS_SOURCE_DIR . 'mod/article/inc/editconfig.php'); } /** * Saves the module's default settings to the database. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function save_configuration () { include(PHPWS_SOURCE_DIR . 'mod/article/inc/saveconfig.php'); } /** * Resets the module's default settings. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function reset_configuration () { $GLOBALS['core']->sqlDelete("mod_article_config"); $GLOBALS['core']->sqlInsert(array(),"mod_article_config", 0, 0, 0, 0); } /** * Determines whether user is authorized to edit, create, delete articles. * * @author Eloi George <el...@NO...> * @module Article Manager * @param action to authorize * @param username to compare against * @return TRUE or FALSE * @access public */ function can($action = NULL, $username = NULL) { if ($action == "edit") return ($_SESSION['OBJ_user']->allow_access('article', "edit_articles") || ((($this->val['users_can_submit'] && $_SESSION['OBJ_user']->isUser()) || $_SESSION['OBJ_user']->allow_access('article', "edit_own_article")) && $_SESSION['OBJ_user']->username==$username)); elseif ($action == "delete") return ($_SESSION['OBJ_user']->allow_access('article', "delete_articles") || ($_SESSION['OBJ_user']->allow_access('article', "delete_own_article") && $_SESSION['OBJ_user']->username==$username)); elseif ($action == "create") return ($_SESSION['OBJ_user']->allow_access('article', "create_articles") || ($this->val['users_can_submit'] && $_SESSION['OBJ_user']->isUser())); else return false; } /** * Allows adds or deletes of files from the Image Library * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function manage_library () { include(PHPWS_SOURCE_DIR . 'mod/article/conf/config.php'); $title = $_SESSION['translate']->it('Image Library Management'); /* Display Errors */ $content .= $this->get_error('LIB_loaded_image'); /* File upload section */ $myelements[0] = $GLOBALS['core']->formHidden('MAX_FILE_SIZE', '26000') . $GLOBALS['core']->formFile('LIB_loaded_image', 33, 255, $_SESSION['translate']->it('File to Upload').': ') . "\n " . $GLOBALS['core']->formSubmit($_SESSION['translate']->it("Save"), 'ARTICLE_vars[config:save_library_item]') . $_SESSION['OBJ_help']->show_link('article', "section_lib_image") . $GLOBALS['core']->formHidden('module', 'article'); $content .= "<br />\n" . $GLOBALS['core']->makeForm('LIB_add', 'index.php', $myelements, 'post', 0, TRUE) . "\n<br />\n"; /* Display table header */ $content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"> <tr> <td width=\"100%\" class=\"bg_dark\">Image Name</td> <td align=\"center\" class=\"bg_dark\">Action</td> </tr>\n"; /* Create array of library files & sort 'em */ $dir_handle = opendir($this->image_path . 'library/'); while($value = readdir($dir_handle)) { if ($value != '.' && $value != '..' && $value != 'CVS') $lib_array[$value] = $value; } closedir($dir_handle); /* Sort the list & output to a table */ if ($lib_array) { asort($lib_array); foreach($lib_array as $value) { $content .= "<tr>\n\t<td width=\"100%\"$bg>"; $myelements[0] = $GLOBALS['core']->formHidden('module', 'article') . $GLOBALS['core']->formHidden("LIB_image", $value) . stripslashes($value) . "</td>\n\t<td$bg>" . $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Delete') , "ARTICLE_vars[config:delete_library_item]") . "\n"; $content .= $GLOBALS['core']->makeForm('LIB_management', 'index.php', $myelements, 'post', 0, 0) . "\n\t</td>\n</tr>"; $GLOBALS['core']->toggle($bg, " class=\"bg_medium\""); } } else $content .= "<tr>\n\t<td>" . $_SESSION['translate']->it('No Images in Library') ."</td>\n</tr>"; $content .= "\n</table>\n"; $_SESSION['OBJ_layout']->popbox($title, $content, NULL, 'CNT_article'); } /** * Deletes an imagefile from the library. * * @author Adam Morton <ad...@NO...> * @module Article Manager * @param string imagename: Name of file to delete. * @return none */ function del_lib_item ($imagename = NULL) { include(PHPWS_SOURCE_DIR . 'mod/article/conf/config.php'); if ($imagename) if (!unlink($this->image_path . 'library/' . $imagename)) $this->error['LIB_loaded_image'] .= $_SESSION['translate']->it('[var1] could not be deleted.', $imagename); } /** * Saves an imagefile to the library. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function save_lib_item () { $image = EZform::saveImage('LIB_loaded_image' , $this->image_path . 'library/' , $this->val['max_image_width'] , $this->val['max_image_height'] , $this->val['max_image_size'] * 1024); if (!is_array($image)) $GLOBALS['CNT_article']['content'] .= $image; } /** * Prints an error message selected by passing the function an error $type * * @author Eloi George <el...@NO...> * @module Article Manager * @param array type : Type of error that occured. Prints an appropriate error message * based on the type. * @return string : Error output text */ function get_error ($type = NULL) { if (isset($this->error[$type])) { $GLOBALS['CNT_article']['content'] .= "\n<span class=\"errortext\">ERROR!<br />\n"; foreach($this->error[$type] as $msg) $GLOBALS['CNT_article']['content'] .= $msg . "<br />\n"; $GLOBALS['CNT_article']['content'] .= "</span>\n"; unset($this->error[$type]); } } /** * Approves an article for publication * * @author Eloi George <el...@NO...> * @module Article Manager * @param array info_array : Array containing the Article Id * @return none */ function approve ($id) { $query_data['approved'] = true; $GLOBALS['core']->sqlUpdate($query_data, 'mod_article', 'id', $id); PHPWS_Fatcat::activate($id, 'article'); } /** * Deletes an unpublishable article * * @author Eloi George <el...@NO...> * @module Article Manager * @param array info_array : Array containing the Article Id * @return none */ function refuse ($id) { $GLOBALS['core']->sqlDelete('mod_article_sections', 'article_id', $id); $GLOBALS['core']->sqlDelete('mod_article', 'id', $id); PHPWS_Fatcat::purge($id, 'article'); } /** * Creates sql text to retrieve published pages. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return string : sql text */ function get_published_sql () { $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"; } } ?> --- NEW FILE: Section.php --- <?php /** * This is the PHPWS_Article_Section class. It holds data for a single section in a article. * It also contains functions for manipulation of the data and updating or * deleting this section. * * @version \$Id\$ * * @author Eloi George <el...@NO...> * @basecode Adam Morton's PageMaster Module * @package phpWebSite * @module Article Manager * @param int id : Database id of this article * @param string title : Title of this article * @param string text : Body text of this article * @param array image : Array of image information * name = Image Name. * directory = Location of Image File. * height = Height of Image (in pixels). NULL for Library Images. * width = Width of Image (in pixels). NULL for Library Images. * alt = Alternate text to display for the Image. * link = If Image is a link, this contains the target URL. * caption = An optional line of text to display below the image * @param string template : Template to use for displaying this section * @param int article_id : Database Id of this section's parent article * @param int new_page : Whether this section starts on a new page or not * @param int edited : FLAG Whether this section has been changed. * @param string old_image : Name of the image that's being replaced * @param string temp_image : Name of the new image sitting in a temporary position */ class PHPWS_Article_Section { var $id; var $title; var $text; var $image; var $template; var $article_id; var $new_page; var $edited; var $old_image; var $temp_image; /** * Constructor for the PHPWS_Article_Section object. * * @author Adam Morton <ad...@NO...> * @param int SECT_id : Database id of the section's data to be loaded into the class. * @param int data : To optimize the # of table queries, PHPWS_Article can send the * data as an array. * @return none */ function PHPWS_Article_Section ($SECT_id = NULL, $data = NULL) { if($SECT_id) { if ($data==null) { $result = $GLOBALS['core']->sqlSelect("mod_article_sections", 'id', $SECT_id); $data = &$result[0]; } $this->id = $SECT_id; $this->title = $data['title']; $this->text = $data['text']; $this->image['name'] = $data['image_name']; $this->image['directory'] = $data['image_directory']; $this->image['height'] = $data['image_height']; $this->image['width'] = $data['image_width']; $this->image['alt'] = $data['image_alt']; $this->image['link'] = $data['image_link']; $this->image['caption'] = $data['image_caption']; $this->template = $data['template']; $this->new_page = $data['new_page']; $this->article_id = $data['article_id']; } else { /* Assign a temporary id to this new section and increment it */ $this->id = $_SESSION['SES_ART_article']->sectionID++; $this->title = $this->text = ''; $this->image['name'] = $this->image['directory'] = $this->image['height'] = $this->image['width'] = $this->image['alt'] = $this->image['link'] = $this->image['caption'] = ''; $this->template = $_SESSION['SES_ART_master']->val['default_section_template']; $this->new_page = 0; } $this->edited = 0; } /** * Displays this section in the context of a article object. * * @author Adam Morton <ad...@NO...> * @author Eloi George <el...@NO...> * @param boolean $edit_mode Simple flag to tell section whether or not the article is in edit mode. * @param string article_id : id of this article * @param string created_username : username of the user that created this article * @param date created_date : Date this article was created * @param string updated_username : username of the lastuser to update this article * @param date updated_date : Date this article was last updated * @return Display data for this section. */ function view_section ($edit_mode = NULL,&$article_id,&$created_username,&$created_date,&$updated_username,&$updated_date) { include(PHPWS_SOURCE_DIR . 'mod/article/conf/config.php'); if($this->template) { /* Develop image appearance */ if ($this->image['name']) { /* If this is a temporary image, look in the main directory */ if ($this->temp_image) $temp_image = $_SESSION['SES_ART_master']->image_directory . $this->image['name']; else $temp_image = $_SESSION['SES_ART_master']->image_directory . $this->image['directory'] . $this->image['name']; /* If this is a library picture, calculate image specs on the fly */ /* in case the picture has been altered. */ if ($this->image['directory'] == 'library/') { /* Determine image display specs */ $image_size = getimagesize($temp_image); $this->image['width'] = $image_size[0]; $this->image['height'] = $image_size[1]; } $image_string = '<img src="' . $temp_image . '" width="' . $this->image['width'] . '" height="' . $this->image['height'] . '" alt="' . $this->image['alt'] . '" title="' . $this->image['alt'] . '" />'; if ($this->image['link']) $image_string = '<a href="http://'. $this->image['link'] . '">' . $image_string . '</a>'; $template_array['IMAGE'] = $image_string; $template_array['CAPTION'] = $this->image['caption']; } if (!$this->title) $this->title = ' '; $template_array['TITLE'] = $this->title; $template_array['TEXT'] = PHPWS_Core::parseOutput($this->text); $template_array['PRINT_ICON'] = '<a href="index.php?module=article&op=view_printable&ARTICLE_id=' . $article_id . '&lay_quiet=1" target="_blank"><img src="mod/article/img/print.gif" border="0" width="22" height="20" alt="Printable Version"/></a>'; $template_array['CREATED_DATE'] = $created_date; $template_array['UPDATED_DATE'] = $updated_date; // If Username is blank, substitute "Anonymous" if(!$created_username) $template_array['CREATED_USER'] = $_SESSION['translate']->it('Anonymous'); else $template_array['CREATED_USER'] = $created_username; if(!$updated_username) $template_array['UPDATED_USER'] = $_SESSION['translate']->it('Anonymous'); else $template_array['UPDATED_USER'] = $updated_username; $section_content = $GLOBALS['core']->processTemplate($template_array, 'article', "section/".$this->template . ".tpl"); } if ($edit_mode) { $myform[0] = $GLOBALS["core"]->formHidden("module", "article") . $GLOBALS["core"]->formHidden("SECT_id", $this->id); $remove = $_SESSION['translate']->it('Remove'); if($_SESSION['OBJ_user']->js_on) { $js_vars['message'] = $_SESSION['translate']->it('Are you sure you want to [var1] [var2]?' , $_SESSION['translate']->it('delete'), $this->title); $js_vars['name'] = $remove; $js_vars['value'] = 'section=remove:'.$this->id; $js_vars['location'] = 'index.php?module=article§ion=remove&SECT_id='.$this->id; $myform[0] .= $GLOBALS['core']->js_insert("confirm", 'SECT_options', $this->id, 0, $js_vars); } else $myform[0] .= $GLOBALS['core']->formSubmit($remove, 'ARTICLE_vars[section:remove]'); $myform[0] .= $_SESSION['OBJ_help']->show_link('article', 'section_remove'); $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Edit'), 'ARTICLE_vars[section:edit]') .$_SESSION['OBJ_help']->show_link('article', 'section_edit'); if (count($_SESSION['SES_ART_article']->order)>1) { $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Move Up'), 'ARTICLE_vars[section:move_up]'); $myform[0] .= $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Move Down'), 'ARTICLE_vars[section:move_down]') .$_SESSION['OBJ_help']->show_link('article', 'section_move'); } $section_content .= "<div class=\"smalltext\" style=\"clear : both;\" align=\"right\">\n" . $GLOBALS["core"]->makeForm("SECT_options" . $this->id, 'index.php#' . $this->id, $myform, "post", 0, 0) . '</div><hr />'; } return $section_content; } /** * Displays an editing interface for this section. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none * */ function edit_section () { include(PHPWS_SOURCE_DIR . 'mod/article/conf/config.php'); if (is_numeric($this->id)) $section_title = '<div name="'.$this->id.'" class="bg_dark">' . $_SESSION['translate']->it('Edit Section') . '</div>'; else $section_title = '<div name="new section" class="bg_dark">' . $_SESSION['translate']->it('New Section') . '</div>'; $myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it("Start on new page?")) . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . "<br />"; $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_title') . $_SESSION['translate']->it('Section Title').':<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_title'); $myelements[0] .= $GLOBALS['core']->formTextField('SECT_title', htmlspecialchars($this->title), 55, 79) . $_SESSION['OBJ_help']->show_link('article', 'section_title') . '<br />'; $myelements[0] .= $_SESSION['translate']->it('Text').':<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text'); $myelements[0] .= $GLOBALS['core']->formTextArea("SECT_text", stripslashes($this->text), 20, 79) . $_SESSION['OBJ_help']->show_link('article', 'section_text') . '<br />'; /* If there is a current image, show it */ if($this->image['name']) /* If this is a temporary image, look in the main directory */ if ($this->temp_image) $myelements[0] .= "<img src=\"" .$_SESSION['SES_ART_master']->image_directory . $this->image['name'] . "\" /><br />"; else $myelements[0] .= "<img src=\"" .$_SESSION['SES_ART_master']->image_directory . $this->image['directory'] . $this->image['name'] . "\" /><br />"; /* If user is allowed to play around with the images... */ if ($_SESSION['OBJ_user']->allow_access('article', 'images_in_articles') || ($_SESSION['SES_ART_master']->val['user_images_in_article'] && $_SESSION['OBJ_user']->isUser())) { /* allow them to remove it */ if($this->image['name']) $myelements[0] .= $_SESSION['translate']->it('Remove Image').'? ' . $GLOBALS['core']->formCheckBox('removeImage', 1, NULL, NULL) . "<br />"; /* If allowed, upload your image here */ if ($_SESSION['OBJ_user']->allow_access('article', 'upload_images') || ($_SESSION['SES_ART_master']->val['user_upload_images'] && $_SESSION['OBJ_user']->isUser())) { $myelements[0] .= $GLOBALS['core']->formHidden('MAX_FILE_SIZE', '26000'); $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_loaded_image') . $_SESSION['translate']->it("Upload a new image").': ' . $GLOBALS['core']->formFile('SECT_loaded_image', 33, 255) . $_SESSION['OBJ_help']->show_link('article', 'section_image') . '<br />'; } /* Or you can select one from the image library */ $dir_handle = opendir($_SESSION['SES_ART_master']->image_path . 'library/'); while($value = readdir($dir_handle)) { if ($value != "." && $value != ".." && $value != "CVS") $lib_array[$value] = $value; if ($value == $this->image['name']) $lib_selected = $value; } closedir($dir_handle); /* Sort the list & put the default "None" at the top */ if ($lib_array) { asort($lib_array); $lib_array = array('None'=>'None') + $lib_array; } else $lib_array = array('None'=>'None'); $myelements[0] .= $_SESSION['translate']->it('Or select one from the library').': ' . $GLOBALS['core']->formSelect('SECT_lib_image', $lib_array, $this->image['name'], NULL, NULL, NULL) . $_SESSION['OBJ_help']->show_link('article', "section_lib_image") . "<br /><br />"; /* Enter alt text, link, & image_caption */ $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_alt') . $_SESSION['translate']->it('Short Image Description').': ' . $GLOBALS['core']->formTextField('SECT_alt', htmlspecialchars($this->image['alt']), 79, 255) . $_SESSION['OBJ_help']->show_link('article', 'section_image_desc') . '<br />'; $myelements[0] .= $_SESSION['translate']->it('This Image Links To') . '...: ' . $GLOBALS['core']->formTextField('SECT_link', htmlspecialchars($this->image['link']), 79, 255) . $_SESSION['OBJ_help']->show_link('article', 'section_image_link') . '<br />'; $myelements[0] .= $_SESSION['translate']->it('Link caption').': ' . $GLOBALS['core']->formTextField('SECT_image_caption', htmlspecialchars($this->image['caption']), 79, 255) . $_SESSION['OBJ_help']->show_link('article', 'section_image_caption') . '<br />'; } /* Template Selection */ if (($_SESSION['OBJ_user']->allow_access('article', 'choose_section_template') || ($_SESSION['SES_ART_master']->val['users_select_section_tpl'] && $_SESSION['OBJ_user']->isUser()) || (!$_SESSION['OBJ_user']->allow_access('article', 'insert_external_pages') && substr($this->template, 0, 11)=='Page Insert')) && $sect_tpl_array = $GLOBALS['core']->listTemplates('article',false,'section')) { /* If user cannot embed external pages, strip the templates out */ if (!$_SESSION['OBJ_user']->allow_access('article', 'insert_external_pages')) { $stop = sizeof($sect_tpl_array); for ($count = 1; ($count < $stop); $count++) if (substr($sect_tpl_array[$count], 0, 11)=='Page Insert') unset($sect_tpl_array[$count]); } /* Strip the extensions off for readability */ $sect_tpl_array = str_replace('.tpl', NULL, $sect_tpl_array); /* Sort the list */ asort($sect_tpl_array); $myelements[0] .= $_SESSION['translate']->it('Section Template').': ' . $GLOBALS['core']->formSelect("SECT_template", $sect_tpl_array, $this->template, true, NULL, NULL) . $_SESSION['OBJ_help']->show_link('article', 'section_template') . "<br /><br />"; } $myelements[0] .= $GLOBALS["core"]->formHidden("module", "article") . $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Save Section'), 'ARTICLE_vars[section:save]') . $_SESSION['OBJ_help']->show_link('article', 'section_save'); return $section_title . $GLOBALS["core"]->makeForm('SECT_edit', 'index.php#'.$this->id, $myelements, 'post', 0, 1) . '<br />'; } /** * Applies changes to this section in memory. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function update () { $temp_name = NULL; if(!$this->title && !$this->text && !isset($_POST['SECT_title']) && !isset($_POST['SECT_text'])) { $_SESSION['SES_ART_master']->error['SECT_title'][] = $_SESSION['translate']->it("You tried to save an empty section"); return; } /* Image Removal */ if(isset($_POST['removeImage']) && $this->image['name'] && $this->image['directory']!="library/") { /* If this is the original image, place its name into "old_image" */ if (!$this->old_image) $this->old_image = $this->image['name']; /* otherwise, if this is a new(uncommitted) image, delete it */ else { @unlink($_SESSION['SES_ART_master']->image_path.$this->image['name']); $this->temp_image = NULL; } /* Blank out the "imagename" var */ $this->image['name'] = NULL; } /* If there was posted data, assign it to the proper variables */ if (isset($_POST['SECT_title'])) $this->title = PHPWS_Core::parseInput($_POST['SECT_title']); if (isset($_POST['SECT_text'])) $this->text = PHPWS_Core::parseInput($_POST['SECT_text']); if (isset($_POST['SECT_alt'])) $this->image['alt'] = $_POST['SECT_alt']; if (isset($_POST['SECT_link'])) $this->image['link'] = $_POST['SECT_link']; if (isset($_POST['SECT_image_caption'])) $this->image['caption'] = $_POST['SECT_image_caption']; if (isset($_POST['SECT_template'])) $this->template = $_POST['SECT_template']; if (isset($_POST['SECT_new_page'])) $this->new_page = 1; else $this->new_page = 0; /* If a file was uploaded and is valid... */ if ($_FILES['SECT_loaded_image']['size']) { /* Give it a unique name */ $ext = strrchr($_FILES['SECT_loaded_image']['name'], "."); $_FILES['SECT_loaded_image']['name'] = time() . "-" . $_SESSION['OBJ_user']->user_id . $ext; /* Place it into the temporary directory */ $image = EZform::saveImage("SECT_loaded_image" , $_SESSION['SES_ART_master']->image_path , $_SESSION['SES_ART_master']->val['max_image_width'] , $_SESSION['SES_ART_master']->val['max_image_height'] , $_SESSION['SES_ART_master']->val['max_image_size'] * 1024); if (is_array($image)) { /* If this is replacing the original image, place the original into "old_image" */ if (!$this->old_image) $this->old_image = $this->image['name']; else /* If this is replacing a new(uncommitted) image, delete the obsolete one */ if ($this->temp_image) @unlink($_SESSION['SES_ART_master']->image_path.$this->temp_image); /* Set the new image information */ $this->image = array_merge($this->image, $image); $this->temp_image = $this->image['name']; if (!$this->image['directory'] || $this->image['directory']=="library/") $this->image['directory'] = $this->AssignDir(); } else $GLOBALS['CNT_article']['content'] .= $image; } /* otherwise, if a file was selected from the library... */ elseif ($_POST['SECT_lib_image'] != "None") { /* Assign the file to the temp variables */ $this->image['name'] = $_POST['SECT_lib_image']; $this->image['directory'] = "library/"; /* If this is replacing a new(uncommitted) image, delete the obsolete one */ if ($this->temp_image) @unlink($_SESSION['SES_ART_master']->image_path.$this->temp_image); $this->temp_image = $this->image['height'] = $this->image['width'] = ""; } /* Make sure that there's an alt tag for the image */ if($this->image['name']) if (!$this->image['alt']) $_SESSION['SES_ART_master']->error['SECT_alt'][] = $_SESSION['translate']->it("You must provide a short description for your image"); /* If this is a new section, add it to the article */ if(!in_array($this->id, $_SESSION['SES_ART_article']->order)) $_SESSION['SES_ART_article']->add_section(); else /* otherwise, just update the article's data */ $_SESSION['SES_ART_article']->update_section($this->id); } /** * Saves this section to the database. * * @author Eloi George <el...@NO...> * @module Article Manager * @param int parentid : ID of the parent article * @return none */ function save ($parentid=NULL) { /* Setup query data for this section. */ $query_data['title'] = $this->title; $query_data['text'] = $this->text; $query_data['template'] = $this->template; $query_data['new_page'] = $this->new_page; if ($parentid) $this->article_id = $query_data['article_id'] = $parentid; /* If there's an old image here... */ if ($this->old_image) { /* If WIKI is running, copy the old image to "/old" */ if (isset($_SESSION['OBJ_WIKI'])) PHPWS_File::fileCopy($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->old_image , $_SESSION['SES_ART_master']->image_path."old/" , $this->old_image, TRUE, FALSE); /* Get rid of it */ @unlink($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->old_image); } /* If none exists, Pre-allocate an ID for this section */ if(!is_numeric($this->id)) $newid = $GLOBALS['core']->db->nextId($GLOBALS['core']->tbl_prefix . "mod_article_sections"); else $newid = $this->id; /* Assign the new image data */ if ($this->image['name']) { $query_data['image_name'] = $this->image['name']; $query_data['image_directory'] = $this->image['directory']; $query_data['image_height'] = $this->image['height']; $query_data['image_width'] = $this->image['width']; $query_data['image_alt'] = PHPWS_Core::parseInput($this->image['alt']); $query_data['image_link'] = $this->image['link']; $query_data['image_caption'] = PHPWS_Core::parseInput($this->image['caption']); /* Move any images from its holding area to its assigned space */ if ($this->temp_image && PHPWS_File::fileCopy($_SESSION['SES_ART_master']->image_path.$this->temp_image , $_SESSION['SES_ART_master']->image_path.$this->image['directory'] , $newid.strrchr($this->image['name'], "."), TRUE, FALSE)) { @unlink($_SESSION['SES_ART_master']->image_path.$this->image['name']); $query_data['image_name'] = $this->image['name'] = $newid.strrchr($this->image['name'], "."); } } else $query_data['image_height'] = $query_data['image_width'] = $query_data['image_alt'] = $query_data['image_link'] = $query_data['image_caption'] = ""; /* If this is a new section, save it to get an ID assigned */ if(!is_numeric($this->id)) { /* Create a new article in the table */ $this->id = $query_data['id'] = $newid; $GLOBALS['core']->sqlInsert($query_data, 'mod_article_sections', 0, 0, 0, 0); } else /* otherwise, save the data */ $GLOBALS['core']->sqlUpdate($query_data, "mod_article_sections", 'id', $this->id); /* Erase section flags */ $this->edited = $this->old_image = $this->temp_image = NULL; } /** * Deletes this section from the database. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return none */ function delete_section () { $GLOBALS['core']->sqlDelete("mod_article_sections", 'id', $this->id); if ($this->image['name'] && $this->image['directory'] != "library/") @unlink($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->image['name']); } /** * Assigns a free image directory. * * Imagefile Storage Optimization * Most OSs optimally search & retrieve up to about 500 files per directory. * This function just makes new directories as the old ones are filled up. * It assumes that the first directory (/1) is already created. * * @author Eloi George <el...@NO...> * @module Article Manager * @param none * @return string : directory name */ function AssignDir () { /* Load up all numbered image directories */ $dir_list = array(); $dir_handle = opendir($_SESSION['SES_ART_master']->image_path); while($value = readdir($dir_handle)) { if (is_numeric($value) && is_dir($_SESSION['SES_ART_master']->image_path.$value)) $dir_list[] = $value; } closedir($dir_handle); /* Find the highest directory number in a sorted list */ sort($dir_list); $last_dir = end($dir_list); /* Count how many files are in the last directory. Allow for "." & ".."*/ $count = -2; if ($dir_handle = opendir($_SESSION['SES_ART_master']->image_path . $last_dir . "/")) while($value = readdir($dir_handle)) $count++; closedir($dir_handle); /* If this dir is full, then make a new directory */ if ($count > 499) { $oldumask = umask(0); if (!mkdir($_SESSION['SES_ART_master']->image_path . ++$last_dir, 0775)) $_SESSION['SES_ART_master']->error['SECT_loaded_image'][] = $_SESSION['translate']->it("Image Directory \"$last_dir\" could not be created. Image was not saved."); umask($oldumask); } return $last_dir . "/"; } } ?> |