当前位置: 首页>>代码示例>>PHP>>正文


PHP unesc函数代码示例

本文整理汇总了PHP中unesc函数的典型用法代码示例。如果您正苦于以下问题:PHP unesc函数的具体用法?PHP unesc怎么用?PHP unesc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unesc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update_config_table

function update_config_table($table_name, $default_cfg, $cfg, $type)
{
    foreach ($default_cfg as $config_name => $config_value) {
        if (isset($_POST[$config_name]) && $_POST[$config_name] != $cfg[$config_name]) {
            if ($type == 'str') {
                $config_value = "'" . bt_sql_esc(unesc($_POST[$config_name])) . "'";
            } else {
                if ($type == 'bool') {
                    $config_value = $_POST[$config_name] ? 1 : 0;
                } else {
                    if ($type == 'num') {
                        $config_value = round(abs(intval($_POST[$config_name])));
                    } else {
                        return;
                    }
                }
            }
            $sql = "UPDATE {$table_name} SET\n\t\t\t\tconfig_value = {$config_value}\n\t\t\t\tWHERE config_name = '{$config_name}'";
            if (!DB()->sql_query($sql)) {
                message_die(GENERAL_ERROR, "Failed to update configuration for {$config_name}", '', __LINE__, __FILE__, $sql);
            }
        }
    }
    return;
}
开发者ID:forummaks,项目名称:forum_maks,代码行数:25,代码来源:functions_admin_torrent.php

示例2: _torrenttable

function _torrenttable($rt, $frame_caption, $speed = false)
{
    global $STYLEPATH, $extratpl, $language;
    $torrent = array();
    $num = 0;
    foreach ($rt as $id => $a) {
        $num++;
        if ($a["leechers"] > 0) {
            $r = $a["seeds"] / $a["leechers"];
            $ratio = number_format($r, 2);
        } else {
            $ratio = $language["INFINITE"];
        }
        $torrent[$num - 1]["rank"] = $num;
        if ($GLOBALS["usepopup"]) {
            $torrent[$num - 1]["filename"] = "<a href=\"javascript:popdetails('index.php?page=details&amp;id=" . $a['hash'] . "');\">" . unesc($a["name"]) . "</a>";
        } else {
            $torrent[$num - 1]["filename"] = "<a href=\"index.php?page=details&amp;id=" . $a['hash'] . "\">" . unesc($a["name"]) . "</a>";
        }
        $torrent[$num - 1]["complete"] = number_format($a["finished"]);
        $torrent[$num - 1]["seeds"] = number_format($a["seeds"]);
        $torrent[$num - 1]["leechers"] = number_format($a["leechers"]);
        $torrent[$num - 1]["peers"] = number_format($a["leechers"] + $a["seeds"]);
        $torrent[$num - 1]["ratio"] = $ratio;
        if ($speed) {
            $torrent[$num - 1]["speed"] = makesize($a["speed"]);
        }
    }
    $extratpl->set("language", $language);
    $extratpl->set("torrent", $torrent);
    $extratpl->set("DISPLAY_SPEED", $speed, true);
    $extratpl->set("DISPLAY_SPEED1", $speed, true);
    return set_block($frame_caption, "center", $extratpl->fetch(load_template("extra-stats.torrent.tpl")));
}
开发者ID:wilian32,项目名称:xbtit,代码行数:34,代码来源:extra-stats.php

示例3: read_invitations

