本文整理汇总了PHP中RMFunctions::get方法的典型用法代码示例。如果您正苦于以下问题:PHP RMFunctions::get方法的具体用法?PHP RMFunctions::get怎么用?PHP RMFunctions::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RMFunctions
的用法示例。
在下文中一共展示了RMFunctions::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_available_updates
function show_available_updates()
{
global $rmTpl, $rmEvents, $updfile, $xoopsSecurity;
$rmFunc = RMFunctions::get();
$rmUtil = RMUtilities::get();
$tf = new RMTimeFormatter('', '%T% %d%, %Y% at %h%:%i%');
if (is_file($updfile)) {
$updates = unserialize(base64_decode(file_get_contents($updfile)));
}
$rmTpl->add_style('updates.css', 'rmcommon');
$rmTpl->add_script('updates.js', 'rmcommon');
$rmTpl->add_head_script('var xoToken = "' . $xoopsSecurity->createToken() . '";');
$rmTpl->add_head_script('var langUpdated = "' . __('Item updated!', 'rmcommon') . '";');
$rmTpl->add_help(__('Updates Help', 'rmcommon'), 'http://www.xoopsmexico.net/docs/common-utilities/actualizaciones-automaticas/standalone/1/');
$ftpserver = parse_url(XOOPS_URL);
$ftpserver = $ftpserver['host'];
$pathinfo = parse_url(XOOPS_URL);
$ftpdir = str_replace($pathinfo['scheme'] . '://' . $pathinfo['host'], '', XOOPS_URL);
unset($pathinfo);
RMBreadCrumb::get()->add_crumb(__('Available Updates', 'rmcommon'));
$rmTpl->assign('xoops_pagetitle', __('Available Updates', 'rmcommon'));
xoops_cp_header();
include $rmTpl->get_template('rmc-updates.php', 'module', 'rmcommon');
xoops_cp_footer();
}
示例2: eventRmcommonGetAvatar
/**
* This function allows to other modules or plugins get gravatars
* by passing an email address and other options
*/
public function eventRmcommonGetAvatar($email, $size = 0, $default = '')
{
$config = RMFunctions::get()->plugin_settings('avatars', true);
$size = $size <= 0 ? $size = $config['size'] : $size;
$default = $default == '' ? $config['default'] : $default;
$avatar = "http://www.gravatar.com/avatar/" . md5($email) . "?s=" . $size . '&d=' . $default;
return $avatar;
}
示例3: settings
public function settings($name = '')
{
$settings = empty($this->settings) ? RMFunctions::get()->plugin_settings($this->get_info('dir'), true) : $this->settings;
if (isset($settings[$name])) {
return $settings[$name];
}
return $settings;
}
示例4: check
public function check()
{
$config = RMFunctions::get()->plugin_settings('recaptcha', true);
include_once RMCPATH . '/plugins/recaptcha/recaptchalib.php';
$privatekey = $config['private'];
$resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
return $resp->is_valid;
}
示例5: dt_block_categories
function dt_block_categories($options)
{
include_once XOOPS_ROOT_PATH . '/modules/dtransport/class/dtcategory.class.php';
$rmu = RMUtilities::get();
$rmf = RMFunctions::get();
$mc = $rmu->module_config('dtransport');
$url = $rmf->current_url();
$rpath = parse_url($url);
$xpath = parse_url(XOOPS_URL);
if ($mc['permalinks']) {
$params = trim(str_replace($xpath['path'] . '/' . trim($mc['htbase'], '/'), '', rtrim($rpath['path'], "/")), '/');
$search = array('category', 'publisher', 'recents', 'popular', 'rated', 'updated');
if ($params == '') {
$params = array();
} else {
$params = explode("/", trim($params));
}
if (!empty($params) && $params[0] == 'category') {
$db = XoopsDatabaseFactory::getDatabaseConnection();
$params = explode("page", implode("/", array_slice($params, 1)));
$path = explode("/", $params[0]);
foreach ($path as $k) {
if ($k == '') {
continue;
}
$category = new DTCategory();
$sql = "SELECT * FROM " . $db->prefix("dtrans_categos") . " WHERE nameid='{$k}' AND parent='{$idp}'";
$result = $db->query($sql);
if ($db->getRowsNum($result) > 0) {
$row = $db->fetchArray($result);
$idp = $row['id_cat'];
$category->assignVars($row);
} else {
$dtfunc->error_404();
}
}
} else {
$category = new DTCategory();
}
}
$tpl = RMTemplate::get();
$tpl->add_xoops_style('blocks.css', 'dtransport');
include_once XOOPS_ROOT_PATH . '/modules/dtransport/class/dtfunctions.class.php';
$categories = array();
$dtfunc = new DTFunctions();
$dtfunc->getCategos($categories, 0, $category->id(), array(), false, 1);
$block = array();
foreach ($categories as $cat) {
if ($cat['jumps'] > $options[0] - 1 && $options[0] > 0) {
continue;
}
$block['categories'][] = $cat;
}
if (!$category->isNew()) {
$block['parent'] = array('name' => $category->name(), 'link' => $category->permalink());
}
return $block;
}
示例6: get_html
private function get_html()
{
$config = RMFunctions::get()->plugin_settings('ayah', true);
self::set_config();
require_once RMCPATH . '/plugins/ayah/include/ayah.php';
$ayah = new AYAH();
$ayah->debug_mode($config['debug']);
return $ayah->getPublisherHTML();
}
示例7: check
public function check()
{
$config = RMFunctions::get()->plugin_settings('recaptcha', true);
$this->set_config();
include_once RMCPATH . '/plugins/ayah/include/ayah.php';
$ayah = new AYAH();
$ayah->debug_mode($config['debug']);
$resp = $ayah->scoreResult();
return $resp;
}
示例8: eventRmcommonCaptchaCheck
public function eventRmcommonCaptchaCheck($value)
{
global $xoopsUser;
$config = RMFunctions::get()->plugin_settings('recaptcha', true);
if ($xoopsUser && $xoopsUser->isAdmin() && !$config['show']) {
return $value;
}
include_once RMCPATH . '/plugins/recaptcha/recaptchalib.php';
$privatekey = $config['private'];
$resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
return $resp->is_valid;
}
示例9: __construct
/**
* @param string $caption Texto del campo
* @param string $name Nombre de este campo
* @param string $width Ancho del campo. Puede ser el valor en formato pixels (300px) o en porcentaje (100%)
* @param string $height Alto de campo. El valor debe ser pasado en formato pixels (300px).
* @param string $default Texto incial al cargar el campo. POr defecto se muestra vaco.
* @param string $type Tipo de Editor. Posibles valores: FCKeditor, DHTML
*/
function __construct($caption, $name, $width = '100%', $height = '300px', $default = '', $type = '', $change = 1, $ele = array('op'))
{
$rmc_config = RMFunctions::get()->configs();
$tcleaner = TextCleaner::getInstance();
$this->setCaption($caption);
$this->setName($name);
$this->_width = $width;
$this->_height = $height;
$this->_default = isset($_REQUEST[$name]) ? $tcleaner->stripslashes($_REQUEST[$name]) : $tcleaner->stripslashes($default);
$this->_type = $type == '' ? $rmc_config['editor_type'] : $type;
$this->_type = strtolower($this->_type);
$this->_change = $change;
$this->_eles = $ele;
}
示例10: eventRmcommonGetStyles
public function eventRmcommonGetStyles($styles)
{
$rmf = RMFunctions::get();
$config = $rmf->plugin_settings('minifier', true);
if (!$config['enable']) {
return $styles;
}
$mini = array();
foreach ($styles as $id => $style) {
$url = parse_url($style['url']);
$info = pathinfo($url['path']);
$path = str_replace($info['basename'], '', $url['path']);
$identifier = sprintf("%u", crc32($path . $style['media']));
$add = !isset($mini[$identifier]) ? RMCURL . '/plugins/minifier/min/f=' . $url['path'] : $mini[$identifier]['url'] . ',' . $url['path'];
$mini[$identifier] = array('url' => $add, 'type' => $style['type'], 'media' => $style['media'], 'rel' => 'stylesheet');
}
return $mini;
}
示例11: eventMywordsViewPost
/**
* This method is designed specially for MyWords
*/
public function eventMywordsViewPost($post_data, MWPost $post)
{
$config = RMFunctions::get()->plugin_settings('metaseo', true);
if (!$config['meta']) {
$metas = '<meta name="description" content="' . TextCleaner::truncate($post->content(true), $config['len']) . '" />';
$tags = array();
foreach ($post->tags() as $tag) {
$tags[] = $tag['tag'];
}
$tags = implode(',', $tags);
$metas .= '<meta name="keywords" content="' . $tags . '" />';
} else {
$metas = '<meta name="description" content="' . $post->get_meta($config['meta_name'], false) . '" />';
$metas = '<meta name="description" content="' . $post->get_meta($config['meta_keys'], false) . '" />';
}
RMTemplate::get()->add_head($metas);
return $post_data;
}
示例12: showScreens
/**
* @des Visualiza todas las pantallas existentes
**/
function showScreens()
{
global $xoopsModule, $xoopsSecurity, $tpl, $functions, $xoopsModule, $xoopsModuleConfig, $xoopsUser, $xoopsConfig;
define('RMCSUBLOCATION', 'screenshots');
if ($xoopsConfig['closesite']) {
showMessage(__('Screenshop uploader does not work when site is closed. Before to start uploding, please change this configuration.', 'rmcommon'), RMMSG_WARN);
}
$db = XoopsDatabaseFactory::getDatabaseConnection();
$tc = TextCleaner::getInstance();
$item = rmc_server_var($_REQUEST, 'item', 0);
if ($item <= 0) {
redirectMsg('items.php', __('Download item ID not provided!', 'dtransport'), RMMSG_WARN);
}
$sw = new DTSoftware($item);
$sql = "SELECT * FROM " . $db->prefix('dtrans_screens') . " WHERE id_soft={$item}";
$result = $db->queryF($sql);
while ($rows = $db->fetchArray($result)) {
$sc = new DTScreenshot();
$sc->assignVars($rows);
$screens[] = array('id' => $sc->id(), 'title' => $sc->title(), 'desc' => substr($tc->clean_disabled_tags($sc->desc()), 0, 80) . "...", 'image' => XOOPS_UPLOAD_URL . '/screenshots/' . date('Y', $sc->date()) . '/' . date('m', $sc->date()) . '/ths/' . $sc->image());
}
// CSS Styles
$tpl->add_style('admin.css', 'dtransport');
$tpl->add_style('screens.css', 'dtransport');
$tpl->add_style('uploadify.css', 'rmcommon');
// Javascripts
$tpl->add_local_script('swfobject.js', 'rmcommon', 'include');
$tpl->add_local_script('jquery.uploadify.js', 'rmcommon', 'include');
$tpl->add_local_script('screens.js', 'dtransport');
$tc = TextCleaner::getInstance();
$rmf = RMFunctions::get();
ob_start();
include DT_PATH . '/js/screenshots.js';
$script = ob_get_clean();
$tpl->add_head_script($script);
$functions->toolbar();
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » <a href='items.php'>" . __('Downloads', 'dtransport') . "</a> » " . __('Screenshots Management', 'dtransport'));
$tpl->assign('xoops_pagetitle', sprintf(__("%s Screenshots", 'dtransport'), $sw->getVar('name')));
include DT_PATH . '/include/js_strings.php';
xoops_cp_header();
include $tpl->get_template('admin/dtrans_screens.php', 'module', 'dtransport');
xoops_cp_footer();
}
示例13: eventRmcommonCheckPostSpam
/**
* This event check spam in comments, posts and other contents for modules
*
* @param array All params to check (blogurl, name, email, url, text, permalink)
* @return bool
*/
public function eventRmcommonCheckPostSpam($params)
{
$config = RMFunctions::get()->plugin_settings('akismet', true);
if ($config['key'] == '') {
return;
}
extract($params);
$akismet = new Akismet($blogurl, $config['key']);
$akismet->setCommentAuthor($name);
$akismet->setCommentAuthorEmail($email);
$akismet->setCommentAuthorURL($url);
$akismet->setCommentContent($text);
$akismet->setPermalink($permalink);
$akismet->setUserIP($_SERVER['REMOTE_ADDR']);
if ($akismet->isCommentSpam()) {
return false;
}
return true;
}
示例14: show_groups_list
/**
* Shows existing groups
*/
function show_groups_list()
{
global $xoopsDB;
define('RMCSUBLOCATION', 'allgroups');
list($total) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("groups_users_link")));
$navigation = new RMPageNav($total, 20, RMHttpRequest::get('page', 'integer', 1));
$navigation->target_url(RMCURL . '/users.php?action=groups&page={PAGE_NUM}');
$sql = "SELECT g.*, (SELECT COUNT(*) FROM " . $xoopsDB->prefix("groups_users_link") . "\n WHERE groupid = g.groupid) as total_users FROM " . $xoopsDB->prefix("groups") . " as g ORDER BY g.name\n LIMIT " . $navigation->start() . ", 20";
$result = $xoopsDB->query($sql);
$groups = array();
while ($row = $xoopsDB->fetchArray($result)) {
$groups[] = (object) $row;
}
$bc = RMBreadCrumb::get();
$bc->add_crumb(__('Users Management', 'rmcommon'), RMCURL . '/users.php');
$bc->add_crumb(__('Groups', 'rmcommon'));
RMTemplate::get()->assign('xoops_pagetitle', __('Groups Management', 'rmcommon'));
RMFunctions::get()->create_toolbar();
RMTemplate::get()->add_script('cu-groups.js', 'rmcommon', array('footer' => 1));
include RMCPATH . '/js/cu-js-language.php';
RMTemplate::get()->header();
include RMTemplate::get()->get_template('rmc-groups.php', 'module', 'rmcommon');
RMTemplate::get()->footer();
}
示例15: render
public function render()
{
$script = "<script type='text/javascript'>\n";
$script .= "var lburl = '" . RMCURL . "/plugins/lightbox';\n";
$config = RMFunctions::get()->plugin_settings('lightbox', true);
$params = "{";
$params .= "transition:'{$config['transition']}'";
$params .= ",speed:{$config['speed']}";
$params .= $config['width'] != '' ? ",maxWidth:'{$config['width']}'" : '';
$params .= $config['height'] != '' ? ",maxHeight:'{$config['height']}'" : '';
$params .= ",scalePhotos:{$config['scale']}";
$params .= ",loop:" . ($config['loop'] ? 'true' : 'false');
if ($config['slideshow']) {
$params .= ",slideshow:true";
$params .= ",slideshowSpeed:" . $config['slspeed'];
$params .= ",slideshowStart:'" . __('Start Slideshow', 'lightbox') . "'";
$params .= ",slideshowStop:'" . __('Stop Slideshow', 'lightbox') . "'";
}
$params .= $config['configs'] != '' ? ",{$config['configs']}" : '';
$params .= "}";
$script .= "var lb_params = " . $params . ";\n";
if (!defined('RM_LB_PARAMS')) {
define('RM_LB_PARAMS', 1);
}
$script .= "\$(function(){\n";
if (is_array($this->elements)) {
foreach ($this->elements as $element) {
$script .= "\$(\"{$element}\").colorbox(lb_params);\n";
}
} else {
$script .= "\$(\"{$this->elements}\").colorbox(lb_params);\n";
}
$script .= "});\n</script>\n";
RMTemplate::get()->add_local_script('jquery.colorbox-min.js', 'rmcommon', 'plugins/lightbox');
return $script;
}