Example #1
0
 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;
 }
Example #2
0
     }
 } 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;
 function getGroupSignupHtml($data)
 {
     //群组活动的状态获取
     global $winduid;
     $replaceArray = $data;
     require_once A_P . 'groups/lib/active.class.php';
     $newActive = new PW_Active();
     if ($this->timestamp > $data['endtime']) {
         $activityStatusKey = 'activity_is_ended';
     } elseif ($this->timestamp > $data['deadline'] && $this->timestamp > $data['begintime']) {
         $activityStatusKey = 'activity_group_running';
     } elseif ($this->timestamp > $data['deadline']) {
         $activityStatusKey = 'signup_is_ended';
     } elseif ($data['limitnum'] && $data['members'] >= $data['limitnum']) {
         $activityStatusKey = 'signup_number_limit_is_reached';
     } elseif ($newActive->isJoin($data['id'], $winduid) && $winduid != $data['uid']) {
         $activityStatusKey = 'activity_is_joined';
     } elseif ($winduid == $data['uid']) {
         $activityStatusKey = 'activity_group_edit';
     } else {
         $activityStatusKey = 'group_is_available_for_member';
     }
     $signupHtml = '<p class="t3">';
     $signupHtml .= $this->getSignupHtmlByActivityKey($activityStatusKey, $replaceArray);
     $signupHtml .= '</p>';
     return $signupHtml;
 }
Example #4
0
     $url_add .= '&cadmin=' . rawurlencode($cadmin);
 }
 if ($createtime_s) {
     $data['createtime_s'] = PwStrtoTime($createtime_s);
     $url_add .= '&createtime_s=' . $createtime_s;
 }
 if ($createtime_e) {
     $data['createtime_e'] = PwStrtoTime($createtime_e);
     $url_add .= '&createtime_e=' . $createtime_e;
 }
 $limit = intval($limit);
 $limit < 1 && ($limit = 30);
 $url_add .= "&orderway={$orderway}&ordertype={$ordertype}&limit={$limit}";
 !$orderway && ($orderway = 'id');
 require_once A_P . 'lib/active.class.php';
 $newActive = new PW_Active();
 list($activedb, $total) = $newActive->searchList($data, $limit, ($page - 1) * $limit, $orderway, $ordertype, true);
 if (empty($activedb)) {
     //Showmsg('没有找到相关的活动!');
 }
 $pages = numofpage($total, $page, ceil($total / $limit), "{$basename}&job=list{$url_add}&");
 $uids = $cids = array();
 foreach ($activedb as $key => $value) {
     $activedb[$key]['createtime'] = get_date($value['createtime']);
     $uids[] = $value['uid'];
     $cids[] = $value['cid'];
 }
 $users = array();
 if ($uids) {
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
Example #5
0
<?php

!defined('R_P') && exit('Forbidden');
//empty($o_invite) && Showmsg('mode_o_invite_close');
if ($uid) {
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    if (!$userService->isExist($uid)) {
        Showmsg('invite_user_not_exist');
    }
}
S::gp(array('hash', 'type', 'id'));
//验证hash的合法性
$hash != appkey($uid, $type) && Showmsg('mode_o_invite_hash_error');
Cookie('o_invite', "{$uid}\t{$hash}\t{$type}");
if ($type == 'group') {
    ObHeader("apps.php?q=group&cyid=" . $id);
} elseif ($type == 'groupactive') {
    require_once R_P . 'apps/groups/lib/active.class.php';
    $newActive = new PW_Active();
    $cyid = $newActive->getCyidById($id);
    ObHeader("apps.php?q=group&a=active&job=view&cyid={$cyid}&id={$id}");
} else {
    ObHeader(USER_URL . $uid);
}
Example #6
0
         $atc_content .= "<div class=\"fr\" style=\"margin-top:20px\">------来自群活动<a href=\"apps.php?q=group&cyid={$cyid}&a=active&job=view&id={$id}\">“{$active[title]}”</a>的消息!</div>";
         $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) {
Example #7
0
    }
    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}", '取消成功!');
    }
}