⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smfcms.php

📁 flashget43的源代码 一个比较常用的下载程序
💻 PHP
字号:
<?php// integration class for Simple Machines Forum (www.simplemachines.org)// written by Manuel Aristar醤 <masterson@diosmilanesa.com.ar>$smf_root_path = realpath(dirname(__FILE__) . '/../../../') . '/';if (!defined("SMF")) define("SMF", "1");include($smf_root_path . 'Settings.php');include($smf_root_path . 'Sources/Load.php');include($smf_root_path . 'Sources/Subs-Auth.php');class SMFCMS {  var $userid;  var $loginStmt;  var $getUserStmt;  var $getUsersStmt;  function SMFCMS() {    $this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=? LIMIT 1");    $this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, memberName AS login, ID_GROUP as status FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=? LIMIT 1");    $this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, memberName as login FROM {$GLOBALS['db_prefix']}members");    $this->userid = NULL;    if (isset($_COOKIE[$GLOBALS['cookiename']])) {      $cookieData = unserialize((get_magic_quotes_gpc() ? stripslashes($_COOKIE[$GLOBALS['cookiename']]) : $_COOKIE[$GLOBALS['cookiename']])) ;      $this->userid = $cookieData[0];     }  }  function isLoggedIn() {    return $this->userid;  }  function getRoles($status) {    $rv = NULL;    if ($status == 1 || $status == 2)      $rv = ROLE_ADMIN;    else      $rv = ROLE_USER;    return $rv;  }  function getUserProfile($userid) {    if ($userid == SPY_USERID) $rv = NULL;    elseif ($user = $this->getUser($userid)) {      $rv  = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;    }    return $rv;  }  function getUser($userid) {    $rv = NULL;    if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {      $rec['roles'] = $this->getRoles($rec['status']);      $rv = $rec;    }    return $rv;  }  function login($login, $password) {    $md5_password = md5_hmac($password, strtolower($login));    $rs = $this->loginStmt->process($login,$md5_password);    $rec = $rs->next();    if ($rec) {      // is the user activated?      if (empty($rec['is_activated'])) return NULL;      $this->userid = $rec['id'];      setLoginCookie(60 * $GLOBALS['modSettings']['cookieTime'], $rec['id'], $md5_password);      return $rec['id'];    }  }  function userInRole($userid, $role) {    $rv = NULL;    if($user = $this->getUser($userid)) {      $rv = (($user['roles'] & $role) != 0);    }    return $rv;  }  function logout() {  }  function getUsers() {   return $this->getUsersStmt->process();  }    function getGender($userid) {	// 'M' for Male, 'F' for Female, NULL for undefined	return NULL;          }}$GLOBALS['fc_config']['db'] = array(                 'host' => $db_server,                 'user' => $db_user,                 'pass' => $db_passwd,                 'base' => $db_name,                 'pref' => $db_prefix . "fc_",                 );$GLOBALS['fc_config']['cms'] = new SMFCMS();foreach($GLOBALS['fc_config']['languages'] as $k => $v) {  $GLOBALS['fc_config']['languages'][$k]['dialog']['login']['moderator'] = '';}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -