示例#1
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     $this->CacheConfig = jconf::get('cache');
     $this->Execute();
 }
示例#2
0
 function index()
 {
     $config = jconf::get('live');
     if (!$config) {
         $setting = true;
         include template('admin/live');
     } else {
         $per_page_num = min(500, max(20, (int) (isset($_GET['pn']) ? $_GET['pn'] : $_GET['per_page_num'])));
         $gets = array('mod' => 'live', 'pn' => $this->Get['pn']);
         $page_url = 'admin.php?' . url_implode($gets);
         $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table("live"));
         $list = array();
         $guestall = array();
         if ($count) {
             $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'), '20 50 100 200,500');
             $query = DB::query("SELECT *\r\n\t\t\t\t\t\t\t\tFROM " . DB::table("live") . "\r\n\t\t\t\t\t\t\t\tORDER BY lid DESC\r\n\t\t\t\t\t\t\t\t{$page_arr['limit']}");
             $lids = array();
             while ($value = DB::fetch($query)) {
                 $value['datetime'] = date('Y-m-d H:i', $value['starttime']) . ':' . date('Y-m-d H:i', $value['endtime']);
                 $lids[] = $value['lid'];
                 $list[$value['lid']] = $value;
             }
             $guestall = $this->LiveLogic->Getguest($lids);
             foreach ($guestall as $key => $val) {
                 $h = '';
                 foreach ($val['host'] as $k => $v) {
                     $h .= $v['nickname'] . ' ';
                 }
                 $list[$key]['hosts'] = $h;
             }
         }
         include template('admin/live_index');
     }
 }
示例#3
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';
     }
 }
示例#4
0
function my_member_validate($uid, $email, $role_id = '', $new = 0, $check_allow = 1)
{
    if (1 > ($uid = (int) $uid)) {
        return false;
    }
    if (!($email = trim($email))) {
        return false;
    }
    $sys_config = jconf::get();
    if ($new == 0 && !$sys_config['reg_email_verify']) {
        return false;
    }
    if ($check_allow && jdisallow($uid)) {
        return false;
    }
    $sql = "select * from `" . TABLE_PREFIX . "member_validate` where `uid`='{$uid}' order by `regdate` asc";
    $query = DB::query($sql);
    $data = array();
    if (DB::num_rows($query) > 0) {
        DB::query("delete from `" . TABLE_PREFIX . "member_validate` where `uid`='{$uid}'");
    }
    $data['uid'] = $uid;
    $data['email'] = $email;
    $data['role_id'] = (int) ($role_id > 0 ? $role_id : $sys_config['normal_default_role_id']);
    $data['key'] = substr(md5(md5($uid . $email . $role_id) . md5(uniqid(mt_rand(), true))), 3, 16);
    $data['status'] = $data['verify_time'] = '0';
    $data['regdate'] = TIMESTAMP;
    $data['type'] = 'email';
    jtable('member_validate')->insert($data);
    $email_message = "您好:\r\n您收到此邮件是因为在 {$sys_config['site_url']} 用户注册中使用了该 Email,\r\n如果您没有进行上述操作,请忽略这封邮件。\r\n------------------------------------------------------\r\n帐号激活说明:\r\n为避免垃圾邮件或您的Email地址被滥用,我们需要对您的email有效性进行验证,\r\n您只需点击下面的链接即可激活您的帐号,并享有真正会员权限:\r\n{$sys_config['site_url']}/index.php?mod=member&code=verify&uid={$data['uid']}&key={$data['key']}&from=reg\r\n\r\n(如果上面不是链接形式,请将地址手工粘贴到浏览器地址栏再访问)\r\n感谢您的访问,祝您使用愉快!\r\n\r\n此致,\r\n{$sys_config['site_name']} 管理团队.\r\n";
    $send_result = send_mail($email, " [{$sys_config['site_name']}]Email地址验证", $email_message, $sys_config['site_name'], $sys_config['site_admin_email'], array(), 3, false);
    return $send_result;
}
示例#5
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->CacheConfig = jconf::get('cache');
     Mobile::is_login();
     $this->Execute();
 }