function read_invitations()
{
    global $TABLE_PREFIX, $admintpl, $language, $CURUSER, $STYLEPATH, $btit_settings;
    $scriptname = htmlspecialchars($_SERVER["PHP_SELF"] . "?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=invitations");
    $addparam = "";
    $res = get_result("SELECT COUNT(*) as invites FROM {$TABLE_PREFIX}invitations", true);
    $count = $res[0]["invites"];
    list($pagertop, $pagerbottom, $limit) = pager('15', $count, $scriptname . "&amp;");
    $admintpl->set("inv_pagertop", $pagertop);
    $admintpl->set("inv_pagerbottom", $pagerbottom);
    $results = get_result("SELECT * FROM {$TABLE_PREFIX}invitations ORDER BY id DESC {$limit}", true);
    $invitees = array();
    $i = 0;
    foreach ($results as $id => $data) {
        $res = do_sqlquery("SELECT username FROM {$TABLE_PREFIX}users WHERE id = " . $data["inviter"], true);
        if (mysql_num_rows($res) > 0) {
            $inviter_name = mysql_result($res, 0, 0);
        } else {
            $inviter_name = 'Unknown';
        }
        $invitees[$i]["inviter"] = "<a href=\"index.php?page=userdetails&amp;user=" . $data["inviter"] . "\">" . $inviter_name . "</a>";
        $invitees[$i]["invitee"] = unesc($data["invitee"]);
        $invitees[$i]["hash"] = unesc($data["hash"]);
        $invitees[$i]["time_invited"] = $data["time_invited"];
        $invitees[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=invitations&amp;action=delete&amp;id=" . $data["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
        $i++;
    }
    $admintpl->set("invitees", $invitees);
    $admintpl->set("language", $language);
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:30,代码来源:admin.invitations.php

示例4: user_with_color

function user_with_color($username, $prefix = NULL, $suffix = NULL)
{
    global $TABLE_PREFIX;
    if (isset($prefix) && isset($suffix)) {
        return unesc($prefix . $username . $suffix);
    } else {
        // get cached version for the user (prefix and suffix)
        $rps = get_result("SELECT prefixcolor,suffixcolor FROM {$TABLE_PREFIX}users u INNER JOIN {$TABLE_PREFIX}users_level ul ON u.id_level=ul.id WHERE u.username=" . sqlesc($username) . "", false, 0);
        return unesc($rps[0]['prefixcolor'] . $username . $rps[0]['suffixcolor']);
    }
}
开发者ID:Karpec,项目名称:gizd,代码行数:11,代码来源:users.functions.php

示例5: format_shout

function format_shout($text)
{
    global $smilies, $BASEURL, $privatesmilies;
    $s = $text;
    $s = strip_tags($s);
    $s = unesc($s);
    $f = @fopen("badwords.txt", "r");
    if ($f && filesize("badwords.txt") != 0) {
        $bw = fread($f, filesize("badwords.txt"));
        $badwords = explode("\n", $bw);
        for ($i = 0; $i < count($badwords); ++$i) {
            $badwords[$i] = trim($badwords[$i]);
        }
        $s = str_replace($badwords, "*censured*", $s);
    }
    @fclose($f);
    // [b]Bold[/b]
    $s = preg_replace("/\\[b\\]((\\s|.)+?)\\[\\/b\\]/", "<b>\\1</b>", $s);
    // [i]Italic[/i]
    $s = preg_replace("/\\[i\\]((\\s|.)+?)\\[\\/i\\]/", "<i>\\1</i>", $s);
    // [u]Underline[/u]
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/", "<u>\\1</u>", $s);
    // [color=blue]Text[/color]
    $s = preg_replace("/\\[color=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color=\\1>\\2</font>", $s);
    // [color=#ffcc99]Text[/color]
    $s = preg_replace("/\\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color=\\1>\\2</font>", $s);
    // [url=http://www.example.com]Text[/url]
    $s = preg_replace("/\\[url=((http|ftp|https|ftps|irc):\\/\\/[^<>\\s]+?)\\]((\\s|.)+?)\\[\\/url\\]/i", "<a href=\\1 target=_blank>\\3</a>", $s);
    // [url]http://www.example.com[/url]
    $s = preg_replace("/\\[url\\]((http|ftp|https|ftps|irc):\\/\\/[^<>\\s]+?)\\[\\/url\\]/i", "<a href=\\1 target=_blank>\\1</a>", $s);
    // [url]www.example.com[/url]
    $s = preg_replace("/\\[url\\](www\\.[^<>\\s]+?)\\[\\/url\\]/i", "<a href='http://\\1' target='_blank'>\\1</a>", $s);
    // [url=www.example.com]Text[/url]
    $s = preg_replace("/\\[url=(www\\.[^<>\\s]+?)\\]((\\s|.)+?)\\[\\/url\\]/i", "<a href='http://\\1' target='_blank'>\\2</a>", $s);
    // [size=4]Text[/size]
    $s = preg_replace("/\\[size=([1-7])\\]((\\s|.)+?)\\[\\/size\\]/i", "<font size=\\1>\\2</font>", $s);
    // [font=Arial]Text[/font]
    $s = preg_replace("/\\[font=([a-zA-Z ,]+)\\]((\\s|.)+?)\\[\\/font\\]/i", "<font face=\"\\1\">\\2</font>", $s);
    // Linebreaks
    $s = nl2br($s);
    // Maintain spacing
    $s = str_replace("  ", " &nbsp;", $s);
    reset($smilies);
    while (list($code, $url) = each($smilies)) {
        $s = str_replace($code, "<img border=\"0\" src=\"{$BASEURL}/images/smilies/{$url}\" alt=\"{$code}\" />", $s);
    }
    reset($privatesmilies);
    while (list($code, $url) = each($privatesmilies)) {
        $s = str_replace($code, "<img border=\"0\" src=\"{$BASEURL}/images/smilies/{$url}\" alt=\"{$code}\" />", $s);
    }
    return $s;
}
开发者ID:fchypzero,项目名称:cybyd,代码行数:52,代码来源:shoutbox_block.php

示例6: invite

function invite($email)
{
    global $CURUSER;
    global $SITENAME;
    global $BASEURL;
    global $SITEEMAIL;
    global $lang_takeinvite;
    $id = $CURUSER[id];
    $email = unesc(htmlspecialchars(trim($email)));
    $email = safe_email($email);
    if (!$email) {
        bark($lang_takeinvite['std_must_enter_email']);
    }
    if (!check_email($email)) {
        bark($lang_takeinvite['std_invalid_email_address']);
    }
    if (EmailBanned($email)) {
        bark($lang_takeinvite['std_email_address_banned']);
    }
    if (!EmailAllowed($email)) {
        bark($lang_takeinvite['std_wrong_email_address_domains'] . allowedemails());
    }
    $body = "\n你好,\n\n我邀请你加入 {$SITENAME}, 这是一个拥有丰富资源的非开放社区. \n如果你有兴趣加入我们请阅读规则并确认邀请.最后,确保维持一个良好的分享率 \n分享允许的资源.\n\n欢迎到来! :)\n";
    $body = str_replace("<br />", "<br />", nl2br(trim(strip_tags($body))));
    if (!$body) {
        bark($lang_takeinvite['std_must_enter_personal_message']);
    }
    // check if email addy is already in use
    $a = @mysql_fetch_row(@sql_query("select count(*) from users where email=" . sqlesc($email))) or die(mysql_error());
    if ($a[0] != 0) {
        bark($lang_takeinvite['std_email_address'] . htmlspecialchars($email) . $lang_takeinvite['std_is_in_use']);
    }
    $b = @mysql_fetch_row(@sql_query("select count(*) from invites where invitee=" . sqlesc($email))) or die(mysql_error());
    if ($b[0] != 0) {
        bark($lang_takeinvite['std_invitation_already_sent_to'] . htmlspecialchars($email) . $lang_takeinvite['std_await_user_registeration']);
    }
    $ret = sql_query("SELECT username FROM users WHERE id = " . sqlesc($id)) or sqlerr();
    $arr = mysql_fetch_assoc($ret);
    $hash = md5(mt_rand(1, 10000) . $CURUSER['username'] . TIMENOW . $CURUSER['passhash']);
    $title = $SITENAME . $lang_takeinvite['mail_tilte'];
    $message = <<<EOD
{$lang_takeinvite['mail_one']}{$arr[username]}{$lang_takeinvite['mail_two']}
<b><a href="http://{$BASEURL}/signup.php?type=invite&invitenumber={$hash}" target="_blank">{$lang_takeinvite['mail_here']}</a></b><br />
http://{$BASEURL}/signup.php?type=invite&invitenumber={$hash}
<br />{$lang_takeinvite['mail_three']}{$invite_timeout}{$lang_takeinvite['mail_four']}{$arr[username]}{$lang_takeinvite['mail_five']}<br />
{$body}
<br /><br />{$lang_takeinvite['mail_six']}
EOD;
    sent_mail($email, $SITENAME, $SITEEMAIL, change_email_encode(get_langfolder_cookie(), $title), change_email_encode(get_langfolder_cookie(), $message), "invitesignup", false, false, '', get_email_encode(get_langfolder_cookie()));
    //this email is sent only when someone give out an invitation
    sql_query("INSERT INTO invites (inviter, invitee, hash, time_invited) VALUES ('" . mysql_real_escape_string($id) . "', '" . mysql_real_escape_string($email) . "', '" . mysql_real_escape_string($hash) . "', " . sqlesc(date("Y-m-d H:i:s")) . ")");
}
开发者ID:NullYing,项目名称:mtpt,代码行数:52,代码来源:viewinvitebox.php

示例7: sub_cat

 public static function sub_cat($sub)
 {
     global $db;
     MCached::connect();
     $key = 'sub::categories::' . $sub;
     $name = MCached::get($key);
     if ($name === MCached::NO_RESULT) {
         $c_q = @$db->query("SELECT name FROM categories WHERE id = '" . $sub . "'");
         $c_q = @$c_q->fetch_array(MYSQLI_BOTH);
         $name = security::html_safe(unesc($c_q["name"]));
         MCached::add($key, $name, self::ONE_DAY);
     }
     return $name;
 }
开发者ID:Q8HMA,项目名称:BtiTracker-1.5.1,代码行数:14,代码来源:class.Cached.php

示例8: category_read

function category_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH, $btit_settings;
    $admintpl->set("language", $language);
    $cres = genrelist();
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["frm_number"] = "form" . $i;
        $cres[$i]["name"] = unesc($cres[$i]["name"]);
        $cres[$i]["image"] = "<img src=\"{$STYLEURL}/images/categories/" . $cres[$i]["image"] . "\" alt=\"\" border=\"0\" />";
        $cres[$i]["smf_select"] = get_forum_list($cres[$i]["forumid"], $cres[$i]["id"]);
    }
    $admintpl->set("categories", $cres);
    unset($cres);
}
开发者ID:Karpec,项目名称:gizd,代码行数:14,代码来源:admin.cats.forum.php

