|
From: Sven <bra...@us...> - 2005-01-07 12:48:53
|
Update of /cvsroot/osbb/osbb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24847 Modified Files: board.php include.php Log Message: Some little bugfixes Index: board.php =================================================================== RCS file: /cvsroot/osbb/osbb/board.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** board.php 3 Jan 2005 12:55:43 -0000 1.4 --- board.php 7 Jan 2005 12:48:25 -0000 1.5 *************** *** 29,33 **** elseif (isset($_GET['id'])) $boardid = intval($_GET['id']); if (intval($boardid) == 0) linkError($lang->lang['board_wrongid']);*/ ! $boardid = requestInt('boardid'); $board_data = $sql->fetch_query("SELECT * FROM ".TABLE_BOARDS." AS b --- 29,33 ---- elseif (isset($_GET['id'])) $boardid = intval($_GET['id']); if (intval($boardid) == 0) linkError($lang->lang['board_wrongid']);*/ ! $boardid = requestInt('id'); $board_data = $sql->fetch_query("SELECT * FROM ".TABLE_BOARDS." AS b *************** *** 54,62 **** WHERE b.boardparentid = '".$boardid."' ORDER BY b.boardparentid ASC, b.boardsortno"); #todo: alphabetical, lastpost sorting! ! if ($sql->num_rows($res) == 0 && $board_data['boardtype'] == BOARD_CAT){ eval("\$foldericons = \"".$template->get('board_foldericons')."\";"); eval("echo \"".$template->get('board_nosubboards')."\";"); exit; ! } while ($row = $sql->fetch_array($res)){ $boardcache[$row['boardparentid']][$row['boardsortno']][$row['boardid']] = $row; --- 54,64 ---- WHERE b.boardparentid = '".$boardid."' ORDER BY b.boardparentid ASC, b.boardsortno"); #todo: alphabetical, lastpost sorting! ! /*if ($sql->num_rows($res) == 0 && $board_data['boardtype'] == BOARD_CAT){ eval("\$foldericons = \"".$template->get('board_foldericons')."\";"); eval("echo \"".$template->get('board_nosubboards')."\";"); exit; ! }*/ ! $subboards = $sql->num_rows($res); ! while ($row = $sql->fetch_array($res)){ $boardcache[$row['boardparentid']][$row['boardsortno']][$row['boardid']] = $row; *************** *** 138,160 **** LIMIT ".(intval($page)-1)*intval($tpp).",".intval($tpp)." "); ! if ($sql->num_rows($res) == 0 && $sql->num_rows($impres) == 0 && $board_data['boardtype'] == 1){ eval("\$foldericons = \"".$template->get('board_foldericons')."\";"); if (!isset($boards)) $boards = 0; eval("output(\"".$template->get('board_nothreads')."\");"); exit; ! } - //fusion important and normal threads to one array $thread_res = array(); ! while($row = $sql->fetch_array($impres)) $thread_res[] = $row; ! while($row = $sql->fetch_array($res)) $thread_res[] = $row; //thread output $threads = ''; ! $ab2 = array(); ! $ab2[] = 'a'; ! $ab2[] = 'b'; $count = 0; //while($row = $sql->fetch_array($res)){ while(list($t,$row) = each($thread_res)){ $old = 0; --- 140,199 ---- LIMIT ".(intval($page)-1)*intval($tpp).",".intval($tpp)." "); ! /*if ($sql->num_rows($res) == 0 && $sql->num_rows($impres) == 0 && $board_data['boardtype'] == 1){ eval("\$foldericons = \"".$template->get('board_foldericons')."\";"); if (!isset($boards)) $boards = 0; eval("output(\"".$template->get('board_nothreads')."\");"); exit; ! }*/ ! $threadcount = $sql->num_rows($res) + $sql->num_rows($impres); $thread_res = array(); ! while($row = $sql->fetch_array($impres)){ ! $old = 0; ! if($userid != 0){ ! if(isset($threadvisitcache[$row['threadid']])) $old = 1; ! if($row['posttime'] <= $userdata['userlastlogin']) $old = 1; ! }else{ ! if(isset($threadvisitcache[$row['threadid']])) $old = 1; ! if($row['posttime'] <= $_COOKIE['osbb_guestlastlogin']) $old = 1; ! } ! if($row['threaddeleted'] == 1){ ! if($row['threaddeletedreason'] == '' ) $row['threaddeletedreason'] = $lang->lang['thread_closed_noreason']; ! $row['threaddeletedreason'] = killHTML($row['threaddeletedreason']); ! $thread_data = $row; ! eval("\$deleted_info = \"".$lang->get4eval('thread_deleted_info')."\";"); ! }else $deleted_info = ''; ! $row['deleted_info'] = $deleted_info; ! $row['old'] = $old; ! $thread_res[] = $row; ! } ! while($row = $sql->fetch_array($res)){ ! $old = 0; ! if($userid != 0){ ! if(isset($threadvisitcache[$row['threadid']])) $old = 1; ! if($row['posttime'] <= $userdata['userlastlogin']) $old = 1; ! }else{ ! if(isset($threadvisitcache[$row['threadid']])) $old = 1; ! if($row['posttime'] <= $_COOKIE['osbb_guestlastlogin']) $old = 1; ! } ! if($row['threaddeleted'] == 1){ ! if($row['threaddeletedreason'] == '' ) $row['threaddeletedreason'] = $lang->lang['thread_closed_noreason']; ! $row['threaddeletedreason'] = killHTML($row['threaddeletedreason']); ! $thread_data = $row; ! eval("\$deleted_info = \"".$lang->get4eval('thread_deleted_info')."\";"); ! }else $deleted_info = ''; ! $row['deleted_info'] = $deleted_info; ! $row['old'] = $old; ! $thread_res[] = $row; ! } //thread output $threads = ''; ! $ab = array(); ! $ab[] = 'a'; ! $ab[] = 'b'; $count = 0; //while($row = $sql->fetch_array($res)){ + /* while(list($t,$row) = each($thread_res)){ $old = 0; *************** *** 185,189 **** eval("\$threads .= \"".$template->get('board_thread')."\";"); ! } //mark the board as read if needed --- 224,228 ---- eval("\$threads .= \"".$template->get('board_thread')."\";"); ! }*/ //mark the board as read if needed *************** *** 215,220 **** } eval("\$foldericons = \"".$template->get('board_foldericons')."\";"); if (!isset($boards)) $boards = 0; ! eval("output(\"".$template->get('board')."\");"); ?> --- 254,271 ---- } + + //assign some variables + $template->assignVar('board','threads',$thread_res); + $template->assignVar('board','threadcount',$threadcount); + $template->assignVar('board','subboardcount',$subboards); + $template->assignVar('board','button_newthread',makeButton('addthread','button_addthread','addthread.php?boardid='.$boardid.'&s='.$s)); + $template->assignVar('board','board',$board_data); + $template->assignVar('board','boardid',$boardid); + $template->assignVar('board','boards',(isset($boards) ? $boards : '')); + $template->assignVar('board','count',$count); + $template->assignVar('board','ab',$ab); + eval("\$foldericons = \"".$template->get('board_foldericons')."\";"); if (!isset($boards)) $boards = 0; ! output('board',$board_data['boardname']); ?> Index: include.php =================================================================== RCS file: /cvsroot/osbb/osbb/include.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** include.php 3 Jan 2005 17:16:52 -0000 1.10 --- include.php 7 Jan 2005 12:48:25 -0000 1.11 *************** *** 53,57 **** //if register_global is switched to 'on' remove ALL ${name} variables which are in the arrays _GET/_POST/_COOKIE/_SERVER AND _ENV ! if(ini_get('register_globals') == 1){ if(is_array($_GET)){ foreach($_GET as $var=>$val) unset(${$var}); --- 53,57 ---- //if register_global is switched to 'on' remove ALL ${name} variables which are in the arrays _GET/_POST/_COOKIE/_SERVER AND _ENV ! if(@ini_get('register_globals')){ if(is_array($_GET)){ foreach($_GET as $var=>$val) unset(${$var}); |