本文整理汇总了PHP中jconf类的典型用法代码示例。如果您正苦于以下问题:PHP jconf类的具体用法?PHP jconf怎么用?PHP jconf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了jconf类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$this->TopicLogic = jlogic('topic');
$this->CacheConfig = jconf::get('cache');
$this->Execute();
}
示例2: index
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: TopicBbsLogic
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: my_member_validate
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: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$this->CacheConfig = jconf::get('cache');
Mobile::is_login();
$this->Execute();
}
示例6: DoSave
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: ModuleObject
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: MiscLogic
function MiscLogic()
{
$this->Config = jconf::get();
$this->DatabaseHandler =& Obj::registry('DatabaseHandler');
Load::logic('other');
$this->OtherLogic = new OtherLogic();
}
示例9: DoClean
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: MTagLogic
function MTagLogic()
{
Load::logic('topic');
$this->TopicLogic = new TopicLogic();
$this->Config = jconf::get();
$this->DatabaseHandler =& Obj::registry('DatabaseHandler');
}
示例11: writeNextRunTime
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: MblogLogic
function MblogLogic()
{
Load::logic('topic');
$this->TopicLogic = new TopicLogic();
Load::logic("topic_list");
$this->TopicListLogic = new TopicListLogic();
$this->Config = jconf::get();
}
示例13: ModuleObject
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: get_feature
function get_feature()
{
$features = array();
$features = jconf::get('feature');
if (empty($features)) {
$this->update_feature_cache();
$features = jconf::get('feature');
}
return $features;
}
示例15: ModuleObject
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();
}