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


PHP htmlspecialchars_uni函数代码示例

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


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

示例1: commenttable

function commenttable($rows, $redaktor = "comment")
{
    global $CURUSER, $avatar_max_width;
    $count = 0;
    foreach ($rows as $row) {
        if ($row["downloaded"] > 0) {
            $ratio = $row['uploaded'] / $row['downloaded'];
            $ratio = number_format($ratio, 2);
        } elseif ($row["uploaded"] > 0) {
            $ratio = "Inf.";
        } else {
            $ratio = "---";
        }
        if (strtotime($row["last_access"]) > gmtime() - 600) {
            $online = "online";
            $online_text = "В сети";
        } else {
            $online = "offline";
            $online_text = "Не в сети";
        }
        print "<table class=maibaugrand width=100% border=1 cellspacing=0 cellpadding=3>";
        print "<tr><td class=colhead align=\"left\" colspan=\"2\" height=\"24\">";
        if (isset($row["username"])) {
            $title = $row["title"];
            if ($title == "") {
                $title = get_user_class_name($row["class"]);
            } else {
                $title = htmlspecialchars_uni($title);
            }
            print ":: <img src=\"pic/buttons/button_" . $online . ".gif\" alt=\"" . $online_text . "\" title=\"" . $online_text . "\" style=\"position: relative; top: 2px;\" border=\"0\" height=\"14\">" . " <a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . " class=altlink_white><b>" . get_user_class_color($row["class"], htmlspecialchars_uni($row["username"])) . "</b></a> ::" . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=\"/pic/warned.gif\" alt=\"Warned\">" : "") . " {$title} ::\n" . " <img src=\"pic/upl.gif\" alt=\"upload\" border=\"0\" width=\"12\" height=\"12\"> " . mksize($row["uploaded"]) . " :: <img src=\"pic/down.gif\" alt=\"download\" border=\"0\" width=\"12\" height=\"12\"> " . mksize($row["downloaded"]) . " :: <font color=\"" . get_ratio_color($ratio) . "\">{$ratio}</font> :: ";
        } else {
            print "<a name=\"comm" . $row["id"] . "\"><i>[Anonymous]</i></a>\n";
        }
        $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars_uni($row["avatar"]) : "";
        if (!$avatar) {
            $avatar = "pic/default_avatar.gif";
        }
        if (md5($row['text']) == $row['text_hash']) {
            $text = $row['text_parsed'];
        } else {
            $text = format_comment($row['text']);
            sql_query('INSERT INTO comments_parsed (cid, text_hash, text_parsed) VALUES (' . implode(', ', array_map('sqlesc', array($row['id'], md5($row['text']), $text))) . ')') or sqlerr(__FILE__, __LINE__);
        }
        if ($row["editedby"]) {
            //$res = mysql_fetch_assoc(sql_query("SELECT * FROM users WHERE id = $row[editedby]")) or sqlerr(__FILE__,__LINE__);
            $text .= "<p><font size=1 class=small>Последний раз редактировалось <a href=userdetails.php?id={$row['editedby']}><b>{$row['editedbyname']}</b></a> в {$row['editedat']}</font></p>\n";
        }
        print "</td></tr>";
        print "<tr valign=top>\n";
        print "<td style=\"padding: 0px; width: 5%;\" align=\"center\"><img src={$avatar} width=\"{$avatar_max_width}\"> </td>\n";
        print "<td width=100% class=text>";
        //print("<span style=\"float: right\"><a href=\"#top\"><img title=\"Top\" src=\"pic/top.gif\" alt=\"Top\" border=\"0\" width=\"15\" height=\"13\"></a></span>");
        print "{$text}</td>\n";
        print "</tr>\n";
        print "<tr><td class=colhead align=\"center\" colspan=\"2\">";
        print "<div style=\"float: left; width: auto;\">" . ($CURUSER ? " [<a href=\"" . $redaktor . ".php?action=quote&amp;cid={$row['id']}\" class=\"altlink_white\">Цитата</a>]" : "") . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? " [<a href=" . $redaktor . ".php?action=edit&amp;cid={$row['id']} class=\"altlink_white\">Изменить</a>]" : "") . (get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=delete&amp;cid={$row['id']}\" class=\"altlink_white\">Удалить</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=vieworiginal&amp;cid={$row['id']}\" class=\"altlink_white\">Оригинал</a>]" : "") . (get_user_class() >= UC_MODERATOR ? " IP: " . ($row["ip"] ? "<a href=\"usersearch.php?ip={$row['ip']}\" class=\"altlink_white\">" . $row["ip"] . "</a>" : "Неизвестен") : "") . "</div>";
        print "<div align=\"right\"><!--<font size=1 class=small>-->Комментарий добавлен: " . $row["added"] . " GMT<!--</font>--></td></tr>";
        print "</table><br>";
    }
}
开发者ID:klldll,项目名称:tbdev,代码行数:60,代码来源:functions_commenttable.php