示例9: readGoldSettings

function readGoldSettings()
{
    global $TABLE_PREFIX, $settings;
    $res = get_result("SELECT * FROM {$TABLE_PREFIX}gold  WHERE id='1'", true);
    $count = 0;
    foreach ($res as $key => $value) {
        $settings[$count]["gold_picture"] = unesc("<img src='../gold/" . $value["gold_picture"] . "' border='0' alt='gold'/>\r\n             \t\t\t\t\t\t\t\t\t\t  <br/>Choose new picture (max size 100px x 100px):<br/><input type='file' name='gold_picture'/>");
        $settings[$count]["level"] = createUsersLevelCombo(unesc($value["level"]));
        $settings[$count]["silver_picture"] = unesc("<img src='../gold/" . $value["silver_picture"] . "' border='0'  alt='silver'/>\r\n             \t\t\t\t\t\t\t\t\t\t\t<br/>Choose new picture (max size 100px x 100px):<br/><input type='file' name='silver_picture'/>");
        $settings[$count]["gold_description"] = unesc("<textarea name='gold_description' style='width:250px; height:120px; border:1px solid #999999;'>" . $value["gold_description"] . "</textarea>");
        $settings[$count]["silver_description"] = unesc("<textarea name='silver_description' style='width:250px; height:120px; border:1px solid #999999;'>" . $value["silver_description"] . "</textarea>");
        $settings[$count]["classic_description"] = unesc("<textarea name='classic_description' style='width:250px; height:120px; border:1px solid #999999;'>" . $value["classic_description"] . "</textarea>");
        $count++;
    }
}
开发者ID:fchypzero,项目名称:cybyd,代码行数:15,代码来源:admin.gold.php

