コード例 #1
0
ファイル: async.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function wqueue()
 {
     $do = $this->Get['do'];
     if ($do == 'run') {
         if ($this->Config['wqueue_enabled']) {
             $url = 'http:/' . '/' . $this->Config['wqueue']['host'] . '/?name=' . $this->Config['wqueue']['name'] . '&opt=get&auth=' . $this->Config['wqueue']['auth'];
             while (true) {
                 $r = dfopen($url);
                 if (!in_array($r, array('HTTPSQS_GET_END', 'HTTPSQS_ERROR'))) {
                     $data = unserialize(base64_decode($r));
                     $data['datas']['content'] = base64_decode($data['datas']['content']);
                     $r = jlogic('topic')->Add($data['datas'], $data['totid'], $data['imageid'], $data['attachid'], $data['from'], $data['type'], $data['uid'], $data['item'], $data['item_id'], true);
                     if (DEBUG) {
                         if (is_array($r) && $r['tid']) {
                             echo 'publish success' . "\n";
                         } else {
                             echo var_export($r, true) . "\n";
                         }
                         ob_flush();
                     }
                 } else {
                     sleep(1);
                 }
             }
         } else {
             exit('weibo.queue.close');
         }
     } else {
         exit('weibo.action.no');
     }
 }
コード例 #2
0
 function TopicBbsLogic()
 {
     $this->MemberHandler =& Obj::registry("MemberHandler");
     $this->TopicLogic = jlogic('topic');
     if ($GLOBALS['_J']['config']['dzbbs_enable'] && ($config['dzbbs'] = jconf::get('dzbbs'))) {
         $this->BbsDatabase = new jishigou_mysql($config['dzbbs']['db_host'], $config['dzbbs']['db_port']);
         $this->BbsDatabase->Charset($config['dzbbs']['charset']);
         $this->BbsDatabase->doConnect($config['dzbbs']['db_user'], $config['dzbbs']['db_pass'], $config['dzbbs']['db_name'], $GLOBALS['_J']['config']['db_persist']);
         Obj::register('BbsDatabase', $this->BbsDatabase);
         define('BBS_TB_PRE', $config['dzbbs']['db_pre']);
         define('BBS_API_URL', $config['dzbbs']['db_url']);
         define('BBS_ENABLE', $config['dzbbs']['enable']);
         define('DZ_BBS_VER', $config['dzbbs']['dz_ver']);
         $this->BbsType = 'discuz';
     } elseif ($GLOBALS['_J']['config']['phpwind_enable'] && $GLOBALS['_J']['config']['pwbbs_enable']) {
         $config['phpwind'] = jconf::get('phpwind');
         $this->BbsDatabase = new jishigou_mysql($config['phpwind']['pw_db_host']);
         $this->BbsDatabase->Charset($config['phpwind']['pw_db_charset']);
         $this->BbsDatabase->doConnect($config['phpwind']['pw_db_user'], $config['phpwind']['pw_db_password'], $config['phpwind']['pw_db_name'], $GLOBALS['_J']['config']['db_persist']);
         Obj::register('BbsDatabase', $this->BbsDatabase);
         define('BBS_TB_PRE', $config['phpwind']['pw_db_table_prefix']);
         define('BBS_API_URL', $config['phpwind']['pw_api']);
         define('BBS_ENABLE', $config['phpwind']['enable']);
         $this->BbsType = 'phpwind';
     }
 }
コード例 #3
0
ファイル: qmd.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     $this->CacheConfig = jconf::get('cache');
     $this->Execute();
 }
コード例 #4
0
ファイル: plugin.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Main()
 {
     if (MEMBER_ID < 1) {
         response_text('登录后才能继续操作');
     }
     global $_J;
     if (!isset($_J['plugins'])) {
         jlogic('plugin')->loadplugincache();
     }
     $pluginid = jget('id');
     if (!empty($pluginid)) {
         list($identifier, $module) = explode(':', $pluginid);
         $module = $module !== NULL ? $module : $identifier;
     }
     if (!is_array($_J['plugins']['hookmod']) || !array_key_exists($pluginid, $_J['plugins']['hookmod'])) {
         response_text("插件不存在或已关闭");
     }
     if (empty($identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $module)) {
         response_text("未定义的操作");
     }
     if (@(!file_exists($modfile = PLUGIN_DIR . '/' . $identifier . '/' . $module . '.mod.php'))) {
         response_text("插件模块文件(" . $modfile . ")不存在或者插件文件不完整");
     }
     if ($_J['plugins']['hookmod'][$pluginid]['role_id'] && 'admin' != MEMBER_ROLE_TYPE) {
         response_text("您没有权限进行该操作");
     }
     include $modfile;
 }
