Changeset 1100 for trunk/wp-admin/link-categories.php
- Timestamp:
- 04/19/2004 08:09:27 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-categories.php
r957 r1100 11 11 $wpvar = $wpvarstoreset[$i]; 12 12 if (!isset($$wpvar)) { 13 if (empty($ HTTP_POST_VARS["$wpvar"])) {14 if (empty($ HTTP_GET_VARS["$wpvar"])) {13 if (empty($_POST["$wpvar"])) { 14 if (empty($_GET["$wpvar"])) { 15 15 $$wpvar = ''; 16 16 } else { 17 $$wpvar = $ HTTP_GET_VARS["$wpvar"];17 $$wpvar = $_GET["$wpvar"]; 18 18 } 19 19 } else { 20 $$wpvar = $ HTTP_POST_VARS["$wpvar"];20 $$wpvar = $_POST["$wpvar"]; 21 21 } 22 22 } … … 32 32 die ("Cheatin' uh ?"); 33 33 34 $cat_name = addslashes($ HTTP_POST_VARS['cat_name']);35 $auto_toggle = $ HTTP_POST_VARS['auto_toggle'];34 $cat_name = addslashes($_POST['cat_name']); 35 $auto_toggle = $_POST['auto_toggle']; 36 36 if ($auto_toggle != 'Y') { 37 37 $auto_toggle = 'N'; 38 38 } 39 39 40 $show_images = $ HTTP_POST_VARS['show_images'];40 $show_images = $_POST['show_images']; 41 41 if ($show_images != 'Y') { 42 42 $show_images = 'N'; 43 43 } 44 44 45 $show_description = $ HTTP_POST_VARS['show_description'];45 $show_description = $_POST['show_description']; 46 46 if ($show_description != 'Y') { 47 47 $show_description = 'N'; 48 48 } 49 49 50 $show_rating = $ HTTP_POST_VARS['show_rating'];50 $show_rating = $_POST['show_rating']; 51 51 if ($show_rating != 'Y') { 52 52 $show_rating = 'N'; 53 53 } 54 54 55 $show_updated = $ HTTP_POST_VARS['show_updated'];55 $show_updated = $_POST['show_updated']; 56 56 if ($show_updated != 'Y') { 57 57 $show_updated = 'N'; 58 58 } 59 59 60 $sort_order = $ HTTP_POST_VARS['sort_order'];61 62 $sort_desc = $ HTTP_POST_VARS['sort_desc'];60 $sort_order = $_POST['sort_order']; 61 62 $sort_desc = $_POST['sort_desc']; 63 63 if ($sort_desc != 'Y') { 64 64 $sort_desc = 'N'; 65 65 } 66 $text_before_link = addslashes($ HTTP_POST_VARS['text_before_link']);67 $text_after_link = addslashes($ HTTP_POST_VARS['text_after_link']);68 $text_after_all = addslashes($ HTTP_POST_VARS['text_after_all']);69 70 $list_limit = $ HTTP_POST_VARS['list_limit'];66 $text_before_link = addslashes($_POST['text_before_link']); 67 $text_after_link = addslashes($_POST['text_after_link']); 68 $text_after_all = addslashes($_POST['text_after_all']); 69 70 $list_limit = $_POST['list_limit']; 71 71 if ($list_limit == '') 72 72 $list_limit = -1; … … 86 86 include_once('admin-header.php'); 87 87 88 $cat_id = $ HTTP_GET_VARS['cat_id'];88 $cat_id = $_GET['cat_id']; 89 89 $cat_name=get_linkcatname($cat_id); 90 90 $cat_name=addslashes($cat_name); … … 105 105 { 106 106 include_once ('admin-header.php'); 107 $cat_id = $ HTTP_GET_VARS['cat_id'];107 $cat_id = $_GET['cat_id']; 108 108 $row = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, " 109 109 . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, " … … 123 123 124 124 <div class="wrap"> 125 <h 3>Edit Link Category “<?php echo $row->cat_name?>”</h3>126 <p> 125 <h2>Edit “<?php echo $row->cat_name?>” Category </h2> 126 127 127 <form name="editcat" method="post"> 128 128 <input type="hidden" name="action" value="editedcat" /> 129 129 <input type="hidden" name="cat_id" value="<?php echo $row->cat_id ?>" /> 130 <table border="0"> 131 <tr> 132 <td align="right">Name:</td> 133 <td><input type="text" name="cat_name" size="25" value="<?php echo stripslashes($row->cat_name)?>" /> 134 <label for="auto_toggle"> 135 <input type="checkbox" name="auto_toggle" id="auto_toggle" <?php echo ($row->auto_toggle == 'Y') ? 'checked' : '';?> value="Y" /> 136 auto-toggle?</label></td> 137 </tr> 138 <tr> 139 <td align="right">Show:</td> 130 <fieldset class="options"> 131 <legend>Category Options</legend> 132 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 133 <tr> 134 <th width="33%" scope="row">Name:</th> 135 <td width="67%"><input name="cat_name" type="text" value="<?php echo stripslashes($row->cat_name)?>" size="30" /></td> 136 </tr> 137 <tr> 138 <th scope="row">Show:</th> 140 139 <td> 141 <label for="show_images"> 142 <input type="checkbox" name="show_images" id="show_images" <?php echo ($row->show_images == 'Y') ? 'checked' : '';?> value="Y" /> 143 images</label> 144 <label for="show_description"> 145 <input type="checkbox" name="show_description" id="show_description" <?php echo ($row->show_description == 'Y') ? 'checked' : '';?> value="Y" /> 146 description</label> 147 <label for="show_rating"> 148 <input type="checkbox" name="show_rating" id="show_rating" <?php echo ($row->show_rating == 'Y') ? 'checked' : '';?> value="Y" /> 149 rating</label> 150 <label for="show_updated"> 151 <input type="checkbox" name="show_updated" id="show_updated" <?php echo ($row->show_updated == 'Y') ? 'checked' : '';?> value="Y" /> 152 updated</label> 153 </td> 154 </tr> 155 <tr> 156 <td align="right">Sort by:</td> 157 <td> 158 <select name="sort_order" size="1"> 140 <label> 141 <input type="checkbox" name="show_images" value="Y" <?php checked('Y', $row->show_images); ?> /> 142 Image</label> <br /> 143 <label> 144 <input type="checkbox" name="show_description" value="Y" <?php checked('Y', $row->show_description); ?> /> 145 Description</label> 146 (shown in <code>title</code> regardless)<br /> 147 <label> 148 <input type="checkbox" name="show_rating" value="Y" <?php checked('Y', $row->show_rating); ?> /> 149 Rating</label> <br /> 150 <label> 151 <input type="checkbox" name="show_updated" value="Y" <?php checked('Y', $row->show_updated); ?> /> 152 Updated</label> 153 (shown in <code>title</code> regardless)</td> 154 </tr> 155 <tr> 156 <th scope="row">Sort order:</th> 157 <td> 158 <select name="sort_order" size="1"> 159 159 <option value="name" <?php echo ($row->sort_order == 'name') ? 'selected' : ''?>>Name</option> 160 160 <option value="id" <?php echo ($row->sort_order == 'id') ? 'selected' : ''?>>Id</option> … … 164 164 <option value="rand" <?php echo ($row->sort_order == 'rand') ? 'selected' : ''?>>Random</option> 165 165 <option value="length" <?php echo ($row->sort_order == 'length') ? 'selected' : ''?>>Name Length</option> 166 </select> 167 <input type="checkbox" name="sort_desc" <?php echo ($row->sort_desc == 'Y') ? 'checked' : '';?> value="Y" /> Descending?<br /> 168 </td> 169 </tr> 170 <tr> 171 <td align="center">Text/HTML</td> 172 <td> </td> 173 </tr> 174 <tr> 175 <td align="right">Before:</td> 176 <td><input type="text" name="text_before_link" size="45" value="<?php echo stripslashes($row->text_before_link)?>" /></td> 177 </tr> 178 <tr> 179 <td align="right">Between:</td> 180 <td><input type="text" name="text_after_link" size="45" value="<?php echo stripslashes($row->text_after_link)?>" /></td> 181 </tr> 182 <tr> 183 <td align="right">After:</td> 184 <td><input type="text" name="text_after_all" size="45" value="<?php echo stripslashes($row->text_after_all)?>" /></td> 185 </tr> 186 <tr> 187 <td align="right">Limit:</td> 188 <td><input type="text" name="list_limit" size="5" value="<?php echo $row->list_limit?>"/> (How many links are shown. Empty for unlimited.)</td> 189 </tr> 190 <tr> 191 <td align="center" colspan="2"> 192 <input type="submit" name="submit" value="Save" class="search" /> 193 <input type="submit" name="submit" value="Cancel" class="search"> 194 </td> 195 </tr> 196 </table> 197 </form> 198 </p> 166 </select> 167 <label> 168 <input type="checkbox" name="sort_desc" value="Y" <?php checked('Y', $row->sort_desc); ?> /> 169 Descending</label> 170 </td> 171 </tr> 172 <tr> 173 <th scope="row">Limit:</th> 174 <td> 175 <input type="text" name="list_limit" size="5" value="<?php echo $row->list_limit ?>" /> 176 (Leave empty for no limit to number of links shown) 177 </td> 178 </tr> 179 <tr> 180 <th scope="row">Toggle:</th> 181 <td><label> 182 <input type="checkbox" name="auto_toggle" value="Y" <?php checked('Y', $row->auto_toggle); ?> /> 183 When new link is added toggle all others to be invisible</label></td> 184 </tr> 185 186 </table> 187 </fieldset> 188 <fieldset class="options"> 189 <legend>Formatting</legend> 190 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 191 <tr> 192 <th width="33%" scope="row">Before Link:</th> 193 <td width="67%"><input type="text" name="text_before_link" size="45" value="<?php echo stripslashes($row->text_before_link)?>" /></td> 194 </tr> 195 <tr> 196 <th scope="row">Between Link and Description:</th> 197 <td><input type="text" name="text_after_link" size="45" value="<?php echo stripslashes($row->text_after_link)?>" /></td> 198 </tr> 199 <tr> 200 <th scope="row">After Link:</th> 201 <td><input type="text" name="text_after_all" size="45" value="<?php echo stripslashes($row->text_after_all)?>"/></td> 202 </tr> 203 </table> 204 </fieldset> 205 <p class="submit"><input type="submit" name="submit" value="Save Category Settings »" /></p> 206 </form> 207 199 208 </div> 200 209 <?php … … 210 219 die ("Cheatin' uh ?"); 211 220 212 $submit=$ HTTP_POST_VARS["submit"];213 if (isset($submit) && ($submit == "Save")) {214 215 $cat_id=$ HTTP_POST_VARS["cat_id"];216 217 $cat_name=addslashes( $HTTP_POST_VARS["cat_name"]);218 $auto_toggle = $ HTTP_POST_VARS["auto_toggle"];221 $submit=$_POST["submit"]; 222 if (isset($submit)) { 223 224 $cat_id=$_POST["cat_id"]; 225 226 $cat_name=addslashes(stripslashes($_POST["cat_name"])); 227 $auto_toggle = $_POST["auto_toggle"]; 219 228 if ($auto_toggle != 'Y') { 220 229 $auto_toggle = 'N'; 221 230 } 222 231 223 $show_images = $ HTTP_POST_VARS["show_images"];232 $show_images = $_POST["show_images"]; 224 233 if ($show_images != 'Y') { 225 234 $show_images = 'N'; 226 235 } 227 236 228 $show_description = $ HTTP_POST_VARS["show_description"];237 $show_description = $_POST["show_description"]; 229 238 if ($show_description != 'Y') { 230 239 $show_description = 'N'; 231 240 } 232 241 233 $show_rating = $ HTTP_POST_VARS["show_rating"];242 $show_rating = $_POST["show_rating"]; 234 243 if ($show_rating != 'Y') { 235 244 $show_rating = 'N'; 236 245 } 237 246 238 $show_updated = $ HTTP_POST_VARS["show_updated"];247 $show_updated = $_POST["show_updated"]; 239 248 if ($show_updated != 'Y') { 240 249 $show_updated = 'N'; 241 250 } 242 251 243 $sort_order = $ HTTP_POST_VARS["sort_order"];244 245 $sort_desc = $ HTTP_POST_VARS["sort_desc"];252 $sort_order = $_POST["sort_order"]; 253 254 $sort_desc = $_POST["sort_desc"]; 246 255 if ($sort_desc != 'Y') { 247 256 $sort_desc = 'N'; 248 257 } 249 $text_before_link = addslashes($ HTTP_POST_VARS["text_before_link"]);250 $text_after_link = addslashes($ HTTP_POST_VARS["text_after_link"]);251 $text_after_all = addslashes($ HTTP_POST_VARS["text_after_all"]);252 253 $list_limit = $ HTTP_POST_VARS["list_limit"];258 $text_before_link = addslashes($_POST["text_before_link"]); 259 $text_after_link = addslashes($_POST["text_after_link"]); 260 $text_after_all = addslashes($_POST["text_after_all"]); 261 262 $list_limit = $_POST["list_limit"]; 254 263 if ($list_limit == '') 255 264 $list_limit = -1; … … 291 300 </ul> 292 301 <div class="wrap"> 293 294 <form name="cats" method="post" action="link-categories.php"> 295 <strong>Edit</strong> a link category:<?php echo gethelp_link($this_file,'edit_link_category');?><br /> 302 <h2>Link Categories:<?php echo gethelp_link($this_file,'edit_link_category');?></h2> 296 303 <table width="100%" cellpadding="5" cellspacing="0" border="0"> 297 304 <tr> 298 305 <th rowspan="2" valign="bottom">Name</th> 299 <th rowspan="2" valign="bottom">I d</th>300 <th rowspan="2" valign="bottom"> Auto<br />Toggle?</th>306 <th rowspan="2" valign="bottom">ID</th> 307 <th rowspan="2" valign="bottom">Toggle?</th> 301 308 <th colspan="4" valign="bottom">Show</th> 302 309 <th rowspan="2" valign="bottom">Sort Order</th> 303 310 <th rowspan="2" valign="bottom">Desc?</th> 304 <th colspan="3" valign="bottom"> Text/HTML</th>311 <th colspan="3" valign="bottom">Formatting</th> 305 312 <th rowspan="2" valign="bottom">Limit</th> 306 313 <th rowspan="2" colspan="2"> </th> 307 314 </tr> 308 315 <tr> 309 <th valign="top"> images?</th>310 <th valign="top"> desc?</th>311 <th valign="top"> rating?</th>312 <th valign="top"> updated?</th>313 <th valign="top"> before</th>314 <th valign="top"> between</th>315 <th valign="top"> after</th>316 <th valign="top">Images</th> 317 <th valign="top">Desc.</th> 318 <th valign="top">Rating</th> 319 <th valign="top">Updated</th> 320 <th valign="top">Before</th> 321 <th valign="top">Between</th> 322 <th valign="top">After</th> 316 323 </tr> 317 <input type="hidden" name="cat_id" value="" />318 <input type="hidden" name="action" value="" />319 324 <?php 320 325 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, " 321 326 . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, " 322 327 . " text_after_all, list_limit FROM $tablelinkcategories ORDER BY cat_id"); 328 $i = 1; 323 329 foreach ($results as $row) { 324 330 if ($row->list_limit == -1) { … … 349 355 ?> 350 356 </table> 351 </form>357 <p>These are the defaults for when you call a link category with no additional arguments. All of these settings may be overwritten.</p> 352 358 353 359 </div> … … 356 362 <form name="addcat" method="post"> 357 363 <input type="hidden" name="action" value="addcat" /> 358 <h3>Add a Link Category:<?php echo gethelp_link($this_file,'add_link_category');?></h3> 359 <table width="100%" cellpadding="5" cellspacing="0" border="0"> 360 <tr> 361 <td align="right">Name:</td> 362 <td><input type="text" name="cat_name" size="25" /> 363 <input type="checkbox" name="auto_toggle" value="Y" /> auto-toggle?</td> 364 </tr> 365 <tr> 366 <td align="right">Show:</td> 364 <h2>Add a Link Category:<?php echo gethelp_link($this_file,'add_link_category');?></h2> 365 <fieldset class="options"> 366 <legend>Category Options</legend> 367 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 368 <tr> 369 <th width="33%" scope="row">Name:</th> 370 <td width="67%"><input type="text" name="cat_name" size="30" /></td> 371 </tr> 372 <tr> 373 <th scope="row">Show:</th> 367 374 <td> 368 <input type="checkbox" name="show_images" value="Y" /> images 369 <input type="checkbox" name="show_description" value="Y" /> description 370 <input type="checkbox" name="show_rating" value="Y" /> rating 371 <input type="checkbox" name="show_updated" value="Y" /> updated</td> 372 </tr> 373 <tr> 374 <td align="right">Sort order:</td> 375 <td> 376 <select name="sort_order" size="1"> 377 <option value="name">Name</option> 378 <option value="id">Id</option> 379 <option value="url">URL</option> 380 <option value="rating">Rating</option> 381 <option value="updated">Updated</option> 382 <option value="rand">Random</option> 383 </select> 384 <input type="checkbox" name="sort_desc" value="N" /> Descending?<br /> 385 </td> 386 </tr> 387 <tr> 388 <td align="center">Text/HTML</td> 389 <td> </td> 390 </tr> 391 <tr> 392 <td align="right">before:</td> 393 <td><input type="text" name="text_before_link" size="45" value="<li>"/></td> 394 </tr> 395 <tr> 396 <td align="right">between:</td> 397 <td><input type="text" name="text_after_link" size="45" value="<br />" /></td> 398 </tr> 399 <tr> 400 <td align="right">after:</td> 401 <td><input type="text" name="text_after_all" size="45" value="</li>"/></td> 402 </tr> 403 <tr> 404 <td align="right">limit:</td> 405 <td><input type="text" name="list_limit" size="5" value=""/> (leave empty for no limit)</td> 406 </tr> 407 <tr> 408 <td align="center" colspan="2"><input type="submit" name="submit" value="Add Category!" class="search" /></td> 409 </tr> 410 </table> 375 <label> 376 <input type="checkbox" name="show_images" value="Y" /> 377 Image</label> <br /> 378 <label> 379 <input type="checkbox" name="show_description" value="Y" /> 380 Description</label> 381 (shown in <code>title</code> regardless)<br /> 382 <label> 383 <input type="checkbox" name="show_rating" value="Y" /> 384 Rating</label> <br /> 385 <label> 386 <input type="checkbox" name="show_updated" value="Y" /> 387 Updated</label> 388 (shown in <code>title</code> regardless)</td> 389 </tr> 390 <tr> 391 <th scope="row">Sort order:</th> 392 <td> 393 <select name="sort_order" size="1"> 394 <option value="name">Name</option> 395 <option value="id">Id</option> 396 <option value="url">URL</option> 397 <option value="rating">Rating</option> 398 <option value="updated">Updated</option> 399 <option value="rand">Random</option> 400 </select> 401 <label> 402 <input type="checkbox" name="sort_desc" value="Y" /> 403 Descending</label> 404 </td> 405 </tr> 406 <tr> 407 <th scope="row">Limit:</th> 408 <td> 409 <input type="text" name="list_limit" size="5" value="" /> (Leave empty for no limit to number of links shown) 410 </td> 411 </tr> 412 <tr> 413 <th scope="row">Toggle:</th> 414 <td><label> 415 <input type="checkbox" name="auto_toggle" value="Y" /> 416 When new link is added toggle all others to be invisible</label></td> 417 </tr> 418 419 </table> 420 </fieldset> 421 <fieldset class="options"> 422 <legend>Formatting</legend> 423 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 424 <tr> 425 <th width="33%" scope="row">Before Link:</th> 426 <td width="67%"><input type="text" name="text_before_link" size="45" value="<li>" /></td> 427 </tr> 428 <tr> 429 <th scope="row">Between Link and Description:</th> 430 <td><input type="text" name="text_after_link" size="45" value="<br />" /></td> 431 </tr> 432 <tr> 433 <th scope="row">After Link:</th> 434 <td><input type="text" name="text_after_all" size="45" value="</li>"/></td> 435 </tr> 436 </table> 437 </fieldset> 438 <p class="submit"><input type="submit" name="submit" value="Add Category »" /></p> 411 439 </form> 412 440 </div>
Note: See TracChangeset
for help on using the changeset viewer.