function init($id) { $this->_activeId = $id; require_once R_P . 'apps/groups/lib/active.class.php'; $newActive = new PW_Active(); $activeDB = $newActive->getActiveById($this->_activeId); if (!$activeDB) { return false; } require_once R_P . 'apps/groups/lib/colonys.class.php'; $newColony = new PW_Colony(); $colonyDB = $newColony->getColonyById($activeDB['cid']); $content = sprintf("[url=%s] %s [/url]", $this->_url . "&a=active&job=view&cyid={$colonyDB['id']}&id=" . $this->_activeId, $activeDB['title']); $mailSubject = getLangInfo('app', 'groupactive_recommend'); $mailContent = getLangInfo('app', 'ajax_sendweibo_groupinfo', array('cname' => $colonyDB['cname'], 'title' => $content, 'descrip' => substrs($activeDB['introduction'], 50))); $this->_content = $content; $this->_mailSubject = $mailSubject; $this->_mailContent = $mailContent; }
} elseif ($type == 'group') { $group = $db->get_one("SELECT id,cname,cnimg,admin FROM pw_colonys WHERE id=" . S::sqlEscape($id)); empty($group) && Showmsg('data_error'); if ($group['cnimg']) { list($cnimg) = geturl("cn_img/{$group['cnimg']}", 'lf'); } else { $cnimg = $imgpath . '/g/groupnopic.gif'; } $collection['username'] = $group['admin']; $collection['link'] = $db_bbsurl . '/{#APPS_BASEURL#}q=group&cyid=' . $id; $collection['group']['name'] = $group['cname']; $collection['group']['image'] = $cnimg; } elseif ($type == 'groupactive') { require_once A_P . 'groups/lib/active.class.php'; $newActive = new PW_Active(); $active = $newActive->getActiveById($id); empty($active) && Showmsg('data_error'); require_once A_P . 'groups/lib/colonys.class.php'; $newColony = new PW_Colony(); $colony = $newColony->getColonyById($active['cid']); if ($active['poster']) { list($poster) = geturl("{$active['poster']}", 'lf'); } else { $poster = $imgpath . '/defaultactive.jpg'; } $collection['uid'] = $active['uid']; $collection['link'] = $db_bbsurl . '/apps.php?q=group&a=active&job=view&cyid=' . $colony['id'] . '&id=' . $active['id']; $collection['active']['type'] = $type; $collection['active']['name'] = $active['title']; $collection['active']['image'] = $poster; $type = 'active';
$userNames = array(); $actMembers = $newActive->getActMembers($id); foreach ($actMembers as $val) { $userNames[] = $val['username']; } M::sendNotice($userNames, array('create_uid' => $winduid, 'create_username' => $windid, 'title' => $msg_title, 'content' => $atc_content), 'notice_website', null, $winduid); Showmsg('发送成功!'); } } elseif ($job == 'del') { if (empty($_POST)) { define('AJAX', 1); } S::gp(array('id', 'frombbs')); require_once A_P . 'groups/lib/active.class.php'; $newActive = new PW_Active(); if (!($active = $newActive->getActiveById($id)) || $active['cid'] != $cyid) { Showmsg('data_error'); } if (empty($_POST['step'])) { require_once PrintEot('m_ajax'); ajax_footer(); } else { if ($winduid != $active['uid'] && !$ifadmin) { Showmsg('您不是活动的创建者,无权取消!'); } $newActive->delActive($id); $weiboService = L::loadClass('weibo', 'sns'); /* @var $weiboService PW_Weibo */ $weibo = $weiboService->getWeibosByObjectIdsAndType($id, 'group_active'); if ($weibo) { $weiboService->deleteWeibos($weibo['mid']);
} if (empty($_POST['step'])) { require_once PrintEot('thread_active_ajax'); ajax_footer(); } else { $newActive->quitActive($id, $winduid); Showmsg("退出成功!\treload"); } } elseif ($job == 'del') { if (empty($_POST)) { define('AJAX', 1); ob_end_clean(); ObStart(); } S::gp(array('id')); require_once A_P . 'groups/lib/active.class.php'; $newActive = new PW_Active(); if (!($active = $newActive->getActiveById($id))) { Showmsg('data_error'); } if (empty($_POST['step'])) { require_once PrintEot('thread_active_ajax'); ajax_footer(); } else { if ($winduid != $active['uid']) { Showmsg('您不是活动的创建者,无权取消!'); } $newActive->delActive($id); refreshto("{$basename}", '取消成功!'); } }