本文整理汇总了PHP中doArgs函数的典型用法代码示例。如果您正苦于以下问题:PHP doArgs函数的具体用法?PHP doArgs怎么用?PHP doArgs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doArgs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayPortlets
/**
* Loops through the blocks and displays them nicely using the theme template
*
* @version 1.0
* @since 1.0
* @author Daniel Noel-Davies
*
* @param array $blocks Collection of blocks
*
*/
private function displayPortlets($blocks)
{
$objTPL = Core_Classes_coreObj::getTPL();
$objTPL->set_filenames(array('block_notices' => cmsROOT . Core_Classes_Page::$THEME_ROOT . 'block.tpl'));
$rowCount = 12;
foreach ($blocks as $title => $block) {
$block['COL'] = (int) doArgs('COL', 12, $block);
$objTPL->assign_block_vars('block', array('TITLE' => $title, 'CONTENT' => dump($rowCount, 'RowCount') . dump($block, 'block'), 'ICON' => 'icon-' . doArgs('ICON', null, $block)));
// If there are no blocks in the row, Start new row
if ($rowCount === 12) {
$objTPL->assign_block_vars('block.start_row', array());
// If there is no space for the current block, end the current div above everything, and start a new one
} else {
if ($rowCount - $block['COL'] < 0) {
$objTPL->assign_block_vars('block.start_row', array());
$objTPL->assign_block_vars('block.pre_end_row', array());
}
}
// If, after everything, we are at 0, end the current block, and reset the row count
$rowCount -= $block['COL'];
if ($rowCount <= 0) {
$objTPL->assign_block_vars('block.end_row', array());
$rowCount = 12;
}
$objTPL->assign_block_vars('block.' . doArgs('COL', '12', $block) / 4 . 'col', array());
$objTPL->assign_vars(array('BLOCKS' => $objTPL->get_html('block_notices')));
}
}
示例2: menu_affiliates
function menu_affiliates($args)
{
if (defined('NO_DB')) {
return;
}
global $objTPL, $objSQL;
$settings = array('limit' => doArgs('limit', 6, $args), 'perRow' => doArgs('limit', 2, $args));
//grab the table
$table = $objSQL->getTable('SELECT * FROM `$Paffiliates` WHERE active = 1 AND showOnMenu = 1 ORDER BY rand() LIMIT %d;', array($settings['limit']));
if ($table === NULL) {
return 'Error: Could not query Affiliates.';
}
if (is_empty($table)) {
return 'Error: No Affiliates in the database active.';
}
$return = NULL;
$counter = 1;
foreach ($table as $a) {
$title = secureMe($a['title']) . '
In: ' . $a['in'] . ' | Out: ' . $a['out'];
$return .= '<a href="/' . root() . 'affiliates.php?out&id=' . $a['id'] . '" title="' . $title . '" target="_blank" rel="nofollow"><img src="' . $a['img'] . '" alt="' . $title . '" /></a>';
if ($counter % $settings['perRow'] == 0) {
$return .= '<br />';
}
$counter++;
}
return '<center>' . $return . '</center>';
}
示例3: menu_forum_users
function menu_forum_users($args)
{
global $objCore;
$limit = doArgs('limit', 5, $args);
$objCore->objTPL->set_filenames(array($args['uniqueId'] => 'modules/forum/template/block_forum.tpl'));
$users = $objCore->objSQL->getTable('SELECT u.id, COUNT(DISTINCT p.id) AS count
FROM `$Pusers` u, `$Pforum_posts` p, `$Pforum_threads` t, `$Pforum_cats` c
WHERE p.author = u.id AND p.thread_id = t.id AND t.cat_id = c.id AND c.postcounts = 1
GROUP BY u.id
ORDER BY count DESC
LIMIT %d', array($limit));
if (!$users) {
$objCore->objTPL->assign_block_vars('error', array('MESSAGE' => langVar('L_ERROR')));
return $objCore->objTPL->get_html($args['uniqueId']);
}
$opened = round((time() - $objCore->config('statistics', 'site_opened')) / 86400);
$j = 0;
foreach ($users as $user) {
$objCore->objTPL->assign_block_vars('userRow', array('ID' => $objCore->objUser->getUserInfo($user['id'], 'id'), 'USERNAME' => $objCore->objUser->profile($user['id']), 'COUNT' => $user['count'], 'PER_DAY' => langVar('L_PER_DAY', round(sprintf('%.2f', $user['count'] / $opened), 0)), 'CLASS' => $j % 2 == 0 ? 'row_color2' : 'row_color1'));
$j++;
}
//reset the block var so the data dosent creep into the other templates
$return = $objCore->objTPL->get_html($args['uniqueId']);
$objCore->objTPL->reset_block_vars('userRow');
return $return;
}
示例4: __construct
/**
* Sets up a new MySQL Class
*
* @version 1.0
* @since 1.0.0
* @author xLink
*
* @param array $config
*
* @return bool
*/
public function __construct($config = array())
{
if (is_empty($config)) {
return false;
}
$this->db = array('host' => doArgs('host', '', $config), 'username' => doArgs('username', '', $config), 'password' => doArgs('password', '', $config), 'database' => doArgs('database', '', $config), 'prefix' => doArgs('prefix', '', $config));
return true;
}
示例5: add
/**
* Add a new user to the system
*
* @version 1.0
* @since 1.0.0
* @author Dan Aldridge
*
* @return void
*/
public function add()
{
$objSQL = Core_Classes_coreObj::getDBO();
$objTPL = Core_Classes_coreObj::getTPL();
$objTime = Core_Classes_coreObj::getTime();
Core_Classes_coreObj::getPage()->addBreadcrumbs(array(array('url' => doArgs('REQUEST_URI', '', $_SERVER), 'name' => 'Add User')));
$objTPL->set_filenames(array('body' => cmsROOT . Core_Classes_Page::$THEME_ROOT . 'block.tpl', 'panel' => cmsROOT . 'modules/core/views/admin/users/add.tpl'));
$objTPL->parse('panel', false);
Core_Classes_coreObj::getAdminCP()->setupBlock('body', array('cols' => 3, 'vars' => array('TITLE' => 'Add User', 'CONTENT' => $objTPL->get_html('panel', false), 'ICON' => 'faicon-user')));
}
示例6: siteConfig
/**
* Generates a form for the site configuration
*
* @version 1.0
* @since 1.0.0
* @author Dan Aldridge
*
* @return void
*/
public function siteConfig()
{
Core_Classes_coreObj::getPage()->addBreadcrumbs(array(array('url' => doArgs('REQUEST_URI', '', $_SERVER), 'name' => 'Site Config')));
$objForm = Core_Classes_coreObj::getForm();
$objTPL = Core_Classes_coreObj::getTPL();
$yn = array(1 => langVar('L_YES'), 0 => langVar('L_NO'));
$fields = array(langVar('L_SITE_CONFIG') => '_header_', langVar('L_SITE_TITLE') => $objForm->inputbox('title', 'text', $this->config('site', 'title')), langVar('L_SITE_SLOGAN') => $objForm->inputbox('slogan', 'text', $this->config('site', 'slogan')), langVar('L_ADMIN_EMAIL') => $objForm->inputbox('admin_email', 'text', $this->config('site', 'admin_email')), langVar('L_GANALYTICS') => $objForm->inputbox('google_analytics', 'input', $this->config('site', 'google_analytics')), langVar('L_CUSTOMIZE') => '_header_', langVar('L_THEME_OVERRIDE') => $objForm->radio('theme_override', $yn, $this->config('site', 'theme_override')), langVar('L_SITE_TZ') => $timezone, langVar('L_DST') => $objForm->radio('dst', $yn, $this->config('time', 'dst')), langVar('L_DEF_DATE_FORMAT') => $objForm->inputbox('default_format', 'input', $this->config('time', 'default_format')));
$form = $objForm->outputForm(array('FORM_START' => $objForm->start('panel', array('method' => 'POST', 'action' => $saveUrl, 'class' => 'form-horizontal')), 'FORM_END' => $objForm->finish(), 'FORM_TITLE' => $mod_name, 'FORM_SUBMIT' => $objForm->button('submit', 'Submit', array('class' => 'btn-primary')), 'FORM_RESET' => $objForm->button('reset', 'Reset'), 'HIDDEN' => $objForm->inputbox('sessid', 'hidden', $sessid) . $objForm->inputbox('id', 'hidden', $uid)), array('field' => $fields, 'desc' => array(langVar('L_INDEX_MODULE') => langVar('L_DESC_IMODULE'), langVar('L_SITE_TZ') => langVar('L_DESC_SITE_TZ'), langVar('L_DEF_DATE_FORMAT') => langVar('L_DESC_DEF_DATE'), langVar('L_DEF_THEME') => langVar('L_DESC_DEF_THEME'), langVar('L_THEME_OVERRIDE') => langVar('L_DESC_THEME_OVERRIDE'), langVar('L_ALLOW_REGISTER') => langVar('L_DESC_ALLOW_REGISTER'), langVar('L_EMAIL_ACTIVATE') => langVar('L_DESC_EMAIL_ACTIVATE'), langVar('L_MAX_LOGIN_TRIES') => langVar('L_DESC_MAX_LOGIN'), langVar('L_REMME') => langVar('L_DESC_REMME'), langVar('L_GANALYTICS') => langVar('L_DESC_GANALYTICS')), 'errors' => $_SESSION['site']['panel']['error']), array('header' => '<h4>%s</h4>', 'dedicatedHeader' => true, 'parseDesc' => true));
Core_Classes_coreObj::getAdminCP()->setupBlock('body', array('cols' => 3, 'vars' => array('TITLE' => 'Site Configuration', 'CONTENT' => $form, 'ICON' => 'fa-icon-user')));
}
示例7: login_process
public function login_process()
{
$objUser = Core_Classes_coreObj::getUser();
$objLogin = Core_Classes_coreObj::getLogin();
$objPage = Core_Classes_coreObj::getPage();
if ($objLogin->process() !== true) {
$this->login_form();
return;
}
$objPage->redirect(doArgs('referer', '/' . root(), $_SESSION['login']), 0);
}
示例8: __construct
function __construct($name = '', $args = array())
{
$args = array('useCache' => doArgs('useCache', false, $args), 'cacheDir' => doArgs('cacheDir', '', $args), 'root' => doArgs('root', '.', $args));
if (!$this->set_rootdir($args['root'])) {
trigger_error('Error: Unable to find template root directory', E_USER_ERROR);
}
$this->use_cache = $args['useCache'];
if ($this->use_cache) {
if (is_dir($args['cacheDir']) && is_writeable($args['cacheDir'])) {
$this->cache_directory = $args['cacheDir'];
} else {
$this->cache_directory = $args['root'] . '/cache/template/';
}
}
}
示例9: __construct
/**
* Sets up a new SQL Class
*
* @version 1.0
* @since 1.0.0
* @author Dan Aldridge
*
* @param array $config
*
* @return bool
*/
public function __construct($name = null, $options = array())
{
$this->driver = @end(explode('_', $this->getClassName()));
$this->dbSettings = array('driver' => doArgs('driver', '', $options), 'host' => doArgs('host', '', $options), 'port' => doArgs('port', '', $options), 'username' => doArgs('username', '', $options), 'password' => doArgs('password', '', $options), 'database' => doArgs('database', '', $options), 'prefix' => doArgs('prefix', '', $options), 'persistent' => doArgs('persistent', false, $options), 'debug' => doArgs('debug', false, $options), 'logging' => doArgs('logging', false, $options));
if ($this->dbSettings['driver'] == 'pdo' && !class_exists('PDO', false)) {
trigger_error('Error: You have selected to use PDO, the interface for this Driver dosen\'t exist.', E_USER_ERROR);
}
if ($this->dbSettings['driver'] == 'mysqli' && (!class_exists('Core_Drivers_mysqli', false) || !class_exists('mysqli', false))) {
trigger_error('Error: You have selected to use MySQLi, the interface for this Driver dosen\'t exist.', E_USER_ERROR);
}
if ($this->dbSettings['driver'] == 'mysql' && (!class_exists('Core_Drivers_mysql', false) || !function_exists('mysql_connect'))) {
trigger_error('Error: You have selected to use MySQL, the interface for this Driver dosen\'t exist.', E_USER_ERROR);
}
return false;
}
示例10: __construct
function __construct($args = array())
{
$args = array('useCache' => doArgs('useCache', false, $args), 'cacheDir' => doArgs('cacheDir', '', $args), 'root' => doArgs('root', '.', $args));
if (!$this->set_rootdir($args['root'])) {
msgDie('FAIL', 'Unable to find template root directory: ' . $args['root'] . ' @ Line ' . __LINE__);
}
$this->use_cache = $args['useCache'];
if ($this->use_cache) {
if (is_dir($args['cacheDir']) && is_writeable($args['cacheDir'])) {
$this->cache_directory = $args['cacheDir'];
} else {
$this->cache_directory = $args['root'] . '/cache/template/';
}
}
}
示例11: __construct
public function __construct($instance, $total_per_page, $total_items = 0)
{
$this->instance = $instance;
$this->total_per_page = $total_per_page;
$this->total_items = $total_items;
//calculate some more basic vars
$this->total_pages = ceil($total_items / $total_per_page);
$this->current_page = doArgs($instance, 1, $_GET, 'is_number');
//check that the current page is not over the max pages
if ($this->current_page > $this->total_pages) {
$this->current_page = $this->total_pages;
}
//check that the current page is not below 0
if ($this->current_page < 1) {
$this->current_page = 1;
}
}
示例12: _geshiHighlight
function _geshiHighlight($content, $language = '')
{
$langauge = is_empty($language) ? 'text' : strtolower($language);
$langInfo = grabLangInfo($language);
$ext = doArgs('ext', null, $langInfo);
$language = doArgs('lang', null, $langInfo);
$geshiExt = doArgs('geshi', null, $langInfo);
if (is_empty($content)) {
return false;
}
$content = trim($content);
$content = htmlspecialchars_decode($content, ENT_NOQUOTES);
$geshi = Core_Classes_coreObj::getLib('GeSHi', array($content, $geshiExt));
$geshi->set_header_type(GESHI_HEADER_PRE);
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5);
$content = $geshi->parse_code();
return "\n<div class=\"markdown_code\">\n<div class=\"markdown_code_body\">" . $content . "</div>\n</div>\n";
}
示例13: themes
/**
* Outputs a table with currently detected themes in
*
* @version 1.0
* @since 1.0.0
* @author Dan Aldridge
*
* @return void
*/
public function themes()
{
$objForm = Core_Classes_coreObj::getForm();
$objTPL = Core_Classes_coreObj::getTPL();
$objTPL->set_filenames(array('body' => cmsROOT . Core_Classes_Page::$THEME_ROOT . 'block.tpl', 'table' => cmsROOT . 'modules/core/views/admin/themes/manageTable.tpl'));
$dir = cmsROOT . 'themes';
$tpls = getFiles($dir);
//echo dump($tpls);
foreach ($tpls as $tpl) {
if ($tpl['type'] !== 'dir') {
continue;
}
$tplName = secureMe($tpl['name'], 'alphanum');
$details = $this->getDetails($tplName);
//echo dump($details, $tplName);
$objTPL->assign_block_vars('theme', array('NAME' => doArgs('name', 'N/A', $details), 'VERSION' => doArgs('version', '0.0', $details), 'ENABLED' => 'true', 'COUNT' => '9001', 'MODE' => doArgs('mode', 'N/A', $details), 'AUTHOR' => doArgs('author', 'N/A', $details)));
}
$objTPL->parse('table', false);
Core_Classes_coreObj::getAdminCP()->setupBlock('body', array('cols' => 3, 'vars' => array('TITLE' => 'Theme Management', 'CONTENT' => $objTPL->get_html('table', false), 'ICON' => 'fa-icon-user')));
}
示例14: getComments
/**
* Grabs all avalible comments for the requested module and id
*
* @version 1.0
* @since 1.0.0
* @author Richard Clifford, Dan Aldridge
*
* @param string $tplVar
*/
function getComments($tplVar)
{
$objTPL = coreObj::getTPL();
$objUser = coreObj::getUser();
$objSQL = coreObj::getDBO();
//set the template for the comments
$objTPL->set_filenames(array('comments' => 'modules/core/template/comments/viewComments.tpl'));
if (User::$IS_ONLINE) {
$dontShow = false;
switch ($_GET['mode']) {
case 'postComment':
if (HTTP_POST) {
if (doArgs('comment_' . $this->getVar('module_id'), false, $_SESSION[$this->module]) != $_POST['sessid']) {
trigger_error('Error: Cant remember where you were posting to.');
} else {
$comment = $this->insertComment($this->getVar('module'), $this->getVar('module_id'), $objUser->grab('id'), $_POST['comment']);
if (!$comment) {
trigger_error('Error: Your comment wasnt posted, please try again.');
}
unset($_SESSION[$module]);
}
$dontShow = true;
}
break;
case 'ajPostComment':
if (HTTP_AJAX && HTTP_POST) {
if (doArgs('comment_' . $this->getVar('module_id'), false, $_SESSION[$this->getVar('module')]) != $_POST['sessid']) {
die('1 <script>console.log(' . json_encode(array('comment_' . $this->getVar('module_id'), $_SESSION[$this->getVar('module')], $_POST['sessid'], $_POST)) . ');</script>');
} else {
$comment = $this->insertComment($this->getVar('module'), $this->getVar('module_id'), $objUser->grab('id'), $_POST['comment']);
if (!$comment) {
die('0');
}
echo $this->getLastComment($comment);
}
exit;
}
break;
case 'deleteComment':
$id = doArgs('id', 0, $_GET, 'is_number');
$query = $objSQL->queryBuilder()->select('*')->from('#__comments')->where('id', '=', $id)->build();
$comment = $objSQL->query($query);
if (!$comment) {
msg('FAIL', 'Error: Comment not found.', '_ERROR');
break;
}
//check if user has perms
if (User::$IS_ADMIN || User::$IS_MOD || User::$IS_ONLINE && ($objUser->grab('id') == $comments['author'] || $objUser->grab('id') == $this->getVar('author_id'))) {
//do teh the delete
$log = 'Comments System: ' . $objUser->profile($objUser->grab('id'), RAW) . ' deleted comment from <a href="' . $this->aURL[1] . '">this</a>.';
$deleteQuery = $objSQL->queryBuilder()->deleteFrom('#__comments')->where('id', '=', $id)->build();
$delete = $objSQL->query($deleteQuery);
if (!$delete) {
trigger_error('Error: The comment was not deleted.');
} else {
msg('INFO', 'The comment was successfully deleted.');
}
}
break;
case 'ajDelComment':
if (HTTP_AJAX && HTTP_POST) {
$id = doArgs('id', 0, $_GET, 'is_number');
$commentQuery = $objSQL->queryBuilder()->select('*')->from('#__comments')->where('id', '=', $id)->build();
$comment = $objSQL->fetchLine($commentQuery);
if (!$comment) {
die('-1');
}
//check if user has perms
if (User::$IS_ADMIN || User::$IS_MOD || User::$IS_ONLINE && ($objUser->grab('id') == $comments['author'] || $objUser->grab('id') == $this->getVar('author_id'))) {
//do teh the delete
$log = 'Comments System: ' . $this->objUser->profile($this->objUser->grab('id'), RAW) . ' deleted comment from <a href="' . $this->aURL[1] . '">this</a>.';
$deleteQuery = $objSQL->queryBuilder()->deleteFrom('#__comments')->where('id', '=', $id)->build();
$delete = $objSQL->query($deleteQuery);
die(!$delete ? '0' : '1');
}
} else {
die('-1');
}
die('0');
break;
}
//make sure the submit form only shows when we want it to
if (!$dontShow) {
$this->makeSubmitForm();
}
}
//get a comments count for this module and id
$commentsCount = $this->getCount();
// TODO: fix the pagination
echo dump($this->getCount(), 'GetCount');
$comPagniation = coreObj::getPagination('commentsPage', $this->perPage, $commentsCount);
//.........这里部分代码省略.........
示例15: checkPermissions
/**
* Returns permission state for given user and group
*
* @version 1.0
* @since 1.0.0
* @author xLink
*
* @param int $uid UserID
* @param int $group GUEST, USER, MOD, or ADMIN
*
* @return bool True/False on successful check, -1 on unknown group
*/
public function checkPermissions($uid, $group = 0)
{
$group = (int) $group;
//make sure we have a group to check against
if (is_empty($group) || $group == 0 || $group == GUEST) {
return true;
}
//check to see whether we have a user id to check against..
if (is_empty($uid)) {
return false;
}
//grab the user level if possible
$userlevel = GUEST;
if (self::$IS_ONLINE) {
$userlevel = $this->getUserInfo($uid, 'userlevel');
}
//see which group we are checking for
switch ($group) {
case GUEST:
if (!self::$IS_ONLINE) {
return true;
}
break;
case USER:
if (self::$IS_ONLINE) {
return true;
}
break;
case MOD:
if ($userlevel == MOD) {
return true;
}
break;
case ADMIN:
if ($userlevel == ADMIN) {
if (LOCALHOST) {
return true;
}
if (doArgs('adminAuth', false, $_SESSION['acp'])) {
return true;
}
}
break;
//no idea what they tried to check for, so we'll return something unexpected too
//no idea what they tried to check for, so we'll return something unexpected too
default:
return -1;
break;
}
//if we are an admin then give them mod powers regardless
if (($group == MOD || $group == USER) && $userlevel == ADMIN) {
return true;
}
//apparently the checks didnt return true, so we'll go for false
return false;
}