本文整理汇总了PHP中Sites类的典型用法代码示例。如果您正苦于以下问题:PHP Sites类的具体用法?PHP Sites怎么用?PHP Sites使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Sites类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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: updateAllGroups
/**
* Process headers and store in database for all active groups.
*/
function updateAllGroups()
{
$n = $this->n;
$groups = new Groups();
$res = $groups->getActive();
$s = new Sites();
echo $s->getLicense();
if ($res) {
shuffle($res);
$alltime = microtime(true);
echo 'Updating: ' . sizeof($res) . ' groups - Using compression? ' . ($this->compressedHeaders ? 'Yes' : 'No') . $n;
$nntp = new Nntp();
if ($nntp->doConnect()) {
$pos = 0;
foreach ($res as $groupArr) {
$pos++;
echo 'Group ' . $pos . ' of ' . sizeof($res) . $n;
$this->message = array();
$this->updateGroup($nntp, $groupArr);
}
$nntp->doQuit();
echo 'Updating completed in ' . number_format(microtime(true) - $alltime, 2) . ' seconds' . $n;
} else {
echo "Failed to get NNTP connection.{$n}";
}
} else {
echo "No groups specified. Ensure groups are added to newznab's database and activated before updating.{$n}";
}
}
示例3: getMailEnt
public static function getMailEnt($OER)
{
$idS = $OER->getSiteId();
$Nom = $OER->getNomUsuari();
$Activitat = $OER->getNomActivitat();
$OH = $OER->getHoraris();
$OS = SitesPeer::retrieveByPK($OER->getSiteId());
if (!$OS instanceof Sites) {
$OS = new Sites();
}
$TEXT = OptionsPeer::getString('BODY_MAIL_ENTRADES', $idS);
$TEXT = str_replace('{{NOM}}', $OER->getNomUsuari(), $TEXT);
$TEXT = str_replace('{{NUM_ENTRADES}}', $OER->getQuantitat(), $TEXT);
$TEXT = str_replace('{{ACTIVITAT}}', $OER->getNomActivitat(), $TEXT);
$TEXT = str_replace('{{ENTITAT}}', $OS->getNom(), $TEXT);
$TEXT = str_replace('{{TEL_ENTITAT}}', $OS->getTelefon(), $TEXT);
$TEXT = str_replace('{{MAIL_ENTITAT}}', $OS->getEmail(), $TEXT);
$TEXT = str_replace('{{TEL_ADMIN}}', '972.20.20.13', $TEXT);
$TEXT = str_replace('{{MAIL_ADMIN}}', OptionsPeer::getString('MAIL_ADMIN', $idS), $TEXT);
$TEXT = str_replace('{{DIA}}', $OH->getDia('d/m/Y'), $TEXT);
$TEXT = str_replace('{{HORA}}', $OH->getHorainici('H:i'), $TEXT);
$TEXT = str_replace('{{ESPAI}}', implode(',', Horaris::getArrayEspais()), $TEXT);
$TEXT = str_replace('{{CODI}}', sha1($OER->getIdentrada()), $TEXT);
return $TEXT;
}
示例4: 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';
}
示例5: getsitelist
public function getsitelist()
{
$sites = new Sites();
$select = $sites->select();
// $select'id, name';
echo $select->__toString();
return $sites->fetchAll($select)->toArray();
}
示例6: Movie
function Movie($echooutput = false)
{
$this->echooutput = $echooutput;
$s = new Sites();
$site = $s->get();
$this->apikey = $site->tmdbkey;
$this->imgSavePath = WWW_DIR . 'covers/movies/';
}
示例7: 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, "");
}
}
示例8: 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/';
}
示例9: 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/';
}
示例10: 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/';
}
示例11: initialize
/**
* Inicialitza un formulari de Site
* @param $idS Site ID
* @return SitesForm()
* */
public static function initialize($idS)
{
$OO = self::retrieveByPK($idS);
if (!$OO instanceof Sites) {
$OO = new Sites();
$OO->setNom('');
$OO->setActiu(true);
}
return new SitesForm($OO, array('IDS' => $idS));
}
示例12: 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;
}
示例13: 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";
}
示例14: 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);
}
示例15: 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;
}