Make WordPress Core

Changeset 23


Ignore:
Timestamp:
05/14/2003 12:50:59 AM (21 years ago)
Author:
mikelittle
Message:

Added in rel attribute

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/linkmanager.php

    r21 r23  
    5252$b2varstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image',
    5353                       'description', 'visible', 'target', 'category', 'link_id',
    54                        'submit', 'order_by', 'links_show_cat_id', 'rating');
     54                       'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel');
    5555for ($i=0; $i<count($b2varstoreset); $i += 1) {
    5656    $b2var = $b2varstoreset[$i];
     
    8686    $link_visible = $HTTP_POST_VARS["visible"];
    8787    $link_rating = $HTTP_POST_VARS["rating"];
     88    $link_rel = $HTTP_POST_VARS["rel"];
    8889    $auto_toggle = get_autotoggle($link_category);
    8990
     
    9899    }
    99100
    100     $sql = "INSERT INTO $tablelinks (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating) " .
     101    $sql = "INSERT INTO $tablelinks (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel) " .
    101102      " VALUES('" . addslashes($link_url) . "','"
    102103           . addslashes($link_name) . "', '"
    103104           . addslashes($link_image) . "', '$link_target', $link_category, '"
    104            . addslashes($link_description) . "', '$link_visible', $user_ID, $link_rating)";
     105           . addslashes($link_description) . "', '$link_visible', $user_ID, $link_rating, '" . addslashes($link_rel) ."')";
    105106
    106107    $sql_result = mysql_query($sql) or die("Couldn't execute query."."sql=[$sql]". mysql_error());
     
    135136      $link_visible = $HTTP_POST_VARS["visible"];
    136137      $link_rating = $HTTP_POST_VARS["rating"];
     138      $link_rel = $HTTP_POST_VARS["rel"];
    137139      $auto_toggle = get_autotoggle($link_category);
    138140
     
    151153             " link_target='$link_target',\n link_category=$link_category,\n " .
    152154             " link_visible='$link_visible',\n link_description='" . addslashes($link_description) . "',\n " .
    153              " link_rating=$link_rating\n" .
     155             " link_rating=$link_rating,\n" .
     156             " link_rel='" . addslashes($link_rel) . "'\n" .
    154157             " WHERE link_id=$link_id";
    155158      //error_log($sql);
     
    195198    }
    196199
    197     $sql = "SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating " .
     200    $sql = "SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel " .
    198201      " FROM $tablelinks " .
    199202      " WHERE link_id = $link_id";
     
    209212      $link_visible = $row->link_visible;
    210213      $link_rating = $row->link_rating;
     214      $link_rel = stripslashes($row->link_rel);
    211215    }
    212216
     
    236240        <td height="20" align="right">Description:</td>
    237241        <td><input type="text" name="description" size="80" value="<?php echo $link_description; ?>"></td>
     242      </tr>
     243      <tr height="20">
     244        <td height="20" align="right">Rel:</td>
     245        <td><input type="text" name="rel" size="80" value="<?php echo $link_rel; ?>"></td>
    238246      </tr>
    239247      <tr height="20">
     
    409417    </tr>
    410418<?php
    411     $sql = "SELECT link_url, link_name, link_image, link_description, link_visible, link_category AS cat_id, cat_name AS category, $tableusers.user_login, link_id, link_rating "
     419    $sql = "SELECT link_url, link_name, link_image, link_description, link_visible, link_category AS cat_id, cat_name AS category, $tableusers.user_login, link_id, link_rating, link_rel "
    412420           . " FROM $tablelinks LEFT JOIN $tablelinkcategories ON $tablelinks.link_category = $tablelinkcategories.cat_id "
    413421           . " LEFT JOIN $tableusers on $tableusers.ID = $tablelinks.link_owner ";
     
    455463
    456464      echo("<tr>\n");
    457       echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" colspan=\"4\"><b>Desc:</b>&nbsp;".stripslashes($row->link_description)."</td>\n");
     465      echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" colspan=\"2\"><b>Desc:</b>&nbsp;".stripslashes($row->link_description)."</td>\n");
     466      echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" ><b>Rel:</b></td>\n");
     467      $my_rel = stripslashes($row->link_rel);
     468      if ($my_rel == '') {
     469          $my_rel = '&nbsp;';
     470      }
     471      echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" >$my_rel</td>\n");
    458472      echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" ><b>Rating:</b>&nbsp;".$row->link_rating."</td>\n");
    459       echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" valign=\"top\"><b>Owner:</ab></td>\n");
     473      echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" valign=\"top\"><b>Owner:</b></td>\n");
    460474      echo("  <td style=\"border-bottom: 1px dotted #9C9A9C;\" valign=\"top\">".$row->user_login."</td>\n");
    461475      echo("</tr>\n");
     
    491505        <td height="20" align="right">Description:</td>
    492506        <td><input type="text" name="description" size="80" value=""></td>
     507      </tr>
     508      <tr height="20">
     509        <td height="20" align="right">Rel:</td>
     510        <td><input type="text" name="rel" size="80" value=""></td>
    493511      </tr>
    494512      <tr height="20">
  • trunk/links.install.php

    r21 r23  
    9393           " link_rating int NOT NULL DEFAULT '0',              " .
    9494           " link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " .
     95           " link_rel varchar(255) NOT NULL default '',         " .
    9596           " PRIMARY KEY (link_id)                              " .
    9697           ") ";
  • trunk/links.php

    r21 r23  
    111111    dbconnect();
    112112    $sql = "SELECT link_url, link_name, link_image, link_target, " .
    113            " link_description, link_rating $get_updated " .
     113           " link_description, link_rating, link_rel $get_updated " .
    114114           " FROM $tablelinks " .
    115115           " WHERE link_visible = 'Y' " .
     
    140140            $the_link = $row->link_url;
    141141        }
    142         echo("<a href=\"".$the_link."\" title=\"" .
     142        $rel = stripslashes($row->link_rel);
     143        if ($rel != '') {
     144            $rel = 'rel="'.$rel.'"';
     145        }
     146        echo("<a href=\"".$the_link."\" $rel title=\"" .
    143147             stripslashes($row->link_description) .
    144148             "\" target=\"$row->link_target\">");
  • trunk/links.sql

    r21 r23  
    4141  link_rating int NOT NULL DEFAULT '0',
    4242  link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
     43  link_rel varchar(255) NOT NULL default '',
    4344  PRIMARY KEY (link_id)
    4445) TYPE=MyISAM;
  • trunk/links.update-1.3.sql

    r21 r23  
    2929
    3030ALTER TABLE b2links ADD COLUMN link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
     31ALTER TABLE b2links ADD COLUMN link_rel varchar(255) NOT NULL DEFAULT '';
    3132
    3233
    33 
  • trunk/links.weblogs.com.php

    r21 r23  
    55
    66// globals to hold state
    7 $inside_weblog = false;
    87$updated_timestamp = 0;
    98$all_links = array();
     
    8483 **/
    8584function startElement($parser, $tagName, $attrs) {
    86     global $inside_weblog, $updated_timestamp, $all_links;
     85    global $updated_timestamp, $all_links;
    8786    if ($tagName == 'WEBLOGUPDATES') {
    8887        //convert 'updated' into php date variable
Note: See TracChangeset for help on using the changeset viewer.