本文整理汇总了PHP中htmlspecialchars_uni函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlspecialchars_uni函数的具体用法?PHP htmlspecialchars_uni怎么用?PHP htmlspecialchars_uni使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了htmlspecialchars_uni函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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&cid={$row['id']}\" class=\"altlink_white\">Цитата</a>]" : "") . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? " [<a href=" . $redaktor . ".php?action=edit&cid={$row['id']} class=\"altlink_white\">Изменить</a>]" : "") . (get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=delete&cid={$row['id']}\" class=\"altlink_white\">Удалить</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? " [<a href=\"" . $redaktor . ".php?action=vieworiginal&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> » ' . $subject;
} else {
$subject = htmlspecialchars_uni($logitem['threadsubject']) . ' » ' . $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> » ' . $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 .= " час";
} else {
$ttl .= " часов";
}
$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']}&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
示例16: ParseInputs
function ParseInputs($val)
{
if (is_int($val)) {
$val = intval($val);
return $val;
} else {
$val = htmlspecialchars_uni(trim(addslashes($val)));
return $val;
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:10,代码来源:ishop_control.php
示例17: myalerts_acp_manage_alert_types
function myalerts_acp_manage_alert_types()
{
global $mybb, $lang, $page, $db, $cache;
$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::getInstance();
$alertTypes = $alertTypeManager->getAlertTypes();
if (strtolower($mybb->request_method) == 'post') {
if (!verify_post_check($mybb->get_input('my_post_key'))) {
flash_message($lang->invalid_post_verify_key2, 'error');
admin_redirect("index.php?module=config-myalerts_alert_types");
}
$enabledAlertTypes = $mybb->get_input('alert_types_enabled', MyBB::INPUT_ARRAY);
$canBeUserDisabled = $mybb->get_input('alert_types_can_be_user_disabled', MyBB::INPUT_ARRAY);
$enabledAlertTypes = array_map('intval', array_keys($enabledAlertTypes));
$canBeUserDisabled = array_map('intval', array_keys($canBeUserDisabled));
$updateArray = array();
foreach ($alertTypes as $alertType) {
$type = MybbStuff_MyAlerts_Entity_AlertType::unserialize($alertType);
$type->setEnabled(in_array($type->getId(), $enabledAlertTypes));
$type->setCanBeUserDisabled(in_array($type->getId(), $canBeUserDisabled));
$updateArray[] = $type;
}
$alertTypeManager->updateAlertTypes($updateArray);
flash_message($lang->myalerts_alert_types_updated, 'success');
admin_redirect("index.php?module=config-myalerts_alert_types");
} else {
$page->output_header($lang->myalerts_alert_types);
$form = new Form('index.php?module=config-myalerts_alert_types', 'post');
$table = new Table();
$table->construct_header($lang->myalerts_alert_type_code);
$table->construct_header($lang->myalerts_alert_type_enabled, array('width' => '5%', 'class' => 'align_center'));
$table->construct_header($lang->myalerts_alert_type_can_be_user_disabled, array('width' => '10%', 'class' => 'align_center'));
$noResults = false;
if (!empty($alertTypes)) {
foreach ($alertTypes as $type) {
$alertCode = htmlspecialchars_uni($type['code']);
$table->construct_cell($alertCode);
$table->construct_cell($form->generate_check_box('alert_types_enabled[' . $type['id'] . ']', '', '', array('checked' => $type['enabled'])));
$table->construct_cell($form->generate_check_box('alert_types_can_be_user_disabled[' . $type['id'] . ']', '', '', array('checked' => $type['can_be_user_disabled'])));
$table->construct_row();
}
} else {
$table->construct_cell($lang->myalerts_no_alert_types, array('colspan' => 2));
$table->construct_row();
$noResults = true;
}
$table->output($lang->myalerts_alert_types);
if (!$noResults) {
$buttons[] = $form->generate_submit_button($lang->myalerts_update_alert_types);
$form->output_submit_wrapper($buttons);
}
$form->end();
$page->output_footer();
}
}
开发者ID:harrygg,项目名称:MyAlerts,代码行数:54,代码来源:myalerts.php
示例18: prepareProperties
/**
* Prepares properties for rendering.
*/
protected function prepareProperties()
{
parent::prepareProperties();
// vB_View_Content has already htmlspecialchars_uni($this->title) so we should not htmlspecialchars_uni again here. Fixed bug #29663
// $this->title = htmlspecialchars_uni($this->title);
$this->css = new vB_View('vbcms_article_css');
$this->author_phrase = new vB_Phrase('vbcms', 'author');
if ($this->pagelist AND sizeof($this->pagelist) > 1)
{
// create a route
$route = new vBCms_Route_Content();
$route->setSegments(array('node' => $this->nodesegment, 'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'View')));
$pagelist = $this->pagelist;
$pagelist[1] = $this->title;
$this->pagelist = $pagelist;
$pages = array();
foreach ($this->pagelist AS $pagenum => $title)
{
$route->setParameter(0, $pagenum);
$title = $title ? $title : new vB_Phrase('vbcms', 'page_x', $pagenum);
// undo the 'stop_parse' from the [page] bbcode and strip bbcode and html
$title = vbchop(strip_tags(strip_bbcode(str_replace(array('[', ']'), array('[', ']'), $title))), 75);
$pages[$pagenum] = array(
'url' => $route->getCurrentURL(null, array($pagenum)),
'title' => htmlspecialchars_uni($title),
'selected' => ($pagenum == $this->current_page) ? 1 : 0
);
}
if ($this->current_page > 1)
{
$this->prev_page_url = $pages[$this->current_page - 1]['url'];
$this->prev_page_phrase = new vB_Phrase('vbcms', 'previous');
}
if ($this->current_page < sizeof($pages))
{
$this->next_page_url = $pages[$this->current_page + 1]['url'];
$this->next_page_ph
|
请发表评论