示例10: faq_read

function faq_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("faq_add", false, true);
    $admintpl->set("language", $language);
    $cres = genrelistfaq('', 'faq_group');
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["title"]);
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_group&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_group&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("faq", $cres);
    $admintpl->set("faq_add_new", "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_group&amp;action=add\">" . $language["FAQ_ADD"] . "</a>");
    unset($cres);
}
开发者ID:Karpec,项目名称:gizd,代码行数:15,代码来源:admin.faq.group.php

示例11: category_read

function category_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("category_add", false, true);
    $admintpl->set("language", $language);
    $cres = genrelist();
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["name"]);
        $cres[$i]["image"] = "<img src=\"{$STYLEURL}/images/categories/" . $cres[$i]["image"] . "\" alt=\"\" border=\"0\" />";
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("categories", $cres);
    $admintpl->set("category_add_new", "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=add\">" . $language["CATEGORY_ADD"] . "</a>");
    unset($cres);
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:16,代码来源:admin.categories.php

示例12: read_styles

function read_styles()
{
    global $TABLE_PREFIX, $language, $CURUSER, $admintpl, $STYLEPATH;
    $sres = style_list();
    for ($i = 0; $i < count($sres); $i++) {
        $res = do_sqlquery("SELECT COUNT(*) FROM {$TABLE_PREFIX}users WHERE style = " . $sres[$i]["id"], true);
        $sres[$i]["style_users"] = mysql_result($res, 0, 0);
        $sres[$i]["style"] = unesc($sres[$i]["style"]);
        $sres[$i]["style_url"] = unesc($sres[$i]["style_url"]);
        $sres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=style&amp;action=edit&amp;id=" . $sres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $sres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=style&amp;action=delete&amp;id=" . $sres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("style_add", false, true);
    $admintpl->set("language", $language);
    $admintpl->set("styles", $sres);
    $admintpl->set("style_add_new", "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=style&amp;action=add\">" . $language["STYLE_ADD"] . "</a>");
    unset($sres);
    mysql_free_result($res);
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:19,代码来源:admin.styles.php

示例13: comment_form

function comment_form()
{
    global $comment, $id, $cid;
    block_begin(NEW_COMMENT);
    $comment = str_replace('\\r\\n', "\n", $comment);
    ?>
    <center>
    <form enctype='multipart/form-data' name='comment' method='post'>
    <input type='hidden' name='info_hash' value='<?php 
    echo $id;
    ?>
' />
    <table class='lista' border='0' cellpadding='10'>
    <tr>
    <tr><td align='left' class='header'><?php 
    echo USER_NAME;
    ?>
:</td><td class='lista' align='left'><input name='user' type='text'  value='<?php 
    echo security::html_safe($_GET["usern"]);
    ?>
' size='20' maxlength='100' disabled; readonly></td></tr>
    <tr><td align='left' class='header'><?php 
    echo COMMENT_1;
    ?>
:</td><td class='lista' align='left'><?php 
    textbbcode("comment", "comment", security::html_safe(unesc($comment)));
    ?>
</td></tr>
    <tr><td class='header' colspan='2' align='center'><input type='submit' name='confirm' value='<?php 
    echo FRM_CONFIRM;
    ?>
' />&nbsp;&nbsp;&nbsp;<input type='submit' name='confirm' value='<?php 
    echo FRM_PREVIEW;
    ?>
' /></td></tr>
    </table>
    </form>
    </center>
    
    <?php 
    block_end();
}
开发者ID:HDVinnie,项目名称:BtiTracker-1.5.0,代码行数:42,代码来源:comment.php

示例14: category_read

function category_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("category_add", false, true);
    $admintpl->set("language", $language);
    $admintpl->set("perm", false, true);
    $admintpl->set("permedit", false, true);
    $cres = genrelist();
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["name"]);
        $cres[$i]["perm"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=perm&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["PERMISSIONS"]) . "</a>";
        $cres[$i]["image"] = "<img src=\"{$STYLEURL}/images/categories/" . $cres[$i]["image"] . "\" alt=\"\" border=\"0\" />";
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("categories", $cres);
    $admintpl->set("category_add_new", "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=add\">" . $language["CATEGORY_ADD"] . "</a>");
    $ajax_order = "<script type=\"text/javascript\">\n\t   \t\tfunction updateOrder()\n            {\n                var options = {\n                                method : 'post',\n                                parameters : Sortable.serialize('categories_list'),\n                                onComplete : function(request) {                                \t\n\t\t\t                        new Effect.Highlight(ID.id,{duration:3});\n\t\t\t                        \n\t\t\t                    }\n                              };\n                new Ajax.Request('index.php?page=admin&user=" . $_GET["user"] . "&code=" . $_GET["code"] . "&do=category&action=order', options);\n            }\n  \t Sortable.create('categories_list', { onUpdate : updateOrder });\n\t   \n            \n</script>";
    $admintpl->set('ajax_order', $ajax_order);
    unset($cres);
}
开发者ID:Karpec,项目名称:gizd,代码行数:21,代码来源:admin.categories.php

