if (!$memberid) { cumessage('nousernoaddfripermis'); } if ($mid == $memberid) { cumessage('cannotaddyourself'); } if (empty($mcommu['available'])) { cumessage('favoriatefunclos'); } if (!$curuser->pmbypmids('cuadd', $mcommu['setting']['apmid'])) { cumessage('nousernoaddfripermis', $forward); } $actuser = new cls_userinfo(); $actuser->activeuser($mid); if (!$actuser->info['mid']) { cumessage('choosemember'); } if (!empty($mcommu['setting']['max'])) { $counts = $db->result_one("SELECT COUNT(*) FROM {$tblprefix}mfriends WHERE fromid='{$memberid}'"); if ($counts >= $mcommu['setting']['max']) { cumessage('friamountoverlim', $forward); } } if ($db->result_one("SELECT COUNT(*) FROM {$tblprefix}mfriends WHERE fromid='{$memberid}' AND mid='{$mid}'")) { cumessage('memberalreadyadd', $forward); } $db->query("INSERT INTO {$tblprefix}mfriends SET \n\t\tmid='{$mid}',\n\t\tmname='" . $actuser->info['mname'] . "',\n\t\tfromid='{$memberid}',\n\t\tfromname='" . $curuser->info['mname'] . "',\n\t\tchecked='" . ($mcommu['setting']['autocheck'] ? 1 : 0) . "',\n\t\tcreatedate='{$timestamp}'", 'SILENT'); cumessage($inajax ? 'succeed' : 'friendaddsucce', $forward); } else { include M_ROOT . $mcommu['ucadd']; }
!$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && cumessage('younoscorepermis'); $score = empty($score) ? 0 : max(0, intval($score)); $scorearr = empty($commu['setting']['scorestr']) ? array() : array_filter(explode(',', $commu['setting']['scorestr'])); if (!in_array($score, $scorearr)) { cumessage('scoreoptionerr'); } if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) { if (empty($m_cookie['08cms_cuid_' . $commu['cuid'] . '_' . $aid])) { msetcookie('08cms_cuid_' . $commu['cuid'] . '_' . $aid, '1', empty($commu['setting']['repeat']) ? 365 * 24 * 3600 : $commu['setting']['repeattime'] * 60); } else { cumessage(empty($commu['setting']['repeat']) ? 'norepeatoper' : 'overquick', $forward); } } $aedit = new cls_arcedit(); $aedit->set_aid($aid); $aedit->basic_data(); !$aedit->aid && cumessage('choosearchive'); !$aedit->archive['checked'] && cumessage('poinarcnoche'); $aedit->updatefield('avgscore', round(($aedit->archive['avgscore'] * $aedit->archive['scores'] + $score) / ($aedit->archive['scores'] + 1), 2), 'main'); //平均分 if (!empty($commu['setting']['pics']) && isset($aedit->archive['score_' . $score])) { $aedit->updatefield('score_' . $score, $aedit->archive['score_' . $score] + 1, 'main'); } $aedit->arc_nums('scores', 1, 1); //文档统计 $curuser->basedeal('score', 1, 1, 1); //会员统计及积分 cumessage($inajax ? 'succeed' : 'scoresucceed'); } else { include M_ROOT . $commu['ucadd']; }
} } elseif ($action == 'vote') { $inajax = empty($inajax) ? 0 : 1; $cid = empty($cid) ? 0 : max(0, intval($cid)); if (!$cid) { cumessage('choosevoteobject'); } if (!($row = $db->fetch_one("SELECT * FROM {$tblprefix}offers WHERE cid='{$cid}'"))) { cumessage('choosevoteobject', $forward); } if (!($commu = read_cache('commu', $row['cid']))) { cumessage('setcomitem', $forward); } if (empty($commu['ucvote'])) { if (!empty($commu['setting']['nouservote']) && !$memberid) { cumessage('loginmember', $forward); } if (empty($commu['setting']['repeatvote'])) { if (empty($m_cookie['08cms_cuid_' . $commu['cuid'] . '_vote_' . $aid . '_' . $cid])) { msetcookie('08cms_cuid_' . $commu['cuid'] . '_vote_' . $aid . '_' . $cid, '1', 365 * 24 * 3600); } else { cumessage('dontnrepeatvote', $forward); } } $option = empty($option) ? 1 : min(5, max(1, intval($option))); $db->query("UPDATE {$tblprefix}offers SET votes{$option} = votes{$option} + 1 WHERE cid='{$cid}'", 'SILENT'); cumessage($inajax ? 'succeed' : 'votesucceed', $forward); } else { include M_ROOT . $commu['ucvote']; } }
include_once dirname(dirname(__FILE__)) . '/include/general.inc.php'; include_once M_ROOT . './include/common.fun.php'; include_once M_ROOT . './include/arcedit.cls.php'; $forward = empty($forward) ? M_REFERER : $forward; $aid = empty($aid) ? 0 : max(0, intval($aid)); !$aid && cumessage('choosearchive'); !$memberid && cumessage('nousernofavoritepermis', $forward); !($commu = read_cache('commu', 4)) && cumessage('choosecommuitem'); if (empty($commu['ucadd'])) { !$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && cumessage('younoitempermis', $forward); $aedit = new cls_arcedit(); $aedit->set_aid($aid); $aedit->basic_data(); !$aedit->aid && cumessage('choosearchive'); !$aedit->archive['checked'] && cumessage('poinarcnoche', $forward); $curuser->sub_data(); if (!empty($commu['setting']['max']) && $curuser->info['favorites'] >= $commu['setting']['max']) { cumessage('favoriteamooverlimit', $forward); } if ($db->result_one("SELECT COUNT(*) FROM {$tblprefix}favorites WHERE mid='{$memberid}' AND aid='{$aid}'")) { cumessage('archivealreadyfavorite', $forward); } $abnew = empty($a_edit->archive['abnew']) ? 0 : $a_edit->archive['abnew']; $db->query("INSERT INTO {$tblprefix}favorites SET mid='{$memberid}',aid='{$aid}',createdate='{$timestamp}',abnew='{$abnew}'", 'SILENT'); //加入收藏记录 $aedit->arc_nums('favorites', 1, 1); $curuser->basedeal('favorite', 1, 1, 1); cumessage($inajax ? 'succeed' : 'favoritesucceed', $forward); } else { include M_ROOT . $commu['ucadd']; }
<?php include_once dirname(dirname(__FILE__)) . '/include/general.inc.php'; include_once M_ROOT . './include/common.fun.php'; include_once M_ROOT . './include/arcedit.cls.php'; $forward = empty($forward) ? M_REFERER : $forward; $inajax = empty($inajax) ? 0 : 1; $aid = empty($aid) ? 0 : max(0, intval($aid)); !$aid && cumessage('choosearchive'); !($commu = read_cache('commu', 1)) && cumessage('choosecommuitem'); if (empty($commu['ucadd'])) { !$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && cumessage('younoitempermis', $forward); if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) { if (empty($m_cookie['08cms_cuid_' . $commu['cuid'] . '_' . $aid])) { msetcookie('08cms_cuid_' . $commu['cuid'] . '_' . $aid, '1', empty($commu['setting']['repeat']) ? 365 * 24 * 3600 : $commu['setting']['repeattime'] * 60); } else { cumessage(!empty($commu['setting']['repeat']) ? 'overquick' : 'norepeatoper', $forward); } } $aedit = new cls_arcedit(); $aedit->set_aid($aid); $aedit->basic_data(); !$aedit->aid && cumessage('choosearchive'); !$aedit->archive['checked'] && cumessage('poinarcnoche'); $aedit->arc_nums('debases', 1, 1); $curuser->basedeal('commu', 1, 1, 1); cumessage($inajax ? 'succeed' : 'operatesucceed', $forward); } else { include M_ROOT . $commu['ucadd']; }
$arc = new cls_archive(); !$arc->arcid($aid) && cumessage('choosearchive'); !$arc->archive['checked'] && cumessage('poinarcnoche'); switch_cache($arc->archive['sid']); $sid = $arc->archive['sid']; $stritem = $isatm ? 'attachment' : 'archive'; if (!($crids = $arc->arc_crids($isatm))) { cumessage("youalrpurchasestritem", '', $stritem); } $cridstr = ''; foreach ($crids['total'] as $k => $v) { $cridstr .= ($cridstr ? ',' : '') . abs($v) . $currencys[$k]['unit'] . $currencys[$k]['cname']; } if (!$curuser->crids_enough($crids['total'])) { cumessage('younopurcstriwanenocurr', '', $stritem); } $curuser->updatecrids($crids['total'], 0, lang("purchasestritem", $stritem)); $curuser->payrecord($arc->aid, $isatm, $cridstr, 1); if (!empty($crids['sale'])) { $actuser = new cls_userinfo(); $actuser->activeuser($arc->archive['mid']); foreach ($crids['sale'] as $k => $v) { $crids['sale'][$k] = -$v; } $actuser->updatecrids($crids['sale'], 1, lang("salestritem", $stritem)); unset($actuser); } cumessage($inajax ? 'succeed' : 'operatesucceed'); } else { include M_ROOT . $commu['ucadd']; }
} if (!$curuser->pmbypmids('cuadd', $mcommu['setting']['apmid'])) { cumessage('younoscorepermis', $forward); } if (!empty($mcommu['setting']['norepeat']) || !empty($mcommu['setting']['repeattime'])) { if (empty($m_cookie['08cms_mcuid_1_' . $mid])) { msetcookie('08cms_mcuid_1_' . $mid, '1', !empty($mcommu['setting']['norepeat']) ? 365 * 24 * 3600 : $mcommu['setting']['repeattime'] * 60); } else { cumessage(empty($mcommu['setting']['norepeat']) ? 'overquick' : 'dontrepeatscore', $forward); } } $actuser = new cls_userinfo(); $actuser->activeuser($mid, 1); if (!$actuser->info['mid']) { cumessage('choosemember', $forward); } $score = empty($score) ? 0 : max(0, intval($score)); $score = max(1, min(5, $score)); //统计原有评分数 $counts = 0; for ($i = 1; $i <= 5; $i++) { $counts += $actuser->info['mscores' . $i]; } $actuser->updatefield('mscores' . $score, $actuser->info['mscores' . $score] + 1, 'sub'); $actuser->updatefield('mavgscore', round(($counts * $actuser->info['mavgscore'] + $score) / ($counts + 1), 2), 'sub'); //平均分 $actuser->updatedb(); cumessage($inajax ? 'succeed' : 'scoresucceed', $forward); } else { include M_ROOT . $mcommu['ucadd']; }
<?php include_once dirname(dirname(__FILE__)) . '/include/general.inc.php'; include_once M_ROOT . './include/common.fun.php'; include_once M_ROOT . './include/archive.fun.php'; $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . rawurlencode($forward); $aid = empty($aid) ? 0 : max(0, intval($aid)); if (!$aid) { cumessage('choosearchive'); } $cuid = $db->result_one("SELECT c.report FROM {$tblprefix}archives a LEFT JOIN {$tblprefix}channels c ON c.chid=a.chid WHERE a.aid='{$aid}'"); if (!$cuid || !($commu = read_cache('commu', $cuid))) { message('setcomitem'); } if (empty($commu['ucadd'])) { if (!submitcheck('newcommu')) { include_once M_ROOT . './include/archive.cls.php'; $arc = new cls_archive(); $arc->arcid($aid); if (!$arc->aid) { message('choosearchive'); } if (!$arc->archive['checked']) { message('poinarcnoche'); } if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) { if (!empty($m_cookie['08cms_cuid_' . $commu['cuid'] . '_' . $aid])) { message(empty($commu['setting']['repeat']) ? 'norepeatoper' : 'overquick'); } }