コード例 #5
0
ファイル: album.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function topic()
 {
     $id = jget('id', 'int');
     $infos = jlogic('image')->get_uploadimg_byid($id);
     $sql_wheres = array("item" => "`item` = 'topic_image'", "item_id" => "`item_id` = '" . $id . "'");
     $this->_topic_list('new', $sql_wheres, $order, array(), array('imageinfo' => $infos[$id]));
 }
コード例 #6
0
 function hot_at($uid = MEMBER_ID, $limit = 10, $day = 7, $key = 'uid', $field = 'tuid')
 {
     $rets = array();
     $uid = jfilter($uid, 'int');
     $limit = jfilter($limit, 'int');
     $day = jfilter($day, 'int');
     if ($uid > 0 && $limit > 0 && $day > 0) {
         $cache_id = $this->cache_id("hot_at-{$field}-{$key}-{$uid}-{$limit}-{$day}");
         if (false === ($rets = cache_db('mget', $cache_id))) {
             $gets = $this->get(array('sql_field' => " `{$field}`, COUNT(`{$field}`) AS `at_count` ", $key => $uid, '>@dateline' => TIMESTAMP - $day * 86400, 'sql_group' => " `{$field}` ", 'sql_order' => ' `at_count` DESC, `id` DESC ', 'result_count' => $limit, 'return_list' => 1));
             $uids = array();
             if ($gets) {
                 $at_counts = array();
                 foreach ($gets as $k => $v) {
                     $uid = (int) $v[$field];
                     if ($uid > 0) {
                         $uids[$uid] = $uid;
                         $at_counts[$uid] = $v['at_count'];
                     }
                 }
             }
             $rets = array();
             if ($uids) {
                 $rets = jlogic('topic')->GetMember($uids, "`uid`,`ucuid`,`username`,`nickname`,`face`,`face_url`,`fans_count`");
                 foreach ($rets as $k => $row) {
                     $row['at_count'] = $at_counts[$row['uid']];
                     $rets[$k] = $row;
                 }
             }
             cache_db('mset', $cache_id, $rets, 3600);
         }
     }
     return $rets;
 }
コード例 #7
0
ファイル: wechat.mod.php プロジェクト: YouthAndra/huaitaoo2o
 public function login()
 {
     $username = jget('username', 'txt');
     $password = jget('password');
     $openid = jget('openid');
     if ($username == "" || $password == "") {
         json_error("无法登录,用户名或密码不能为空");
     }
     if ($this->Config['login_by_uid']) {
         is_numeric($username) && json_error("禁止使用UID登录");
     }
     if ($GLOBALS['_J']['plugins']['func']['login']) {
         hookscript('login', 'funcs', array('param' => $this->Post, 'step' => 'check'), 'login');
     }
     $rets = jsg_member_login($username, $password);
     $uid = (int) $rets['uid'];
     if ($uid < 1) {
         json_error(array_iconv($this->Config['charset'], 'utf-8', $rets['error']));
     }
     $r = false;
     if ($openid && $uid) {
         $r = jlogic('wechat')->do_bind($openid, $uid);
     }
     if ($r) {
         json_result("绑定成功!");
     } else {
         json_error("绑定失败!");
     }
 }
コード例 #8
0
ファイル: ios.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Out()
 {
     $uid = max(0, (int) $this->Inputs['uid']);
     if ($uid > 0) {
         jlogic('ios')->loginout($uid);
     }
 }
コード例 #9
0
ファイル: view.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function TopicContentView()
 {
     $TopicLogic = jlogic('topic');
     $tid = is_numeric($this->ID) ? $this->ID : 0;
     if ($tid < 1) {
         js_alert_output('ID 不能为空');
     }
     $topic_info = $TopicLogic->Get($tid);
     if (!$topic_info) {
         js_alert_output('内容已经不存在了');
     }
     $parent_list = array();
     if ($topic_info['parent_id']) {
         $parent_id_list = array($topic_info['parent_id'], $topic_info['top_parent_id']);
         if ($parent_id_list) {
             $parent_list = $TopicLogic->Get($parent_id_list);
         }
     }
     $sid = max(0, (int) ($this->Post['sid'] ? $this->Post['sid'] : $this->Get['sid']));
     if ($sid < 1 || $sid == $tid) {
         unset($sid);
     }
     $TPT_ = 'TPT_' != $this->Post['TPT_'] ? $this->Post['TPT_'] : '';
     $topic_view = $this->Post['topic_view'] ? 1 : 0;
     $together_view = 1;
     include template('topic_content_view_ajax');
 }
