link-categories.php
来自「在综合英文版XOOPS 2.09, 2.091, 2.092 的基础上正式发布X」· PHP 代码 · 共 431 行 · 第 1/2 页
PHP
431 行
$submit=$_POST["submit"]; if (isset($submit) && ($submit == _LANG_WLC_SAVEBUTTON_TEXT)) { $cat_id=$_POST["cat_id"]; $cat_id = intval($cat_id); $cat_name=addslashes($_POST["cat_name"]); $auto_toggle = $_POST["auto_toggle"]; if ($auto_toggle != 'Y') { $auto_toggle = 'N'; } $show_images = $_POST["show_images"]; if ($show_images != 'Y') { $show_images = 'N'; } $show_description = $_POST["show_description"]; if ($show_description != 'Y') { $show_description = 'N'; } $show_rating = $_POST["show_rating"]; if ($show_rating != 'Y') { $show_rating = 'N'; } $show_updated = $_POST["show_updated"]; if ($show_updated != 'Y') { $show_updated = 'N'; } $sort_order = $_POST["sort_order"]; $sort_desc = $_POST["sort_desc"]; if ($sort_desc != 'Y') { $sort_desc = 'N'; } $text_before_link = addslashes($_POST["text_before_link"]); $text_after_link = addslashes($_POST["text_after_link"]); $text_after_all = addslashes($_POST["text_after_all"]); $list_limit = $_POST["list_limit"]; if ($list_limit == '') { $list_limit = -1; } else { $list_limit = intval($list_limit); } $wpdb->query("UPDATE {$wpdb->linkcategories} set cat_name='$cat_name', auto_toggle='$auto_toggle', show_images='$show_images', show_description='$show_description', show_rating='$show_rating', show_updated='$show_updated', sort_order='$sort_order', sort_desc='$sort_desc', text_before_link='$text_before_link', text_after_link='$text_after_link', text_after_all='$text_after_all', list_limit=$list_limit WHERE cat_id=$cat_id "); } // end if save header("Location: link-categories.php"); break; } // end editcat default: { $standalone=0; include_once ("./admin-header.php"); if ($user_level < get_settings('links_minadminlevel')) { die("You have no right to edit the link categories for this blog.<br>Ask for a promotion to your <a href=\"mailto:".get_settings('admin_email')."\">blog admin</a> :)"); }?><ul id="adminmenu2"> <li><a href="link-manager.php" ><?php echo _LANG_WLA_MANAGE_LINK; ?></a></li> <li><a href="link-add.php"><?php echo _LANG_WLA_ADD_LINK; ?></a></li> <li><a href="link-categories.php" class="current"><?php echo _LANG_WLA_LINK_CATE; ?></a></li> <li class="last"><a href="link-import.php"><?php echo _LANG_WLA_IMPORT_BLOG; ?></a></li></ul><div class="wrap"><h2><?php echo _LANG_WLC_EPAGE_TITLE; ?></h2> <form name="cats" method="post" action="link-categories.php"> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <th rowspan="2" valign="bottom"><?php echo _LANG_WLC_SUBCATE_NAME; ?></th> <th rowspan="2" valign="bottom">Id</th> <th rowspan="2" valign="bottom"><?php echo _LANG_WLC_SUBCATE_ATT; ?></th> <th colspan="4" valign="bottom"><?php echo _LANG_WLC_SUBCATE_SHOW; ?></th> <th rowspan="2" valign="bottom"><?php echo _LANG_WLC_SUBCATE_SORT; ?></th> <th rowspan="2" valign="bottom"><?php echo _LANG_WLC_SUBCATE_DESC; ?></th> <th colspan="3" valign="bottom">Text/HTML</th> <th rowspan="2" valign="bottom"><?php echo _LANG_WLC_SUBCATE_LIMIT; ?></th> <th rowspan="2" colspan="2"> </th> </tr> <tr> <th valign="top"><?php echo _LANG_WLC_SUBCATE_IMAGES; ?></th> <th valign="top"><?php echo _LANG_WLC_SUBCATE_MINIDESC; ?></th> <th valign="top"><?php echo _LANG_WLC_SUBCATE_RATE; ?></th> <th valign="top"><?php echo _LANG_WLC_SUBCATE_UPDATE; ?></th> <th valign="top"><?php echo _LANG_WLC_SUBCATE_BEFORE; ?></th> <th valign="top"><?php echo _LANG_WLC_SUBCATE_BETWEEN; ?></th> <th valign="top"><?php echo _LANG_WLC_SUBCATE_AFTER; ?></th> </tr> <input type="hidden" name="cat_id" value="" /> <input type="hidden" name="action" value="" /><?php$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, " . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, " . " text_after_all, list_limit FROM {$wpdb->linkcategories} ORDER BY cat_id");foreach ($results as $row) { if ($row->list_limit == -1) { $row->list_limit = 'none'; } $style = ($i % 2) ? ' class="alternate"' : '';?> <tr valign="middle" align="center" <?php echo $style ?> style="border-bottom: 1px dotted #9C9A9C;"> <td><?php echo stripslashes($row->cat_name)?></td> <td ><?php echo $row->cat_id?></td> <td><?php echo $row->auto_toggle?></td> <td><?php echo $row->show_images?></td> <td><?php echo $row->show_description?></td> <td><?php echo $row->show_rating?></td> <td><?php echo $row->show_updated?></td> <td><?php echo $row->sort_order?></td> <td><?php echo $row->sort_desc?></td> <td nowrap="nowrap"><?php echo htmlentities($row->text_before_link)?> </td> <td nowrap="nowrap"><?php echo htmlentities($row->text_after_link)?> </td> <td nowrap="nowrap"><?php echo htmlentities($row->text_after_all)?></td> <td><?php echo $row->list_limit?></td> <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&action=Edit" class="edit"><?php echo _LANG_WLC_SUBCATE_EDIT; ?></a></td> <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&action=Delete" onclick="return confirm('You are about to delete this category.\n \'Cancel\' to stop, \'OK\' to delete.');" class="delete"><?php echo _LANG_WLC_SUBCATE_DELETE; ?></a></td> </tr><?php ++$i; }?> </table> </form></div><div class="wrap"><h2><?php echo _LANG_WLC_ADD_TITLE; ?></h2> <form name="addcat" method="post"> <input type="hidden" name="action" value="addcat" /> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_NAME; ?></td> <td><input type="text" name="cat_name" size="25" /> <input type="checkbox" name="auto_toggle" value="Y" /> <?php echo _LANG_WLC_SUBEDIT_TOGGLE; ?></td> </tr> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_SHOW; ?></td> <td> <input type="checkbox" name="show_images" value="Y" /> <?php echo _LANG_WLC_SUBEDIT_IMAGES; ?> <input type="checkbox" name="show_description" value="Y" /> <?php echo _LANG_WLC_SUBEDIT_DESC; ?> <input type="checkbox" name="show_rating" value="Y" /> <?php echo _LANG_WLC_SUBEDIT_RATE; ?> <input type="checkbox" name="show_updated" value="Y" /> <?php echo _LANG_WLC_SUBEDIT_UPDATE; ?></td> </tr> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_ORDER; ?></td> <td> <select name="sort_order" size="1"> <option value="name">Name</option> <option value="id">Id</option> <option value="url">URL</option> <option value="rating">Rating</option> <option value="updated">Updated</option> <option value="rand">Random</option> </select> <input type="checkbox" name="sort_desc" value="N" /> <?php echo _LANG_WLC_SUBEDIT_DESCEND; ?><br /> </td> </tr> <tr> <td align="center">Text/HTML</td> <td> </td> </tr> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_BEFORE; ?></td> <td><input type="text" name="text_before_link" size="45" value="<li>"/></td> </tr> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_BETWEEN; ?></td> <td><input type="text" name="text_after_link" size="45" value="<br />" /></td> </tr> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_AFTER; ?></td> <td><input type="text" name="text_after_all" size="45" value="</li>"/></td> </tr> <tr> <td align="right"><?php echo _LANG_WLC_SUBEDIT_LIMIT; ?></td> <td><input type="text" name="list_limit" size="5" value=""/> (<?php echo _LANG_WLC_EPAGE_EMPTY; ?>)</td> </tr> <tr> <td align="center" colspan="2"><input type="submit" name="submit" value="<?php echo _LANG_WLC_ADDBUTTON_TEXT; ?>" /></td> </tr> </table> </form></div><div class="wrap"> <h2>说明:</h2> <p><?php echo _LANG_WLC_EPAGE_NOTE; ?> <b><?php echo get_linkcatname(1) ?></b>. </p></div><?php break; } // end default} // end case?><?php include('admin-footer.php'); ?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?