示例2: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $postinfo =& $this->content['cms_post'][$activity['contentid']];
     $nodeinfo =& $this->content['cms_node'][$postinfo['nodeid']];
     $articleinfo =& $this->content['cms_article'][$nodeinfo['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($postinfo['pagetext']);
     $articleinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $articleinfo['fullurl'] = vB_Route::create('vBCms_Route_Content', $nodeinfo['nodeid'] . ($nodeinfo['url'] == '' ? '' : '-' . $nodeinfo['url']))->getCurrentURL();
     $nodeinfo['parenturl'] = $this->fetchParentUrl($nodeinfo['parentnode']);
     $nodeinfo['parenttitle'] = $this->fetchParentTitle($nodeinfo['parentnode']);
     $userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_commented_on_an_article_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], $articleinfo['fullurl'], $nodeinfo['title'], $nodeinfo['parenturl'], $nodeinfo['parenttitle']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_commented_on_an_article_y_in_z'], $userinfo['username'], $articleinfo['fullurl'], $nodeinfo['title'], $nodeinfo['parenturl'], $nodeinfo['parenttitle']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('postinfo', $postinfo);
         $templater->register('activity', $activity);
         $templater->register('nodeinfo', $nodeinfo);
         $templater->register('articleinfo', $articleinfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:30,代码来源:comment.php

示例3: automedia_xxxymovies

function automedia_xxxymovies($message)
{
    global $mybb, $width, $height;
    $w = $width;
    $h = $height;
    /**
     *Example:
     *http://www.xxxymovies.com/164396/
    */
    $pattern = "<http://www.xxxymovies.com/([0-9]{1,12})/\" target>";
    if (preg_match($pattern, $message)) {
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.xxxymovies.com/" . $url . "/");
            $data = fetch_remote_file($site);
            if ($data) {
                $nrxxx = get_avmatch('~rel="video_src" href="([\\w\\.\\/:-_]+)"~i', $data);
                $vid = array($nrxxx);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?xxxymovies\\.com/([0-9]{1,12})/(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"{$n}\" loop=\"false\" width=\"{$w}\" height=\"{$h}\" allowfullscreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></div>", $message, $limit);
            }
        }
    }
    return $message;
}
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:29,代码来源:xxxymovies.php

示例4: upgrade15_usernameupdate

function upgrade15_usernameupdate()
{
    global $db, $output, $mybb;
    $output->print_header("Performing Queries");
    echo "<p>Performing username updates..</p>";
    flush();
    require_once MYBB_ROOT . "inc/datahandler.php";
    require_once MYBB_ROOT . "inc/datahandlers/user.php";
    $not_renameable = array();
    // Because commas can cause some problems with private message sending in usernames we have to remove them
    $query = $db->simple_select("users", "uid, username", "username LIKE '%,%'");
    while ($user = $db->fetch_array($query)) {
        $userhandler = new UserDataHandler('update');
        $updated_user = array("uid" => $user['uid'], "username" => str_replace(',', '', $user['username']));
        $userhandler->set_data($updated_user);
        if (!$userhandler->validate_user()) {
            $not_renameable[] = htmlspecialchars_uni($user['username']);
        } else {
            $userhandler->update_user();
        }
    }
    if (!empty($not_renameable)) {
        echo "<span style=\"color: red;\">NOTICE:</span> The following users could not be renamed automatically. Please rename these users in the Admin CP manually after the upgrade process has finished completing:<br />\n\t\t<ul>\n\t\t<li>";
        echo implode('</li>\\n<li>', $not_renameable);
        echo "</li>\n\t\t</ul>";
    }
    $contents .= "Click next to continue with the upgrade process.</p>";
    $output->print_contents($contents);
    $output->print_footer("15_done");
}
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:30,代码来源:upgrade15.php

示例5: spamalyser_build_post_path

function spamalyser_build_post_path(&$logitem)
{
    global $lang, $forums, $mybb;
    $bburl = htmlspecialchars_uni($mybb->settings['bburl'] . '/');
    $subject = htmlspecialchars_uni($logitem['subject']);
    if ($logitem['real_pid']) {
        $subject = '<a href="' . $bburl . get_post_link($logitem['pid'], $logitem['tid']) . '#pid' . $logitem['pid'] . '" target="_blank">' . $subject . '</a>';
    }
    if ($logitem['threadsubject']) {
        if ($logitem['real_tid']) {
            $subject = '<a href="' . $bburl . get_thread_link($logitem['tid']) . '" target="_blank">' . htmlspecialchars_uni($logitem['threadsubject']) . '</a> &raquo; ' . $subject;
        } else {
            $subject = htmlspecialchars_uni($logitem['threadsubject']) . ' &raquo; ' . $subject;
        }
    }
    if (empty($forums)) {
        $forums = $GLOBALS['cache']->read('forums');
    }
    if ($forums[$logitem['fid']]) {
        $subject = '<a href="' . $bburl . get_forum_link($logitem['fid']) . '" target="_blank">' . $forums[$logitem['fid']]['name'] . '</a> &raquo; ' . $subject;
    }
    // new/edit icons
    if ($logitem['event'] == 0) {
        $subject = '<img src="spamalyser_img/post_new.gif" title="' . $lang->icon_new_thread_post . '" alt="' . $lang->icon_alt_new_thread_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
    } elseif ($logitem['event'] == 2) {
        $subject = '<img src="spamalyser_img/post_merge.gif" title="' . $lang->icon_merge_post . '" alt="' . $lang->icon_alt_merge_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
    } else {
        $subject = '<img src="spamalyser_img/post_edit.gif" title="' . $lang->icon_edit_thread_post . '" alt="' . $lang->icon_alt_edit_thread_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
    }
    return $subject;
}
开发者ID:andarms,项目名称:python-gaming.com,代码行数:31,代码来源:spamalyserlog.php

示例6: maketable

function maketable($res)
{
    global $tracker_lang, $use_ttl, $ttl_days;
    $ret = "<table class=main border=1 cellspacing=0 cellpadding=5>" . "<tr><td class=colhead align=left>" . $tracker_lang['type'] . "</td><td class=colhead>" . $tracker_lang['name'] . "</td>" . ($use_ttl ? "<td class=colhead align=center>" . $tracker_lang['ttl'] . "</td>" : "") . "<td class=colhead align=center>" . $tracker_lang['size'] . "</td><td class=colhead align=right>" . $tracker_lang['details_seeding'] . "</td><td class=colhead align=right>" . $tracker_lang['details_leeching'] . "</td><td class=colhead align=center>" . $tracker_lang['uploaded'] . "</td>\n" . "<td class=colhead align=center>" . $tracker_lang['downloaded'] . "</td><td class=colhead align=center>" . $tracker_lang['ratio'] . "</td></tr>\n";
    while ($arr = mysql_fetch_assoc($res)) {
        if ($arr["downloaded"] > 0) {
            $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
            $ratio = "<font color=" . get_ratio_color($ratio) . ">{$ratio}</font>";
        } else {
            if ($arr["uploaded"] > 0) {
                $ratio = "Inf.";
            } else {
                $ratio = "---";
            }
        }
        $catid = $arr["catid"];
        $catimage = htmlspecialchars_uni($arr["image"]);
        $catname = htmlspecialchars_uni($arr["catname"]);
        $ttl = $ttl_days * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
        if ($ttl == 1) {
            $ttl .= "&nbsp;час";
        } else {
            $ttl .= "&nbsp;часов";
        }
        $size = str_replace(" ", "<br />", mksize($arr["size"]));
        $uploaded = str_replace(" ", "<br />", mksize($arr["uploaded"]));
        $downloaded = str_replace(" ", "<br />", mksize($arr["downloaded"]));
        $seeders = number_format($arr["seeders"]);
        $leechers = number_format($arr["leechers"]);
        $ret .= "<tr><td style='padding: 0px'><a href=\"browse.php?cat={$catid}\"><img src=\"pic/cats/{$catimage}\" alt=\"{$catname}\" border=\"0\" /></a></td>\n" . "<td><a href=details.php?id={$arr['torrent']}&amp;hit=1><b>" . $arr["torrentname"] . "</b></a></td>" . ($use_ttl ? "<td align=center>{$ttl}</td>" : "") . "<td align=center>{$size}</td><td align=right>{$seeders}</td><td align=right>{$leechers}</td><td align=center>{$uploaded}</td>\n" . "<td align=center>{$downloaded}</td><td align=center>{$ratio}</td></tr>\n";
    }
    $ret .= "</table>\n";
    return $ret;
}
开发者ID:klldll,项目名称:tbdev,代码行数:34,代码来源:userdetails.php

示例7: verify_word_allowed

function verify_word_allowed(&$word)
{
    global $vbulletin, $phrasequery;
    $wordlower = strtolower($word);
    // check if the word contains wildcards
    if (strpos($wordlower, '*') !== false) {
        // check if wildcards are allowed
        if ($vbulletin->options['allowwildcards']) {
            // check the length of the word with all * characters removed
            // and make sure it's at least (minsearchlength - 1) characters long
            // in order to prevent searches like *a**... which would be bad
            if (vbstrlen(str_replace('*', '', $wordlower)) < $vbulletin->options['minsearchlength'] - 1) {
                // word is too short
                $word = htmlspecialchars_uni($word);
                eval(standard_error(fetch_error('searchinvalidterm', $word, $vbulletin->options['minsearchlength'])));
            } else {
                // word is of valid length
                return true;
            }
        } else {
            // wildcards are not allowed - error
            $word = htmlspecialchars_uni($word);
            eval(standard_error(fetch_error('searchinvalidterm', $word, $vbulletin->options['minsearchlength'])));
        }
    } else {
        if ($wordokay = is_index_word($word)) {
            return true;
        } else {
            // word is a bad word (common, too long, or too short; don't search on it)
            return false;
        }
    }
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:33,代码来源:functions_search.php

示例8: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $messageinfo =& $this->content['visitormessage'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $userinfo2 =& $this->content['user'][$messageinfo['userid']];
     $messageinfo['preview'] = strip_quotes($messageinfo['pagetext']);
     $messageinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($messageinfo['preview'], false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $userinfo = $this->fetchUser($activity['userid'], $messageinfo['postusername']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_created_a_visitormessage_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_created_a_visitormessage_y_in_z'], $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('userinfo2', $userinfo2);
         $templater->register('linkinfo', array('vmid' => $messageinfo['vmid']));
         $templater->register('linkinfo2', array('tab' => 'visitor_messaging'));
         $templater->register('activity', $activity);
         $templater->register('messageinfo', $messageinfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:visitormessage.php

示例9: tags_editpost_end

function tags_editpost_end()
{
    global $mybb, $db, $lang, $templates, $thread, $post, $tags, $tags_value;
    if ($mybb->settings['tags_enabled'] == 0 || tags_in_disforum($thread['fid']) || $mybb->settings['tags_groups'] != -1 && !is_member($mybb->settings['tags_groups'])) {
        return;
    }
    $lang->load('tags');
    if ($thread['firstpost'] != $mybb->get_input('pid', 1)) {
        return;
    }
    $tags_value = $mybb->get_input('tags');
    if (!$tags_value) {
        $bad_tags = tags_getbads(true, false);
        $query = $db->simple_select('tags', '*', "tid='{$thread['tid']}'{$bad_tags}");
        $thread['tags'] = array();
        while ($tag = $db->fetch_array($query)) {
            if (!in_array($tag['name'], $thread['tags']) && $tag['name'] != '') {
                array_push($thread['tags'], $tag['name']);
            }
        }
        $tags_value = implode(',', $thread['tags']);
    }
    $tags_value = htmlspecialchars_uni(tags_string2tag($tags_value));
    eval('$tags = "' . $templates->get('tags_input') . '";');
}
开发者ID:ATofighi,项目名称:MyBB-Tags,代码行数:25,代码来源:editpost.php

示例10: fetch_podcast_categoryarray

/**
* Fetch array of podcast categories
*
* @return	array		Array of categories
*/
function fetch_podcast_categoryarray($categoryid)
{
    require_once DIR . '/includes/class_xml.php';
    $xmlobj = new vB_XML_Parser(false, DIR . '/includes/xml/podcast_vbulletin.xml');
    $podcastdata = $xmlobj->parse();
    $key = 1;
    $output = array();
    if (is_array($podcastdata['category'])) {
        foreach ($podcastdata['category'] as $cats) {
            if ($key == $categoryid) {
                $output[] = htmlspecialchars_uni($cats['name']);
                break;
            }
            $key++;
            if (is_array($cats['sub']['name'])) {
                foreach ($cats['sub']['name'] as $subcats) {
                    if ($key == $categoryid) {
                        $output[] = htmlspecialchars_uni($cats['name']);
                        $output[] = htmlspecialchars_uni($subcats);
                        break 2;
                    }
                    $key++;
                }
            }
        }
    }
    return $output;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:33,代码来源:adminfunctions_misc.php

示例11: tags_index_start

function tags_index_start()
{
    global $mybb, $db, $tags, $theme, $templates, $lang, $collapsedimg, $collapsed;
    if ($mybb->settings['tags_enabled'] == 0 || $mybb->settings['tags_index'] == 0) {
        return;
    }
    $lang->load('tags');
    $mybb->settings['tags_limit'] = (int) $mybb->settings['tags_limit'];
    $order_by = 'RAND()';
    if ($db->type == 'pgsql' || $db->type == 'sqlite') {
        $order_by = 'RANDOM()';
    }
    $query = DBTags::get("SUM(threads.views) as sumviews, tags.name", "tags.name != ''", array('orderBy' => $order_by, 'orderType' => '', 'limit' => "0, {$mybb->settings['tags_limit']}"));
    $tags = $comma = '';
    while ($tag = $db->fetch_array($query)) {
        if (!$tag['name']) {
            continue;
        }
        $tag['name'] = htmlspecialchars_uni($tag['name']);
        $tag['tag_link'] = get_tag_link($tag['name']);
        $tag['size'] = tags_getsize($tag['sumviews']);
        eval('$tags .= "' . $templates->get('tags_box_tag_sized') . '";');
        $comma = $lang->comma;
    }
    if ($tags != '') {
        eval('$tags = "' . $templates->get('tags_box') . '";');
    }
}
开发者ID:ATofighi,项目名称:MyBB-Tags,代码行数:28,代码来源:index.php

示例12: fetch_forum_announcements

function fetch_forum_announcements($pid = 0, $depth = 1)
{
    global $mybb, $db, $lang, $announcements, $templates, $announcements_forum, $moderated_forums;
    static $forums_by_parent, $forum_cache, $parent_forums;
    if (!is_array($forum_cache)) {
        $forum_cache = cache_forums();
    }
    if (!is_array($parent_forums) && $mybb->user['issupermod'] != 1) {
        // Get a list of parentforums to show for normal moderators
        $parent_forums = array();
        foreach ($moderated_forums as $mfid) {
            $parent_forums = array_merge($parent_forums, explode(',', $forum_cache[$mfid]['parentlist']));
        }
    }
    if (!is_array($forums_by_parent)) {
        foreach ($forum_cache as $forum) {
            $forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
        }
    }
    if (!is_array($forums_by_parent[$pid])) {
        return;
    }
    foreach ($forums_by_parent[$pid] as $children) {
        foreach ($children as $forum) {
            if ($forum['active'] == 0 || !is_moderator($forum['fid'])) {
                // Check if this forum is a parent of a moderated forum
                if (in_array($forum['fid'], $parent_forums)) {
                    // A child is moderated, so print out this forum's title.  RECURSE!
                    $trow = alt_trow();
                    eval("\$announcements_forum .= \"" . $templates->get("modcp_announcements_forum_nomod") . "\";");
                } else {
                    // No subforum is moderated by this mod, so safely continue
                    continue;
                }
            } else {
                // This forum is moderated by the user, so print out the forum's title, and its announcements
                $trow = alt_trow();
                $padding = 40 * ($depth - 1);
                eval("\$announcements_forum .= \"" . $templates->get("modcp_announcements_forum") . "\";");
                if ($announcements[$forum['fid']]) {
                    foreach ($announcements[$forum['fid']] as $aid => $announcement) {
                        $trow = alt_trow();
                        if ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0) {
                            $icon = "<img src=\"images/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\"  style=\"vertical-align: middle;\" /> ";
                        } else {
                            $icon = "<img src=\"images/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\"  style=\"vertical-align: middle;\" /> ";
                        }
                        $subject = htmlspecialchars_uni($announcement['subject']);
                        eval("\$announcements_forum .= \"" . $templates->get("modcp_announcements_announcement") . "\";");
                    }
                }
            }
            // Build the list for any sub forums of this forum
            if ($forums_by_parent[$forum['fid']]) {
                fetch_forum_announcements($forum['fid'], $depth + 1);
            }
        }
    }
}
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:59,代码来源:functions_modcp.php

示例13: get_tag_link

function get_tag_link($name = '')
{
    if ($name == '') {
        $link = TAG_URL_PAGE;
    } else {
        $link = str_replace("{name}", $name, TAG_URL);
    }
    return htmlspecialchars_uni($link);
}
开发者ID:ATofighi,项目名称:MyBB-Tags,代码行数:9,代码来源:url.php

示例14: automedia_divshare

function automedia_divshare($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "560";
        $h = "400";
    }
    /**
     *Example:
     *http://www.divshare.com/download/7714880-d76
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?divshare\\.com/download/([^\\"]*)\\">isU', $message)) {
        $pattern = "<http://www.divshare.com/download/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.divshare.com/download/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrdv = get_avmatch('/video_flash_detector.php\\?data=(.*)\\" name=\\"movie\\"/isU', $data);
                $vid = array($nrdv);
                $nrdi = get_avmatch('/ class=\\"img_thumb\\" id=\\"(.{6,40}?)\\" border=/isU', $data);
                $img = array($nrdi);
            }
            $limit = 1;
            if ($vid) {
                foreach ($vid as $video_id) {
                    if (!in_array("ajaxData_img_thumb", $img)) {
                        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?divshare\\.com/download/(.{6,18}?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><div id=\"kadoo_video_container_\$3\"><object height=\"{$h}\" width=\"{$w}\" id=\"video_detector_\$3\"><param value=\"http://divshare.com/flash/video_flash_detector.php?data={$video_id}\" name=\"movie\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"wmode\" value=\"opaque\"></param><embed wmode=\"opaque\" height=\"{$h}\" width=\"{$w}\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" src=\"http://divshare.com/flash/video_flash_detector.php?data={$video_id}\"></embed></object></div>", $message, $limit);
                    }
                }
            }
            if ($img) {
                foreach ($img as $image_id) {
                    if ($image_id == "ajaxData_img_thumb") {
                        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?divshare\\.com/download/(.{6,18}?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0\" width=\"{$w}\" height=\"{$h}\" id=\"divslide\"><param name=\"movie\" value=\"http://www.divshare.com/flash/slide?myId=\$3\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.divshare.com/flash/slide?myId=\$3\" width=\"{$h}\" height=\"{$h}\" name=\"divslide\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>", $message, $limit);
                    }
                }
            }
        }
    }
    return $message;
}
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:57,代码来源:divshare.php

示例15: getLoadQuery

 /**
  * Fetches the SQL for loading.
  * $required_query is used to identify which query to build for classes that
  * have multiple queries for fetching info.
  *
  * This can safely be based on $this->required_info as long as a consitent
  * flag is used for identifying the query.
  *
  * @param int $required_query				- The required query
  * @param bool $force_rebuild				- Whether to rebuild the string
  *
  * @return string
  */
 protected function getLoadQuery($required_query = self::QUERY_BASIC, $force_rebuild = false)
 {
     // Hooks should check the required query before populating the hook vars
     $hook_query_fields = $hook_query_join = $hook_query_where = '';
     ($hook = vBulletinHook::fetch_hook($this->query_hook)) ? eval($hook) : false;
     if (self::QUERY_BASIC == $required_query) {
         return $query = "\n\t\t\t\tSELECT \n\t\t\t\t\tgroupmessage.gmid as itemid,\n\t\t\t\t\tgroupmessage.discussionid,\n\t\t\t\t\tgroupmessage.postuserid,\n\t\t\t\t\tgroupmessage.postusername,\n\t\t\t\t\tgroupmessage.dateline,\n\t\t\t\t\tgroupmessage.state,\n\t\t\t\t\tgroupmessage.title,\n\t\t\t\t\tgroupmessage.pagetext,\n\t\t\t\t\tgroupmessage.ipaddress,\n\t\t\t\t\tgroupmessage.allowsmilie,\n\t\t\t\t\tgroupmessage.reportthreadid " . $hook_query_fields . "\n\t\t\t\tFROM " . TABLE_PREFIX . "groupmessage AS groupmessage " . $hook_query_join . "\n\t\t\t\tWHERE groupmessage.gmid IN (" . implode(',', $this->itemid) . ") \n\t\t\t\t\t{$hook_query_where}";
     }
     throw new vB_Exception_Model('Invalid query id \'' . htmlspecialchars_uni($required_query) . '\'specified for social group message collection: ' . htmlspecialchars_uni($query));
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:23,代码来源:socialgroupmessage.php


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