本文整理汇总了PHP中Sites::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Sites::get方法的具体用法?PHP Sites::get怎么用?PHP Sites::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sites
的用法示例。
在下文中一共展示了Sites::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Sites
/**
* Constructor creates the necessary variables needed later on.
*
* @ignore
* @access private
*/
function __construct()
{
$s = new Sites();
$this->site = $s->get();
$this->nzb = new Nzb();
$this->indexes = array("releases", "releasefiles", "releasenfo", "nzbs", "predb");
}
示例2: PostProcess
function PostProcess($echooutput = false)
{
$this->echooutput = $echooutput;
$s = new Sites();
$this->site = $s->get();
$this->mediafileregex = 'AVI|VOB|MKV|MP4|TS|WMV|MOV|M4V|F4V|MPG|MPEG';
}
示例3: Movie
function Movie($echooutput = false)
{
$this->echooutput = $echooutput;
$s = new Sites();
$site = $s->get();
$this->apikey = $site->tmdbkey;
$this->imgSavePath = WWW_DIR . 'covers/movies/';
}
示例4: BasePage
function BasePage()
{
@session_start();
if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() || ini_get('magic_quotes_sybase')) {
foreach ($_GET as $k => $v) {
$_GET[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
}
foreach ($_POST as $k => $v) {
$_POST[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
}
foreach ($_REQUEST as $k => $v) {
$_REQUEST[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
}
foreach ($_COOKIE as $k => $v) {
$_COOKIE[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
}
}
// set site variable
$s = new Sites();
$this->site = $s->get();
$this->smarty = new Smarty();
$this->smarty->template_dir = WWW_DIR . 'views/templates/' . $this->template_dir;
$this->smarty->compile_dir = SMARTY_DIR . 'templates_c/';
$this->smarty->config_dir = SMARTY_DIR . 'configs/';
$this->smarty->cache_dir = SMARTY_DIR . 'cache/';
$this->smarty->error_reporting = E_ALL - E_NOTICE;
$this->smarty->assign('site', $this->site);
$this->smarty->assign('page', $this);
if (isset($_SERVER["SERVER_NAME"])) {
$this->serverurl = (isset($_SERVER["HTTPS"]) ? "https://" : "http://") . $_SERVER["SERVER_NAME"] . ($_SERVER["SERVER_PORT"] != "80" ? ":" . $_SERVER["SERVER_PORT"] : "") . WWW_TOP . '/';
$this->smarty->assign('serverroot', $this->serverurl);
}
$this->page = isset($_GET['page']) ? $_GET['page'] : 'content';
$users = new Users();
if ($users->isLoggedIn()) {
$this->userdata = $users->getById($users->currentUserId());
$this->userdata["categoryexclusions"] = $users->getCategoryExclusion($users->currentUserId());
//update lastlogin every 15 mins
if (strtotime($this->userdata['now']) - 900 > strtotime($this->userdata['lastlogin'])) {
$users->updateSiteAccessed($this->userdata['ID']);
}
$this->smarty->assign('userdata', $this->userdata);
$this->smarty->assign('loggedin', "true");
$sab = new SABnzbd($this);
if ($sab->integrated !== false && $sab->url != '' && $sab->apikey != '') {
$this->smarty->assign('sabintegrated', $sab->integrated);
$this->smarty->assign('sabapikeytype', $sab->apikeytype);
}
if ($this->userdata["role"] == Users::ROLE_ADMIN) {
$this->smarty->assign('isadmin', "true");
}
$this->floodCheck(true, $this->userdata["role"]);
} else {
$this->smarty->assign('isadmin', "false");
$this->smarty->assign('loggedin', "false");
$this->floodCheck(false, "");
}
}
示例5: PostProcess
/**
* Default constructor.
*/
function PostProcess($echooutput = false)
{
$this->echooutput = $echooutput;
$s = new Sites();
$this->site = $s->get();
$this->mediafileregex = 'AVI|VOB|MKV|MP4|TS|WMV|MOV|M4V|F4V|MPG|MPEG|M2TS';
$this->audiofileregex = 'MP3|AAC|OGG';
$this->mp3SavePath = WWW_DIR . 'covers/audio/';
}
示例6: Music
function Music($echooutput = false)
{
$this->echooutput = $echooutput;
$s = new Sites();
$site = $s->get();
$this->pubkey = $site->amazonpubkey;
$this->privkey = $site->amazonprivkey;
$this->imgSavePath = WWW_DIR . 'covers/music/';
}
示例7: Book
/**
* Default constructor.
*/
function Book($echooutput = false)
{
$this->echooutput = $echooutput;
$s = new Sites();
$site = $s->get();
$this->pubkey = $site->amazonpubkey;
$this->privkey = $site->amazonprivkey;
$this->asstag = $site->amazonassociatetag;
$this->imgSavePath = WWW_DIR . 'covers/book/';
}
示例8: update_rankings
/**
* Retrieves and stores current rankings for the keyword.
*
* @return null
*/
public function update_rankings()
{
$db = DB::connect();
$site = Sites::get(array('id' => $this->site_id));
$rank = Scroogle::get_ranking($this->text, $site->domain);
$q = "INSERT INTO keyword_rank (site_id, search_engine_id, keyword_id, created_at, rank)" . " VALUES ({$site->id}, 1, {$this->id}, NOW(), {$rank})";
$db->exec($q);
$rank = Yahoo::get_ranking($this->text, $site->domain);
$q = "INSERT INTO keyword_rank (site_id, search_engine_id, keyword_id, created_at, rank)" . " VALUES ({$site->id}, 2, {$this->id}, NOW(), {$rank})";
$db->exec($q);
}
示例9: addComment
public function addComment($id, $text, $userid, $host)
{
$db = new DB();
$site = new Sites();
$s = $site->get();
if ($s->storeuserips != "1") {
$host = "";
}
$comid = $db->queryInsert(sprintf("INSERT INTO releasecomment (`releaseID`, \t`text`, \t`userID`, \t`createddate`, \t`host`\t)\t\n\t\t\t\t\t\tVALUES (%d, \t%s, \t%d, \tnow(), \t%s\t)", $id, $db->escapeString($text), $userid, $db->escapeString($host)));
$this->updateReleaseCommentCount($id);
return $comid;
}
示例10: getNZBPath
/**
* Builds a full path to the nzb file on disk. nzbs are stored in a subdir of their first char.
*/
function getNZBPath($releaseGuid, $sitenzbpath = "", $createIfDoesntExist = false)
{
if ($sitenzbpath == "") {
$s = new Sites();
$site = $s->get();
$sitenzbpath = $site->nzbpath;
}
$nzbpath = $sitenzbpath . substr($releaseGuid, 0, 1) . "/";
if ($createIfDoesntExist && !file_exists($nzbpath)) {
mkdir($nzbpath);
}
return $nzbpath . $releaseGuid . ".nzb.gz";
}
示例11: AdminPage
function AdminPage()
{
$this->template_dir = 'admin';
parent::BasePage();
$users = new Users();
if (!$users->isLoggedIn() || !isset($this->userdata["role"]) || $this->userdata["role"] != Users::ROLE_ADMIN) {
$this->show403(true);
}
// set site variable
$s = new Sites();
$this->site = $s->get();
$this->smarty->assign('site', $this->site);
}
示例12: Binaries
function Binaries()
{
$this->n = "\n";
$s = new Sites();
$site = $s->get();
$this->compressedHeaders = $site->compressedheaders == "1" ? true : false;
$this->messagebuffer = !empty($site->maxmssgs) ? $site->maxmssgs : 20000;
$this->NewGroupScanByDays = $site->newgroupscanmethod == "1" ? true : false;
$this->NewGroupMsgsToScan = !empty($site->newgroupmsgstoscan) ? $site->newgroupmsgstoscan : 50000;
$this->NewGroupDaysToScan = !empty($site->newgroupdaystoscan) ? $site->newgroupdaystoscan : 3;
$this->blackList = array();
//cache of our black/white list
$this->message = array();
}
示例13: doConnect
function doConnect($retries = 5, $throw = False, $overridecompression = false)
{
if ($this->_isConnected()) {
return true;
}
$s = new Sites();
$site = $s->get();
$this->compressedHeaders = $site->compressedheaders == "1" ? true : false;
$enc = false;
if (defined("NNTP_SSLENABLED") && NNTP_SSLENABLED == true) {
$enc = 'ssl';
}
while ($retries >= 1) {
$retries--;
$enc = false;
if (defined("NNTP_SSLENABLED") && NNTP_SSLENABLED == true) {
$enc = 'ssl';
}
$ret = $this->connect(NNTP_SERVER, $enc, NNTP_PORT);
if ($this->isError($ret)) {
$err = "Cannot connect to server " . NNTP_SERVER . (!$enc ? " (nonssl) " : "(ssl) ") . ": " . $ret->getMessage();
echo $err;
if ($retries < 1 && $throw) {
throw new NNTPException($err);
}
continue;
}
if (!defined(NNTP_USERNAME) && NNTP_USERNAME != "") {
$ret2 = $this->authenticate(NNTP_USERNAME, NNTP_PASSWORD);
if ($this->isError($ret2)) {
$err = "Cannot authenticate to server " . NNTP_SERVER . (!$enc ? " (nonssl) " : " (ssl) ") . " - " . NNTP_USERNAME . " (" . $ret2->getMessage() . ")";
echo $err;
if ($retries < 1 && $throw) {
throw new NNTPException($err);
}
continue;
}
}
if ($this->compressedHeaders && !$overridecompression) {
$response = $this->_sendCommand('XFEATURE COMPRESS GZIP');
if ($this->isError($response) || $response != 290) {
//echo "NNTP: XFeature not supported.\n";
} else {
$this->enableXFCompression();
}
}
return true;
}
return false;
}
示例14: Parsing
/**
* Default constructor.
*/
function Parsing($echoonly = false, $limited = true, $verbose = false)
{
$this->echoonly = $echoonly;
$this->limited = $limited;
$this->verbose = $verbose;
$this->releasestocheck = 0;
$this->numupdated = 0;
$this->numcleaned = 0;
$this->numnuked = 0;
$this->nummiscd = 0;
$this->nfosprocessed = 0;
$this->parsprocessed = 0;
$this->releasefilesprocessed = 0;
$this->cleanup = array('nuke' => array(), 'misc' => array());
$s = new Sites();
$this->site = $s->get();
}
示例15: Page
function Page()
{
parent::BasePage();
$this->page = isset($_GET['page']) ? $_GET['page'] : 'content';
// set site variable
$s = new Sites();
$this->site = $s->get();
$this->smarty->assign('site', $this->site);
$role = Users::ROLE_GUEST;
if ($this->userdata != null) {
$role = $this->userdata["role"];
}
$content = new Contents();
$menu = new Menu();
$this->smarty->assign('menulist', $menu->get($role, $this->serverurl));
$this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role));
$this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role));
$this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl'));
$this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl'));
$this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl'));
$category = new Category();
if ($this->userdata != null) {
$parentcatlist = $category->getForMenu($this->userdata["categoryexclusions"]);
} else {
$parentcatlist = $category->getForMenu();
}
$this->smarty->assign('parentcatlist', $parentcatlist);
$searchStr = '';
if ($this->page == 'search' && isset($_REQUEST["id"])) {
$searchStr = (string) $_REQUEST["id"];
}
$this->smarty->assign('header_menu_search', $searchStr);
if (isset($_REQUEST["t"])) {
$this->smarty->assign('header_menu_cat', $_REQUEST["t"]);
}
$header_menu = $this->smarty->fetch('headermenu.tpl');
$this->smarty->assign('header_menu', $header_menu);
}