';
} else {
return $host.$href;
}
}
function mobilereplace($file, $replace) {
return helper_mobile::mobilereplace($file, $replace);
}
function mobileoutput() {
helper_mobile::mobileoutput();
}
function output() {
global $_G;
if(defined('DISCUZ_OUTPUTED')) {
return;
} else {
define('DISCUZ_OUTPUTED', 1);
}
if(!empty($_G['blockupdate'])) {
block_updatecache($_G['blockupdate']['bid']);
}
if(defined('IN_MOBILE')) {
mobileoutput();
}
$havedomain = implode('', $_G['setting']['domain']['app']);
if($_G['setting']['rewritestatus'] || !empty($havedomain)) {
$content = ob_get_contents();
$content = output_replace($content);
ob_end_clean();
$_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
echo $content;
}
if(isset($_G['makehtml'])) {
helper_makehtml::make_html();
}
if($_G['setting']['ftp']['connid']) {
@ftp_close($_G['setting']['ftp']['connid']);
}
$_G['setting']['ftp'] = array();
if(defined('CACHE_FILE') && CACHE_FILE && !defined('CACHE_FORBIDDEN') && !defined('IN_MOBILE') && !IS_ROBOT && !checkmobile()) {
if(diskfreespace(DISCUZ_ROOT.'./'.$_G['setting']['cachethreaddir']) > 1000000) {
if($fp = @fopen(CACHE_FILE, 'w')) {
flock($fp, LOCK_EX);
$content = empty($content) ? ob_get_contents() : $content;
$temp_md5 = md5(substr($_G['timestamp'], 0, -3).substr($_G['config']['security']['authkey'], 3, -3));
$temp_formhash = substr($temp_md5, 8, 8);
$content = preg_replace('/(name=[\'|\"]formhash[\'|\"] value=[\'\"]|formhash=)('.constant("FORMHASH").')/ismU', '${1}'.$temp_formhash, $content);
$temp_siteurl = 'siteurl_'.substr($temp_md5, 16, 8);
$content = preg_replace('/("|\')('.preg_quote($_G['siteurl'], '/').')/ismU', '${1}'.$temp_siteurl, $content);
fwrite($fp, empty($content) ? ob_get_contents() : $content);
}
@fclose($fp);
chmod(CACHE_FILE, 0777);
}
}
if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG && @include(libfile('function/debug'))) {
function_exists('debugmessage') && debugmessage();
}
}
function output_replace($content) {
global $_G;
if(defined('IN_MODCP') || defined('IN_ADMINCP')) return $content;
if(!empty($_G['setting']['output']['str']['search'])) {
if(empty($_G['setting']['domain']['app']['default'])) {
$_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $_G['siteurl'], $_G['setting']['output']['str']['replace']);
}
$content = str_replace($_G['setting']['output']['str']['search'], $_G['setting']['output']['str']['replace'], $content);
}
if(!empty($_G['setting']['output']['preg']['search']) && (empty($_G['setting']['rewriteguest']) || empty($_G['uid']))) {
if(empty($_G['setting']['domain']['app']['default'])) {
$_G['setting']['output']['preg']['search'] = str_replace('\{CURHOST\}', preg_quote($_G['siteurl'], '/'), $_G['setting']['output']['preg']['search']);
$_G['setting']['output']['preg']['replace'] = str_replace('{CURHOST}', $_G['siteurl'], $_G['setting']['output']['preg']['replace']);
}
foreach($_G['setting']['output']['preg']['search'] as $key => $value) {
$content = preg_replace_callback($value, create_function('$matches', 'return '.$_G['setting']['output']['preg']['replace'][$key].';'), $content);
}
}
return $content;
}
function output_ajax() {
global $_G;
$s = ob_get_contents();
ob_end_clean();
$s = preg_replace("/([\\x01-\\x08\\x0b-\\x0c\\x0e-\\x1f])+/", ' ', $s);
$s = str_replace(array(chr(0), ']]>'), array(' ', ']]>'), $s);
if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG && @include(libfile('function/debug'))) {
function_exists('debugmessage') && $s .= debugmessage(1);
}
$havedomain = implode('', $_G['setting']['domain']['app']);
if($_G['setting']['rewritestatus'] || !empty($havedomain)) {
$s = output_replace($s);
}
return $s;
}
function runhooks($scriptextra = '') {
if(!defined('HOOKTYPE')) {
define('HOOKTYPE', !defined('IN_MOBILE') ? 'hookscript' : 'hookscriptmobile');
}
if(defined('CURMODULE')) {
global $_G;
if($_G['setting']['plugins']['func'][HOOKTYPE]['common']) {
hookscript('common', 'global', 'funcs', array(), 'common');
}
hookscript(CURMODULE, $_G['basescript'], 'funcs', array(), '', $scriptextra);
}
}
function hookscript($script, $hscript, $type = 'funcs', $param = array(), $func = '', $scriptextra = '') {
global $_G;
static $pluginclasses;
if($hscript == 'home') {
if($script == 'space') {
$scriptextra = !$scriptextra ? $_GET['do'] : $scriptextra;
$script = 'space'.(!empty($scriptextra) ? '_'.$scriptextra : '');
} elseif($script == 'spacecp') {
$scriptextra = !$scriptextra ? $_GET['ac'] : $scriptextra;
$script .= !empty($scriptextra) ? '_'.$scriptextra : '';
}
}
if(!isset($_G['setting'][HOOKTYPE][$hscript][$script][$type])) {
return;
}
if(!isset($_G['cache']['plugin'])) {
loadcache('plugin');
}
foreach((array)$_G['setting'][HOOKTYPE][$hscript][$script]['module'] as $identifier => $include) {
if($_G['pluginrunlist'] && !in_array($identifier, $_G['pluginrunlist'])) {
continue;
}
$hooksadminid[$identifier] = !$_G['setting'][HOOKTYPE][$hscript][$script]['adminid'][$identifier] || ($_G['setting'][HOOKTYPE][$hscript][$script]['adminid'][$identifier] && $_G['adminid'] > 0 && $_G['setting']['hookscript'][$hscript][$script]['adminid'][$identifier] >= $_G['adminid']);
if($hooksadminid[$identifier]) {
@include_once DISCUZ_ROOT.'./source/plugin/'.$include.'.class.php';
}
}
if(@is_array($_G['setting'][HOOKTYPE][$hscript][$script][$type])) {
$_G['inhookscript'] = true;
$funcs = !$func ? $_G['setting'][HOOKTYPE][$hscript][$script][$type] : array($func => $_G['setting'][HOOKTYPE][$hscript][$script][$type][$func]);
foreach($funcs as $hookkey => $hookfuncs) {
foreach($hookfuncs as $hookfunc) {
if($hooksadminid[$hookfunc[0]]) {
$classkey = (HOOKTYPE != 'hookscriptmobile' ? '' : 'mobile').'plugin_'.($hookfunc[0].($hscript != 'global' ? '_'.$hscript : ''));
if(!class_exists($classkey, false)) {
continue;
}
if(!isset($pluginclasses[$classkey])) {
$pluginclasses[$classkey] = new $classkey;
}
if(!method_exists($pluginclasses[$classkey], $hookfunc[1])) {
continue;
}
$return = call_user_func(array($pluginclasses[$classkey], $hookfunc[1]), $param);
if(substr($hookkey, -7) == '_extend' && !empty($_G['setting']['pluginhooks'][$hookkey])) {
continue;
}
if(is_array($return)) {
if(!isset($_G['setting']['pluginhooks'][$hookkey]) || is_array($_G['setting']['pluginhooks'][$hookkey])) {
foreach($return as $k => $v) {
$_G['setting']['pluginhooks'][$hookkey][$k] .= $v;
}
} else {
foreach($return as $k => $v) {
$_G['setting']['pluginhooks'][$hookkey][$k] = $v;
}
}
} else {
if(!is_array($_G['setting']['pluginhooks'][$hookkey])) {
$_G['setting']['pluginhooks'][$hookkey] .= $return;
} else {
foreach($_G['setting']['pluginhooks'][$hookkey] as $k => $v) {
$_G['setting']['pluginhooks'][$hookkey][$k] .= $return;
}
}
}
}
}
}
}
$_G['inhookscript'] = false;
}
function hookscriptoutput($tplfile) {
global $_G;
if(!empty($_G['hookscriptoutput'])) {
return;
}
hookscript('global', 'global');
$_G['hookscriptoutput'] = true;
if(defined('CURMODULE')) {
$param = array('template' => $tplfile, 'message' => $_G['hookscriptmessage'], 'values' => $_G['hookscriptvalues']);
hookscript(CURMODULE, $_G['basescript'], 'outputfuncs', $param);
}
}
function pluginmodule($pluginid, $type) {
global $_G;
$pluginid = $pluginid ? preg_replace("/[^A-Za-z0-9_:]/", '', $pluginid) : '';
if(!isset($_G['cache']['plugin'])) {
loadcache('plugin');
}
list($identifier, $module) = explode(':', $pluginid);
if(!is_array($_G['setting']['plugins'][$type]) || !array_key_exists($pluginid, $_G['setting']['plugins'][$type])) {
showmessage('plugin_nonexistence');
}
if(!empty($_G['setting']['plugins'][$type][$pluginid]['url'])) {
dheader('location: '.$_G['setting']['plugins'][$type][$pluginid]['url']);
}
$directory = $_G['setting']['plugins'][$type][$pluginid]['directory'];
if(empty($identifier) || !preg_match("/^[a-z]+[a-z0-9_]*\/$/i", $directory) || !preg_match("/^[a-z0-9_\-]+$/i", $module)) {
showmessage('undefined_action');
}
if(@!file_exists(DISCUZ_ROOT.($modfile = './source/plugin/'.$directory.$module.'.inc.php'))) {
showmessage('plugin_module_nonexistence', '', array('mod' => $modfile));
}
return DISCUZ_ROOT.$modfile;
}
function updatecreditbyaction($action, $uid = 0, $extrasql = array(), $needle = '', $coef = 1, $update = 1, $fid = 0) {
$credit = credit::instance();
if($extrasql) {
$credit->extrasql = $extrasql;
}
return $credit->execrule($action, $uid, $needle, $coef, $update, $fid);
}
function checklowerlimit($action, $uid = 0, $coef = 1, $fid = 0, $returnonly = 0) {
require_once libfile('function/credit');
return _checklowerlimit($action, $uid, $coef, $fid, $returnonly);
}
function batchupdatecredit($action, $uids = 0, $extrasql = array(), $coef = 1, $fid = 0) {
$credit = & credit::instance();
if($extrasql) {
$credit->extrasql = $extrasql;
}
return $credit->updatecreditbyrule($action, $uids, $coef, $fid);
}
function updatemembercount($uids, $dataarr = array(), $checkgroup = true, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '') {
if(!empty($uids) && (is_array($dataarr) && $dataarr)) {
require_once libfile('function/credit');
return _updatemembercount($uids, $dataarr, $checkgroup, $operation, $relatedid, $ruletxt, $customtitle, $custommemo);
}
return true;
}
function checkusergroup($uid = 0) {
$credit = & credit::instance();
$credit->checkusergroup($uid);
}
function checkformulasyntax($formula, $operators, $tokens) {
$var = implode('|', $tokens);
$operator = implode('', $operators);
$operator = str_replace(
array('+', '-', '*', '/', '(', ')', '{', '}', '\''),
array('\+', '\-', '\*', '\/', '\(', '\)', '\{', '\}', '\\\''),
$operator
);
if(!empty($formula)) {
if(!preg_match("/^([$operator\.\d\(\)]|(($var)([$operator\(\)]|$)+))+$/", $formula) || !is_null(eval(preg_replace("/($var)/", "\$\\1", $formula).';'))){
return false;
}
}
return true;
}
function checkformulacredits($formula) {
return checkformulasyntax(
$formula,
array('+', '-', '*', '/', ' '),
array('extcredits[1-8]', 'digestposts', 'posts', 'threads', 'oltime', 'friends', 'doings', 'polls', 'blogs', 'albums', 'sharings')
);
}
function debug($var = null, $vardump = false) {
echo '';
$vardump = empty($var) ? true : $vardump;
if($vardump) {
var_dump($var);
} else {
print_r($var);
}
exit();
}
function debuginfo() {
global $_G;
if(getglobal('setting/debug')) {
$db = & DB::object();
$_G['debuginfo'] = array(
'time' => number_format((microtime(true) - $_G['starttime']), 6),
'queries' => $db->querynum,
'memory' => ucwords(C::memory()->type)
);
if($db->slaveid) {
$_G['debuginfo']['queries'] = 'Total '.$db->querynum.', Slave '.$db->slavequery;
}
return TRUE;
} else {
return FALSE;
}
}
function getfocus_rand($module) {
global $_G;
if(empty($_G['setting']['focus']) || !array_key_exists($module, $_G['setting']['focus']) || !empty($_G['cookie']['nofocus_'.$module]) || !$_G['setting']['focus'][$module]) {
return null;
}
loadcache('focus');
if(empty($_G['cache']['focus']['data']) || !is_array($_G['cache']['focus']['data'])) {
return null;
}
$focusid = $_G['setting']['focus'][$module][array_rand($_G['setting']['focus'][$module])];
return $focusid;
}
function check_seccode($value, $idhash, $fromjs = 0, $modid = '') {
return helper_seccheck::check_seccode($value, $idhash, $fromjs, $modid);
}
function check_secqaa($value, $idhash) {
return helper_seccheck::check_secqaa($value, $idhash);
}
function seccheck($rule, $param = array()) {
return helper_seccheck::seccheck($rule, $param);
}
function make_seccode($seccode = '') {
return helper_seccheck::make_seccode($seccode);
}
function make_secqaa() {
return helper_seccheck::make_secqaa();
}
function adshow($parameter) {
global $_G;
if($_G['inajax'] || $_G['group']['closead']) {
return;
}
$return = (isset($_G['config']['plugindeveloper']) && $_G['config']['plugindeveloper'] == 2) ? '[ad '.$parameter.']' : '';
$params = explode('/', $parameter);
$customid = 0;
$customc = explode('_', $params[0]);
if($customc[0] == 'custom') {
$params[0] = $customc[0];
$customid = $customc[1];
}
$adcontent = null;
if(empty($_G['setting']['advtype']) || !in_array($params[0], $_G['setting']['advtype'])) {
$adcontent = '';
}
if($adcontent === null) {
loadcache('advs');
$adids = array();
$evalcode = &$_G['cache']['advs']['evalcode'][$params[0]];
$parameters = &$_G['cache']['advs']['parameters'][$params[0]];
$codes = &$_G['cache']['advs']['code'][$_G['basescript']][$params[0]];
if(!empty($codes)) {
foreach($codes as $adid => $code) {
$parameter = &$parameters[$adid];
$checked = true;
@eval($evalcode['check']);
if($checked) {
$adids[] = $adid;
}
}
if(!empty($adids)) {
$adcode = $extra = '';
@eval($evalcode['create']);
if(empty($notag)) {
$adcontent = ''.$adcode.'
';
} else {
$adcontent = $adcode;
}
}
}
}
$adfunc = 'ad_'.$params[0];
$_G['setting']['pluginhooks'][$adfunc] = null;
hookscript('ad', 'global', 'funcs', array('params' => $params, 'content' => $adcontent, 'customid' => $customid), $adfunc);
if(!$_G['setting']['hookscript']['global']['ad']['funcs'][$adfunc]) {
hookscript('ad', $_G['basescript'], 'funcs', array('params' => $params, 'content' => $adcontent, 'customid' => $customid), $adfunc);
}
return $return.($_G['setting']['pluginhooks'][$adfunc] === null ? $adcontent : $_G['setting']['pluginhooks'][$adfunc]);
}
function showmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0) {
require_once libfile('function/message');
return dshowmessage($message, $url_forward, $values, $extraparam, $custom);
}
function submitcheck($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0) {
if(!getgpc($var)) {
return FALSE;
} else {
return helper_form::submitcheck($var, $allowget, $seccodecheck, $secqaacheck);
}
}
function multi($num, $perpage, $curpage, $mpurl, $maxpages = 0, $page = 10, $autogoto = FALSE, $simple = FALSE, $jsfunc = FALSE) {
return $num > $perpage ? helper_page::multi($num, $perpage, $curpage, $mpurl, $maxpages, $page, $autogoto, $simple, $jsfunc) : '';
}
function simplepage($num, $perpage, $curpage, $mpurl) {
return helper_page::simplepage($num, $perpage, $curpage, $mpurl);
}
function censor($message, $modword = NULL, $return = FALSE, $modasban = TRUE) {
return helper_form::censor($message, $modword, $return, $modasban);
}
function censormod($message) {
return getglobal('group/ignorecensor') || !$message ? false :helper_form::censormod($message);
}
function space_merge(&$values, $tablename, $isarchive = false) {
global $_G;
$uid = empty($values['uid'])?$_G['uid']:$values['uid'];
$var = "member_{$uid}_{$tablename}";
if($uid) {
if(!isset($_G[$var])) {
$ext = $isarchive ? '_archive' : '';
if(($_G[$var] = C::t('common_member_'.$tablename.$ext)->fetch($uid)) !== false) {
if($tablename == 'field_home') {
$_G['setting']['privacy'] = empty($_G['setting']['privacy']) ? array() : (is_array($_G['setting']['privacy']) ? $_G['setting']['privacy'] : dunserialize($_G['setting']['privacy']));
$_G[$var]['privacy'] = empty($_G[$var]['privacy'])? array() : is_array($_G[$var]['privacy']) ? $_G[$var]['privacy'] : dunserialize($_G[$var]['privacy']);
foreach (array('feed','view','profile') as $pkey) {
if(empty($_G[$var]['privacy'][$pkey]) && !isset($_G[$var]['privacy'][$pkey])) {
$_G[$var]['privacy'][$pkey] = isset($_G['setting']['privacy'][$pkey]) ? $_G['setting']['privacy'][$pkey] : array();
}
}
$_G[$var]['acceptemail'] = empty($_G[$var]['acceptemail'])? array() : dunserialize($_G[$var]['acceptemail']);
if(empty($_G[$var]['acceptemail'])) {
$_G[$var]['acceptemail'] = empty($_G['setting']['acceptemail'])?array():dunserialize($_G['setting']['acceptemail']);
}
}
} else {
C::t('common_member_'.$tablename.$ext)->insert(array('uid'=>$uid));
$_G[$var] = array();
}
}
$values = array_merge($values, $_G[$var]);
}
}
function runlog($file, $message, $halt=0) {
helper_log::runlog($file, $message, $halt);
}
function stripsearchkey($string) {
$string = trim($string);
$string = str_replace('*', '%', addcslashes($string, '%_'));
return $string;
}
function dmkdir($dir, $mode = 0777, $makeindex = TRUE){
if(!is_dir($dir)) {
dmkdir(dirname($dir), $mode, $makeindex);
@mkdir($dir, $mode);
if(!empty($makeindex)) {
@touch($dir.'/index.html'); @chmod($dir.'/index.html', 0777);
}
}
return true;
}
function dreferer($default = '') {
global $_G;
$default = empty($default) && $_ENV['curapp'] ? $_ENV['curapp'].'.php' : '';
$_G['referer'] = !empty($_GET['referer']) ? $_GET['referer'] : $_SERVER['HTTP_REFERER'];
$_G['referer'] = substr($_G['referer'], -1) == '?' ? substr($_G['referer'], 0, -1) : $_G['referer'];
if(strpos($_G['referer'], 'member.php?mod=logging')) {
$_G['referer'] = $default;
}
$reurl = parse_url($_G['referer']);
if(!$reurl || (isset($reurl['scheme']) && !in_array(strtolower($reurl['scheme']), array('http', 'https')))) {
$_G['referer'] = '';
}
list($http_host,)=explode(':', $_SERVER['HTTP_HOST']);
if(!empty($reurl['host']) && !in_array($reurl['host'], array($http_host, 'www.'.$http_host)) && !in_array($http_host, array($reurl['host'], 'www.'.$reurl['host']))) {
if(!in_array($reurl['host'], $_G['setting']['domain']['app']) && !isset($_G['setting']['domain']['list'][$reurl['host']])) {
$domainroot = substr($reurl['host'], strpos($reurl['host'], '.')+1);
if(empty($_G['setting']['domain']['root']) || (is_array($_G['setting']['domain']['root']) && !in_array($domainroot, $_G['setting']['domain']['root']))) {
$_G['referer'] = $_G['setting']['domain']['defaultindex'] ? $_G['setting']['domain']['defaultindex'] : 'index.php';
}
}
} elseif(empty($reurl['host'])) {
$_G['referer'] = $_G['siteurl'].'./'.$_G['referer'];
}
$_G['referer'] = durlencode($_G['referer']);
return $_G['referer'];
}
function ftpcmd($cmd, $arg1 = '') {
static $ftp;
$ftpconfig = getglobal('setting/ftp');
if(empty($ftpconfig['on']) || empty($ftpconfig['host'])) {
return $cmd == 'error' ? -101 : 0;
} elseif($ftp == null) {
$ftp = & discuz_ftp::instance();
}
if(!$ftp->enabled) {
return $ftp->error();
} elseif($ftp->enabled && !$ftp->connectid) {
$ftp->connect();
}
switch ($cmd) {
case 'upload' : return $ftp->upload(getglobal('setting/attachdir').'/'.$arg1, $arg1); break;
case 'delete' : return $ftp->ftp_delete($arg1); break;
case 'close' : return $ftp->ftp_close(); break;
case 'error' : return $ftp->error(); break;
case 'object' : return $ftp; break;
default : return false;
}
}
function diconv($str, $in_charset, $out_charset = CHARSET, $ForceTable = FALSE) {
global $_G;
$in_charset = strtoupper($in_charset);
$out_charset = strtoupper($out_charset);
if(empty($str) || $in_charset == $out_charset) {
return $str;
}
$out = '';
if(!$ForceTable) {
if(function_exists('iconv')) {
$out = iconv($in_charset, $out_charset.'//IGNORE', $str);
} elseif(function_exists('mb_convert_encoding')) {
$out = mb_convert_encoding($str, $out_charset, $in_charset);
}
}
if($out == '') {
$chinese = new Chinese($in_charset, $out_charset, true);
$out = $chinese->Convert($str);
}
return $out;
}
function widthauto() {
global $_G;
if($_G['disabledwidthauto']) {
return 0;
}
if(!empty($_G['widthauto'])) {
return $_G['widthauto'] > 0 ? 1 : 0;
}
if($_G['setting']['switchwidthauto'] && !empty($_G['cookie']['widthauto'])) {
return $_G['cookie']['widthauto'] > 0 ? 1 : 0;
} else {
return $_G['setting']['allowwidthauto'] ? 0 : 1;
}
}
function renum($array) {
$newnums = $nums = array();
foreach ($array as $id => $num) {
$newnums[$num][] = $id;
$nums[$num] = $num;
}
return array($nums, $newnums);
}
function sizecount($size) {
if($size >= 1073741824) {
$size = round($size / 1073741824 * 100) / 100 . ' GB';
} elseif($size >= 1048576) {
$size = round($size / 1048576 * 100) / 100 . ' MB';
} elseif($size >= 1024) {
$size = round($size / 1024 * 100) / 100 . ' KB';
} else {
$size = intval($size) . ' Bytes';
}
return $size;
}
function swapclass($class1, $class2 = '') {
static $swapc = null;
$swapc = isset($swapc) && $swapc != $class1 ? $class1 : $class2;
return $swapc;
}
function writelog($file, $log) {
helper_log::writelog($file, $log);
}
function getstatus($status, $position) {
$t = $status & pow(2, $position - 1) ? 1 : 0;
return $t;
}
function setstatus($position, $value, $baseon = null) {
$t = pow(2, $position - 1);
if($value) {
$t = $baseon | $t;
} elseif ($baseon !== null) {
$t = $baseon & ~$t;
} else {
$t = ~$t;
}
return $t & 0xFFFF;
}
function notification_add($touid, $type, $note, $notevars = array(), $system = 0) {
return helper_notification::notification_add($touid, $type, $note, $notevars, $system);
}
function manage_addnotify($type, $from_num = 0, $langvar = array()) {
helper_notification::manage_addnotify($type, $from_num, $langvar);
}
function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0) {
return helper_pm::sendpm($toid, $subject, $message, $fromid, $replypmid, $isusername, $type);
}
function g_icon($groupid, $return = 0) {
global $_G;
if(empty($_G['cache']['usergroups'][$groupid]['icon'])) {
$s = '';
} else {
if(preg_match('/^https?:\/\//is', $_G['cache']['usergroups'][$groupid]['icon'])) {
$s = '
';
} else {
$s = '
';
}
}
if($return) {
return $s;
} else {
echo $s;
}
}
function updatediytemplate($targettplname = '', $tpldirectory = '') {
$r = false;
$alldata = !empty($targettplname) ? array( C::t('common_diy_data')->fetch($targettplname, $tpldirectory)) : C::t('common_diy_data')->range();
require_once libfile('function/portalcp');
foreach($alldata as $value) {
$r = save_diy_data($value['tpldirectory'], $value['primaltplname'], $value['targettplname'], dunserialize($value['diycontent']));
}
return $r;
}
function space_key($uid, $appid=0) {
global $_G;
return substr(md5($_G['setting']['siteuniqueid'].'|'.$uid.(empty($appid)?'':'|'.$appid)), 8, 16);
}
function getposttablebytid($tids, $primary = 0) {
return table_forum_post::getposttablebytid($tids, $primary);
}
function getposttable($tableid = 0, $prefix = false) {
return table_forum_post::getposttable($tableid, $prefix);
}
function memory($cmd, $key='', $value='', $ttl = 0, $prefix = '') {
if($cmd == 'check') {
return C::memory()->enable ? C::memory()->type : '';
} elseif(C::memory()->enable && in_array($cmd, array('set', 'add', 'get', 'rm', 'inc', 'dec'))) {
if(defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) {
if(is_array($key)) {
foreach($key as $k) {
C::memory()->debug[$cmd][] = ($cmd == 'get' || $cmd == 'rm' || $cmd == 'add' ? $value : '').$prefix.$k;
}
} else {
C::memory()->debug[$cmd][] = ($cmd == 'get' || $cmd == 'rm' || $cmd == 'add' ? $value : '').$prefix.$key;
}
}
switch ($cmd) {
case 'set': return C::memory()->set($key, $value, $ttl, $prefix); break;
case 'add': return C::memory()->add($key, $value, $ttl, $prefix); break;
case 'get': return C::memory()->get($key, $value); break;
case 'rm': return C::memory()->rm($key, $value); break;
case 'inc': return C::memory()->inc($key, $value ? $value : 1); break;
case 'dec': return C::memory()->dec($key, $value ? $value : -1); break;
}
}
return null;
}
function ipaccess($ip, $accessli
毛泽东诗词中令人拍案叫绝的27个谜语 - 文学艺术 - 台山同学网 - Powered by Discuz!
|
查看: 3097|回复: 27
|
毛泽东诗词中令人拍案叫绝的27个谜语
[复制链接]
|
|
|
毛泽东诗词中令人拍案叫绝的27个谜语
|
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2013-10-30 22:54:12
|
显示全部楼层
毛泽东诗词中令人拍案叫绝的27个谜语 - 宝贝梦 - 分享美丽.分享快乐.品味人生毛泽东喜欢谜语,尤其喜欢制作谜语让大家猜。他曾出谜面“慢慢走”,打一人名,答案是“徐向前”,令人叫绝!包罗万象的毛泽东诗词,以坚强的革命意志、博大渊深的胸怀、厚实的文学修养、高强的表现艺术而受到亿万读者的喜爱,流传甚广,因此也被民间的许多制谜高手作为创作题材,且涌现出不少佳作来,其中有27个谜语妙趣横生,颇值玩味。
以毛泽东诗词作为谜面的佳谜有11个:
一、以毛泽东的词《浣溪沙·和柳亚子先生》中的“一唱雄鸡天下白”句为谜面,打一外交名词:谜底是“声明”。这是采用的会意手法,在会意上设谜,非常之巧妙。
二、以毛泽东的古体诗《七律·人民解放军占领南京》中的“宜将剩勇追穷寇”句为谜面,打戏曲、曲牌名各一,谜底是“得胜令、收江南”,意即人民解放军在“得胜”后,毛泽东“令收江南”,构思甚是出彩。
三、毛泽东的词《沁园春·雪》中有“大河上下,顿失滔滔”句为谜面,打一字,谜底是“奇”。此谜采用离合、增损的手法,猜时先将“大河上下”进行上下组合,然后再根据“顿失滔滔”的意思,去掉“三滴水”即为谜底。此谜扣合得天衣无缝。
四、以毛泽东的词《沁园春·长沙》中的“鹰击长空”为谜面,打一台湾地名,谜底是“高雄”,形象生动,不失为谜中佳构,是地名谜之佼佼者。
五、以毛泽东的词《浪淘沙·北戴河》中的“往事越千年”句为谜面,打水浒人名二,谜底是“时迁、史进”(时代在变迁,历史在前进);
六、以毛泽东的古体诗《七律·冬云》中的“大地微微暖气吹”句为谜面,打浙江地名一,谜底是“温州”;
七、以毛泽东的古体诗《七律·到韶山》中的“喜看稻菽千重浪”句为谜面,打三国人名二:“田丰、黄盖”;
八、以毛泽东的词《念奴娇·昆仑》中的“江河横溢”为谜面,打常用词“浪漫”(浪花漫卷),十分贴切,耐人寻味。
九、以毛泽东的词《沁园春·长沙》中的“浪遏飞舟”句为谜面,打一常用字,谜底是“心”。这个谜语采用的是象形法,“心”字中的“勾儿”比作“飞舟”,“三点”借喻浪花飞溅,惟妙惟肖,十分传神
十、以毛泽东的词《念奴娇·昆仑》中的“一截还东国”句为谜面,打一字,谜底是“杲”。“东国”指“日本”,谜底“杲”字“还”“一截”,上下拆开即为“日本”。
十一、以毛泽东的词《念奴娇·昆仑》中的“环球同此凉热”为谜面,打数学、物理名词各一,谜底为“圆周、恒温” |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2013-10-30 22:59:04
|
显示全部楼层
以毛泽东诗词作为谜底的佳谜有12个:
一、以温庭筠《商山早行》的诗句“鸡声茅店月,人迹板桥霜”为谜面,打毛泽东诗词一句,谜底是《清平乐·会昌》中的“莫道君行早”。刘继兴认为,古时旅人于雄鸡报晓、残月未落之时上路,也算得上“早行”了,然而已经是“人迹板桥霜”,这不是谜底“莫道君行早”吗?
二、以“月下追韩信”为谜面,打毛泽东诗词一句,谜底是《减字木兰花·广昌路上》中的“此行何去”(这个行动萧何去完成),让人回味不尽,真乃谜语中的上乘之作。
三、以“我挑水来你浇园”或“生死之交一碗酒”为谜面,打毛泽东诗词一句,谜底是《渔家傲·反第一次大“围剿”》中的“同心干”。
四、以“恰如李广从天降”为谜面,打毛泽东诗词一句,谜底是《渔家傲·反第二次大“围剿”》中的“飞将军自重霄入”,因李广有“飞将军”称誉,故以此来扣合谜底与谜面。
五、以“滑稽大夫也想知”为谜面,打毛泽东诗词一句,谜底是“东方欲晓”。“滑稽大夫”指性格诙谐,言词敏捷而多智的东方朔,“也想知”自然是“欲晓”的白话文。
六、以“犹忆潇湘竹”为谜面,打毛泽东诗词一句,谜底是《贺新郎·读史》中的“但记得斑斑点点”。在文学史上,“潇湘竹”是眼泪的代名词,毛泽东1961年也曾写过《七律·答友人》,有“斑竹一枝千滴泪,红霞万朵百重衣”之佳句。
七、以“劝君更尽一杯酒”为谜面,打毛泽东诗词一句,谜底是《贺新郎·别友》中的“从此天涯孤旅”。
八、以“心事浩茫连广宇”为谜面,打毛泽东诗词一句,谜底是《沁园春·长沙》中的“怅寥廓”。
九、以“煮酒论英雄”为谜面,打毛泽东诗词一句,谜底是《沁园春·雪》中的“数风流人物”。
十、以“人面不知何处去”为谜面,打毛泽东诗词一句,谜底是《卜算子·咏梅》)“犹有花枝俏”。
十一、以“徐志摩再别康桥”为谜面,打毛泽东诗词一句,谜底是《贺新郎·别友》中的“挥手从兹去”。
十二、以“世上已千年,上界仅一日”为谜面,打毛泽东诗词一句,谜底是《采桑子·重阳》中的“人生易老天难老”。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2013-10-30 23:02:34
|
显示全部楼层
以毛泽东诗词句子制谜,谜底还是毛泽东诗词中的句子,更令人叫绝。这样的佳谜有四个:
一、以毛泽东的词《沁园春·雪》中的“万里雪飘”句为谜面,打毛泽东诗词一句,谜底是《减字木兰花·广昌路上》中的“漫天皆白”;
二、以毛泽东的词《十六字令三首》中的“快马加鞭未下鞍”句为谜面,打毛泽东诗词一句,谜底是同一首词中的“奔腾急”。
三、以毛泽东的词《念奴娇·鸟儿问答》中的“背负青天朝下看”句为谜面,打毛泽东诗词一句,谜底是《念奴娇·昆仑》中的“阅尽人间春色”。
四、以毛泽东的词《清平乐·六盘山》中的“天高云淡”句为谜面,打毛泽东诗词一句,谜底是《满江红·和郭沫若同志》中的“玉宇澄清万里埃”。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2013-10-30 23:05:35
|
显示全部楼层
本文转载自宝贝梦《毛泽东诗词中令人拍案叫绝的27个谜语》 |
|
|
|
|
|
|
|
|
|
|
发表于 2013-10-30 23:45:28
|
显示全部楼层
|
我家里有本英文版的毛泽东红皮语录、流传海外令人拍案叫绝。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2013-10-31 00:26:35
|
显示全部楼层
回 jan 的帖子
jan:
我家里有本英文版的毛泽东红皮语录、流传海外令人拍案叫绝。  谢谢分享! |
|
|
|
|
|
|
|
|
|
|
发表于 2013-10-31 00:55:24
|
显示全部楼层
|
暮色苍茫看劲松,乱云飞渡仍从容。
天生一个仙人洞,无限风光在险峰。
这迷底也令人叫绝 |
|
|
|
|
|
|
|
|
该用户从未签到
团长
︶ㄣay⿴{美姐!开心快乐每一天
- 积分
- 13759
 

|
发表于 2013-10-31 01:48:44
|
显示全部楼层
|
|
︶ㄣay⿴{只要人人都献出一点爱,世界将变成美好的人间!
|
|
|
|
|
|
|
|
发表于 2013-10-31 03:47:52
|
显示全部楼层
|
|
|
|
|
|
|
|
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.