示例#6
0
 function DoSave()
 {
     $dedecms = $this->Post['dedecms'];
     $dedecms_config_default = $dedecms_config = jconf::get('dedecms');
     $dedecms_config['enable'] = $dedecms['enable'] ? 1 : 0;
     $dedecms_config['db_host'] = $dedecms['db_host'];
     $dedecms_config['db_name'] = $dedecms['db_name'];
     $dedecms_config['db_user'] = $dedecms['db_user'];
     $dedecms_config['db_pass'] = $dedecms['db_pass'];
     $dedecms_config['db_port'] = $dedecms['db_port'];
     $dedecms_config['db_pre'] = $dedecms['db_pre'];
     $dedecms_config['charset'] = $dedecms['charset'];
     $dedecms_config['db_url'] = $dedecms['db_url'];
     if ($dedecms_config['enable']) {
         include_once ROOT_PATH . './api/uc_api_db.php';
         $dede_db = new JSG_UC_API_DB();
         @$dede_db->connect($dedecms['db_host'], $dedecms['db_user'], $dedecms['db_pass'], $dedecms['db_name'], $dedecms['charset'], 1, $dedecms['db_pre']);
         if (!$dede_db->link || !$dede_db->query("SHOW COLUMNS FROM {$dedecms['db_pre']}member", 'SILENT')) {
             $this->Messager("无法连接DedeCMS数据库,请检查您填写的DedeCMS数据库配置信息是否正确.");
             exit;
         }
     }
     if ($dedecms_config_default != $dedecms_config) {
         jconf::set('dedecms', $dedecms_config);
     }
     if ($dedecms_config['enable'] != $this->Config['dedecms_enable']) {
         $config = array();
         $config['dedecms_enable'] = $dedecms_config['enable'];
         jconf::update($config);
     }
     $this->Messager("修改成功");
 }
示例#7
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ShowConfig = jconf::get('show');
     Load::logic('vote');
     $this->VoteLogic = new VoteLogic();
     $this->TopicLogic = jlogic('topic');
     if (MEMBER_ROLE_TYPE != 'admin') {
         if (!$this->Config['vote_open']) {
             $this->Messager("当前站点没有开放投票功能", null);
         }
     }
     $code =& $this->Code;
     ob_start();
     if (!empty($this->Get['vid']) && empty($code)) {
         $code = 'view';
     } else {
         if (empty($code)) {
             $code = 'index';
             if (!empty($this->Get['uid']) && empty($this->Get['view'])) {
                 $this->Get['view'] = 'me';
             }
         }
     }
     if (in_array($code, array('create'))) {
         $this->_check_login();
     }
     if (method_exists('ModuleObject', $code)) {
         $this->{$code}();
     } else {
         $this->index();
     }
     $body = ob_get_clean();
     $this->ShowBody($body);
 }
示例#8
0
 function MiscLogic()
 {
     $this->Config = jconf::get();
     $this->DatabaseHandler =& Obj::registry('DatabaseHandler');
     Load::logic('other');
     $this->OtherLogic = new OtherLogic();
 }
示例#9
0
 function DoClean()
 {
     $type = get_param('type');
     if (!$type) {
         $this->Messager("请先选择要清理的缓存对象");
     }
     $this->_removeTopicAttach();
     $this->_removeTopicLongtext();
     $this->_removeVoteImage();
     if (in_array('data', $type)) {
         cache_db('clear');
         jtable('failedlogins')->truncate();
         DB::query("update " . TABLE_PREFIX . "members set `username`=`uid` WHERE `username`!=`uid` AND `username` REGEXP '^[0-9]*\$'");
     }
     if (in_array('tpl', $type)) {
         cache_clear();
         jconf::set('validate_category', array());
         jlogic('credits')->rule_conf(true);
     }
     if (in_array('channel', $type)) {
         jlogic('channel')->update_data();
     }
     if (in_array('album', $type)) {
         jlogic('image')->update_data();
     }
     $this->Messager("已清空所有缓存");
 }
