⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 link-manager.php

📁 在综合英文版XOOPS 2.09, 2.091, 2.092 的基础上正式发布XOOPS 2.09中文版 XOOPS 2.09x 版主要是PHP5升级、bug修正和安全补正: 1 全面兼容PHP 5.
💻 PHP
📖 第 1 页 / 共 2 页
字号:
              <th scope="row"> <?php echo _LANG_WLA_SUB_PROFESSIONAL; ?> </th>              <td>                <label for="label5">                <input class="valinp" type="checkbox" name="professional" value="co-worker" id="label5" <?php xfn_check('professional', 'co-worker'); ?> />          <?php echo _LANG_WLA_CHECK_WORKER; ?></label>                <label for="label6">                <input class="valinp" type="checkbox" name="professional" value="colleague" id="label6" <?php xfn_check('professional', 'colleague'); ?> />          <?php echo _LANG_WLA_CHECK_COLL; ?></label>              </td>            </tr>            <tr>              <th scope="row"> <?php echo _LANG_WLA_SUB_GEOGRAPH; ?> </th>              <td>                <label for="label7">                <input class="valinp" type="radio" name="geographical" value="co-resident" id="label7" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_RESI; ?></label>                <label for="label8">                <input class="valinp" type="radio" name="geographical" value="neighbor" id="label8" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_NEIG; ?></label>                <label for="label9">                <input class="valinp" type="radio" name="geographical" value="" id="label9" <?php xfn_check('geographical', '', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_NONE; ?></label>              </td>            </tr>            <tr>              <th scope="row"> <?php echo _LANG_WLA_SUB_FAMILY; ?> </th>              <td>                <label for="label10">                <input class="valinp" type="radio" name="family" value="child" id="label10" <?php xfn_check('family', 'child', 'radio'); ?>  />          <?php echo _LANG_WLA_CHECK_CHILD; ?></label>                <label for="label11">                <input class="valinp" type="radio" name="family" value="parent" id="label11" <?php xfn_check('family', 'parent', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_PARENT; ?></label>                <label for="label12">                <input class="valinp" type="radio" name="family" value="sibling" id="label12" <?php xfn_check('family', 'sibling', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_SIBLING; ?></label>                <label for="label13">                <input class="valinp" type="radio" name="family" value="spouse" id="label13" <?php xfn_check('family', 'spouse', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_SPOUSE; ?></label>                <label for="label14">                <input class="valinp" type="radio" name="family" value="" id="label14" <?php xfn_check('family', '', 'radio'); ?> />          <?php echo _LANG_WLA_CHECK_NONE; ?></label>              </td>            </tr>            <tr>              <th scope="row"> <?php echo _LANG_WLA_SUB_ROMANTIC; ?> </th>              <td>                <label for="label15">                <input class="valinp" type="checkbox" name="romantic" value="muse" id="label15" <?php xfn_check('romantic', 'muse'); ?> />          <?php echo _LANG_WLA_CHECK_MUSE; ?></label>                <label for="label16">                <input class="valinp" type="checkbox" name="romantic" value="crush" id="label16" <?php xfn_check('romantic', 'crush'); ?> />          <?php echo _LANG_WLA_CHECK_CRUSH; ?></label>                <label for="label17">                <input class="valinp" type="checkbox" name="romantic" value="date" id="label17" <?php xfn_check('romantic', 'date'); ?> />          <?php echo _LANG_WLA_CHECK_DATE; ?></label>                <label for="label18">                <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="label18" <?php xfn_check('romantic', 'sweetheart'); ?> />          <?php echo _LANG_WLA_CHECK_HEART; ?></label>              </td>            </tr>        </table></td>      </tr>      <tr>        <th scope="row"><?php echo _LANG_WLA_SUB_NOTE; ?></th>        <td><textarea name="notes" cols="80" rows="10"><?php echo $link_notes; ?></textarea></td>      </tr>      <tr>        <th scope="row"><?php echo _LANG_WLA_SUB_RATE; ?></th>        <td><select name="rating" size="1">          <?php    for ($r = 0; $r < 10; $r++) {      echo('            <option value="'.$r.'" ');      if ($link_rating == $r)        echo 'selected="selected"';      echo('>'.$r.'</option>');    }?>        </select> (<?php echo _LANG_WLA_CHECK_ZERO; ?>) </td>      </tr>      <tr>        <th scope="row"><?php echo _LANG_WLA_SUB_TARGET; ?></th>        <td><label>          <input type="radio" name="target" value="_blank"   <?php echo(($link_target == '_blank') ? 'checked="checked"' : ''); ?> />          <code>_blank</code></label>&nbsp;<label><input type="radio" name="target" value="_top" <?php echo(($link_target == '_top') ? 'checked="checked"' : ''); ?> /><code>_top</code></label>&nbsp;<label><input type="radio" name="target" value=""     <?php echo(($link_target == '') ? 'checked="checked"' : ''); ?> />none (<?php echo _LANG_WLA_CHECK_STRICT; ?>)</label></td>      </tr>      <tr>        <th scope="row"><?php echo _LANG_WLA_SUB_VISIBLE; ?></th>        <td><label>          <input type="radio" name="visible" <?php if ($link_visible == 'Y') echo "checked"; ?> value="Y" />Yes</label>&nbsp;<label><input type="radio" name="visible" <?php if ($link_visible == 'N') echo "checked"; ?> value="N" />No</label></td>      </tr>      <tr>        <th scope="row"><?php echo _LANG_WLA_SUB_CAT; ?></th>        <td><?php category_dropdown('category', $link_category); ?></td>      </tr>      <tr>        <td colspan="2" align="center"><input type="submit" name="submit" value="<?php echo _LANG_WLM_SAVE_CHANGES; ?>" />          &nbsp;          <input type="submit" name="submit" value="<?php echo _LANG_WLM_EDIT_CANCEL; ?>" />          <input type="hidden" name="action" value="editlink" />          <input type="hidden" name="link_id" value="<?php echo $link_id; ?>" />          <input type="hidden" name="order_by" value="<?php echo $order_by ?>" />          <input type="hidden" name="cat_id" value="<?php echo $cat_id ?>" /></td>      </tr>    </table>  </form></div><?php    break;  } // end linkedit  case "Show":  {    if (!isset($cat_id) || ($cat_id == '')) {        if (!isset($links_show_cat_id) || ($links_show_cat_id == ''))        $cat_id = 'All';    }    $links_show_cat_id = $cat_id;    if (!isset($order_by) || ($order_by == '')) {        if (!isset($links_show_order) || ($links_show_order == ''))        $order_by = 'order_name';    }    $links_show_order = $order_by;    //break; fall through  } // end Show  case "popup":  {    $link_url = stripslashes($_GET["linkurl"]);    $link_name = stripslashes($_GET["name"]);    //break; fall through  }  default:  {    if (isset($links_show_cat_id) && ($links_show_cat_id != ''))        $cat_id = intval($links_show_cat_id);    if (!isset($cat_id) || ($cat_id == '')) {        if (!isset($links_show_cat_id) || ($links_show_cat_id == ''))        $cat_id = 'All';    }    $links_show_cat_id = intval($cat_id);    if (isset($links_show_order) && ($links_show_order != ''))        $order_by = $links_show_order;    if (!isset($order_by) || ($order_by == ''))        $order_by = 'order_name';    $links_show_order = $order_by;    setcookie('links_show_cat_id_'.$cookiehash, $links_show_cat_id, time()+600);    setcookie('links_show_order_'.$cookiehash, $links_show_order, time()+600);    $standalone=0;    include_once ("./admin-header.php");    if ($user_level < get_settings('links_minadminlevel')) {      die("You have no right to edit the links for this blog.<br>Ask for a promotion to your <a href=\"mailto:get_settings('admin_email')\">blog admin</a> :)");    }    switch ($order_by)    {        case 'order_id':     $sqlorderby = 'id';          break;        case 'order_url':    $sqlorderby = 'url';         break;        case 'order_desc':   $sqlorderby = 'description'; break;        case 'order_owner':  $sqlorderby = 'owner';       break;        case 'order_rating': $sqlorderby = 'rating';      break;        case 'order_name':        default:             $sqlorderby = 'name';        break;    }  if ($action != "popup") {?><script type="text/javascript"><!--function checkAll(form){	for (i = 0, n = form.elements.length; i < n; i++) {		if(form.elements[i].type == "checkbox") {			if(form.elements[i].checked == true)				form.elements[i].checked = false;			else				form.elements[i].checked = true;		}	}}//--></script><ul id="adminmenu2">	<li><a href="link-manager.php" class="current"><?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"><?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">    <form name="cats" method="post" action="">    <table width="75%" cellpadding="3" cellspacing="3">      <tr>        <td>          <?php echo _LANG_WLM_SHOW_LINKS; ?><br />        </td>        <td>          <?php echo _LANG_WLM_ORDER_BY; ?>        </td>		<td>&nbsp;</td>      </tr>      <tr>        <td><?php    $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM {$wpdb->linkcategories} ORDER BY cat_id");    echo "        <select name=\"cat_id\">\n";    echo "          <option value=\"All\"";    if ($cat_id == 'All')      echo " selected='selected'";    echo "> 全部</option>\n";    foreach ($results as $row) {      echo "          <option value=\"".$row->cat_id."\"";      if ($row->cat_id == $cat_id)        echo " selected='selected'";        echo ">".$row->cat_id.": ".$row->cat_name;        if ($row->auto_toggle == 'Y')            echo ' (auto toggle)';        echo "</option>\n";    }    echo "        </select>\n";?>        </td>        <td>          <select name="order_by">            <option value="order_id"     <?php if ($order_by == 'order_id')     echo " selected='selected'";?>>链接ID</option>            <option value="order_name"   <?php if ($order_by == 'order_name')   echo " selected='selected'";?>>名称</option>            <option value="order_url"    <?php if ($order_by == 'order_url')    echo " selected='selected'";?>>URI</option>            <option value="order_desc"   <?php if ($order_by == 'order_desc')   echo " selected='selected'";?>>描述</option>            <option value="order_owner"  <?php if ($order_by == 'order_owner')  echo " selected='selected'";?>>所有者</option>            <option value="order_rating" <?php if ($order_by == 'order_rating') echo " selected='selected'";?>>评分</option>          </select>        </td>        <td>          <input type="submit" name="action" value="<?php echo _LANG_WLM_SHOW_BUTTONTEXT; ?>" />        </td>      </tr>    </table>    </form></div><div class="wrap">    <form name="links" id="links" method="post" action="">    <input type="hidden" name="link_id" value="" />    <input type="hidden" name="action" value="" />    <input type="hidden" name="order_by" value="<?php echo $order_by ?>" />    <input type="hidden" name="cat_id" value="<?php echo $cat_id ?>" />  <table width="100%" cellpadding="3" cellspacing="3">    <tr>      <th width="15%"><?php echo gethelp_link($this_file,'list_o_links');?> <?php echo _LANG_WLA_SUB_NAME; ?></th>      <th><?php echo _LANG_WLA_SUB_URI; ?></th>      <th><?php echo _LANG_WLA_SUB_CAT; ?></th>      <th><?php echo _LANG_WLA_SUB_REL; ?></th>      <th><?php echo _LANG_WLA_SUB_IMAGE; ?></th>      <th><?php echo _LANG_WLA_SUB_VISIBLE; ?></th>      <th colspan="2"><?php echo _LANG_WLM_SHOW_ACTIONTEXT; ?></th>      <th>&nbsp;</th>  </tr><?php    $sql = "SELECT link_url, link_name, link_image, link_description, link_visible,            link_category AS cat_id, cat_name AS category, {$wpdb->users}.user_login, link_id,            link_rating, link_rel, {$wpdb->users}.user_level            FROM {$wpdb->links}            LEFT JOIN {$wpdb->linkcategories} ON {$wpdb->links}.link_category = {$wpdb->linkcategories}.cat_id            LEFT JOIN {$wpdb->users} ON {$wpdb->users}.ID = {$wpdb->links}.link_owner ";    if (isset($cat_id) && ($cat_id != 'All ')) {      $cat_id = intval($cat_id);      $sql .= " WHERE link_category = $cat_id ";    }    $sql .= ' ORDER BY link_' . $sqlorderby;    // echo "$sql";    $links = $wpdb->get_results($sql);    if ($links) {        foreach ($links as $link) {            $short_url = str_replace('http://', '', stripslashes($link->link_url));            $short_url = str_replace('www.', '', $short_url);            if ('/' == substr($short_url, -1))                $short_url = substr($short_url, 0, -1);            if (strlen($short_url) > 35)                $short_url =  substr($short_url, 0, 32).'...';            $link->link_name = stripslashes($link->link_name);            $link->category = stripslashes($link->category);            $link->link_rel = stripslashes($link->link_rel);            $link->link_description = stripslashes($link->link_description);            $image = ($link->link_image != null) ? '是' : '否';            $visible = ($link->link_visible == 'Y') ? '是' : '否';            ++$i;            $style = ($i % 2) ? ' class="alternate"' : '';            echo <<<LINKS    <tr valign="middle" $style>        <td><strong>$link->link_name</strong><br />        描述: $link->link_description</td>        <td><a href="$link->link_url" title="Visit $link->link_name">$short_url</a></td>        <td>$link->category</td>        <td>$link->link_rel</td>        <td align='center'>$image</td>        <td align='center'>$visible</td>LINKS;            $show_buttons = 1; // default            if (get_settings('links_use_adminlevels') && ($link->user_level > $user_level)) {              $show_buttons = 0;            }            if ($show_buttons) {              echo <<<LINKS        <td><a href="link-manager.php?link_id=$link->link_id&amp;action=linkedit" class="edit">编辑</a></td>        <td><a href="link-manager.php?link_id=$link->link_id&amp;action=Delete" onclick="return confirm('要删除链接.\\n  选择\'取消\'或\'确定\'.');" class="delete">删除</a></td>        <td><input type="checkbox" name="linkcheck[]" value="$link->link_id" /></td>LINKS;            } else {              echo "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>\n";            }		echo "\n\t</tr>";        }    }?></table></div><div class="wrap"><h2><?php echo _LANG_WLM_MULTI_LINK; ?></h2>  <table width="100%" cellpadding="3" cellspacing="3">    <tr><td colspan="4"><?php echo _LANG_WLM_CHECK_CHOOSE; ?></td></tr>    <tr>        <td>          <input type="submit" name="action2" value="<?php echo _LANG_WLM_ASSIGN_TEXT; ?>" /> <?php echo _LANG_WLM_OWNER_SHIP; ?><?php    $results = $wpdb->get_results("SELECT ID, user_login FROM {$wpdb->users} WHERE user_level > 0 ORDER BY ID");    echo "          <select name=\"newowner\" size=\"1\">\n";    foreach ($results as $row) {      echo "            <option value=\"".$row->ID."\"";      echo ">".$row->user_login;      echo "</option>\n";    }    echo "          </select>\n";?>        </td>        <td>          <?php echo _LANG_WLM_TOGGLE_TEXT; ?><input type="submit" name="action2" value="<?php echo _LANG_WLM_VISIVILITY_TEXT; ?>" />        </td>        <td>          <input type="submit" name="action2" value="<?php echo _LANG_WLM_MOVE_TEXT; ?>" /><?php echo _LANG_WLM_TO_CATEGORY; ?><?php category_dropdown('category'); ?>        </td>        <td align="right">          <a href="#" onclick="checkAll(document.getElementById('links')); return false; "><?php echo _LANG_WLM_TOGGLE_BOXES; ?></a>        </td>    </tr></table><?php  } // end if !popup?></form></div><?php    break;  } // end default} // end case?><?php include('admin-footer.php'); ?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -