Make WordPress Core

Changeset 280


Ignore:
Timestamp:
07/30/2003 02:44:57 PM (23 years ago)
Author:
mikelittle
Message:

Added admin configuration of link categories, added functons to use that.
Updated install and upgrade scripts
Added recently updated pre/append text

Location:
trunk/wp-admin
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/linkcategories.php

    r254 r280  
    5757      if ($user_level < $minadminlevel)
    5858          die ("Cheatin' uh ?");
    59    
     59
    6060      $cat_name=addslashes($HTTP_POST_VARS["cat_name"]);
    6161      $auto_toggle = $HTTP_POST_VARS["auto_toggle"];
     
    6464      }
    6565
    66       $wpdb->query("INSERT INTO $tablelinkcategories (cat_id,cat_name, auto_toggle) VALUES ('0', '$cat_name', '$auto_toggle')");
     66      $show_images = $HTTP_POST_VARS["show_images"];
     67      if ($show_images != 'Y') {
     68          $show_images = 'N';
     69      }
    6770     
     71      $show_description = $HTTP_POST_VARS["show_description"];
     72      if ($show_description != 'Y') {
     73          $show_description = 'N';
     74      }
     75     
     76      $show_rating = $HTTP_POST_VARS["show_rating"];
     77      if ($show_rating != 'Y') {
     78          $show_rating = 'N';
     79      }
     80     
     81      $show_updated = $HTTP_POST_VARS["show_updated"];
     82      if ($show_updated != 'Y') {
     83          $show_updated = 'N';
     84      }
     85     
     86      $sort_order = $HTTP_POST_VARS["sort_order"];
     87     
     88      $sort_desc = $HTTP_POST_VARS["sort_desc"];
     89      if ($sort_desc != 'Y') {
     90          $sort_desc = 'N';
     91      }
     92      $text_before_link = addslashes($HTTP_POST_VARS["text_before_link"]);
     93      $text_after_link = addslashes($HTTP_POST_VARS["text_after_link"]);
     94      $text_after_all = addslashes($HTTP_POST_VARS["text_after_all"]);
     95
     96      $list_limit = $HTTP_POST_VARS["list_limit"];
     97      if ($list_limit == '')
     98          $list_limit = -1;
     99
     100      $wpdb->query("INSERT INTO $tablelinkcategories (cat_id, cat_name, auto_toggle, show_images, show_description, \n" .
     101             " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, text_after_all, list_limit) \n" .
     102             " VALUES ('0', '$cat_name', '$auto_toggle', '$show_images', '$show_description', \n" .
     103             " '$show_rating', '$show_updated', '$sort_order', '$sort_desc', '$text_before_link', '$text_after_link', \n" .
     104             " '$text_after_all', $list_limit)");
     105
    68106      header("Location: linkcategories.php");
    69107    break;
     
    83121    if ($user_level < $minadminlevel)
    84122    die ("Cheatin' uh ?");
    85    
     123
    86124    $wpdb->query("DELETE FROM $tablelinkcategories WHERE cat_id='$cat_id'");
    87125    $wpdb->query("UPDATE $tablelinks SET link_category=1 WHERE link_category='$cat_id'");
     
    94132    include_once ("./b2header.php");
    95133    $cat_id = $HTTP_POST_VARS["cat_id"];
    96     $cat_name=get_linkcatname($cat_id);
    97     $cat_name=addslashes($cat_name);
    98     $auto_toggle=get_autotoggle($cat_id);
     134    $row = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
     135         . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
     136         . " text_after_all, list_limit FROM $tablelinkcategories WHERE cat_id=$cat_id");
     137    if ($row) {
     138        if ($row->list_limit == -1) {
     139            $row->list_limit = '';
     140        }
    99141?>
    100142<div class="wrap">
    101   <p><b>Old</b> name: <?php echo $cat_name ?></p>
     143  <p>Edit Link Category '<b><?php echo $row->cat_name?></b>'</p>
    102144  <p>
    103145    <form name="editcat" method="post">
    104       <b>New</b> name:<br />
    105146      <input type="hidden" name="action" value="editedcat" />
    106       <input type="hidden" name="cat_id" value="<?php echo $HTTP_POST_VARS["cat_id"] ?>" />
    107       <input type="text" name="cat_name" value="<?php echo $cat_name ?>" /><br />
    108       <input type="checkbox" name="auto_toggle" value="Y" <?php echo $auto_toggle == 'Y' ? '"checked"' : ''; ?>/> auto-toggle?<br />
    109       <input type="submit" name="submit" value="Edit it !" class="search" />
     147      <input type="hidden" name="cat_id" value="<?php echo $row->cat_id ?>" />
     148    <table border="0">
     149      <tr>
     150        <td align="right">Name:</td>
     151        <td><input type="text" name="cat_name" size="25" value="<?php echo stripslashes($row->cat_name)?>" />&nbsp;&nbsp;&nbsp;
     152            <input type="checkbox" name="auto_toggle" <?php echo ($row->auto_toggle == 'Y') ? 'checked' : '';?> value="Y" /> auto-toggle?</td>
     153      </tr>
     154      <tr>
     155        <td align="right"><b>Show:</b></td>
     156        <td>
     157          <input type="checkbox" name="show_images"      <?php echo ($row->show_images  == 'Y') ? 'checked' : '';?>     value="Y" /> images&nbsp;&nbsp;
     158          <input type="checkbox" name="show_description" <?php echo ($row->show_description == 'Y') ? 'checked' : '';?> value="Y" /> description&nbsp;&nbsp;
     159          <input type="checkbox" name="show_rating"      <?php echo ($row->show_rating  == 'Y') ? 'checked' : '';?>     value="Y" /> rating&nbsp;&nbsp;
     160          <input type="checkbox" name="show_updated"     <?php echo ($row->show_updated == 'Y') ? 'checked' : '';?>     value="Y" /> updated
     161        </td>
     162      </tr>
     163      <tr>
     164        <td align="right">Sort order:</td>
     165        <td>
     166          <select name="sort_order" size="1">                                       
     167            <option value="name"    <?php echo ($row->sort_order == 'name') ? 'selected' : ''?>>Name</option>
     168            <option value="id"      <?php echo ($row->sort_order == 'id') ? 'selected' : ''?>>Id</option>                                           
     169            <option value="url"     <?php echo ($row->sort_order == 'url') ? 'selected' : ''?>>URL</option>
     170            <option value="rating"  <?php echo ($row->sort_order == 'rating') ? 'selected' : ''?>>Rating</option>
     171            <option value="updated" <?php echo ($row->sort_order == 'updated') ? 'selected' : ''?>>Updated</option>
     172            <option value="rand"  <?php echo ($row->sort_order == 'rand') ? 'selected' : ''?>>Random</option>
     173          </select>&nbsp;&nbsp;
     174          <input type="checkbox" name="sort_desc" <?php echo ($row->sort_desc  == 'Y') ? 'checked' : '';?> value="Y" /> Descending?<br />
     175        </td>
     176      </tr>
     177      <tr>
     178        <td align="center"><b>Text/HTML</b></td>
     179        <td>&nbsp;</td>
     180      </tr>
     181      <tr>
     182        <td align="right">before:</td>
     183        <td><input type="text" name="text_before_link" size="45" value="<?php echo stripslashes($row->text_before_link)?>" /></td>
     184      </tr>
     185      <tr>
     186        <td align="right">between:</td>
     187        <td><input type="text" name="text_after_link" size="45" value="<?php echo stripslashes($row->text_after_link)?>" /></td>
     188      </tr>
     189      <tr>
     190        <td align="right">after:</td>
     191        <td><input type="text" name="text_after_all" size="45" value="<?php echo stripslashes($row->text_after_all)?>" /></td>
     192      </tr>
     193      <tr>
     194        <td align="right">limit:</td>
     195        <td><input type="text" name="list_limit" size="5" value="<?php echo $row->list_limit?>"/> (leave empty for no limit)</td>
     196      </tr>
     197      <tr>
     198        <td align="center" colspan="2">
     199          <input type="submit" name="submit" value="Save" class="search" />&nbsp;
     200          <input type="submit" name="submit" value="Cancel" class="search">
     201        </td>
     202      </tr>
     203    </table>
    110204    </form>
    111205  </p>
    112206</div>
    113207<?php
     208    } // end if row
    114209    break;
    115210  } // end Edit
     
    121216    if ($user_level < $minadminlevel)
    122217      die ("Cheatin' uh ?");
     218
     219    if (isset($submit) && ($submit == "Save")) {
     220
     221    $cat_id=$HTTP_POST_VARS["cat_id"];
    123222   
    124223    $cat_name=addslashes($HTTP_POST_VARS["cat_name"]);
    125     $cat_id=$HTTP_POST_VARS["cat_id"];
    126     $auto_toggle=$HTTP_POST_VARS["auto_toggle"];
    127 
    128     $wpdb->query("UPDATE $tablelinkcategories SET cat_name='$cat_name', auto_toggle='$auto_toggle' WHERE cat_id=$cat_id");
     224    $auto_toggle = $HTTP_POST_VARS["auto_toggle"];
     225    if ($auto_toggle != 'Y') {
     226        $auto_toggle = 'N';
     227    }
     228
     229    $show_images = $HTTP_POST_VARS["show_images"];
     230    if ($show_images != 'Y') {
     231        $show_images = 'N';
     232    }
     233
     234    $show_description = $HTTP_POST_VARS["show_description"];
     235    if ($show_description != 'Y') {
     236        $show_description = 'N';
     237    }
     238
     239    $show_rating = $HTTP_POST_VARS["show_rating"];
     240    if ($show_rating != 'Y') {
     241        $show_rating = 'N';
     242    }
     243
     244    $show_updated = $HTTP_POST_VARS["show_updated"];
     245    if ($show_updated != 'Y') {
     246        $show_updated = 'N';
     247    }
     248
     249    $sort_order = $HTTP_POST_VARS["sort_order"];
     250
     251    $sort_desc = $HTTP_POST_VARS["sort_desc"];
     252    if ($sort_desc != 'Y') {
     253        $sort_desc = 'N';
     254    }
     255    $text_before_link = addslashes($HTTP_POST_VARS["text_before_link"]);
     256    $text_after_link = addslashes($HTTP_POST_VARS["text_after_link"]);
     257    $text_after_all = addslashes($HTTP_POST_VARS["text_after_all"]);
     258
     259    $list_limit = $HTTP_POST_VARS["list_limit"];
     260    if ($list_limit == '')
     261        $list_limit = -1;
     262
     263    $wpdb->query("UPDATE $tablelinkcategories set
     264            cat_name='$cat_name',
     265            auto_toggle='$auto_toggle',
     266            show_images='$show_images',
     267            show_description='$show_description',
     268            show_rating='$show_rating',
     269            show_updated='$show_updated',
     270            sort_order='$sort_order',
     271            sort_desc='$sort_desc',
     272            text_before_link='$text_before_link',
     273            text_after_link='$text_after_link',
     274            text_after_all='$text_after_all',
     275            list_limit=$list_limit
     276            WHERE cat_id=$cat_id
     277            ");
     278    } // end if save
     279   
    129280
    130281    header("Location: linkcategories.php");
    131282    break;
    132   } // end edit
     283  } // end editcat
    133284  default:
    134285  {
     
    141292<div class="wrap">
    142293    <table width="" cellpadding="5" cellspacing="0" border="0">
    143       <tr><td><b>Link Categories:</b></td></tr>
    144294      <tr>
    145295        <td>
    146296          <form name="cats" method="post">
    147297            <b>Edit</b> a link category:<br />
     298            <table width="" cellpadding="5" cellspacing="0" border="0">
     299              <tr style="background-color: #ddd;">
     300                <th rowspan="2" valign="bottom" style="border-bottom: 1px dotted #9C9A9C;" >Id</th>
     301                <th rowspan="2" valign="bottom" style="border-bottom: 1px dotted #9C9A9C;" >Name</th>
     302                <th rowspan="2" valign="bottom" style="border-bottom: 1px dotted #9C9A9C;" >Auto<br />Toggle?</th>
     303                <th colspan="4" valign="bottom" style="border-left: 1px dotted #9C9A9C; border-right: 1px dotted #9C9A9C;">Show</th>
     304                <th rowspan="2" valign="bottom" style="border-bottom: 1px dotted #9C9A9C;" >Sort Order</th>
     305                <th rowspan="2" valign="bottom" style="border-bottom: 1px dotted #9C9A9C;" >Desc?</th>
     306                <th colspan="3" valign="bottom" style="border-left: 1px dotted #9C9A9C; border-right: 1px dotted #9C9A9C;">Text/HTML</th>
     307                <th rowspan="2" valign="bottom" style="border-bottom: 1px dotted #9C9A9C;" >Limit</th>
     308                <th rowspan="2" colspan="2" style="border-bottom: 1px dotted #9C9A9C;" >&nbsp;</th>
     309              </tr>
     310              <tr style="background-color: #ddd;">
     311                <th valign="top" style="border-bottom: 1px dotted #9C9A9C; border-left: 1px dotted #9C9A9C;" >images?</th>
     312                <th valign="top" style="border-bottom: 1px dotted #9C9A9C;" >desc?</th>
     313                <th valign="top" style="border-bottom: 1px dotted #9C9A9C;" >rating?</th>
     314                <th valign="top" style="border-bottom: 1px dotted #9C9A9C; border-right: 1px dotted #9C9A9C;" >updated?</th>
     315                <th valign="top" style="border-bottom: 1px dotted #9C9A9C; border-left: 1px dotted #9C9A9C;" >before</th>
     316                <th valign="top" style="border-bottom: 1px dotted #9C9A9C;" >between</th>
     317                <th valign="top" style="border-bottom: 1px dotted #9C9A9C; border-right: 1px dotted #9C9A9C;" >after</th>
     318              </tr>
     319                <form name="cats" method="post">
     320                <input type="hidden" name="cat_id" value="" />
     321                <input type="hidden" name="action" value="" />
    148322<?php
    149 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
    150     echo "        <select name=\"cat_id\">\n";
     323$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
     324         . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
     325         . " text_after_all, list_limit FROM $tablelinkcategories ORDER BY cat_id");
    151326    foreach ($results as $row) {
    152         echo "          <option value=\"".$row->cat_id."\"";
    153         if ($row->cat_id == $cat_id)
    154             echo ' selected';
    155         echo ">".$row->cat_id.": ".$row->cat_name;
    156         if ($row->auto_toggle == 'Y')
    157             echo ' (auto toggle)';
    158         echo "</option>\n";
    159     }
    160     echo "        </select>\n";
     327        if ($row->list_limit == -1) {
     328            $row->list_limit = 'none';
     329        }
     330        $style = ($i % 2) ? ' class="alternate"' : '';
    161331?>
    162             <br /><br />
    163             <input type="submit" name="action" value="Delete" class="search" />
    164             <input type="submit" name="action" value="Edit" class="search" />
     332              <tr valign="middle" <?php echo $style ?>>
     333                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->cat_id?></td>
     334                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo stripslashes($row->cat_name)?></td>
     335                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->auto_toggle?></td>
     336                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->show_images?></td>
     337                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->show_description?></td>
     338                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->show_rating?></td>
     339                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->show_updated?></td>
     340                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->sort_order?></td>
     341                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->sort_desc?></td>
     342                <td style="border-bottom: 1px dotted #9C9A9C;" nowrap><?php echo htmlentities($row->text_before_link)?>&nbsp;</td>
     343                <td style="border-bottom: 1px dotted #9C9A9C;" nowrap><?php echo htmlentities($row->text_after_link)?>&nbsp;</td>
     344                <td style="border-bottom: 1px dotted #9C9A9C;" nowrap><?php echo htmlentities($row->text_after_all)?></td>
     345                <td style="border-bottom: 1px dotted #9C9A9C;"><?php echo $row->list_limit?></td>
     346                <td style="border-bottom: 1px dotted #9C9A9C;"><input type="submit" name="edit" onclick="forms['cats'].cat_id.value='<?php echo $row->cat_id?>'; forms['cats'].action.value='Edit'; " value="Edit" class="search" /></td>
     347                <td style="border-bottom: 1px dotted #9C9A9C;"><input type="submit" name="delete" onclick="forms['cats'].cat_id.value='<?php echo $row->cat_id?>'; forms['cats'].action.value='Delete'; return confirm('You are about to delete this category.\\n  \'Cancel\' to stop, \'OK\' to delete.'); " value="Delete" class="search" /></td>
     348              </tr>
     349<?php
     350        ++$i;
     351    }
     352?>
     353            </table>
     354
     355            </table>
    165356          </form>
    166         </td>
     357</div>
     358
     359<div class="wrap">
     360    <form name="addcat" method="post">
     361      <input type="hidden" name="action" value="addcat" />
     362    <table border="0">
     363      <tr>
     364        <th>Add a Link Category:</th>
     365      </tr>
     366      <tr>
     367        <td align="right">Name:</td>
     368        <td><input type="text" name="cat_name" size="25" />&nbsp;&nbsp;&nbsp;
     369            <input type="checkbox" name="auto_toggle"  value="Y" /> auto-toggle?</td>
     370      </tr>
     371      <tr>
     372        <td align="right">Show:</td>
    167373        <td>
    168           <?php echo $blankline ?>
    169         </td>
    170         <td>
    171           <b>Add</b> a link category:<br />
    172           <form name="addcat" method="post">
    173             <input type="hidden" name="action" value="addcat" />
    174             <input type="text" name="cat_name" />&nbsp;<input type="checkbox" name="auto_toggle" value="Y" /> auto-toggle?<br /><br />
    175             <input type="submit" name="submit" value="Add it !" class="search" />
    176           </form>
    177         </td>
    178       </tr>
     374          <input type="checkbox" name="show_images"  value="Y" /> images&nbsp;&nbsp;
     375          <input type="checkbox" name="show_description"    value="Y" /> description&nbsp;&nbsp;
     376          <input type="checkbox" name="show_rating"  value="Y" /> rating&nbsp;&nbsp;
     377          <input type="checkbox" name="show_updated" value="Y" /> updated</td>
     378      </tr>
     379      <tr>
     380        <td align="right">Sort order:</td>
     381        <td><select name="sort_order" size="1">                                       
     382              <option value="name">Name</option>
     383              <option value="id">Id</option>                                           
     384              <option value="url">URL</option>
     385              <option value="rating">Rating</option>
     386              <option value="updated">Updated</option>
     387              <option value="rand">Random</option>
     388            </select>&nbsp;&nbsp;
     389            <input type="checkbox" name="sort_desc" value="N" /> Descending?<br /></td>
     390      </tr>
     391      <tr>
     392        <td align="center">Text/HTML</td>
     393        <td>&nbsp;</td>
     394      </tr>
     395      <tr>
     396        <td align="right">before:</td>
     397        <td><input type="text" name="text_before_link" size="45" value="&lt;li&gt;"/></td>
     398      </tr>
     399      <tr>
     400        <td align="right">between:</td>
     401        <td><input type="text" name="text_after_link" size="45" value="&lt;br /&gt;" /></td>
     402      </tr>
     403      <tr>
     404        <td align="right">after:</td>
     405        <td><input type="text" name="text_after_all" size="45" value="&lt;/li&gt;"/></td>
     406      </tr>
     407      <tr>
     408        <td align="right">limit:</td>
     409        <td><input type="text" name="list_limit" size="5" value=""/> (leave empty for no limit)</td>
     410      </tr>
     411      <tr>
     412        <td align="center" colspan="2"><input type="submit" name="submit" value="Add Category!" class="search" /></td>
     413      </tr>
     414    </form>
    179415    </table>
    180416
  • trunk/wp-admin/linkmanager.php

    r279 r280  
    3232
    3333$title = 'Manage Links';
     34$this_file = 'linkmanager.php';
    3435
    3536function category_dropdown($fieldname, $selected = 0) {
    3637    global $wpdb, $tablelinkcategories;
    37    
     38
    3839    $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
    3940    echo '        <select name="'.$fieldname.'" size="1">'."\n";
     
    9192    $action = $action2;
    9293
    93 //error_log("action=$action");
    9494switch ($action) {
    9595  case 'Assign':
     
    9797    $standalone = 1;
    9898    include_once('b2header.php');
    99        
     99
    100100    // check the current user's level first.
    101101    if ($user_level < $minadminlevel)
    102102      die ("Cheatin' uh ?");
    103    
     103
    104104    //for each link id (in $linkcheck[]): if the current user level >= the
    105105    //userlevel of the owner of the link then we can proceed.
    106106
    107107    if (count($linkcheck) == 0) {
    108         header('Location: linkmanager.php');
     108        header('Location: '.$this_file);
    109109        exit;
    110110    }
     
    121121    $q = $wpdb->query("update $tablelinks SET link_owner='$newowner' WHERE link_id IN ($all_links)");
    122122
    123     header('Location: linkmanager.php');
     123    header('Location: '.$this_file);
    124124    break;
    125125  }
     
    128128    $standalone = 1;
    129129    include_once('b2header.php');
    130        
     130
    131131    // check the current user's level first.
    132132    if ($user_level < $minadminlevel)
    133133      die ("Cheatin' uh ?");
    134    
     134
    135135    //for each link id (in $linkcheck[]): toggle the visibility
    136136    if (count($linkcheck) == 0) {
    137         header('Location: linkmanager.php');
     137        header('Location: '.$this_file);
    138138        exit;
    139139    }
     
    153153        $q = $wpdb->query("update $tablelinks SET link_visible='N' WHERE link_id IN ($all_linksoff)");
    154154    }
    155    
     155
    156156    if (count($ids_to_turnon)) {
    157157        $all_linkson = join(',', $ids_to_turnon);
     
    159159    }
    160160
    161     header('Location: linkmanager.php');
     161    header('Location: '.$this_file);
    162162    break;
    163163  }
     
    169169    if ($user_level < $minadminlevel)
    170170      die ("Cheatin' uh ?");
    171    
     171
    172172    //for each link id (in $linkcheck[]) change category to selected value
    173173    if (count($linkcheck) == 0) {
    174         header('Location: linkmanager.php');
     174        header('Location: '.$this_file);
    175175        exit;
    176176    }
     
    179179    $q = $wpdb->query("update $tablelinks SET link_category='$category' WHERE link_id IN ($all_links)");
    180180
    181     header('Location: linkmanager.php');
     181    header('Location: '.$this_file);
    182182    break;
    183183  }
     
    214214           . addslashes($link_description) . "', '$link_visible', $user_ID, $link_rating, '" . addslashes($link_rel) . "', '" . addslashes($link_notes) . "')");
    215215
    216     header('Location: linkmanager.php');
     216    header('Location: '.$this_file);
    217217    break;
    218218  } // end Add
     
    264264             " link_notes='" . addslashes($link_notes) . "'\n" .
    265265             " WHERE link_id=$link_id");
    266       //error_log($sql);
    267266    } // end if save
    268267    setcookie('links_show_cat_id', $links_show_cat_id, time()+600);
    269     header("Location: linkmanager.php");
     268    header('Location: '.$this_file);
    270269    break;
    271270  } // end Save
     
    292291    $links_show_cat_id = $cat_id;
    293292    setcookie("links_show_cat_id", $links_show_cat_id, time()+600);
    294     header("Location: linkmanager.php");
     293    header('Location: '.$this_file);
    295294    break;
    296295  } // end Delete
     
    383382      <td height="20" align="right">Visible:</td>
    384383      <td><label>
    385         <input type="radio" name="visible" checked="checked" value="Y">
     384        <input type="radio" name="visible" <?php if ($link_visible == 'Y') echo "checked"; ?> value="Y">
    386385        Yes</label>
    387386        &nbsp;<label>
    388         <input type="radio" name="visible" value="N">
     387        <input type="radio" name="visible" <?php if ($link_visible == 'N') echo "checked"; ?> value="N">
    389388        No</label>
    390389      </td>
     
    466465?>
    467466<script type="text/javascript">
    468 <!-- 
     467<!--
    469468function checkAll(form)
    470469{
     
    479478}
    480479//-->
    481 </script> 
     480</script>
    482481
    483482<div class="wrap">
     
    564563            LEFT JOIN $tableusers ON $tableusers.ID = $tablelinks.link_owner ";
    565564
    566     //$use_adminlevels = 0;
    567 
    568565    if (isset($cat_id) && ($cat_id != 'All')) {
    569       // have we already started the where clause?
    570566      $sql .= " WHERE link_category = $cat_id ";
    571567    }
     
    602598LINKS;
    603599            $show_buttons = 1; // default
    604            
     600
    605601            if ($use_adminlevels && ($link->user_level > $user_level)) {
    606602              $show_buttons = 0;
    607603            }
    608            
     604
    609605            if ($show_buttons) {
    610606              echo <<<LINKS
     
    737733
    738734<div class="wrap">
    739 <p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo $siteurl; ?>/wp-admin/linkmanager.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'Link Manager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();" title="Link add bookmarklet">link this</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.</p>
     735<p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo $siteurl; ?>/wp-admin/<?php echo $this_file ?>?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'Link Manager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();" title="Link add bookmarklet">link this</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.</p>
    740736</div>
    741737<?php
  • trunk/wp-admin/upgrade-071-to-072.php

    r267 r280  
    8282$ddl = "ALTER TABLE $tablelinks ADD COLUMN link_notes MEDIUMTEXT NOT NULL DEFAULT '' ";
    8383maybe_add_column($tablename, 'link_notes', $ddl);
    84 if (check_column($tablelinks, 'link_notes', 'mediumtext')) {
    85     $res .= $tablename . ' - ok <br />';
    86 } else {
    87     $res .= 'There was a problem with ' . $tablename . '<br />';
    88     ++$error_count;
    89 }
     84if (check_column($tablename, 'link_notes', 'mediumtext')) {
     85    $res .= $tablename . ' - ok <br />';
     86} else {
     87    $res .= 'There was a problem with ' . $tablename . '<br />';
     88    ++$error_count;
     89}
     90
     91$tablename = $tablelinkcategories;
     92$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN show_images enum('Y','N') NOT NULL default 'Y'";
     93maybe_add_column($tablename, 'show_images', $ddl);
     94if (check_column($tablename, 'show_images', "enum('Y','N')")) {
     95    $res .= $tablename . ' - ok <br />';
     96} else {
     97    $res .= 'There was a problem with ' . $tablename . '<br />';
     98    ++$error_count;
     99}
     100
     101$tablename = $tablelinkcategories;
     102$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN show_description enum('Y','N') NOT NULL default 'Y'";
     103maybe_add_column($tablename, 'show_description', $ddl);
     104if (check_column($tablename, 'show_description', "enum('Y','N')")) {
     105    $res .= $tablename . ' - ok <br />';
     106} else {
     107    $res .= 'There was a problem with ' . $tablename . '<br />';
     108    ++$error_count;
     109}
     110
     111$tablename = $tablelinkcategories;
     112$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN show_rating enum('Y','N') NOT NULL default 'Y'";
     113maybe_add_column($tablename, 'show_rating', $ddl);
     114if (check_column($tablename, 'show_rating', "enum('Y','N')")) {
     115    $res .= $tablename . ' - ok <br />';
     116} else {
     117    $res .= 'There was a problem with ' . $tablename . '<br />';
     118    ++$error_count;
     119}
     120
     121$tablename = $tablelinkcategories;
     122$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN show_updated enum('Y','N') NOT NULL default 'Y'";
     123maybe_add_column($tablename, 'show_updated', $ddl);
     124if (check_column($tablename, 'show_updated', "enum('Y','N')")) {
     125    $res .= $tablename . ' - ok <br />';
     126} else {
     127    $res .= 'There was a problem with ' . $tablename . '<br />';
     128    ++$error_count;
     129}
     130
     131$tablename = $tablelinkcategories;
     132$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN sort_order varchar(64) NOT NULL default 'name'";
     133maybe_add_column($tablename, 'sort_order', $ddl);
     134if (check_column($tablename, 'sort_order', "varchar(64)")) {
     135    $res .= $tablename . ' - ok <br />';
     136} else {
     137    $res .= 'There was a problem with ' . $tablename . '<br />';
     138    ++$error_count;
     139}
     140
     141$tablename = $tablelinkcategories;
     142$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN sort_desc enum('Y','N') NOT NULL default 'N'";
     143maybe_add_column($tablename, 'sort_desc', $ddl);
     144if (check_column($tablename, 'sort_Desc', "enum('Y','N')")) {
     145    $res .= $tablename . ' - ok <br />';
     146} else {
     147    $res .= 'There was a problem with ' . $tablename . '<br />';
     148    ++$error_count;
     149}
     150
     151$tablename = $tablelinkcategories;
     152$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN text_before_link varchar(128) not null default '<li>'";
     153maybe_add_column($tablename, 'text_before_link', $ddl);
     154if (check_column($tablename, 'text_before_link', 'varchar(128)')) {
     155    $res .= $tablename . ' - ok <br />';
     156} else {
     157    $res .= 'There was a problem with ' . $tablename . '<br />';
     158    ++$error_count;
     159}
     160
     161$tablename = $tablelinkcategories;
     162$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN text_after_link  varchar(128) not null default '<br />'";
     163maybe_add_column($tablename, 'text_after_link', $ddl);
     164if (check_column($tablename, 'text_after_link', 'varchar(128)')) {
     165    $res .= $tablename . ' - ok <br />';
     166} else {
     167    $res .= 'There was a problem with ' . $tablename . '<br />';
     168    ++$error_count;
     169}
     170
     171$tablename = $tablelinkcategories;
     172$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN text_after_all  varchar(128) not null default '</li>'";
     173maybe_add_column($tablename, 'text_after_all', $ddl);
     174if (check_column($tablename, 'text_after_all', 'varchar(128)')) {
     175    $res .= $tablename . ' - ok <br />';
     176} else {
     177    $res .= 'There was a problem with ' . $tablename . '<br />';
     178    ++$error_count;
     179}
     180
     181$tablename = $tablelinkcategories;
     182$ddl = "ALTER TABLE $tablelinkcategories ADD COLUMN list_limit int not null default -1";
     183maybe_add_column($tablename, 'list_limit', $ddl);
     184if (check_column($tablename, 'list_limit', 'int(11)')) {
     185    $res .= $tablename . ' - ok <br />';
     186} else {
     187    $res .= 'There was a problem with ' . $tablename . '<br />';
     188    ++$error_count;
     189}
     190
     191if ($error_count > 0) {
     192?>
     193<p>Hmmm... there was some kind of error. If you cannot figure out
     194   see from the output above how to correct the problems please
     195   visit our <a href="http://wordpress.org/support/">support
     196   forums</a> and report your problem.</p>
     197<?php
     198} else {
    90199?>
    91200<p>OK, that wasn't too bad was it? Let's move on to <a href="<?php echo $thisfile;?>?step=2">step 2</a>!</p>
    92 
    93 <?php
     201<?php
     202}
     203    break;
    94204    case 2:
    95205?>
     
    105215  blog_id int(11) NOT NULL default 0,
    106216  option_name varchar(64) NOT NULL default '',
    107   option_can_override enum ('Y','N') NOT NULL default 'Y',
     217  option_can_override enum('Y','N') NOT NULL default 'Y',
    108218  option_type int(11) NOT NULL default 1,
    109219  option_value varchar(255) NOT NULL default '',
  • trunk/wp-admin/wp-install-helper.php

    r265 r280  
    9696   
    9797    foreach ($results as $row ) {
    98         print_r($row);
     98        //print_r($row);
    9999        if ($row->Field == $col_name) {
    100100            // got our column, check the params
    101             echo ("checking $row->Type != $col_type\n");
     101            //echo ("checking $row->Type against $col_type\n");
    102102            if (($col_type != null) && ($row->Type != $col_type)) {
    103103                ++$diffs;
     
    115115                ++$diffs;
    116116            }
    117             if ($diffs > 0)
     117            if ($diffs > 0) {
     118                //echo ("diffs = $diffs returning false\n");
    118119                return false;
     120            }
    119121            return true;
    120122        } // end if found our column
  • trunk/wp-admin/wp-install.php

    r267 r280  
    9090           " cat_name tinytext NOT NULL, ".
    9191           " auto_toggle enum ('Y','N') NOT NULL default 'N', ".
     92           " show_images enum ('Y','N') NOT NULL default 'Y',        " .
     93           " show_description enum ('Y','N') NOT NULL default 'Y',   " .
     94           " show_rating enum ('Y','N') NOT NULL default 'Y',        " .
     95           " show_updated enum ('Y','N') NOT NULL default 'Y',       " .
     96           " sort_order varchar(64) NOT NULL default 'name',         " .
     97           " sort_desc enum('Y','N') NOT NULL default 'N',           " .
     98           " text_before_link varchar(128) not null default '<li>',  " .
     99           " text_after_link  varchar(128) not null default '<br />'," .
     100           " text_after_all  varchar(128) not null default '</li>',  " .
     101           " list_limit int not null default -1,                     " .
    92102           " PRIMARY KEY (cat_id) ".
    93103           ") ";
Note: See TracChangeset for help on using the changeset viewer.