本文整理汇总了PHP中rewriteoutput函数的典型用法代码示例。如果您正苦于以下问题:PHP rewriteoutput函数的具体用法?PHP rewriteoutput怎么用?PHP rewriteoutput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rewriteoutput函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: global_header
function global_header()
{
global $_G;
$url = base64_decode($_G['currenturl_encode']);
if ($_G['mod'] == 'viewthread') {
if (in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('forum_viewthread', 1, '', $_G['tid'], $_G['page'], $_G['prevpage'], '');
} else {
$url = str_replace(array('&extra=' . $_GET['extra'], '&extra=' . urlencode($_GET['extra']), '&page=' . $_G['page']), '', $url);
}
} elseif ($_G['mod'] == 'redirect') {
if (in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('forum_viewthread', 1, '', $_G['tid'], $_G['page'], $_G['prevpage'], '');
}
} elseif ($_G['mod'] == 'forumdisplay') {
if (in_array('forum_forumdisplay', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('forum_forumdisplay', 1, '', $_G['fid'], $_G['page'], '', '');
} else {
$url = str_replace(array('&page=' . $_G['page']), '', $url);
}
} elseif ($_G['basescript'] == 'group' && $_G['mod'] == 'forumdisplay') {
if (in_array('group_group', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('group_group', 1, '', $_G['fid'], $_G['page'], '', '');
}
}
$copy_open_area = str_replace(array('1', '2', '3', '4', '5', '6'), array('forumdisplay', 'viewthread', 'redirect', 'group', 'home', 'portal'), unserialize($this->settings['copy_open_area']));
$return = '';
if ((in_array($_G['mod'], $copy_open_area) || in_array($_G['basescript'], $copy_open_area)) && in_array($_G['groupid'], unserialize($this->settings['copy_group']))) {
if ($this->settings['ban_copy'] && !$this->settings['add_copy']) {
if (in_array($_G['mod'], array('forumdisplay', 'viewthread', 'redirect'))) {
if (in_array($_G['fid'], unserialize($this->settings['copy_forum']))) {
$return .= '<script type="text/javascript">document.onselectstart=function(){return false};</script><style type="text/css">html{-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}</style>';
}
} else {
$return .= '<script type="text/javascript">document.onselectstart=function(){return false};</script><style type="text/css">html{-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}</style>';
}
}
if ($this->settings['add_copy'] && !$this->settings['ban_copy']) {
$auto_add = str_replace(array("'", '"', '{bbname}', '{boardurl}', '{url}'), array("\\'", '\\"', $_G['setting']['bbname'], $_G['siteurl'], $url), $this->settings['add_copy_content']);
if (in_array($_G['mod'], array('forumdisplay', 'viewthread', 'redirect'))) {
if (in_array($_G['fid'], unserialize($this->settings['copy_forum']))) {
$return .= '<script type="text/javascript">function dsuMarcoAddCopyright(){var a="' . $auto_add . '";if("function"==typeof window.getSelection){var b=window.getSelection();if("Microsoft Internet Explorer"==navigator.appName&&navigator.appVersion.match(/MSIE ([\\d.]+)/)[1]>=10||"Opera"==navigator.appName){var c=b.getRangeAt(0),d=document.createElement("span");d.appendChild(c.cloneContents()),c.insertNode(d);var e=d.innerHTML.replace(/(?:\\n|\\r\\n|\\r)/gi,"").replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/gim,"").replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/gim,"").replace(/<!--.*?-->/gim,"").replace(/<!DOCTYPE.*?>/gi,"");try{document.getElementsByTagName("body")[0].removeChild(d)}catch(f){d.style.display="none",d.innerHTML=""}}else var e=""+b;var g=document.getElementsByTagName("body")[0],h=document.createElement("div");h.style.position="absolute",h.style.left="-99999px",g.appendChild(h),h.innerHTML=e.replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g,"$1<br />$2")+"<br />"+a,b.selectAllChildren(h),setTimeout(function(){g.removeChild(h)},0)}else if("object"==typeof document.selection.createRange){event.returnValue=!1;var b=document.selection.createRange().text;window.clipboardData.setData("Text",b+"\\r\\n"+a)}}document.body.oncopy=dsuMarcoAddCopyright;</script>';
}
} else {
$return .= '<script type="text/javascript">function dsuMarcoAddCopyright(){var a="' . $auto_add . '";if("function"==typeof window.getSelection){var b=window.getSelection();if("Microsoft Internet Explorer"==navigator.appName&&navigator.appVersion.match(/MSIE ([\\d.]+)/)[1]>=10||"Opera"==navigator.appName){var c=b.getRangeAt(0),d=document.createElement("span");d.appendChild(c.cloneContents()),c.insertNode(d);var e=d.innerHTML.replace(/(?:\\n|\\r\\n|\\r)/gi,"").replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/gim,"").replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/gim,"").replace(/<!--.*?-->/gim,"").replace(/<!DOCTYPE.*?>/gi,"");try{document.getElementsByTagName("body")[0].removeChild(d)}catch(f){d.style.display="none",d.innerHTML=""}}else var e=""+b;var g=document.getElementsByTagName("body")[0],h=document.createElement("div");h.style.position="absolute",h.style.left="-99999px",g.appendChild(h),h.innerHTML=e.replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g,"$1<br />$2")+"<br />"+a,b.selectAllChildren(h),setTimeout(function(){g.removeChild(h)},0)}else if("object"==typeof document.selection.createRange){event.returnValue=!1;var b=document.selection.createRange().text;window.clipboardData.setData("Text",b+"\\r\\n"+a)}}document.body.oncopy=dsuMarcoAddCopyright;</script>';
}
}
if ($this->settings['popup']) {
if (in_array($_G['mod'], array('forumdisplay', 'viewthread', 'redirect'))) {
if (in_array($_G['fid'], unserialize($this->settings['copy_forum']))) {
$return .= '<script type="text/javascript">function copyright(msg, script){script = !script ? \'\' : script;var c = \'<div class="f_c"><div class="c floatwrap" style="height:' . $this->settings['height_mini'] . ';">\' + msg + \'</div></div>\';var t = \'' . lang('plugin/dsu_marcocopyright', 'copyright') . '\' ;showDialog(c, \'info\', t);}document.oncontextmenu=function(){copyright(\'' . $this->text_mini . '\', this.href);return false;}</script>';
}
} else {
$return .= '<script type="text/javascript">function copyright(msg, script){script = !script ? \'\' : script;var c = \'<div class="f_c"><div class="c floatwrap" style="height:' . $this->settings['height_mini'] . ';">\' + msg + \'</div></div>\';var t = \'' . lang('plugin/dsu_marcocopyright', 'copyright') . '\' ;showDialog(c, \'info\', t);}document.oncontextmenu=function(){copyright(\'' . $this->text_mini . '\', this.href);return false;}</script>';
}
}
return $return;
}
}
示例2: foreach
$alldata = C::t('forum_rsscache')->fetch_all_by_fid($fidarray, $num);
if ($alldata) {
foreach ($alldata as $thread) {
if (TIMESTAMP - $thread['lastupdate'] > $ttl * 60) {
updatersscache($num);
break;
} else {
list($thread['description'], $attachremote, $attachfile, $attachsize) = explode("\t", $thread['description']);
if ($attachfile) {
if ($attachremote) {
$filename = $_G['setting']['ftp']['attachurl'] . 'forum/' . $attachfile;
} else {
$filename = $_G['siteurl'] . $_G['setting']['attachurl'] . 'forum/' . $attachfile;
}
}
echo " <item>\n" . " <title>" . $thread['subject'] . "</title>\n" . " <link>{$_G['siteurl']}" . ($trewriteflag ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : "forum.php?mod=viewthread&tid={$thread['tid']}") . "</link>\n" . " <description><![CDATA[" . dhtmlspecialchars($thread['description']) . "]]></description>\n" . " <category>" . dhtmlspecialchars($thread['forum']) . "</category>\n" . " <author>" . dhtmlspecialchars($thread['author']) . "</author>\n" . ($attachfile ? '<enclosure url="' . $filename . '" length="' . $attachsize . '" type="image/jpeg" />' : '') . " <pubDate>" . gmdate('r', $thread['dateline']) . "</pubDate>\n" . " </item>\n";
}
}
} else {
updatersscache($num);
}
}
echo " </channel>\n" . "</rss>";
function updatersscache($num)
{
global $_G;
$processname = 'forum_rss_cache';
if (discuz_process::islocked($processname, 600)) {
return false;
}
C::t('forum_rsscache')->truncate();
示例3: dhtmlspecialchars
}
$t_link = 'forum.php?mod=forumdisplay&fid=' . $_G['fid'] . ($_GET['extra'] && !IS_ROBOT ? '&' . $_GET['extra'] : '');
$navigation .= ' <em>›</em> <a href="' . $t_link . '">' . $_G['forum']['name'] . '</a>';
if ($archiveid) {
if ($threadtable_info[$archiveid]['displayname']) {
$t_name = dhtmlspecialchars($threadtable_info[$archiveid]['displayname']);
} else {
$t_name = lang('core', 'archive') . ' ' . $archiveid;
}
$navigation .= ' <em>›</em> <a href="forum.php?mod=forumdisplay&fid=' . $_G['fid'] . '&archiveid=' . $archiveid . '">' . $t_name . '</a>';
}
unset($t_link, $t_name);
}
$_GET['extra'] = $_GET['extra'] ? rawurlencode($_GET['extra']) : '';
if (@in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$canonical = rewriteoutput('forum_viewthread', 1, '', $_G['tid'], 1, '', '');
} else {
$canonical = 'forum.php?mod=viewthread&tid=' . $_G['tid'];
}
$_G['setting']['seohead'] .= '<link href="' . $_G['siteurl'] . $canonical . '" rel="canonical" />';
$_G['forum_tagscript'] = '';
$threadsort = $thread['sortid'] && isset($_G['forum']['threadsorts']['types'][$thread['sortid']]) ? 1 : 0;
if ($threadsort) {
require_once libfile('function/threadsort');
$threadsortshow = threadsortshow($thread['sortid'], $_G['tid']);
}
if (empty($_G['forum']['allowview'])) {
if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) {
showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
} elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) {
showmessagenoperm('viewperm', $_G['fid']);
示例4: rewriteoutput
}
$target = $thread['isgroup'] == 1 || $thread['forumstick'] ? ' target="_blank"' : ' onclick="atarget(this)"';
if (in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$thread['threadurl'] = '<a href="' . rewriteoutput('forum_viewthread', 1, '', $thread['tid'], 1, '', '') . '"' . $thread['highlight'] . $target . 'class="s xst">' . $thread['subject'] . '</a>';
} else {
$thread['threadurl'] = '<a href="forum.php?mod=viewthread&tid=' . $thread['tid'] . '"' . $thread['highlight'] . $target . 'class="s xst">' . $thread['subject'] . '</a>';
}
if (in_array($thread['displayorder'], array(1, 2, 3, 4))) {
$thread['id'] = 'stickthread_' . $thread['tid'];
} else {
$thread['id'] = 'normalthread_' . $thread['tid'];
}
$thread['threadurl'] = $thread['threadtype'] . $thread['threadsort'] . $thread['threadurl'];
if (in_array('home_space', $_G['setting']['rewritestatus'])) {
$thread['authorurl'] = '<a href="' . rewriteoutput('home_space', 1, '', $thread['authorid'], '', '') . '">' . $thread['author'] . '</a>';
$thread['lastposterurl'] = '<a href="' . rewriteoutput('home_space', 1, '', '', rawurlencode($thread['lastposter']), '') . '">' . $thread['lastposter'] . '</a>';
} else {
$thread['authorurl'] = '<a href="home.php?mod=space&uid=' . $thread['authorid'] . '">' . $thread['author'] . '</a>';
$thread['lastposterurl'] = '<a href="home.php?mod=space&username=' . rawurlencode($thread['lastposter']) . '">' . $thread['lastposter'] . '</a>';
}
$threadlist[] = $thread;
}
if ($threadlist) {
krsort($threadlist);
}
include template('forum/ajax_threadlist');
}
} elseif ($_GET['action'] == 'downremoteimg') {
$_GET['message'] = str_replace(array("\r", "\n"), array($_GET['wysiwyg'] ? '<br />' : '', "\\n"), $_GET['message']);
preg_match_all("/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]|\\[img=\\d{1,4}[x|\\,]\\d{1,4}\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/is", $_GET['message'], $image1, PREG_SET_ORDER);
preg_match_all("/\\<img.+src=('|\"|)?(.*)(\\1)([\\s].*)?\\>/ismUe", $_GET['message'], $image2, PREG_SET_ORDER);
示例5: preg_replace
if (strpos($msglower, '[/quote]') !== FALSE) {
$post['message'] = preg_replace('/\\[quote\\].*\\[\\/quote\\](\\r\\n|\\n|\\r){0,}/is', '', $post['message']);
}
if (strpos($msglower, '[/media]') !== FALSE) {
$post['message'] = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", '', $post['message']);
}
if (strpos($msglower, '[/flash]') !== FALSE) {
$post['message'] = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", '', $post['message']);
}
if (strpos($msglower, '[/hide]') !== FALSE) {
$post['message'] = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", '', $post['message']);
}
$html_content = $connectService->connectParseBbcode($post['message'], $thread['fid'], $post['pid'], $post['htmlon'], $attach_images);
$html_content = strip_tags(preg_replace('/( )+/', ' ', $html_content));
if ($_G['setting']['rewritestatus'] && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $tid);
} else {
$url = $_G['siteurl'] . 'forum.php?mod=viewthread&tid=' . $tid;
}
$qzone_params = array('title' => $thread['subject'], 'url' => $url, 'summary' => $html_content, 'nswb' => '1');
$_t_content = lang('plugin/qqconnect', 'connect_feed_iam');
$_t_content .= '#' . cutstr($_G['setting']['bbname'], 20, '') . '#';
$_t_content .= lang('plugin/qqconnect', 'connect_feed_published_thread', array('subject' => cutstr($thread['subject'], 120)));
$_t_content .= cutstr($html_content, 80);
$_t_content .= ' ' . $url;
$t_params = array('content' => $_t_content);
if ($attach_images && is_array($attach_images)) {
$attach_image = array_shift($attach_images);
$qzone_params['images'] = $attach_image['big'];
$t_params['pic'] = $attach_image['path'];
$t_params['remote'] = $attach_image['remote'];
示例6: space_blog_title_output
function space_blog_title_output()
{
global $_G, $blog;
if ($this->conf['space_blog_title']) {
if (@in_array('home_blog', $_G['setting']['rewritestatus'])) {
$canonical = rewriteoutput('home_blog', 1, '', $blog['blogid'], 1, '', '');
} else {
$canonical = 'home.php?mod=space&uid=' . $blog['uid'] . '&do=blog&id=' . $blog['blogid'];
}
$pdata = array('url' => $_G['siteurl'] . $canonical);
return parent::pocode($pdata);
}
}
示例7: global_header
function global_header()
{
global $_G;
$url_dz = base64_decode($_G['currenturl_encode']);
if ($_G['gp_mod'] == 'viewthread') {
if (in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('forum_viewthread', 1, '', $_G['tid'], $_G['page'], $_G['prevpage'], '');
} else {
$url = str_replace(array('&extra=' . $_G['gp_extra'] . '', '&page=' . $_G['gp_page'] . ''), '', $url_dz);
}
} elseif ($_G['gp_mod'] == 'redirect') {
if (in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('forum_viewthread', 1, '', $_G['gp_tid'], $_G['page'], $_G['prevpage'], '');
} else {
$url = $url_dz;
}
} elseif ($_G['gp_mod'] == 'forumdisplay') {
if (in_array('forum_forumdisplay', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('forum_forumdisplay', 1, '', $_G['fid'], $_G['page'], '', '');
} else {
$url = str_replace(array('&page=' . $_G['gp_page'] . ''), '', $url_dz);
}
} elseif ($_G['basescript'] == 'group' && $_G['gp_mod'] == 'forumdisplay') {
if (in_array('group_group', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('group_group', 1, '', $_G['fid'], $_G['page'], '', '');
} else {
$url = $url_dz;
}
} else {
$url = $url_dz;
}
$replace_script = array('1', '2', '3', '4', '5', '6');
$script = array('forumdisplay', 'viewthread', 'redirect', 'group', 'home', 'portal');
$copy_open_area = str_replace($replace_script, $script, $this->copy_open_area);
if ((in_array($_G['gp_mod'], $copy_open_area) || in_array($_G['basescript'], $copy_open_area)) && in_array($_G['groupid'], $this->copy_group)) {
if ($this->ban_copy && !$this->add_copy) {
$return .= '<script type="text/javascript">document.onselectstart=function(){return false;};</script><style type="text/css">html{-moz-user-select: none;-webkit-user-select: none;}</style>';
} else {
$return .= "";
}
if ($this->add_copy && !$this->ban_copy && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') == TRUE) {
$auto_add = str_replace(array("'", '"', "{bbname}", "{boardurl}", "{url}"), array("\\'", '\\"', $_G['setting']['bbname'], $_G['siteurl'], $url), $this->add_copy_content);
$return .= '<script type="text/javascript">document.body.oncopy=function(){event.returnValue=false;var t=document.selection.createRange().text;var s=\'' . $auto_add . '\';clipboardData.setData(\'Text\',t+"\\r\\n"+s);}</script>';
} else {
$return .= "";
}
if ($this->popup) {
$return .= "<script type=text/javascript>function copyright(msg, script){script = !script ? '' : script;var c = '<div class=\"f_c\"><div class=\"c floatwrap\" style=\"height:" . $this->height_mini . ";\">' + msg + '</div></div>';var t = '" . lang('plugin/dsu_marcocopyright', 'copyright') . "' ;showDialog(c, 'info', t);}document.oncontextmenu=function(){copyright('{$this->text_mini}', this.href);return false;}</script>";
} else {
$return .= "";
}
return $return;
}
}
示例8: getPluginUrl
public static function getPluginUrl($pluginid, $param = array())
{
global $_G;
if (in_array('plugin', $_G['setting']['rewritestatus'])) {
$url = $_G['siteurl'] . rewriteoutput('plugin', 1, 'wechat', 'access');
} else {
$url = $_G['siteurl'] . 'plugin.php?id=wechat:access';
}
$url .= '&pluginid=' . urlencode($pluginid);
$url .= '¶m=' . urlencode(base64_encode(http_build_query($param)));
return $url;
}
示例9: array
$afmethods[] = array('class' => 'extend_thread_sort', 'method' => 'after_newthread');
}
$bfmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'before_newthread');
$afmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'after_newthread');
$afmethods[] = array('class' => 'extend_thread_image', 'method' => 'after_newthread');
if (!empty($_GET['adddynamic'])) {
$afmethods[] = array('class' => 'extend_thread_follow', 'method' => 'after_newthread');
}
$modthread->attach_before_methods('newthread', $bfmethods);
$modthread->attach_after_methods('newthread', $afmethods);
$return = $modthread->newthread($params);
$tid = $modthread->tid;
$pid = $modthread->pid;
dsetcookie('clearUserdata', 'forum');
if ($specialextra) {
$classname = 'threadplugin_' . $specialextra;
if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'newthread_submit_end')) {
$threadpluginclass->newthread_submit_end($_G['fid'], $modthread->tid);
}
}
if (!$modthread->param('modnewthreads') && !empty($_GET['addfeed'])) {
$modthread->feed();
}
if (!empty($_G['setting']['rewriterule']['forum_viewthread']) && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$returnurl = rewriteoutput('forum_viewthread', 1, '', $modthread->tid, 1, '', $extra);
} else {
$returnurl = "forum.php?mod=viewthread&tid={$modthread->tid}&extra={$extra}";
}
$values = array('fid' => $modthread->forum('fid'), 'tid' => $modthread->tid, 'pid' => $modthread->pid, 'coverimg' => '', 'sechash' => !empty($_GET['sechash']) ? $_GET['sechash'] : '');
showmessage($return, $returnurl, array_merge($values, (array) $modthread->param('values')), $modthread->param('param'));
}
示例10: switch
C::app()->init();
$jump = true;
$domain = C::t('common_domain')->fetch_by_domain_domainroot($_ENV['prefixdomain'], $_ENV['domainroot']);
$apphost = $_ENV['domain']['app'][$domain['idtype']] ? $_ENV['domain']['app'][$domain['idtype']] : $_ENV['domain']['app']['default'];
$apphost = $apphost ? 'http://' . $apphost . '/' : '';
switch ($domain['idtype']) {
case 'home':
if ($_G['setting']['rewritestatus'] && in_array('home_space', $_G['setting']['rewritestatus'])) {
$url = rewriteoutput('home_space', 1, $apphost, $domain['id']);
} else {
$url = $apphost . 'home.php?mod=space&uid=' . $domain['id'];
}
break;
case 'group':
if ($_G['setting']['rewritestatus'] && in_array('group_group', $_G['setting']['rewritestatus'])) {
$url = rewriteoutput('group_group', 1, $apphost, $domain['id']);
} else {
$url = $apphost . 'forum.php?mod=group&fid=' . $domain['id'] . '&page=1';
}
break;
}
}
} else {
$jump = true;
}
if (empty($url) && empty($_ENV['curapp'])) {
if (!empty($_ENV['domain']['defaultindex']) && !$jump) {
if ($_ENV['defaultapp'][$_ENV['domain']['defaultindex']]) {
$_ENV['curapp'] = $_ENV['defaultapp'][$_ENV['domain']['defaultindex']];
} else {
$url = $_ENV['domain']['defaultindex'];
示例11: arch_multi
}
?>
<div class="page">
<?php
echo arch_multi($_G['forum_thread']['replies'] + 1, $_G['ppp'], $page, "?tid-{$_G['tid']}.html");
?>
</div>
</div>
<div id="end">
<?php
echo lang('forum/archiver', 'full_version');
?>
:
<a href="../<?php
echo in_array('forum_viewthread', $_G['setting']['rewritestatus']) ? rewriteoutput('forum_viewthread', 1, '', $_G['tid'], $page) : 'forum.php?mod=viewthread&tid=' . $_G['tid'] . '&page=' . $page;
?>
" target="_blank"><strong><?php
echo $_G['forum_thread']['subject'];
?>
</strong></a>
</div>
<?php
include loadarchiver('common/footer');
function archivermessage($message)
{
if (strpos($message, '[/password]') !== FALSE) {
return '';
}
return nl2br(preg_replace(array('/&(#\\d{3,5};)/', "/\\[hide=?\\d*\\](.*?)\\[\\/hide\\]/is", "/\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]/is", "/\\[\\/?\\w+=?.*?\\]/"), array('&\\1', '<b>**** Hidden Message *****</b>', ''), str_replace(array('&', '"', '<', '>', "\t", ' ', '', ' '), array('&', '"', '<', '>', ' ', ' ', ' '), $message)));
}
示例12: strip_tags
} else {
$navigation = ' <em>›</em> <a href="forum.php">' . $_G['setting']['navs'][2]['navname'] . '</a> <em>›</em> <a href="forum.php?mod=forumdisplay&fid=' . $fup['fid'] . '">' . (strip_tags($fup['name']) ? strip_tags($fup['name']) : $fup['name']) . '</a> <em>›</em> <a href="' . $upnavlink . '">' . (strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name']) . '</a>' . ' <em>›</em> <a href="forum.php?mod=forumdisplay&fid=' . $_G['fid'] . '&archiveid=' . $_G['forum']['threadtableid'] . '">' . $forumarchivename . '</a>';
}
}
} elseif ($_G['gp_from'] == 'portal') {
$_G['setting']['ratelogon'] = 1;
$navigation = ' <em>›</em> <a href="portal.php">' . lang('core', 'portal') . '</a>';
$navsubject = $_G['forum_thread']['subject'];
$navtitle = $_G['forum_thread']['subject'];
}
$_G['gp_extra'] = $_G['gp_extra'] ? rawurlencode($_G['gp_extra']) : '';
$metakeywords = strip_tags($_G['forum_thread']['subject']);
if (in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$canonical = rewriteoutput('forum_viewthread', 1, '', $_G['tid'], 1, '', '');
} elseif (in_array('all_script', $_G['setting']['rewritestatus'])) {
$canonical = rewriteoutput('all_script', 1, '', 'forum', 'viewthread&tid=' . $_G['tid'] . '&page=1', '');
} else {
$canonical = 'forum.php?mod=viewthread&tid=' . $_G['tid'];
}
$_G['setting']['seohead'] .= '<link href="' . $_G['siteurl'] . $canonical . '" rel="canonical" />';
if ($_G['forum']['status'] == 3) {
$_G['action']['action'] = 3;
require_once libfile('function/group');
$status = groupperm($_G['forum'], $_G['uid']);
if ($status == 1) {
showmessage('forum_group_status_off');
} elseif ($status == 2) {
showmessage('forum_group_noallowed', 'forum.php?mod=group&fid=' . $_G['fid']);
} elseif ($status == 3) {
showmessage('forum_group_moderated', 'forum.php?mod=group&fid=' . $_G['fid']);
}
示例13: foreach
$alldata = C::t('portal_rsscache')->fetch_all_by_catid($catarray, $num);
if ($alldata) {
foreach ($alldata as $article) {
if (TIMESTAMP - $article['lastupdate'] > $ttl * 60) {
updatersscache($num);
break;
} else {
list($article['description'], $attachremote, $attachfile, $attachsize) = explode("\t", $article['description']);
if ($attachfile) {
if ($attachremote) {
$filename = $_G['setting']['ftp']['attachurl'] . 'portal/' . $attachfile;
} else {
$filename = $_G['siteurl'] . $_G['setting']['attachurl'] . 'portal/' . $attachfile;
}
}
echo " <item>\n" . " <title>" . $article['subject'] . "</title>\n" . " <link>{$_G['siteurl']}" . ($rewriteflag ? rewriteoutput('portal_article', 1, '', $article[aid]) : "portal.php?mod=view&aid={$article['aid']}") . "</link>\n" . " <description><![CDATA[" . dhtmlspecialchars($article['description']) . "]]></description>\n" . " <category>" . dhtmlspecialchars($article['catname']) . "</category>\n" . " <author>" . dhtmlspecialchars($article['author']) . "</author>\n" . ($attachfile ? '<enclosure url="' . $filename . '" length="' . $attachsize . '" type="image/jpeg" />' . "\n" : '') . " <pubDate>" . gmdate('r', $article['dateline']) . "</pubDate>\n" . " </item>\n";
}
}
} else {
updatersscache($num);
}
}
echo " </channel>\n" . "</rss>";
function updatersscache($num)
{
global $_G;
$processname = 'portal_rss_cache';
if (discuz_process::islocked($processname, 600)) {
return false;
}
C::t('portal_rsscache')->truncate();
示例14: getThreadUrl
/**
* 获取指定tid的链接地址
* @param $tid
*/
function getThreadUrl($tid)
{
global $_G;
$enableFromuid = XWB_plugin::pcfg('link_visit_promotion');
if (1 != $enableFromuid && $_G['setting']['rewritestatus'] && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
$siteUrl = $_G['siteurl'];
if (version_compare(XWB_S_VERSION, '2', '<')) {
$siteUrl = str_replace(array('http://', 'https://', '//'), array('', '', '/'), $siteUrl);
}
$threadURL = rewriteoutput('forum_viewthread', 1, $siteUrl, $tid);
} else {
$threadURL = $_G['siteurl'] . 'forum.php?mod=viewthread&tid=' . $tid;
if (1 == $enableFromuid) {
$threadURL .= '&fromuid=' . $_G['uid'];
}
}
return $threadURL;
}
示例15: showsortmodetemplate
function showsortmodetemplate($sortid, $fid, $sortoptionarray, $templatearray, $threadlist, $threadids = array(), &$verify = array())
{
global $_G;
$sorttemplate = $replaces = array();
$sorttemplate['footer'] = $sorttemplate['body'] = $sorttemplate['header'] = '';
if (strexists($templatearray[$sortid], '[loop]') && strexists($templatearray[$sortid], '[/loop]')) {
preg_match('/^(.+?)\\[loop\\](.+?)\\[\\/loop\\](.+?)$/s', $templatearray[$sortid], $r);
$sorttemplate['header'] = stripslashes($r[1]);
$templatearray[$sortid] = stripslashes($r[2]);
$sorttemplate['footer'] = stripslashes($r[3]);
}
$rewritespace = is_array($_G['setting']['rewritestatus']) && in_array('home_space', $_G['setting']['rewritestatus']);
$rewriteviewthread = is_array($_G['setting']['rewritestatus']) && in_array('forum_viewthread', $_G['setting']['rewritestatus']);
$sortlistarray = showsorttemplate($sortid, $fid, $sortoptionarray, $templatearray, $threadlist, $threadids, true);
foreach ($threadlist as $thread) {
foreach ($thread as $k => $v) {
$replaces['{' . $k . '}'] = $v;
}
$body = $sortlistarray['template'][$sortid][$thread['tid']];
$replaces['{author_url}'] = $rewritespace ? rewriteoutput('home_space', 1, '', $thread['authorid']) : 'home.php?mod=space&uid=' . $thread['authorid'];
$replaces['{lastposter_url}'] = $rewritespace ? rewriteoutput('home_space', 1, '', '', $thread['lastposter']) : 'home.php?mod=space&username=' . $thread['lastposterenc'];
$replaces['{subject_url}'] = $rewriteviewthread ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : 'forum.php?mod=viewthread&tid=' . $thread['tid'];
$replaces['{lastpost_url}'] = 'forum.php?mod=redirect&tid=' . $thread['tid'] . '&goto=lastpost#lastpost';
$replaces['{lastpost_url}'] = 'forum.php?mod=redirect&tid=' . $thread['tid'] . '&goto=lastpost#lastpost';
$sql = "SELECT m.groupid,g.icon FROM " . DB::table('common_member') . " m ," . DB::table('common_usergroup') . " g WHERE m.uid =" . $thread['authorid'] . " and m.groupid=g.groupid LIMIT 0, 1";
$query = DB::query($sql);
$vanfon_usergroup = 0;
while ($result = DB::fetch($query)) {
$vanfon_usergroup = $result['icon'];
}
$replaces['{vanfon_usergroup}'] = $vanfon_usergroup ? '<img src=' . $vanfon_usergroup . ' />' : '<img src=http://static.yylmacro.com/jx3pve/groupicon/LV0.png >';
$sql = "SELECT c.icon FROM " . DB::table('forum_threadclass') . " c ," . DB::table('forum_thread') . " t WHERE t.tid =" . $thread['tid'] . " and t.typeid=c.typeid LIMIT 0, 1";
$query = DB::query($sql);
$vanfon_typeicon = 0;
while ($result = DB::fetch($query)) {
$vanfon_typeicon = $result['icon'];
}
$replaces['{vanfon_typeicon}'] = $vanfon_typeicon ? $vanfon_typeicon : '';
$replaces['{avatar_small}'] = avatar($thread['authorid'], 'small', true);
$replaces['{typename_url}'] = 'forum.php?mod=forumdisplay&fid=' . $fid . '&filter=typeid&typeid=' . $thread['tid'];
$replaces['{attachment}'] = $thread['attachment'] == 2 ? '<img src="' . STATICURL . 'image/filetype/image_s.gif" align="absmiddle" />' : ($thread['attachment'] == 1 ? '<img src="' . STATICURL . 'image/filetype/common.gif" align="absmiddle" />' : '');
$replaces['{author_verify}'] = $verify[$thread['authorid']] ? $verify[$thread['authorid']] : '';
if ($_G['forum']['ismoderator']) {
if ($thread['fid'] == $fid && $thread['displayorder'] <= 3 || $_G['adminid'] == 1) {
$replaces['{modcheck}'] = '<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="' . $thread['tid'] . '" />';
} else {
$replaces['{modcheck}'] = '<input type="checkbox" disabled="disabled" />';
}
} else {
$replaces['{modcheck}'] = '';
}
$body = str_replace(array_keys($replaces), $replaces, $body);
$sorttemplate['body'] .= $body;
}
return $sorttemplate;
}