示例#10
0
 function MTagLogic()
 {
     Load::logic('topic');
     $this->TopicLogic = new TopicLogic();
     $this->Config = jconf::get();
     $this->DatabaseHandler =& Obj::registry('DatabaseHandler');
 }
示例#11
0
 function writeNextRunTime()
 {
     $query = $this->DatabaseHandler->Query("SELECT nextrun FROM " . TABLE_PREFIX . 'task' . " WHERE available>'0' ORDER BY nextrun LIMIT 1");
     $row = $query->GetRow();
     $nextruntime = $row['nextrun'] ? $row['nextrun'] : time() + 1800;
     jconf::set('task', 'nextrun', $nextruntime);
 }
示例#12
0
 function MblogLogic()
 {
     Load::logic('topic');
     $this->TopicLogic = new TopicLogic();
     Load::logic("topic_list");
     $this->TopicListLogic = new TopicListLogic();
     $this->Config = jconf::get();
 }
示例#13
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     $this->TopicLogic = jlogic('topic');
     $this->CacheConfig = jconf::get('cache');
     $this->ShowConfig = jconf::get('show');
     $this->Execute();
 }
示例#14
0
 function get_feature()
 {
     $features = array();
     $features = jconf::get('feature');
     if (empty($features)) {
         $this->update_feature_cache();
         $features = jconf::get('feature');
     }
     return $features;
 }
示例#15
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Mobile::logic('mblog');
     $this->MblogLogic = new MblogLogic();
     $this->CacheConfig = jconf::get('cache');
     $this->ShowConfig = jconf::get('show');
     Mobile::is_login();
     $this->Execute();
 }
示例#16
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     $this->CacheConfig = jconf::get('cache');
     Load::logic('validate_category');
     $this->ValidateLogic = new ValidateLogic($this);
     Load::logic('validate_extra');
     $this->ValidateExtraLogic = new ValidateExtraLogic();
     $this->Execute();
 }
示例#17
0
 function weibo_show()
 {
     $conf = jconf::get('weibo_show');
     $link_display_none_radio = $this->jishigou_form->YesNoRadio('link_display_none', (int) $conf['link_display_none']);
     if (jpost('settingsubmit')) {
         $conf['link_display_none'] = jpost('link_display_none') ? 1 : 0;
         jconf::set('weibo_show', $conf);
         $this->Messager('设置成功了');
     }
     include template();
 }