コード例 #10
0
ファイル: tag.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = $this->Get['id'] ? (int) $this->Get['id'] : (int) $this->Post['id'];
     $this->TopicLogic = jlogic('topic');
     $this->Execute();
 }
コード例 #11
0
ファイル: ajax.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function static_data_refresh()
 {
     $type = jget('type');
     if (!in_array($type, array('app', 'content', 'login', 'other', 'role', 'user', 'verify'))) {
         exit('type is invalid');
     }
     $ret = array();
     $other_logic = jlogic('other');
     $func = 'get' . ucfirst($type) . 'Statistics';
     if (method_exists($other_logic, $func)) {
         $cache_id = 'misc/' . $type . '_statistics';
         cache_file('rm', $cache_id);
         if ($type == 'other') {
             cache_file('rm', 'misc/data_length');
         }
         $ret = $other_logic->{$func}();
     }
     #生成html代码
     $head_html = "<tr class='altbg1'>";
     $body_html = "<tr class='altbg2'>";
     if ($ret) {
         foreach ($ret['data'] as $k => $v) {
             $head_html .= "<td>{$v['name']}</td>";
             $body_html .= "<td>{$v['num']}</td>";
         }
     }
     $head_html .= "</tr>";
     $body_html .= "</tr>";
     echo $head_html . $body_html;
     exit;
 }
コード例 #12
0
 function Main()
 {
     $uid = MEMBER_ID;
     if ($uid < 1) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
     }
     $member = jsg_member_info($uid);
     $sql = "select * from `" . TABLE_PREFIX . "blacklist` where `uid` = '" . MEMBER_ID . "' ";
     $query = $this->DatabaseHandler->Query($sql);
     $uids = array();
     while (false != ($row = $query->GetRow())) {
         $uids[$row['touid']] = $row['touid'];
     }
     if ($uids) {
         $where = "where `uid` in (" . jimplode($uids) . ")";
         $member_list = $this->_MemberList($where);
         if ($uids && MEMBER_ID > 0) {
             $sql = "select `uid`,`tid`,`content`,`dateline` from `" . TABLE_PREFIX . "topic` where `uid` in (" . jimplode($uids) . ") group by `uid` order by `dateline` desc";
             $query = $this->DatabaseHandler->Query($sql);
             $topic_list = array();
             while (false != ($row = $query->GetRow())) {
                 $row['content'] = cut_str($row['content'], 100);
                 $row['dateline'] = my_date_format2($row['dateline']);
                 $topic_list[] = $row;
             }
         }
     }
     $group_list = jlogic('buddy_follow_group')->get_my_group(MEMBER_ID);
     $this->Title = '黑名单';
     include template('social/blacklist');
 }
コード例 #13
0
 public function get_at_my_topic($p)
 {
     $rets = array();
     $uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
     $member = jsg_member_info($uid);
     if ($member) {
         if ($member['at_new'] > 0) {
             jlogic('member')->clean_new_remind('at_new', $member['uid']);
         }
         $rets = $this->get_at_my_tid($p, 1);
         if ($rets && is_array($rets)) {
             if (!$rets['error']) {
                 $rets['member'] = $member;
                 $rets['list'] = $rets['count'] > 0 && $rets['ids'] ? jlogic('topic')->Get($rets['ids']) : array();
                 if ($rets['list']) {
                     if ($GLOBALS['_J']['config']['is_topic_user_follow'] && !$GLOBALS['_J']['disable_user_follow']) {
                         if (true === IN_JISHIGOU_WAP) {
                             $rets['list'] = buddy_follow_html($rets['list'], 'uid', 'wap_follow_html');
                         } else {
                             $rets['list'] = jlogic('buddy')->follow_html2($rets['list']);
                         }
                     }
                     $rets['parent_list'] = jlogic('topic')->get_parent_list($rets['list']);
                 }
                 if (true === IN_JISHIGOU_WAP) {
                     $rets = wap_iconv($rets);
                 }
             }
         }
     } else {
         return jerror('您无权查看该信息,请先登录', -1);
     }
     return $rets;
 }