示例15: catnumber

 function catnumber($val = "")
 {
     global $TABLE_PREFIX;
     print "<div id=catnumber style=\"width:100%;overflow:auto\" align=left><table class=\"lista\" cellpadding=\"2\" cellspacing=\"1\" style=\"width:100%;\" align=left>";
     $c_q = @mysql_query("SELECT * FROM {$TABLE_PREFIX}categories WHERE sub='0' ORDER BY sort_index ASC");
     while ($c = mysql_fetch_array($c_q)) {
         $cid = $c["id"];
         $name = unesc($c["name"]);
         // lets see if it has sub-categories.
         $s_q = mysql_query("SELECT * FROM {$TABLE_PREFIX}categories WHERE sub='{$cid}'");
         $s_t = mysql_num_rows($s_q);
         $res = mysql_query("select count(*) as allincat FROM {$TABLE_PREFIX}files where category=" . $cid);
         if ($res) {
             $row = mysql_fetch_array($res);
             $totalall = $row["allincat"];
         } else {
             $totalall = 0;
         }
         if ($s_t == 0) {
             print "<tr><td class=lista align=left><a href='index.php?page=torrents&amp;category={$cid}'><font style=\"font-size:11px;\">" . $name . "</font></a></td><td class=lista align=right><b>" . $totalall . "</b>&nbsp;</td></tr>";
         } else {
             print "<tr><td class=lista align=left colspan=2><font style=\"font-size:11px;\"><b>" . $name . " :</b></font></td></tr>";
             //          print("<tr><td class=lista align=left colspan=2><a href='torrents.php?category=$cid'><font style=\"font-size:11px;\">".$name." :</font></a></td></tr>");
             while ($s = mysql_fetch_array($s_q)) {
                 $sub = $s["id"];
                 $name = unesc($s["name"]);
                 $name2 = unesc($c["name"]);
                 $res = mysql_query("select count(*) as allincat2 FROM {$TABLE_PREFIX}files where category=" . $sub);
                 if ($res) {
                     $row = mysql_fetch_array($res);
                     $totalall2 = $row["allincat2"];
                 } else {
                     $totalall2 = 0;
                 }
                 print "<tr><td class=lista align=left>&nbsp;&raquo;&nbsp;<a href='index.php?page=torrents&amp;category={$sub}'><font style=\"font-size:11px;\">" . $name . "</font></a></td><td class=lista align=right><b>" . $totalall2 . "</b>&nbsp;&nbsp;</td></tr>";
             }
         }
     }
     print "</table></div>";
 }
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:40,代码来源:categories_block.php


注:本文中的unesc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。