From: <vo...@us...> - 2012-05-19 10:26:30
|
Revision: 9551 http://xoops.svn.sourceforge.net/xoops/?rev=9551&view=rev Author: voltan1 Date: 2012-05-19 10:26:22 +0000 (Sat, 19 May 2012) Log Message: ----------- Improve update system ( not complated and need test ) Modified Paths: -------------- XoopsModules/fmcontent/branches/news/admin/backend.php XoopsModules/fmcontent/branches/news/admin/permissions.php XoopsModules/fmcontent/branches/news/article.php XoopsModules/fmcontent/branches/news/class/story.php XoopsModules/fmcontent/branches/news/class/topic.php XoopsModules/fmcontent/branches/news/include/functions_update.php XoopsModules/fmcontent/branches/news/index.php XoopsModules/fmcontent/branches/news/pdf.php XoopsModules/fmcontent/branches/news/print.php XoopsModules/fmcontent/branches/news/rss.php XoopsModules/fmcontent/branches/news/sql/mysql.sql Added Paths: ----------- XoopsModules/fmcontent/branches/news/class/rate.php Modified: XoopsModules/fmcontent/branches/news/admin/backend.php =================================================================== --- XoopsModules/fmcontent/branches/news/admin/backend.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/admin/backend.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -67,7 +67,7 @@ $topic_id = $obj->db->getInsertId (); //permission - NewsPermission::News_SetPermission ( $NewsModule, 'news_access', $_POST ['groups_view'], $topic_id, true ); + NewsPermission::News_SetPermission ( $NewsModule, 'news_view', $_POST ['groups_view'], $topic_id, true ); NewsPermission::News_SetPermission ( $NewsModule, 'news_submit', $_POST ['groups_submit'], $topic_id, true ); // Redirect page @@ -96,7 +96,7 @@ NewsUtils::News_DeleteImg ( $NewsModule, 'topic_img', $obj ); } //permission - NewsPermission::News_SetPermission ( $NewsModule, 'news_access', $_POST ['groups_view'], $topic_id, false ); + NewsPermission::News_SetPermission ( $NewsModule, 'news_view', $_POST ['groups_view'], $topic_id, false ); NewsPermission::News_SetPermission ( $NewsModule, 'news_submit', $_POST ['groups_submit'], $topic_id, false ); if (! $topic_handler->insert ( $obj )) { Modified: XoopsModules/fmcontent/branches/news/admin/permissions.php =================================================================== --- XoopsModules/fmcontent/branches/news/admin/permissions.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/admin/permissions.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -64,7 +64,7 @@ break; case 2: $title_of_form = _NEWS_AM_PERMISSIONS_ACCESS; - $perm_name = "news_access"; + $perm_name = "news_view"; $perm_desc = ""; break; @@ -72,7 +72,13 @@ $title_of_form = _NEWS_AM_PERMISSIONS_SUBMIT; $perm_name = "news_submit"; $perm_desc = ""; - break; + break; + + case 4: + $title_of_form = _NEWS_AM_PERMISSIONS_APPROVE; + $perm_name = "news_approve"; + $perm_desc = ""; + break; } $permform = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, "admin/permissions.php"); Modified: XoopsModules/fmcontent/branches/news/article.php =================================================================== --- XoopsModules/fmcontent/branches/news/article.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/article.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -112,7 +112,7 @@ // Check the access permission $perm_handler = NewsPermission::getHandler (); - if (! $perm_handler->News_IsAllowed ( $xoopsUser, 'news_access', $view_topic->getVar ( 'topic_id' ), $NewsModule )) { + if (! $perm_handler->News_IsAllowed ( $xoopsUser, 'news_view', $view_topic->getVar ( 'topic_id' ), $NewsModule )) { redirect_header ( "index.php", 3, _NOPERM ); exit (); } Added: XoopsModules/fmcontent/branches/news/class/rate.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/rate.php (rev 0) +++ XoopsModules/fmcontent/branches/news/class/rate.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -0,0 +1,63 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program 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. +*/ + +/** + * News page class + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Hossein Azizabadi (AKA Voltan) + * @version $Id$ + */ + +class news_rate extends XoopsObject { + + /** + * Class constructor + */ + function news_rate() { + $this->initVar ( "rate_id", XOBJ_DTYPE_INT, '' ); + $this->initVar ( "rate_modid", XOBJ_DTYPE_INT, '' ); + $this->initVar ( "rate_story", XOBJ_DTYPE_INT, '' ); + $this->initVar ( "rate_user", XOBJ_DTYPE_INT, '' ); + $this->initVar ( "rate_rating", XOBJ_DTYPE_INT, '' ); + $this->initVar ( "rate_hostname", XOBJ_DTYPE_TXTBOX, '' ); + $this->initVar ( "rate_created", XOBJ_DTYPE_INT, '' ); + + + $this->db = $GLOBALS ['xoopsDB']; + $this->table = $this->db->prefix ( 'news_rate' ); + } + + /** + * Returns an array representation of the object + * + * @return array + **/ + function toArray() { + $ret = array (); + $vars = $this->getVars (); + foreach ( array_keys ( $vars ) as $i ) { + $ret [$i] = $this->getVar ( $i ); + } + return $ret; + } + +} + +class NewsRateHandler extends XoopsPersistableObjectHandler { + + function NewsRateHandler($db) { + parent::XoopsPersistableObjectHandler ( $db, 'news_rate', 'news_rate', 'rate_id', 'rate_story' ); + } + +} +?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/class/story.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/story.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/class/story.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -509,7 +509,7 @@ function News_GetContentList($NewsModule, $story_infos) { $ret = array (); - $access_topic = NewsPermission::News_GetItemIds ( 'news_access', $NewsModule); + $access_topic = NewsPermission::News_GetItemIds ( 'news_view', $NewsModule); $topic_handler = xoops_getmodulehandler ( 'topic', 'news' ); $topic_show = $topic_handler->allVisible($NewsModule,$story_infos ['topics'],$story_infos ['story_topic']); if(isset($story_infos ['story_subtopic'])) { @@ -574,7 +574,7 @@ function News_GetContentBlockList($NewsModule, $story_infos ,$topics) { $ret = array (); - $access_topic = NewsPermission::News_GetItemIds ( 'news_access', $NewsModule); + $access_topic = NewsPermission::News_GetItemIds ( 'news_view', $NewsModule); if (! (count ( $topics ) == 1 && $topics [0] == 0)) { $topiclist = array_intersect($access_topic , $topics); @@ -677,7 +677,7 @@ * use in homepage function in NewsUtils class */ function News_GetContentCount($NewsModule, $story_infos) { - $access_topic = NewsPermission::News_GetItemIds ( 'news_access', $NewsModule); + $access_topic = NewsPermission::News_GetItemIds ( 'news_view', $NewsModule); $topic_handler = xoops_getmodulehandler ( 'topic', 'news' ); $topic_show = $topic_handler->allVisible($NewsModule,$story_infos ['topics'],$story_infos ['story_topic']); if(isset($story_infos ['story_subtopic'])) { @@ -1177,7 +1177,7 @@ function News_Slide($NewsModule, $story_infos ,$topics) { $ret = array(); - $access_topic = NewsPermission::News_GetItemIds ( 'news_access', $NewsModule); + $access_topic = NewsPermission::News_GetItemIds ( 'news_view', $NewsModule); if (! (count ( $topics ) == 1 && $topics [0] == 0)) { $topiclist = array_intersect($access_topic , $topics); } else { @@ -1249,7 +1249,7 @@ function News_Marquee($NewsModule, $story_infos ,$topics) { $ret = array(); - $access_topic = NewsPermission::News_GetItemIds ( 'news_access', $NewsModule); + $access_topic = NewsPermission::News_GetItemIds ( 'news_view', $NewsModule); if (! (count ( $topics ) == 1 && $topics [0] == 0)) { $topiclist = array_intersect($access_topic , $topics); } else { Modified: XoopsModules/fmcontent/branches/news/class/topic.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/topic.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/class/topic.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -153,7 +153,7 @@ $full_list = array_keys ( $group_list ); global $xoopsModule; if (! $this->isNew ()) { - $groups_ids_view = $gperm_handler->getGroupIds ( 'news_access', $this->getVar ( 'topic_id' ), $xoopsModule->getVar ( 'mid' ) ); + $groups_ids_view = $gperm_handler->getGroupIds ( 'news_view', $this->getVar ( 'topic_id' ), $xoopsModule->getVar ( 'mid' ) ); $groups_ids_submit = $gperm_handler->getGroupIds ( 'news_submit', $this->getVar ( 'topic_id' ), $xoopsModule->getVar ( 'mid' ) ); $groups_ids_view = array_values ( $groups_ids_view ); $groups_NEWS_AM_can_view_checkbox = new XoopsFormCheckBox ( _NEWS_AM_PERMISSIONS_ACCESS, 'groups_view[]', $groups_ids_view ); Modified: XoopsModules/fmcontent/branches/news/include/functions_update.php =================================================================== --- XoopsModules/fmcontent/branches/news/include/functions_update.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/include/functions_update.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -23,44 +23,7 @@ * If your version is under 1.68 ( or 1.66 ) please frist update your old version to 1.68. */ function xoops_module_update_news($module, $version) { - - // start update to version 1.82 - if($version < 182) { - - $db = $GLOBALS["xoopsDB"]; - $error = false; - - include_once XOOPS_ROOT_PATH . '/modules/news/class/utils.php'; - - if(!NewsUtils::News_FieldExists('topic_style' ,$db->prefix('news_topic'))) - { - NewsUtils::News_AddField('`topic_style` varchar(64) NOT NULL' ,$db->prefix('news_topic')); - } - - } - // end update to version 1.82 - // start update to version 1.81 - if($version < 181) { - - $db = $GLOBALS["xoopsDB"]; - $error = false; - - include_once XOOPS_ROOT_PATH . '/modules/news/class/utils.php'; - - if(!NewsUtils::News_FieldExists('story_slide' ,$db->prefix('news_story'))) - { - NewsUtils::News_AddField('`story_slide` TINYINT( 1 ) NOT NULL AFTER `story_status`' ,$db->prefix('news_story')); - } - - if(!NewsUtils::News_FieldExists('story_marquee' ,$db->prefix('news_story'))) - { - NewsUtils::News_AddField('`story_marquee` TINYINT( 1 ) NOT NULL AFTER `story_slide`' ,$db->prefix('news_story')); - } - - } - // end update to version 1.81 - // start update to version 1.80 if($version < 180) { @@ -139,44 +102,44 @@ if(!NewsUtils::News_TableExists($db->prefix('news_story'))) { $sql = "CREATE TABLE " . $db->prefix('news_story') . " ( - `story_id` int(10) NOT NULL auto_increment, + `story_id` int(10) NOT NULL auto_increment, `story_title` varchar(255) NOT NULL, - `story_subtitle` varchar(255) NOT NULL, - `story_titleview` tinyint(1) NOT NULL default '1', - `story_topic` int(11) NOT NULL, - `story_type` varchar(25) NOT NULL, - `story_short` text NOT NULL, - `story_text` text NOT NULL, - `story_link` varchar(255) NOT NULL, - `story_words` varchar(255) NOT NULL, - `story_desc` varchar(255) NOT NULL, - `story_alias` varchar(255) NOT NULL, - `story_important` tinyint(1) NOT NULL, - `story_default` tinyint(1) NOT NULL, + `story_subtitle` varchar(255) NOT NULL, + `story_titleview` tinyint(1) NOT NULL default '1', + `story_topic` int(11) NOT NULL, + `story_type` varchar(25) NOT NULL, + `story_short` text NOT NULL, + `story_text` text NOT NULL, + `story_link` varchar(255) NOT NULL, + `story_words` varchar(255) NOT NULL, + `story_desc` varchar(255) NOT NULL, + `story_alias` varchar(255) NOT NULL, + `story_important` tinyint(1) NOT NULL, + `story_default` tinyint(1) NOT NULL, `story_status` tinyint(1) NOT NULL, `story_slide` tinyint(1) NOT NULL, - `story_marquee` tinyint(1) NOT NULL, - `story_create` int (10) NOT NULL default '0', + `story_marquee` tinyint(1) NOT NULL, + `story_create` int (10) NOT NULL default '0', `story_update` int (10) NOT NULL default '0', - `story_publish` int (10) NOT NULL default '0', - `story_expire` int (10) NOT NULL default '0', - `story_uid` int(11) NOT NULL, - `story_author` varchar(255) NOT NULL, - `story_source` varchar(255) NOT NULL, - `story_groups` varchar(255) NOT NULL, - `story_order` int(11) NOT NULL, - `story_next` int(11) NOT NULL default '0', - `story_prev` int(11) NOT NULL default '0', - `story_modid` int(11) NOT NULL, - `story_hits` int(11) NOT NULL, - `story_img` varchar(255) NOT NULL, + `story_publish` int (10) NOT NULL default '0', + `story_expire` int (10) NOT NULL default '0', + `story_uid` int(11) NOT NULL, + `story_author` varchar(255) NOT NULL, + `story_source` varchar(255) NOT NULL, + `story_groups` varchar(255) NOT NULL, + `story_order` int(11) NOT NULL, + `story_next` int(11) NOT NULL default '0', + `story_prev` int(11) NOT NULL default '0', + `story_modid` int(11) NOT NULL, + `story_hits` int(11) NOT NULL, + `story_img` varchar(255) NOT NULL, `story_comments` int(11) unsigned NOT NULL default '0', - `story_file` tinyint(3) NOT NULL, - `dohtml` tinyint(1) NOT NULL, - `dobr` tinyint(1) NOT NULL, - `doimage` tinyint(1) NOT NULL, - `dosmiley` tinyint(1) NOT NULL, - `doxcode` tinyint(1) NOT NULL, + `story_file` tinyint(3) NOT NULL, + `dohtml` tinyint(1) NOT NULL, + `dobr` tinyint(1) NOT NULL, + `doimage` tinyint(1) NOT NULL, + `dosmiley` tinyint(1) NOT NULL, + `doxcode` tinyint(1) NOT NULL, PRIMARY KEY (`story_id`), KEY `idxstoriestopic` (`story_topic`), KEY `story_title` (`story_title`), @@ -191,33 +154,34 @@ if(!NewsUtils::News_TableExists($db->prefix('news_topic'))) { $sql = "CREATE TABLE " . $db->prefix('news_topic') . " ( - `topic_id` int (11) unsigned NOT NULL auto_increment, - `topic_pid` int (5) unsigned NOT NULL , - `topic_title` varchar (255) NOT NULL , - `topic_desc` text NOT NULL , - `topic_img` varchar (255) NOT NULL , - `topic_weight` int (5) NOT NULL , - `topic_showtype` tinyint (4) NOT NULL , - `topic_perpage` tinyint (4) NOT NULL , - `topic_columns` tinyint (4) NOT NULL , - `topic_submitter` int (10) NOT NULL default '0', - `topic_date_created` int (10) NOT NULL default '0', - `topic_date_update` int (10) NOT NULL default '0', - `topic_asmenu` tinyint (1) NOT NULL default '1', - `topic_online` tinyint (1) NOT NULL default '1', - `topic_modid` int(11) NOT NULL, - `topic_showtopic` tinyint (1) NOT NULL default '0', - `topic_showauthor` tinyint (1) NOT NULL default '1', - `topic_showdate` tinyint (1) NOT NULL default '1', - `topic_showpdf` tinyint (1) NOT NULL default '1', - `topic_showprint` tinyint (1) NOT NULL default '1', - `topic_showmail` tinyint (1) NOT NULL default '1', - `topic_shownav` tinyint (1) NOT NULL default '1', - `topic_showhits` tinyint (1) NOT NULL default '1', - `topic_showcoms` tinyint (1) NOT NULL default '1', + `topic_id` int (11) unsigned NOT NULL auto_increment, + `topic_pid` int (5) unsigned NOT NULL , + `topic_title` varchar (255) NOT NULL , + `topic_desc` text NOT NULL , + `topic_img` varchar (255) NOT NULL , + `topic_weight` int (5) NOT NULL , + `topic_showtype` tinyint (4) NOT NULL , + `topic_perpage` tinyint (4) NOT NULL , + `topic_columns` tinyint (4) NOT NULL , + `topic_submitter` int (10) NOT NULL default '0', + `topic_date_created` int (10) NOT NULL default '0', + `topic_date_update` int (10) NOT NULL default '0', + `topic_asmenu` tinyint (1) NOT NULL default '1', + `topic_online` tinyint (1) NOT NULL default '1', + `topic_modid` int(11) NOT NULL, + `topic_showtopic` tinyint (1) NOT NULL default '0', + `topic_showauthor` tinyint (1) NOT NULL default '1', + `topic_showdate` tinyint (1) NOT NULL default '1', + `topic_showpdf` tinyint (1) NOT NULL default '1', + `topic_showprint` tinyint (1) NOT NULL default '1', + `topic_showmail` tinyint (1) NOT NULL default '1', + `topic_shownav` tinyint (1) NOT NULL default '1', + `topic_showhits` tinyint (1) NOT NULL default '1', + `topic_showcoms` tinyint (1) NOT NULL default '1', `topic_alias` varchar(255) NOT NULL, `topic_homepage` tinyint (4) NOT NULL , - `topic_show` tinyint (1) NOT NULL default '1', + `topic_show` tinyint (1) NOT NULL default '1', + `topic_style` varchar(64) NOT NULL, PRIMARY KEY (`topic_id`,`topic_modid`), UNIQUE KEY `file_id` (`topic_id`,`topic_modid`) ) ENGINE=MyISAM;"; @@ -245,6 +209,26 @@ return false; } } + + if(!NewsUtils::News_TableExists($db->prefix('news_rate'))) + { + $sql = "CREATE TABLE " . $db->prefix('news_rate') . " ( + `rate_id` int(11) unsigned NOT NULL auto_increment, + `rate_modid` int(11) NOT NULL, + `rate_story` int(8) unsigned NOT NULL default '0', + `rate_user` int(11) NOT NULL default '0', + `rate_rating` tinyint(3) unsigned NOT NULL default '0', + `rate_hostname` varchar(60) NOT NULL default '', + `rate_created` int(10) NOT NULL default '0', + PRIMARY KEY (rate_id), + KEY rate_user (rate_user), + KEY rate_hostname (rate_hostname), + KEY rate_story (rate_story) + ) ENGINE=MyISAM;"; + if (!$db->queryF($sql)) { + return false; + } + } //load needed handler $module_handler = xoops_gethandler('module'); @@ -253,6 +237,7 @@ $topic_handler = xoops_getmodulehandler('topic', 'news'); $story_handler = xoops_getmodulehandler('story', 'news'); $file_handler = xoops_getmodulehandler('file', 'news'); + $vote_handler = xoops_getmodulehandler('rate', 'news'); $newsModule = $module_handler->getByDirname('news'); $news_mid = $newsModule->getVar('mid'); @@ -280,9 +265,9 @@ return false; } - $result = $db->query('SELECT * FROM '.$old_articles.' WHERE topicid = '.$topic['topic_id'].' ORDER BY created'); + $result1 = $db->query('SELECT * FROM '.$old_articles.' WHERE topicid = '.$topic['topic_id'].' ORDER BY created'); - while ( $article = $db->fetchArray($result) ) { + while ( $article = $db->fetchArray($result1) ) { $storyobj = $story_handler->create (); $storyobj->setVar ( 'story_id', $article['storyid']); @@ -317,8 +302,8 @@ } // The files - $result4 = $db->query('SELECT * FROM '.$old_files.' WHERE storyid='.$article['storyid']); - while ( $file = $db->fetchArray($result4) ) { + $result2 = $db->query('SELECT * FROM '.$old_files.' WHERE storyid='.$article['storyid']); + while ( $file = $db->fetchArray($result2) ) { $fileobj = $file_handler->create (); $fileobj->setVar ( 'file_id', $file['fileid']); $fileobj->setVar ( 'file_modid', $news_mid); @@ -334,6 +319,24 @@ return false; } } + + // The votess + $result3 = $db->query('SELECT * FROM '.$old_rating.' WHERE storyid='.$article['storyid']); + while ( $vote = $db->fetchArray($result3) ) { + $voteobj = $vote_handler->create (); + $voteobj->setVar ( 'rate_id', $vote['ratingid']); + $voteobj->setVar ( 'rate_modid', $news_mid); + $voteobj->setVar ( 'rate_story', $vote['storyid']); + $voteobj->setVar ( 'rate_user', $vote['ratinguser']); + $voteobj->setVar ( 'rate_rating', $vote['rating']); + $voteobj->setVar ( 'rate_hostname', $vote['ratinghostname']); + $voteobj->setVar ( 'rate_created', $vote['ratingtimestamp']); + + if (! $vote_handler->insert ( $voteobj )) { + return false; + } + } + } } } Modified: XoopsModules/fmcontent/branches/news/index.php =================================================================== --- XoopsModules/fmcontent/branches/news/index.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/index.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -74,7 +74,7 @@ // Check the access permission $perm_handler = NewsPermission::getHandler (); - if (! $perm_handler->News_IsAllowed ( $xoopsUser, 'news_access', $view_topic->getVar ( 'topic_id' ), $NewsModule )) { + if (! $perm_handler->News_IsAllowed ( $xoopsUser, 'news_view', $view_topic->getVar ( 'topic_id' ), $NewsModule )) { redirect_header ( "index.php", 3, _NOPERM ); exit (); } Modified: XoopsModules/fmcontent/branches/news/pdf.php =================================================================== --- XoopsModules/fmcontent/branches/news/pdf.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/pdf.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -78,7 +78,7 @@ // Check the access permission $perm_handler = NewsPermission::getHandler(); - if (!$perm_handler->News_IsAllowed($xoopsUser, 'news_access', $view_topic->getVar('topic_id'), $NewsModule)) { + if (!$perm_handler->News_IsAllowed($xoopsUser, 'news_view', $view_topic->getVar('topic_id'), $NewsModule)) { redirect_header("index.php", 3, _NOPERM); exit; } Modified: XoopsModules/fmcontent/branches/news/print.php =================================================================== --- XoopsModules/fmcontent/branches/news/print.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/print.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -76,7 +76,7 @@ // Check the access permission $perm_handler = NewsPermission::getHandler(); - if (!$perm_handler->News_IsAllowed($xoopsUser, 'news_access', $view_topic->getVar('topic_id'), $NewsModule)) { + if (!$perm_handler->News_IsAllowed($xoopsUser, 'news_view', $view_topic->getVar('topic_id'), $NewsModule)) { redirect_header("index.php", 3, _NOPERM); exit; } Modified: XoopsModules/fmcontent/branches/news/rss.php =================================================================== --- XoopsModules/fmcontent/branches/news/rss.php 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/rss.php 2012-05-19 10:26:22 UTC (rev 9551) @@ -92,7 +92,7 @@ if ($story_topic != 0) { $permHandler = NewsPermission::getHandler(); - if ($permHandler->News_IsAllowed($xoopsUser, 'news_access', $story_topic)) { + if ($permHandler->News_IsAllowed($xoopsUser, 'news_view', $story_topic)) { $topic_obj = $topic_handler->get($story_topic); } } Modified: XoopsModules/fmcontent/branches/news/sql/mysql.sql =================================================================== --- XoopsModules/fmcontent/branches/news/sql/mysql.sql 2012-05-19 10:22:50 UTC (rev 9550) +++ XoopsModules/fmcontent/branches/news/sql/mysql.sql 2012-05-19 10:26:22 UTC (rev 9551) @@ -1,6 +1,6 @@ CREATE TABLE `news_story` ( `story_id` int(10) NOT NULL auto_increment, -`story_title` varchar(255) NOT NULL, +`story_title` varchar(255) NOT NULL, `story_subtitle` varchar(255) NOT NULL, `story_titleview` tinyint(1) NOT NULL default '1', `story_topic` int(11) NOT NULL, @@ -13,11 +13,11 @@ `story_alias` varchar(255) NOT NULL, `story_important` tinyint(1) NOT NULL, `story_default` tinyint(1) NOT NULL, -`story_status` tinyint(1) NOT NULL, -`story_slide` tinyint(1) NOT NULL, +`story_status` tinyint(1) NOT NULL, +`story_slide` tinyint(1) NOT NULL, `story_marquee` tinyint(1) NOT NULL, `story_create` int (10) NOT NULL default '0', -`story_update` int (10) NOT NULL default '0', +`story_update` int (10) NOT NULL default '0', `story_publish` int (10) NOT NULL default '0', `story_expire` int (10) NOT NULL default '0', `story_uid` int(11) NOT NULL, @@ -30,18 +30,18 @@ `story_modid` int(11) NOT NULL, `story_hits` int(11) NOT NULL, `story_img` varchar(255) NOT NULL, -`story_comments` int(11) unsigned NOT NULL default '0', +`story_comments` int(11) unsigned NOT NULL default '0', `story_file` tinyint(3) NOT NULL, `dohtml` tinyint(1) NOT NULL, `dobr` tinyint(1) NOT NULL, `doimage` tinyint(1) NOT NULL, `dosmiley` tinyint(1) NOT NULL, `doxcode` tinyint(1) NOT NULL, -PRIMARY KEY (`story_id`), -KEY `idxstoriestopic` (`story_topic`), -KEY `story_title` (`story_title`), -KEY `story_create` (`story_create`), -FULLTEXT KEY `search` (`story_title`,`story_short`,`story_text`,`story_subtitle`) +PRIMARY KEY (`story_id`), +KEY `idxstoriestopic` (`story_topic`), +KEY `story_title` (`story_title`), +KEY `story_create` (`story_create`), +FULLTEXT KEY `search` (`story_title`,`story_short`,`story_text`,`story_subtitle`) ) ENGINE=MyISAM; @@ -70,24 +70,38 @@ `topic_shownav` tinyint (1) NOT NULL default '1', `topic_showhits` tinyint (1) NOT NULL default '1', `topic_showcoms` tinyint (1) NOT NULL default '1', -`topic_alias` varchar(255) NOT NULL, -`topic_homepage` tinyint (4) NOT NULL , -`topic_show` tinyint (1) NOT NULL default '1', +`topic_alias` varchar(255) NOT NULL, +`topic_homepage` tinyint (4) NOT NULL , +`topic_show` tinyint (1) NOT NULL default '1', `topic_style` varchar(64) NOT NULL, PRIMARY KEY (`topic_id`,`topic_modid`), UNIQUE KEY `file_id` (`topic_id`,`topic_modid`) -) ENGINE=MyISAM; - -CREATE TABLE `news_file` ( -`file_id` int (11) unsigned NOT NULL auto_increment, -`file_modid` int(11) NOT NULL, -`file_title` varchar (255) NOT NULL , -`file_name` varchar (255) NOT NULL , -`file_content` int(11) NOT NULL, -`file_date` int(10) NOT NULL default '0', -`file_type` varchar(64) NOT NULL default '', -`file_status` tinyint(1) NOT NULL, -`file_hits` int(11) NOT NULL, +) ENGINE=MyISAM; + +CREATE TABLE `news_file` ( +`file_id` int (11) unsigned NOT NULL auto_increment, +`file_modid` int(11) NOT NULL, +`file_title` varchar (255) NOT NULL , +`file_name` varchar (255) NOT NULL , +`file_content` int(11) NOT NULL, +`file_date` int(10) NOT NULL default '0', +`file_type` varchar(64) NOT NULL default '', +`file_status` tinyint(1) NOT NULL, +`file_hits` int(11) NOT NULL, PRIMARY KEY (`file_id`,`file_modid`), UNIQUE KEY `file_id` (`file_id`,`file_modid`) +) ENGINE=MyISAM; + +CREATE TABLE `news_rate` ( +`rate_id` int(11) unsigned NOT NULL auto_increment, +`rate_modid` int(11) NOT NULL, +`rate_story` int(8) unsigned NOT NULL default '0', +`rate_user` int(11) NOT NULL default '0', +`rate_rating` tinyint(3) unsigned NOT NULL default '0', +`rate_hostname` varchar(60) NOT NULL default '', +`rate_created` int(10) NOT NULL default '0', +PRIMARY KEY (rate_id), +KEY rate_user (rate_user), +KEY rate_hostname (rate_hostname), +KEY rate_story (rate_story) ) ENGINE=MyISAM; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |