From: vladimir c. <ch...@us...> - 2002-03-29 15:53:17
|
Update of /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14/admin/modules In directory usw-pr-cvs1:/tmp/cvs-serv11550 Modified Files: COrderF.php COrderS.php Removed Files: COrder.php Log Message: categories reordering restored Index: COrderF.php =================================================================== RCS file: /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14/admin/modules/COrderF.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** COrderF.php 29 Mar 2002 14:29:36 -0000 1.4 --- COrderF.php 29 Mar 2002 15:53:14 -0000 1.5 *************** *** 4,37 **** if (!authorised(0, 'phpBB_14::', '::', ACCESS_ADMIN)) { echo "Access Denied"; } ! function phpBB_14_ReorderForums($cat_id) { global $bbtable, $hlpfile; include("header.php"); GraphicAdmin($hlpfile); opentable(); ! echo "<center><a class=\"pn-pagetitle\" href=\"admin.php?op=phpBB_14\">"._PHPBB_ADMINFORUMSPANEL."</a></center>"; closetable(); echo "<br>"; OpenTable(); ! echo "<center><font class=\"pn-title\">"._PHPBB_REORDERFORUMS."</font></center><br><br>"; ! //list the categories to be reordered ! $result = mysql_query("SELECT forum_id, forum_name, forum_order ! FROM $bbtable[forums] ! WHERE cat_id='".$cat_id."' ! ORDER BY forum_order"); echo "<table width=\"100%\">"; ! $numforums = mysql_num_rows($result); $currentrow = 1; ! while(list($forum_id, $forum_name, $forum_order) = mysql_fetch_row($result)) { echo "<tr>"; ! echo "<td class=\"pn-normal\">$forum_name</td>"; if ($currentrow != 1) { ! echo "<td align=\"center\"><a class=\"pn-normal\" href=\"admin.php?op=phpBB_14_ReorderForumsMove&forum_id=$forum_id&forum_order=$forum_order&direction=up\">Move Up</a></td>"; }else{ echo "<td> </td>"; } ! if ($currentrow != $numforums) { ! echo "<td align=\"center\"><a class=\"pn-normal\" href=\"admin.php?op=phpBB_14_ReorderForumsMove&forum_id=$forum_id&forum_order=$forum_order&direction=down\">Move Down</td>"; }else{ echo "<td> </td>"; --- 4,35 ---- if (!authorised(0, 'phpBB_14::', '::', ACCESS_ADMIN)) { echo "Access Denied"; } ! function phpBB_14_admin_ReorderCategoriesForm($var,$module) { global $bbtable, $hlpfile; include("header.php"); GraphicAdmin($hlpfile); opentable(); ! echo "<center><a class=\"pn-pagetitle\" href=\"admin.php?op=main&module=".$module."\">"._PHPBB_ADMINFORUMSPANEL."</a></center>"; closetable(); echo "<br>"; OpenTable(); ! echo "<center><font class=\"pn-title\">"._PHPBB_REORDERCATEGORIES."</font></center><br><br>"; ! $result = mysql_query("SELECT cat_id, cat_title, cat_order ! FROM $bbtable[categories] ! ORDER BY cat_order"); echo "<table width=\"100%\">"; ! $numcategories = mysql_num_rows($result); $currentrow = 1; ! while(list($cat_id, $cat_title, $cat_order) = mysql_fetch_row($result)) { echo "<tr>"; ! echo "<td class=\"pn-normal\">$cat_title</td>"; if ($currentrow != 1) { ! echo "<td align=\"center\"><a class=\"pn-normal\" href=\"admin.php?op=phpBB_14_ReorderCategoriesMove&module=$module&cat_id=$cat_id&cat_order=$cat_order&direction=up\">Move Up</a></td>"; }else{ echo "<td> </td>"; } ! if ($currentrow != $numcategories) { ! echo "<td align=\"center\"><a class=\"pn-normal\" href=\"admin.php?op=phpBB_14_ReorderCategoriesMove&module=$module&cat_id=$cat_id&cat_order=$cat_order&direction=down\">Move Down</a></td>"; }else{ echo "<td> </td>"; Index: COrderS.php =================================================================== RCS file: /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14/admin/modules/COrderS.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** COrderS.php 28 Mar 2002 14:42:16 -0000 1.3 --- COrderS.php 29 Mar 2002 15:53:14 -0000 1.4 *************** *** 4,23 **** if (!authorised(0, 'phpBB_14::', '::', ACCESS_ADMIN)) { echo "Access Denied"; } ! function phpBB_14_ReorderForumsMove($forum_id, $forum_order, $direction) { global $bbtable; ! $foruminfo = mysql_query("SELECT cat_id FROM $bbtable[forums] ! WHERE forum_id = $forum_id"); ! list($forumcat) = mysql_fetch_row($foruminfo); if ($direction=='up') { ! if ($forum_order>1) { ! $order = $forum_order - 1; ! $sql = "UPDATE $bbtable[forums] SET forum_order = $order WHERE forum_id = '$forum_id'"; if (!$result = mysql_query($sql)) error_die(_PHPBB_ERROR_CONNECT,$sql,mysql_errno(),mysql_error()); ! $sql = "UPDATE $bbtable[forums] ! SET forum_order=".$forum_order." ! WHERE forum_order=".$order." ! AND forum_id<>".$forum_id.""; if (!$result = mysql_query($sql)) { --- 4,23 ---- if (!authorised(0, 'phpBB_14::', '::', ACCESS_ADMIN)) { echo "Access Denied"; } ! function phpBB_14_admin_ReorderCategoriesMove($var,$module,$cat_id, $cat_order, $direction) { global $bbtable; ! include("modules/$module/functions.php"); if ($direction=='up') { ! if ($cat_order>1) { ! $order = $cat_order - 1; ! $sql = "UPDATE $bbtable[categories] ! SET cat_order = ".$order." ! WHERE cat_id = ".$cat_id.""; if (!$result = mysql_query($sql)) error_die(_PHPBB_ERROR_CONNECT,$sql,mysql_errno(),mysql_error()); ! $sql = "UPDATE $bbtable[categories] ! SET cat_order=".$cat_order." ! WHERE cat_order=".$order." ! AND cat_id <> ".$cat_id.""; if (!$result = mysql_query($sql)) { *************** *** 26,42 **** } } else { ! $forums = mysql_query("SELECT forum_id FROM $bbtable[forums]"); ! $numforums = mysql_num_rows($forums); ! if ($forum_order < $numforums) { ! $newno = $forum_order + 1; ! $sql = "UPDATE $bbtable[forums] SET forum_order=$newno WHERE forum_id=$forum_id"; if (!$result = mysql_query($sql)) { error_die(_PHPBB_ERROR_CONNECT,$sql,mysql_errno(),mysql_error()); } ! $sql = "UPDATE $bbtable[forums] ! SET forum_order=".$forum_order." ! WHERE forum_order = ".$newno." ! AND forum_id<>".$forum_id.""; if (!$result = mysql_query($sql)) { --- 26,42 ---- } } else { ! $categories = mysql_query("SELECT cat_id FROM $bbtable[categories]"); ! $numcategories = mysql_num_rows($categories); ! if ($cat_order < $numcategories) { ! $newno = $cat_order + 1; ! $sql = "UPDATE $bbtable[categories] SET cat_order=$newno WHERE cat_id=$cat_id"; if (!$result = mysql_query($sql)) { error_die(_PHPBB_ERROR_CONNECT,$sql,mysql_errno(),mysql_error()); } ! $sql = "UPDATE $bbtable[categories] ! SET cat_order=".$cat_order." ! WHERE cat_order = ".$newno." ! AND cat_id<>".$cat_id.""; if (!$result = mysql_query($sql)) { *************** *** 45,49 **** } } ! header("Location: admin.php?op=phpBB_14_ReorderForums&cat_id=$forumcat"); } --- 45,49 ---- } } ! header("Location: admin.php?op=phpBB_14_ReorderCategories&module=$module"); } --- COrder.php DELETED --- |