コード例 #14
0
 public function add($postData)
 {
     $member = $this->is_jsg($postData['fromusername']);
     if ($member) {
         $imageID = 0;
         if ($postData['msgtype'] == "image") {
             $p = array('pic_url' => $postData['picurl'], 'uid' => $member['jsg_id']);
             $rets = jlogic('image')->upload($p);
             if ($rets['code'] < 0 && $rets['error']) {
                 jlog('wechat', $postData, 0);
                 jlog('wechat', $rets, 0);
             }
             $imageID = $rets['id'];
         }
         $r = jlogic("topic")->Add($postData['content'], 0, $imageID, 0, "wechat", "first", $member['jsg_id']);
         if (is_array($r) && $r['tid'] > 0) {
         } else {
             jlog('wechat', $postData, 0);
         }
         if ($r) {
             if (is_array($r)) {
                 return $this->wechatConfig['add_weibo_success'];
             } else {
                 return $r;
             }
         } else {
             return $this->wechatConfig['add_weibo_false'];
         }
     }
 }
コード例 #15
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     $this->Member = $this->_member();
     $this->Execute();
 }
コード例 #16
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     Load::logic('topic_recommend');
     $this->TopicRecommendLogic = new TopicRecommendLogic();
     $this->TopicLogic = jlogic('topic');
     $this->Execute();
 }
コード例 #17
0
ファイル: block.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     if (MEMBER_ID < 1) {
         exit("你需要先登录才能继续本操作");
     }
     $this->Execute();
 }
コード例 #18
0
ファイル: people.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     Load::logic('validate_category');
     $this->ValidateLogic = new ValidateLogic();
     $this->CacheConfig = jconf::get('cache');
     $this->Execute();
 }
コード例 #19
0
ファイル: wall.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->WallId = max(0, (int) $this->Get['wall_id']);
     Load::logic('wall');
     $this->WallLogic = new WallLogic();
     $this->TopicLogic = jlogic('topic');
     $this->Execute();
 }
コード例 #20
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     if (MEMBER_ID < 1) {
         $this->Messager(null, $this->Config['site_url'] . "/index.php?mod=login");
     }
     $this->TopicLogic = jlogic('topic');
     $this->Member = $this->TopicLogic->GetMember(MEMBER_ID);
     $this->Execute();
 }
コード例 #21
0
ファイル: comment.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function outbox()
 {
     $this->Title = '我发出的评论 - 我评论的';
     $p = array('page_num' => 10, 'page_url' => 'index.php?mod=comment&code=outbox');
     $rets = jlogic('comment')->outbox($p);
     if (is_array($rets) && $rets['error']) {
         $this->Messager($rets['result'], null);
     }
     include template();
 }
コード例 #22
0
 function get($p = array())
 {
     $uid = (int) $p['uid'];
     $uid = $uid > 0 ? $uid : MEMBER_ID;
     if ($uid < 1) {
         return jerror('获取用户粉丝列表数据时,UID不能为空或您没有登录系统', -1);
     }
     $member = jsg_member_info($uid);
     if (empty($member)) {
         return jerror('您要查看的用户已经不存在了,UID错误', -2);
     }
     $count = (int) $member['fans_count'];
     if ($count < 1) {
         return array();
     }
     $page_num = 10;
     if (isset($p['page_num'])) {
         $page_num = (int) $p['page_num'];
         if ($page_num < 1 || $page_num > 100) {
             return jerror('请设置每页显示的数量在 1 ~ 100 之间', -3);
         }
     }
     $ps = array('result_count' => $count, 'page_num' => $page_num, 'page_url' => $p['page_url'], 'sql_field' => ' M.* ', 'sql_table' => ' `' . DB::table($this->db->table_name($uid)) . '` AS BF LEFT JOIN `' . DB::table('members') . '` AS M ON M.`uid`=BF.`touid` ', 'sql_where' => " BF.`uid`='{$uid}' AND M.`uid` IS NOT NULL ", 'sql_order' => ' BF.`dateline` DESC ', 'result_list_row_make_func' => 'jsg_member_make', 'result_list_make_func' => 'buddy_follow_html');
     if (true === IN_JISHIGOU_WAP) {
         unset($ps['result_list_make_func']);
     }
     if (jallow($uid)) {
         if ($member['fans_new'] > 0) {
             jlogic('member')->clean_new_remind('fans_new', $uid);
         }
         if ($p['nickname']) {
             $nickname = jfilter($p['nickname'], 'txt');
             if (strlen($nickname) < 3 || strlen($nickname) > 15) {
                 return jerror('搜索用户昵称时,字数请控制在 3 ~ 15 个字符之间', -4);
             }
             unset($ps['result_count']);
             $ps['cache_time'] = 600;
             $ps['sql_where'] .= ' AND ' . build_like_query(' M.`nickname` ', $nickname);
         }
         if ($p['order'] && in_array($p['order'], array('lastpost', 'fans_count'))) {
             $p['sql_order'] = ' M.`' . $p['order'] . '` DESC ';
         }
     }
     $rets = $this->db->get($ps);
     if (is_array($rets)) {
         $rets['member'] = $member;
     }
     if (true === IN_JISHIGOU_WAP) {
         if ($rets['list']) {
             $rets['list'] = buddy_follow_html($rets['list'], 'uid', 'wap_follow_html');
         }
         $rets = wap_iconv($rets);
     }
     return $rets;
 }