示例#18
0
 function MailQueue()
 {
     $msg_config = jconf::get('mail_msg');
     $site_url = $this->Config['site_url'];
     $site_name = $this->Config['site_name'];
     $page_url = 'admin.php?mod=notice&code=mailq';
     $per_page_num = min(500, max(20, (int) (isset($_GET['pn']) ? $_GET['pn'] : $_GET['per_page_num'])));
     $count = DB::result_first(" select count(*) from `" . TABLE_PREFIX . "mailqueue` ");
     $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'), '20 50 100 200 500');
     $sql = " select mq.*,m.username,m.nickname\r\n\t\t\t\t from `" . TABLE_PREFIX . "mailqueue` mq\r\n\t\t\t\t left join `" . TABLE_PREFIX . "members` m on m.uid = mq.uid\r\n\t\t\t\t where `dateline` > 0\r\n\t\t\t\t order by `dateline` {$page_arr['limit']}";
     $query = DB::query($sql);
     while ($rs = db::fetch($query)) {
         $msg = array();
         $rs['dateline'] = date('Y-m-d H:i:s', $rs['dateline']);
         if ($rs['msg']) {
             $nickname = $rs['nickname'];
             $msg = unserialize($rs['msg']);
             $site_new_data = array();
             $newpm = $msg['newpm'] ? $msg['newpm'] : 0;
             $newpm && ($site_new_data['newpm'] = "有{$newpm}条未读私信");
             $at_new = $msg['at_new'] ? $msg['at_new'] : 0;
             $at_new && ($site_new_data['at_new'] = "被@{$at_new}次");
             $comment_new = $msg['comment_new'] ? $msg['comment_new'] : 0;
             $comment_new && ($site_new_data['comment_new'] = "被评论{$comment_new}次");
             $event_new = $msg['event_new'] ? $msg['event_new'] : 0;
             $event_new && ($site_new_data['event_new'] = "有{$event_new}个活动更新");
             $fans_new = $msg['fans_new'] ? $msg['fans_new'] : 0;
             $fans_new && ($site_new_data['fans_new'] = "新增加{$fans_new}个粉丝");
             $qun_new = $msg['qun_new'] ? $msg['qun_new'] : 0;
             $qun_new && ($site_new_data['qun_new'] = "有{$qun_new}个群更新");
             $vote_new = $msg['vote_new'] ? $msg['vote_new'] : 0;
             $vote_new && ($site_new_data['vote_new'] = "投票有{$vote_new}个更新");
             $dig_new = $msg['dig_new'] ? $msg['dig_new'] : 0;
             $dig_new && ($site_new_data['dig_new'] = "被赞{$dig_new}次");
             $channel_new = $msg['channel_new'] ? $msg['channel_new'] : 0;
             $channel_new && ($site_new_data['channel_new'] = "频道有{$channel_new}个更新");
             $company_new = $msg['company_new'] ? $msg['company_new'] : 0;
             $company_new && ($site_new_data['company_new'] = "单位有{$company_new}个更新");
             $load = $msg['load'] ? $msg['load'] . "天" : '';
             $site_new_data = $site_new_data ? '<br>您' . implode(',', $site_new_data) . '。' : '';
             if ($msg_config['msg']) {
                 $message = $msg_config['msg'];
                 $message = str_replace(array('newpm', 'at_new', 'comment_new', 'event_new', 'fans_new', 'qun_new', 'vote_new', 'dig_new', 'channel_new', 'company_new', 'load', 'site_url', 'site_name', 'time', 'nickname', 'site_new_data', 'time'), array($newpm, $at_new, $comment_new, $event_new, $fans_new, $qun_new, $vote_new, $dig_new, $channel_new, $company_new, $load, $site_url, $site_name, date('Y:m:d H:i:s'), $nickname, $site_new_data, $time), $message);
             } else {
                 $message = "尊敬的{$nickname:}<br>您好!<br>在未登录{$site_name}的{$load}期间,您收到了一些信息:" . "{$site_new_data}<br>点击<a href='{$site_url}'>{$site_url}</a>查看" . "<br><br>(<font color='gray'>如此邮件提醒对您产生了干扰,请<a href='{$site_url}/index.php?mod=settings&code=sendmail' targegt='_blank'>点击修改提醒设置</a></font>)<br>" . data('Y-m-d H:i:s');
             }
             $message .= $recommend_tips ? '<br><br><b>官方推荐内容:</b>' . $recommend_tips : '';
             $rs['message'] = $message;
         }
         $mailQueue[$rs['qid']] = $rs;
     }
     include template('admin/mail_queue');
 }
示例#19
0
 function DoModify()
 {
     $set['about'] = $this->Post['about'];
     $set['contact'] = $this->Post['contact'];
     $set['joins'] = $this->Post['joins'];
     $set['float'] = $this->Post['float'];
     $set['float_align'] = $this->Post['float_align'];
     $set['float_style'] = $this->Post['float_style'];
     $set = jstripslashes($set);
     jconf::set('web_info', $set);
     $this->Messager("修改成功", 'admin.php?mod=web_info');
 }
示例#20
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Load::logic("topic");
     $this->TopicLogic = new TopicLogic();
     $this->ShowConfig = jconf::get('show');
     if ($this->Code != 'login') {
         Mobile::is_login();
     }
     $this->Execute();
 }
示例#21
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Load::logic('topic');
     $this->TopicLogic = new TopicLogic($this);
     Mobile::logic('tag');
     $this->MTagLogic = new MTagLogic();
     $this->CacheConfig = jconf::get('cache');
     $this->ShowConfig = jconf::get('show');
     Mobile::is_login();
     $this->Execute();
 }
