function GetUseDate($time = 0) { if (!empty($time)) { return GetDateMk($time); } else { return '未使用'; } }
function GetFileUrl( $aid,$typeid,$timetag,$title,$ismake=0,$rank=0, $namerule="",$artdir="",$money=0,$aburl=false,$siteurl="") { if($rank!=0||$ismake==-1||$typeid==0||$money>0) //动态文章 { if($GLOBALS['cfg_multi_site']=='Y') { $siteurl = $GLOBALS['cfg_basehost']; } return $siteurl.$GLOBALS['cfg_plus_dir']."/view.php?aid=$aid"; } else { $articleRule = $namerule; $articleDir = MfTypedir($artdir); if($namerule=="") $articleRule = $GLOBALS['cfg_df_namerule']; if($artdir=="") $articleDir = $GLOBALS['cfg_cmspath'].$GLOBALS['cfg_arcdir']; $dtime = GetDateMk($timetag); $articleRule = strtolower($articleRule); list($y,$m,$d) = explode("-",$dtime); $articleRule = str_replace("{typedir}",$articleDir,$articleRule); $articleRule = str_replace("{y}",$y,$articleRule); $articleRule = str_replace("{m}",$m,$articleRule); $articleRule = str_replace("{d}",$d,$articleRule); $articleRule = str_replace("{timestamp}",$timetag,$articleRule); $articleRule = str_replace("{aid}",$aid,$articleRule); $articleRule = str_replace("{cc}",dd2char($m.$d.$aid.$y),$articleRule); if(ereg('{p',$articleRule)){ $articleRule = str_replace("{pinyin}",GetPinyin($title)."_".$aid,$articleRule); $articleRule = str_replace("{py}",GetPinyin($title,1)."_".$aid,$articleRule); } $articleUrl = "/".ereg_replace("^/","",$articleRule); //是否强制使用绝对网址 if($aburl && $GLOBALS['cfg_multi_site']=='Y'){ if($siteurl=="") $siteurl = $GLOBALS["cfg_basehost"]; $articleUrl = $siteurl.$articleUrl; } return $articleUrl; } }
function GetList($page = 1) { global $dsql, $aid, $pagesize, $cfg_templeturl; $querystring = "select fb.*,mb.userid,mb.face as mface,mb.spacesta,mb.scores from `#@__feedback` fb\r\n left join `#@__member` mb on mb.mid = fb.mid where fb.aid='{$aid}' and fb.ischeck='1' order by fb.id desc"; $row = $dsql->GetOne("select count(*) as dd from `#@__feedback` where aid='{$aid}' and ischeck='1' "); $totalcount = empty($row['dd']) ? 0 : $row['dd']; $startNum = $pagesize * ($page - 1); if ($startNum > $totalcount) { echo "参数错误!"; return $totalcount; } $dsql->Execute('fb', $querystring . " limit {$startNum}, {$pagesize} "); while ($fields = $dsql->GetArray('fb')) { if ($fields['userid'] != '') { $spaceurl = $GLOBALS['cfg_memberurl'] . '/index.php?uid=' . $fields['userid']; } else { $spaceurl = '#'; } if ($fields['username'] == '匿名') { $spaceurl = '#'; } $fields['bgimg'] = 'cmt-neu.gif'; $fields['ftypetitle'] = '该用户表示中立'; if ($fields['ftype'] == 'bad') { $fields['bgimg'] = 'cmt-bad.gif'; $fields['ftypetitle'] = '该用户表示差评'; } else { if ($fields['ftype'] == 'good') { $fields['bgimg'] = 'cmt-good.gif'; $fields['ftypetitle'] = '该用户表示好评'; } } $fields['face'] = empty($fields['face']) ? 6 : $fields['face']; $fields['msg'] = str_replace('<', '<', $fields['msg']); $fields['msg'] = str_replace('>', '>', $fields['msg']); $fields['msg'] = Quote_replace($fields['msg']); extract($fields, EXTR_OVERWRITE); ?> <div id="commetmsgs" class="dede_comment"> <div class='decmt-box'> <div class='decmt-title'> <span class='moodico'><img src='<?php echo $cfg_templeturl; ?> /images/mood/ico-mood-<?php echo $face; ?> .gif'/></span> <span class='username'><a href='<?php echo $spaceurl; ?> '><?php echo $username; ?> </a></span> <span class='date'><?php echo GetDateMk($dtime); ?> </span> <span>发表</span> </div> <div class='decmt-act'> <span id='goodfb<?php echo $id; ?> '> <a href='#goodfb<?php echo $id; ?> ' onclick="postBadGood('goodfb',<?php echo $id; ?> );">支持</a>[<?php echo $good; ?> ] </span> <span id='badfb<?php echo $id; ?> '> <a href='#badfb<?php echo $id; ?> ' onclick="postBadGood('badfb',<?php echo $id; ?> );">反对</a>[<?php echo $bad; ?> ] </span> <span class='quote'> <a href='#postform' onclick="quoteCommet('<?php echo $id; ?> ');">[引用]</a> </span> </div> <div class='decmt-content'> <?php echo $msg; ?> <img src='<?php echo $cfg_templeturl; ?> /images/<?php echo $bgimg; ?> ' alt='<?php echo $ftypetitle; ?> ' /> </div> </div> </div> <?php } return $totalcount; }
$fieldinfo = explode(',', $field); if ($fieldinfo[1] == 'textdata') { ${$fieldinfo[0]} = FilterSearch(stripslashes(${$fieldinfo[0]})); ${$fieldinfo[0]} = addslashes(${$fieldinfo[0]}); } else { if ($fieldinfo[1] == 'img') { ${$fieldinfo[0]} = addslashes(${$fieldinfo[0]}); } else { if (empty(${$fieldinfo[0]})) { ${$fieldinfo[0]} = ''; } ${$fieldinfo[0]} = GetFieldValue(${$fieldinfo[0]}, $fieldinfo[1], 0, 'add', '', 'diy', $fieldinfo[0]); } } if ($fieldinfo[0] == "birthday") { ${$fieldinfo[0]} = GetDateMk(${$fieldinfo[0]}); } $inadd_f .= ',' . $fieldinfo[0] . " ='" . ${$fieldinfo[0]} . "'"; } } } $inadd_f = preg_replace('/,/', '', $inadd_f, 1); $query = "UPDATE `{$membermodel->table}`set {$inadd_f} WHERE mid='{$cfg_ml->M_ID}'"; // 清除缓存 $cfg_ml->DelCache($cfg_ml->M_ID); if (!$dsql->ExecuteNoneQuery($query)) { ShowMsg("更新附加表 `{$membermodel->table}` 时出错,请联系管理员!", "javascript:;"); exit; } else { ShowMsg('成功更新你的详细资料!', 'edit_fullinfo.php', 0, 5000); exit;
echo GetRandStr(); ?> " width="48" height="48" /></span></td> <td><?php echo $oauthico . $row['username']; ?> </td> <td><?php echo $usergroup; if ($row['enteruser'] == 1) { echo '<br /><span class="red">认证用户</span>'; } ?> </td> <td class="number"><?php echo GetDateMk($row['logintime']); ?> <br /> <?php echo MyDate('H:i:s', $row['logintime']); ?> </td> <td><?php echo $row['expval']; ?> </td> <td><?php echo $row['integral']; ?> </td> <td class="action endCol"><span><a href="member_update.php?id=<?php
echo $classname; ?> </a>] <a href="<?php echo $gourl; ?> " class="title" style="color:<?php echo $row['colorval']; ?> ;font-weight:<?php echo $row['boldval']; ?> ;"><?php echo $row['title']; ?> </a> <span> 日期:<small><?php echo GetDateMk($row['posttime']); ?> </small>点击:<small><?php echo $row['hits']; ?> </small></span> <p class="desc"><?php echo ReStrLen($row['description'], 90); ?> </p> <div class="cl"></div> </li> <?php } ?> </ul>
function GetFileName($aid, $typeid, $timetag, $title, $ismake = 0, $rank = 0, $namerule = '', $typedir = '', $money = 0, $filename = '') { global $cfg_rewrite, $cfg_cmspath, $cfg_arcdir, $cfg_special, $cfg_arc_dirname; //没指定栏目时用固定规则(专题) if (empty($namerule)) { $namerule = $cfg_special . '/arc-{aid}.html'; $typeid = -1; } if ($rank != 0 || $ismake == -1 || $typeid == 0 || $money > 0) { //动态文章 if ($cfg_rewrite == 'Y') { return $GLOBALS["cfg_plus_dir"] . "/view-" . $aid . '-1.html'; } else { return $GLOBALS['cfg_phpurl'] . "/view.php?aid={$aid}"; } } else { $articleDir = MfTypedir($typedir); $articleRule = strtolower($namerule); if ($articleRule == '') { $articleRule = strtolower($GLOBALS['cfg_df_namerule']); } if ($typedir == '') { $articleDir = $GLOBALS['cfg_cmspath'] . $GLOBALS['cfg_arcdir']; } $dtime = GetDateMk($timetag); list($y, $m, $d) = explode('-', $dtime); $arr_rpsource = array('{typedir}', '{y}', '{m}', '{d}', '{timestamp}', '{aid}', '{cc}'); $arr_rpvalues = array($articleDir, $y, $m, $d, $timetag, $aid, dd2char($m . $d . $aid . $y)); if ($filename != '') { $articleRule = dirname($articleRule) . '/' . $filename . $GLOBALS['cfg_df_ext']; } $articleRule = str_replace($arr_rpsource, $arr_rpvalues, $articleRule); if (preg_match("/\\{p/", $articleRule)) { $articleRule = str_replace('{pinyin}', GetPinyin($title) . '_' . $aid, $articleRule); $articleRule = str_replace('{py}', GetPinyin($title, 1) . '_' . $aid, $articleRule); } $articleUrl = '/' . preg_replace("/^\\//", '', $articleRule); if (preg_match("/index\\.html/", $articleUrl) && $cfg_arc_dirname == 'Y') { $articleUrl = str_replace('index.html', '', $articleUrl); } return $articleUrl; } }
if ($endtime != 0 && $endtime < $ntime) { continue; } //未达到任务开始时间的任务 if ($starttime != 0 && $ntime < $starttime) { continue; } $dotime = GetMkTime($ndate . ' ' . $arr['runtime'] . ':00'); $limittime = $daylimit * $arr['freq']; $isplay = false; //判断符合执行条件的任务 if ($arr['freq'] > 1 && $ntime - $arr['lastrun'] > $limittime) { $isplay = true; } else { $ndateInt = intval(str_replace('-', '', $ndate)); $rdateInt = intval(str_replace('-', '', GetDateMk($arr['lastrun']))); list($th, $tm) = explode(':', $arr['runtime']); if ($ndateInt > $rdateInt && ($hh > $th || $hh == $th && $mm >= $tm)) { $isplay = true; } } //符合需执行条件的任务 if ($isplay) { $dourl = trim($arr['dourl']); if (!file_exists("task/{$dourl}")) { echo $client == 'js' ? '' : 'notask'; exit; } else { $getConfigStr = trim($arr['parameter']); $getString = ''; if (ereg('t:', $getConfigStr)) {
if (!$member->IsLogin()) { ShowMsg('请先登录再进行投票', $loginurl); exit; } } if ($dopost == 'send') { if (!empty($voteitem)) { $rsmsg = "<br /> 你方才的投票状态:" . $vo->SaveVote($voteitem) . "<br />"; } else { $rsmsg = "<br /> 你刚才没选择任何投票项目!<br />"; } if ($row['isenable'] == 1) { ShowMsg('此投票项未启用,暂时不能进行投票', $ENV_GOBACK_URL); exit; } } $voname = $vo->VoteInfos['votename']; $totalcount = $vo->VoteInfos['totalcount']; $starttime = GetDateMk($vo->VoteInfos['starttime']); $endtime = GetDateMk($vo->VoteInfos['endtime']); $votelist = $vo->GetVoteResult("98%", 30, "30%"); //判断是否允许被查看 $admin = new userLogin(); if ($dopost == 'view') { if ($row['view'] == 1 && empty($admin->userName)) { ShowMsg('此投票项不允许查看结果', $ENV_GOBACK_URL); exit; } } //显示模板(简单PHP文件) include DEDETEMPLATE . '/plus/vote.htm';
/** * 读取列表内容 * * @param int $page 页码 * @return string */ function GetList($page = 1) { global $dsql, $aid, $pagesize, $cfg_templeturl, $cfg_cmspath; $querystring = "SELECT fb.*,mb.userid,mb.face as mface,mb.spacesta,mb.scores,mb.sex FROM `#@__feedback` fb\n LEFT JOIN `#@__member` mb on mb.mid = fb.mid WHERE fb.aid='{$aid}' AND fb.ischeck='1' ORDER BY fb.id DESC"; $row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__feedback` WHERE aid='{$aid}' AND ischeck='1' "); $totalcount = empty($row['dd']) ? 0 : $row['dd']; $startNum = $pagesize * ($page - 1); if ($startNum > $totalcount) { echo "参数错误!"; return $totalcount; } $dsql->Execute('fb', $querystring . " LIMIT {$startNum}, {$pagesize} "); while ($fields = $dsql->GetArray('fb')) { if ($fields['userid'] != '') { $spaceurl = $GLOBALS['cfg_memberurl'] . '/index.php?uid=' . $fields['userid']; } else { $spaceurl = '#'; } if ($fields['username'] == '匿名') { $spaceurl = '#'; } $fields['bgimg'] = 'cmt-neu.gif'; $fields['ftypetitle'] = '该用户表示中立'; if ($fields['ftype'] == 'bad') { $fields['bgimg'] = 'cmt-bad.gif'; $fields['ftypetitle'] = '该用户表示差评'; } else { if ($fields['ftype'] == 'good') { $fields['bgimg'] = 'cmt-good.gif'; $fields['ftypetitle'] = '该用户表示好评'; } } if (empty($fields['mface'])) { if ($fields['sex'] == "女") { $fields['mface'] = $cfg_cmspath . "/member/templets/images/dfgirl.png"; } else { $fields['mface'] = $cfg_cmspath . "/member/templets/images/dfboy.png"; } } $fields['face'] = empty($fields['face']) ? 6 : $fields['face']; $fields['msg'] = str_replace('<', '<', $fields['msg']); $fields['msg'] = str_replace('>', '>', $fields['msg']); helper('smiley'); $fields['msg'] = RemoveXSS(Quote_replace(parseSmileys($fields['msg'], $cfg_cmspath . '/images/smiley'))); extract($fields, EXTR_OVERWRITE); ?> <div class="decmt-box2"> <ul> <li> <a href='<?php echo $spaceurl; ?> ' class='plpic'><img src='<?php echo $mface; ?> ' height='40' width='40'/></a> <span class="title"><a href="<?php echo $spaceurl; ?> "><?php echo $username; ?> </a></span> <div class="comment_act"><span class="fl"><?php echo GetDateMk($dtime); ?> 发表</span></div> <div style="clear:both"><?php echo ubb($msg); ?> </div> <div class="newcomment_act"><span class="fr"><span id='goodfb<?php echo $id; ?> '> <a href='#goodfb<?php echo $id; ?> ' onclick="postBadGood('goodfb',<?php echo $id; ?> );">支持</a>[<?php echo $good; ?> ] </span> <span id='badfb<?php echo $id; ?> '> <a href='#badfb<?php echo $id; ?> ' onclick="postBadGood('badfb',<?php echo $id; ?> );">反对</a>[<?php echo $bad; ?> ] </span> <span class='quote'> <!--<a href='/plus/feedback.php?aid=<?php echo $id; ?> &fid=<?php echo $id; ?> &action=quote'>[引用]</a>--> <a href='javascript:ajaxFeedback(<?php echo $id; ?> ,<?php echo $id; ?> ,"quote");'>[引用]</a> </span></span></div> </li> </ul> <div id="ajaxfeedback_<?php echo $id; ?> "></div> </div> <?php } return $totalcount; }