コード例 #23
0
ファイル: skin.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     if (MEMBER_ID < 1) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", null);
     }
     $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "members where `uid`='" . MEMBER_ID . "'");
     $this->Member = $query->GetRow();
     $this->Execute();
 }
コード例 #24
0
ファイル: app.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     if (MEMBER_ID < 1) {
         response_text("请先登录或者注册一个帐号");
     }
     Load::logic('vote');
     $this->VoteLogic = new VoteLogic();
     $this->TopicLogic = jlogic('topic');
     $this->Execute();
 }
コード例 #25
0
 function me()
 {
     $this->Title = '谁收藏了我的微博';
     $p = array('page_num' => 10, 'page_url' => 'index.php?mod=topic_favorite&code=me');
     $rets = jlogic('topic_favorite')->get_favorite_me_topic($p);
     if (is_array($rets) && $rets['error']) {
         $this->Messager($rets['result'], null);
     }
     $member = $rets['member'];
     $favorite_members = $rets['favorite_members'];
     include template();
 }
コード例 #26
0
ファイル: at.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function index()
 {
     $p = array('page_num' => 10);
     $p['page_url'] = 'index.php?mod=at';
     $rets = jlogic('topic_mention')->get_at_my_topic($p);
     if (is_array($rets) && $rets['error']) {
         $this->Messager($rets['result'], null);
     }
     $member = $rets['member'];
     $this->Title = "@提到我的";
     include template('at_index');
 }
コード例 #27
0
ファイル: feature.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Domodfeature()
 {
     $tid = jget('tid');
     $relateid = jget('replyid');
     $featureid = jget('featureid');
     if ($tid > 0) {
         jlogic('feature')->set_topic_feature($tid, $relateid, $featureid);
         json_result('操作成功');
     } else {
         json_result('没做任何处理');
     }
 }
コード例 #28
0
ファイル: follow.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function index()
 {
     $uid = jget('uid', 'int');
     $p = array('page_num' => 8, 'uid' => $uid);
     $p['page_url'] = 'index.php?mod=follow' . ($uid > 0 && MEMBER_ID != $uid ? '&uid=' . $uid : '');
     $rets = jlogic('buddy_follow')->get($p);
     if (is_array($rets) && $rets['error']) {
         $this->Messager($rets['result'], null);
     }
     $member = $rets['member'];
     $this->Title = "{$member['nickname']}关注的人";
     include template();
 }
コード例 #29
0
 public function get_tag_by_recommend($limit, $cache_time = 0)
 {
     $rets = array();
     $limit = (int) $limit;
     if ($limit > 0) {
         $name = jlogic('tag_recommend')->get_name_by_top_id($limit);
         if ($name) {
             $p = array('cache_time' => $cache_time, 'cache_key' => "hot_tag/get_tag_by_recommend-{$limit}-{$cache_time}", 'result_count' => $limit, 'name' => $name, 'sql_order' => ' `last_post` DESC ');
             $rets = $this->_get_hot_tag($p);
         }
     }
     return $rets;
 }
コード例 #30
0
ファイル: top.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function member()
 {
     $this->Title = '人气用户推荐';
     $show_conf = jconf::get('show', 'topic_top');
     $cache_conf = jconf::get('cache', 'topic_top');
     $credits = $this->Config['credits_filed'];
     $credits_name = $this->Config['credits']['ext'][$credits]['name'];
     $top_fans_member = jlogic('member')->get_member_by_top_fans($show_conf['guanzhu'], $cache_conf['guanzhu']);
     $week_fans_member = jlogic('member')->get_member_by_fans($show_conf['renqi'], $cache_conf['renqi']);
     $week_topic_member = jlogic('member')->get_member_by_topic($show_conf['huoyue'], $cache_conf['huoyue']);
     $week_reply_member = jlogic('member')->get_member_by_reply($show_conf['yingxiang'], $cache_conf['yingxiang']);
     $top_credits_member = jlogic('member')->get_member_by_top_credits($show_conf['credits'], $cache_conf['credits'], $credits);
     include template();
 }