示例#22
0
function yy_enable($sys_config = array())
{
    if (!$sys_config) {
        $sys_config = jconf::get();
    }
    if (!$sys_config['yy_enable']) {
        return false;
    }
    if (!$sys_config['yy']) {
        $sys_config['yy'] = jconf::get('yy');
    }
    return $sys_config;
}
示例#23
0
function kaixin_enable($sys_config = array())
{
    if (!$sys_config) {
        $sys_config = jconf::get();
    }
    if (!$sys_config['kaixin_enable']) {
        return false;
    }
    if (!$sys_config['kaixin']) {
        $sys_config['kaixin'] = jconf::get('kaixin');
    }
    return $sys_config;
}
示例#24
0
 function TopicCmsLogic()
 {
     $this->MemberHandler =& Obj::registry("MemberHandler");
     $this->TopicLogic = jlogic('topic');
     if ($GLOBALS['_J']['config']['dedecms_enable'] && ($config['dedecms'] = jconf::get('dedecms'))) {
         $this->CmsDatabase = new jishigou_mysql($config['dedecms']['db_host'], $config['dedecms']['db_port']);
         $this->CmsDatabase->Charset($config['dedecms']['charset']);
         $this->CmsDatabase->doConnect($config['dedecms']['db_user'], $config['dedecms']['db_pass'], $config['dedecms']['db_name'], $GLOBALS['_J']['config']['db_persist']);
         Obj::register('CmsDatabase', $this->CmsDatabase);
         define('CMS_TB_PRE', $config['dedecms']['db_pre']);
         define('CMS_API_URL', $config['dedecms']['db_url']);
         define('CMS_ENABLE', $config['dedecms']['enable']);
     }
 }
示例#25
0
 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();
 }
示例#26
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $qun_setting = jconf::get('qun_setting');
     if (MEMBER_ROLE_TYPE != 'admin') {
         if (!$qun_setting['qun_open']) {
             $this->Messager('站点暂时不开放微群功能', 'index.php');
         }
     }
     $this->TopicLogic = jlogic('topic');
     Load::logic('qun');
     $this->QunLogic = new QunLogic();
     $this->Execute();
 }
示例#27
0
 public function ModuleObject($config)
 {
     $wechat_conf = jconf::get("wechat");
     if (!$wechat_conf || !$wechat_conf['on'] || !$wechat_conf['token']) {
         $msg = "后台未开启或微信Token值没有设定……";
         jlog('wechat', $msg, 0);
         exit($msg);
     }
     $this->wechatConfig = $wechat_conf;
     define("TOKEN", $wechat_conf['token']);
     $this->MasterObject($config);
     $this->WLogic = jlogic("wechat");
     $this->main();
 }
示例#28
0
 function mail_send_test()
 {
     $k = jget('k', 'int');
     $smtp = jconf::get('smtp');
     $test_smtp = $smtp['smtp'][$k];
     jfunc('mail');
     $ret = _send_mail_by_smtp($test_smtp['mail'], $this->Config['site_name'] . '-' . date('Y-m-d H:i:s'), '邮件测试正文---' . date('Y-m-d H:i:s'), $test_smtp);
     if ($ret) {
         echo '发送成功。';
     } else {
         echo '发送不成功,请检查配置是否正确。';
     }
     exit;
 }
示例#29
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Mobile::logic('mblog');
     $this->MblogLogic = new MblogLogic();
     $this->CacheConfig = jconf::get('cache');
     if (!in_array($this->Code, array('new', 'hot_comments', 'hot_forwards'))) {
         Mobile::is_login();
     }
     if (empty($this->Code)) {
         $this->Code = "home";
     }
     $this->Execute();
 }
示例#30
0
function area_config_to_json()
{
    $config['area'] = jconf::get('area');
    $json = "";
    foreach ($config['area'] as $key => $val) {
        $j = '';
        foreach ($val as $k => $v) {
            $j .= "'{$k}':'{$v}',";
        }
        $j = trim($j, ' ,');
        $json .= "'{$key}':{'key':'{$key}','values':{{$j}}},";
    }
    $json = trim($json, ',');
    $json = "{'请选择…':{'key':'0','defaultvalue' : '0','values':{'请选择…':'0'}},{$json}}";
    return $json;
}