';
} 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
疯娘 - 文学艺术 - 台山同学网 - Powered by Discuz!
|
|
一位湖北大学生的作品,看后久久不能平静
23年前,有个年轻的女子流落到我们村,蓬头垢面,见人就傻笑,且毫不避讳地当众小便。因此,村里的媳妇们常对著那女子吐口水,有的媳妇还上前踹几脚,叫她“滚远些”。可她就是不走,依然傻笑著在村里转悠。那时,我父亲已有35岁。他曾在石料场子干活被机器绞断了左手,又因家穷,一直没娶媳妇。奶奶见那女子还有几份姿色,就动了心思,决定收下她给我父亲做媳妇,等她给我 家“续上香火”后,再把她撵走。父亲虽老大不情愿,但看著家里这番光景,咬咬牙还是答应了。结果,父亲一分未花,就当了新郎。
娘生下我的时候,奶奶抱著我,瘪著没剩几颗牙的嘴,欣喜地说:“这疯婆娘,还给我生了个带把的孙子。”只是我一生下来,奶奶就把我抱走了,而且从不让娘亲近。娘一直想抱抱我,多次在奶奶面前吃力地喊:“给,给我……”奶奶没理她。我那么小,像个肉嘟嘟,万一娘失手把我掉在地上怎么办?毕竟,娘是个疯子。
每当娘有抱我的请求时,奶奶总瞪起眼睛训她:“你别想抱孩子,我不会给你的。要是我发现你偷抱了他,我就打死你。即使不打死,我也要把你撵走。”奶奶说这话时,没有半点儿含糊的意思。娘听懂了,满脸的惶恐,每次只是远远地看著我。尽管娘的奶胀得厉害,可我没能吃到娘的半口奶水,是奶奶一匙一匙把我喂大的。奶奶说娘的奶水里有“神经病”,要是传染给我就麻烦了。那时,我家依然在贫困的泥潭里挣扎。特别是添了娘和我后,家里常常揭不开锅。奶奶决定把娘撵走,因为娘不但在家吃“闲饭”,时不时还惹是生非。
一天,奶奶煮了一大锅饭,亲手给娘添了一大碗,说:“媳妇儿,这个家太穷了,婆婆对不起你,吃完这碗饭,就去找个富点儿的人家过日子,以后也不准来了,啊?”娘刚扒了一大团饭在口里,听了奶奶下的“逐客令”显得非常吃惊,一团饭就在嘴里凝滞了。娘望著奶奶怀中的我,口齿不清地哀叫:“不,不要……” 奶奶猛地沉下脸,拿出威严的家长作风厉声吼到:“你这个疯婆娘,嚷什么呀嚷,再下去没你的好果子吃。你本来就是到处流浪的,我收留了你两年了,你还要怎么样?吃完饭就走,听到没有?”说完奶奶从门后拿出一柄锄,像余太君的龙头杖似的往地上重重一磕,“咚”地发出一声响。娘吓了一大跳,怯怯地看著婆婆,又慢慢低下头去看面前的饭碗,有泪水落在白花花的米饭上。在逼视下,娘突然有个很奇怪的举动,她将碗中的饭分了一大半给另一只空碗,然后可怜巴巴地看著奶奶。
奶奶呆了,原来,娘是向奶奶表示,每餐只吃半碗饭,只求别赶她走。心仿佛被人狠狠揪了几把,奶奶也是女人,她的强硬态度也是装出来的。奶奶别过头,生生地将热泪憋了回去,然后重新板起了脸说:“快吃快吃,吃了快走。在我家你会饿死的。”娘似乎绝望了,连那半碗饭也没吃,朗朗跄跄地出了门,却长时间站在门前不走。奶奶硬著心肠说:“你走,你走,不要回头。天底下富裕人家多著呢!”
娘反而走拢来,一双手伸向婆婆怀里,原来,娘想抱抱我。奶奶忧郁了一下,还是将襁褓中的我递给了娘。娘第一次将我搂在怀里,咧开嘴笑了,笑得春风满面。奶奶却如临大敌,两手在我身下接著,生怕娘的疯劲一上来,将我像扔垃圾一样丢掉。娘抱我的时间不足三分钟,奶奶便迫不及待地将我夺了过去,然后转身进屋关上了门。
待续。。。。。。
[此帖子已被 西毒 在 2005-3-23 17:30:18 编辑过] |
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-23 22:02:54
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-24 01:35:58
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-24 08:33:58
|
显示全部楼层
|
这故事看到这里让人揪心...那“爸爸”怎么了?但愿奶奶在看到“疯娘”抱“我”的那一刻软下心来改变主意,想必也只是萝卜的一厢情愿。 |
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-24 16:19:54
|
显示全部楼层
|
我读后感到悲伤,也是人间的一件很悲哀的事情,这是因为“贫穷”,什么离奇古怪的事都可能发生。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2005-3-24 16:20:01
|
显示全部楼层
续上
当我懵懵懂懂地晓事时,我才发现,除了我,别的小伙伴都有娘。我找父亲要,找奶奶要,他们说,你娘死了。可小伙伴却告诉我:“你娘是疯子,被你奶奶赶走了。”我便找奶奶扯皮,要她还我娘,还骂她是“狼外婆”,甚至将她端给我的饭菜泼了一地。那时我还没有“疯”的概念,只知道非常想念她,她长什么样?还活著吗?没想到,在我六岁那年,离家5年的娘居然回来了。那天,几个小伙伴飞也似地跑来报信:“小树,快去看,你娘回来了,你的疯娘回来了。” 我喜得屁颠屁颠的,撒腿就往外跑,父亲奶奶随著我也追了出来。这是我有记忆后第一次看到娘。她还是破衣烂衫,头发上还有些枯黄的碎草末,天知道是在那个草堆里过的夜。娘不敢进家门,却面对著我家,坐在村前稻场的石头上,手里还拿著个脏兮兮的气球。当我和一群小伙伴站在她面前时,她急切地从我们中间搜寻她的儿子。娘终于盯住我,死死地盯住我,裂著嘴叫我:“小树……球……球”她站起来,不停地扬著手中的气球,讨好地往我怀里塞。我却一个劲儿地往后退。我大失所望,没想到日思夜想的娘居然是这样一副形象。一个小伙伴在一旁起哄说:“小树,你现在知道疯子是什么样了吧?就是你娘这样的。”我气愤地对小伙伴说:“她是你娘!你娘才是疯子,你娘才是这个样子。”我扭头就跑了。这个疯娘我不要了。
奶奶和父亲却把娘领进了门。当年,奶奶撵走娘后,她的良心受到了拷问,随著一天天衰老,她的心再也硬不起来,所以主动留下了娘,而我老大不乐意,因为娘丢了我的面子。我从没给娘好脸色看,从没跟她主动说过话,更没有喊她一声“娘”,我们之间的交流是以我“吼”为主,娘是绝不敢顶嘴的。家里不能白养著娘,奶奶决定训练娘做些杂活。下地劳动时,奶奶就带著娘出去“观摩”,说不听话就要挨打。
过了些日子,奶奶以为娘已被自己训练得差不多了,就叫娘单独出去割猪草。没想到,娘只用了半小时就割了两筐“猪草” 。奶奶一看,又急又慌,娘割的是人家田里正生浆拔穗的稻谷。奶奶气急败坏地骂她:“疯婆娘谷草不分……”
奶奶正想著如何善后时,稻田的主人找来了,竟说是奶奶故意教唆的。奶奶火冒三丈,当著人家的面拿出根棒一下敲在娘的后腰上,说:“打死你这个疯婆娘,你给老娘滚远些……”娘虽疯,疼还是知道的,她一跳一跳地躲著棒槌,口里不停地发出“别、别……”的哀号。最后,人家看不过眼,主动说“算了,我们不追究了。以后把她看严点就是……”这场风波平息后,娘歪在地上抽泣著。我鄙夷地对她说:“草和稻子都分不清,你真是个猪。”话音刚落,我的后脑勺挨了一巴掌,是奶奶打的。奶奶瞪著眼骂我:“小兔崽子,你怎么说话的?再这么著,她也是你娘啊!”我不屑地嘴一撇:“我没有这样的傻疯娘!”“树,你真是越来越不象话了。看我不打你!”奶奶又举起巴掌,这时只见娘像弹簧一样从地上跳起,横在我和奶奶中间,娘指著自己的头,“打我、打我”地叫著。我懂了,娘是叫奶奶打她,别打我。奶奶举在半空中的手颓然垂下,嘴里喃喃地说道:“这个疯婆娘,心里也知道疼爱自己的孩子啊!”
待续
[此帖子已被 西毒 在 2005-3-24 16:22:11 编辑过] |
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-24 16:26:17
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2005-3-25 10:20:21
|
显示全部楼层
我上学不久,父亲被邻村一位养鱼专业户请去守鱼池,每月能赚50元。娘仍然在奶奶的带领下出门干活,主要是打猪草,她没再惹什么大的乱子。记得我读小学三年级饿一个冬日,天空突然下起了雨,奶奶让娘给我送雨伞。娘可能一路摔了好几跤,浑身像个泥猴似的,她站在教室的窗户旁望著我傻笑着,口里还叫:“树……伞……”一些同学嘻嘻地笑,我如坐针毡,对娘恨得牙痒痒,恨她不识相,恨她给我丢人,更恨带头起哄的范嘉喜。
当他还在夸张地模仿时,我抓起面前的文具盒,猛地向他砸过去,却被范嘉喜躲过了,他冲上前来掐住我的脖子,我俩撕打起来。我个子小,根本不是他的对手,被他轻易压在地上。这时,只听教室外传来“嗷”的一声长啸,娘像个大侠似地飞跑进来,一把抓起范嘉喜,拖到了屋外。都说疯子力气大,真是不假。娘双手将欺负我的范嘉喜举向半空,他吓得哭爹喊娘,一双胖乎乎的小腿在空中乱踢蹬。娘毫不理会,居然将他丢到了学校门口的水塘里,然后一脸漠然地走开了。 娘为我闯了大祸,她却像没事似的。在我面前,娘又恢复了一副怯怯的神态,讨好地看著我。我明白这就是母爱,即使神志不清,母爱也是清醒的,因为她的儿子遭到了别人的欺负。当时我情不自禁地叫了声:“娘!”这是我会说话以来第一次喊她。娘浑身一震,久久地看著我,然后像个孩子似的羞红了脸,咧了咧嘴,傻傻地笑了。那天,我们母子俩第一次共撑一把伞回家。我把这事跟奶奶说了,奶奶吓得跌倒在椅子上,连忙请人去把爸爸叫了回来。
爸爸刚进屋,一群拿著刀棒的壮年男人闯进我家,不分青红皂白,先将锅碗瓢盆砸了个稀巴烂,家里像发生了九级地震。这都是范嘉喜家请来的人,范父恶狠狠地指著爸爸的鼻子说:“我儿子吓出了神经病,现在卫生院躺著。你家要不拿出1000块钱的医药费,我他妈一把火烧了你家的房子。”1000块?爸爸每月才50块钱啊!看著杀气腾腾的范家人,爸爸的眼睛慢慢烧红了,他用非常恐怖的目光盯著娘,一只手飞快地解下腰间的皮带,劈头盖脸地向娘打去。一下又一下,娘像只惶惶偷生的老鼠,又像一只跑进死胡同的猎物,无助地跳著、躲著,她发出的凄厉声以及皮带抽在她身上发出的那种清脆的声响,我一辈子都忘不了。
最后还是派出所所长赶来制止了爸爸施暴的手。派出所的调解结果是,双方互有损失,两不亏欠。谁在闹就抓谁!一帮人走后,爸看看满屋狼籍的锅碗碎片,又看看伤痕累累的娘,他突然将娘搂在怀里痛哭起来,说:“疯婆娘,不是我硬要打你,我要不打你,这事下不了地,咱们没钱赔人家啊。这都是家穷惹的祸!”爸又看著我说:“树儿,你一定要好好读书考大学。要不,咱们就这样被人欺负一辈子啊!”我懂事地点点头。
|
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-25 11:14:26
|
显示全部楼层
这位湖北大学生骗了玫瑰的眼泪~~~  |
|
|
|
|
|
|
|
|
|
|
发表于 2005-3-25 11:52:00
|
显示全部楼层
|
西毒老前辈的故事不仅仅挣萝卜眼泪,还挣了萝卜几位要好的同事的眼泪,现在都在等待您的续篇呢。 |
|
|
|
|
|
|
|
|
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.