CVSROOT: /sources/phpgroupware Module name: forum Changes by: Dave Hall <skwashd> 07/09/27 12:07:49
Modified files: inc : class.boforum.inc.php class.uiforum.inc.php Log message: merge fixes from 16 CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/forum/inc/class.boforum.inc.php?cvsroot=phpgroupware&r1=1.12&r2=1.13 http://cvs.savannah.gnu.org/viewcvs/forum/inc/class.uiforum.inc.php?cvsroot=phpgroupware&r1=1.12&r2=1.13 Patches: Index: class.boforum.inc.php =================================================================== RCS file: /sources/phpgroupware/forum/inc/class.boforum.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -b -r1.12 -r1.13 --- class.boforum.inc.php 24 Jan 2007 17:11:13 -0000 1.12 +++ class.boforum.inc.php 27 Sep 2007 12:07:49 -0000 1.13 @@ -11,7 +11,7 @@ * option) any later version. * \*****************************************************************************/ - /* $Id: class.boforum.inc.php,v 1.12 2007/01/24 17:11:13 Caeies Exp $ */ + /* $Id: class.boforum.inc.php,v 1.13 2007/09/27 12:07:49 skwashd Exp $ */ class boforum { @@ -45,22 +45,35 @@ $this->use_session = True; } - $var = Array( - 'view', - 'location', - 'cat_id', - 'forum_id' + $input_vars = Array + ( + 'view' => 'string', + 'location' => 'string', + 'cat_id' => 'int', + 'forum_id' => 'int' ); - for($i=0;$i<count($var);$i++) + foreach ( $input_vars as $vname => $vtype ) { - $var_str = $var[$i]; -// $this->$var_str = intval(get_var($var_str,'Array('DEFAULT','GET','POST'),$this->$var_str)); - $this->$var_str = get_var($var_str,Array('DEFAULT','GET','POST'),$this->$var_str); + if ( $vtype == 'string' ) + { + $this->$vname = isset($_REQUEST[$vname]) ? addslashes($_REQUEST[$vname]) : ''; + } + elseif ( $vtype == 'int' ) + { + $this->$vname = isset($_REQUEST[$vname]) ? (int) $_REQUEST[$vname] : 0; + } + else + { + $this->$vname = NULL;//make it empty if invalid } - if([EMAIL PROTECTED]($this->view)) + } + + if ( !isset($this->view) || $this->view == '' ) { - $this->view = $GLOBALS['phpgw_info']['user']['preferences']['forum']['default_view']; + $this->view = $GLOBALS['phpgw_info']['user']['preferences']['forum']['default_view'] + ? $GLOBALS['phpgw_info']['user']['preferences']['forum']['default_view'] + : 'collapsed'; } } Index: class.uiforum.inc.php =================================================================== RCS file: /sources/phpgroupware/forum/inc/class.uiforum.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -b -r1.12 -r1.13 --- class.uiforum.inc.php 24 Jan 2007 17:11:13 -0000 1.12 +++ class.uiforum.inc.php 27 Sep 2007 12:07:49 -0000 1.13 @@ -11,7 +11,7 @@ * option) any later version. * \*****************************************************************************/ - /* $Id: class.uiforum.inc.php,v 1.12 2007/01/24 17:11:13 Caeies Exp $ */ + /* $Id: class.uiforum.inc.php,v 1.13 2007/09/27 12:07:49 skwashd Exp $ */ class uiforum { @@ -166,6 +166,7 @@ 'THREADS_LINK' => $GLOBALS['phpgw']->link('/index.php', Array( 'menuaction' => 'forum.uiforum.threads', + 'cat_id' => (int) $this->bo->cat_id, 'forum_id' => $forum['id'] ) ), @@ -241,6 +242,8 @@ 'READ_LINK' => $GLOBALS['phpgw']->link('/index.php', Array( 'menuaction' => 'forum.uiforum.read', + 'cat_id' => $this->bo->cat_id, + 'forum_id' => $this->bo->forum_id, 'msg' => $thread['id'] ) ), @@ -253,7 +256,9 @@ 'THREADS_LINK' => $GLOBALS['phpgw']->link('/index.php', Array( 'menuaction' => 'forum.uiforum.threads', - 'view' => 'threads' + 'view' => 'threads', + 'cat_id' => $this->bo->cat_id, + 'forum_id' => $this->bo->forum_id ) ), 'LANG_THREADS' => lang('View Threads') @@ -478,7 +483,7 @@ 'FORUM_LINK' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.uiforum.forum')), 'MAIN_LINK' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.uiforum.index')), 'POST_LINK' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.uiforum.post')), - 'THREADS_LINK' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.uiforum.threads')), + 'THREADS_LINK' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.uiforum.threads', 'cat_id' => $this->bo->cat_id, 'forum_id' => $this->bo->forum_id)), 'SEARCH_LINK' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.uiforum.search')), 'POST_ACTION' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'forum.boforum.post')), 'CAT_ID' => $this->bo->cat_id, _______________________________________________ phpGroupWare-cvs mailing list phpGroupWare-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/phpgroupware-cvs