本文整理汇总了PHP中RMUtilities::get方法的典型用法代码示例。如果您正苦于以下问题:PHP RMUtilities::get方法的具体用法?PHP RMUtilities::get怎么用?PHP RMUtilities::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RMUtilities
的用法示例。
在下文中一共展示了RMUtilities::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: permalink
/**
* Obtiene el enlace a la categor?a
*/
public function permalink()
{
$mc = RMUtilities::get()->module_config('mywords');
$link = MWFunctions::get_url();
$link .= $mc['permalinks'] == 1 ? '?cat=' . $this->id() : ($mc['permalinks'] == 2 ? 'category/' . $this->path() : 'category/' . $this->id());
return $link;
}
示例2: permalink
public function permalink()
{
$mc = RMUtilities::get()->module_config('mywords');
$rtn = MWFunctions::get_url();
$rtn .= $mc['permalinks'] == 1 ? '?author=' . $this->id() : ($mc['permalinks'] == 2 ? "author/" . $this->getVar('shortname', 'n') . "/" : "author/" . RMUtilities::add_slash($this->id()));
return $rtn;
}
示例3: 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;
}
示例4: permalink
public function permalink()
{
$rmu = RMUtilities::get();
$mc = $rmu->module_config('dtransport');
if ($mc['permalinks']) {
return XOOPS_URL . '/' . trim($mc['htbase'], '/') . '/platform/' . $this->nameId() . '/';
} else {
return XOOPS_URL . '/modules/dtransport/index.php?p=platform&id=' . $this->id();
}
}
示例5: bxpress_recents_show
function bxpress_recents_show($options)
{
$util = RMUtilities::get();
$tc = TextCleaner::getInstance();
$db = XoopsDatabaseFactory::getDatabaseConnection();
$xoopsModuleConfig = $util->module_config('exmbb');
$mc = RMUtilities::module_config('bxpress');
$tbl1 = $db->prefix('bxpress_posts');
$tbl2 = $db->prefix('bxpress_topics');
$tbl3 = $db->prefix('bxpress_posts_text');
$tbl4 = $db->prefix('bxpress_forums');
$sql = "SELECT MAX(id_post) AS id FROM {$tbl1} WHERE approved=1 GROUP BY id_topic ORDER BY MAX(id_post) DESC LIMIT 0,{$options['0']}";
$result = $db->queryF($sql);
$topics = array();
$block = array();
include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxforum.class.php';
include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxpost.class.php';
include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxtopic.class.php';
include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxfunctions.class.php';
$post = new bXPost();
$forum = new bXForum();
$tf = new RMTimeFormatter(0, '%T%-%d%-%Y% at %h%:%i%');
while ($row = $db->fetchArray($result)) {
$post = new bXPost($row['id']);
$topic = new bXTopic($post->topic());
$forum = new bXForum($post->forum());
$ret = array();
$ret['id'] = $topic->id();
$ret['post'] = $post->id();
$ret['link'] = $post->permalink();
if ($options[2]) {
$ret['date'] = $tf->format($post->date());
}
if ($options[3]) {
$ret['poster'] = sprintf(__('Posted by: %s', 'bxpress'), "<a href='" . $post->permalink() . "'>" . $post->uname() . "</a>");
}
$ret['title'] = $topic->title();
if ($options[4]) {
$ret['text'] = $tc->clean_disabled_tags($post->text());
}
$ret['forum'] = array('id' => $forum->id(), 'name' => $forum->name(), 'link' => $forum->permalink());
$topics[] = $ret;
}
// Opciones
$block['showdates'] = $options[2];
$block['showuname'] = $options[3];
$block['showtext'] = $options[4];
$block['topics'] = $topics;
$block['lang_topic'] = __('Topic', 'bxpress');
$block['lang_date'] = __('Date', 'bxpress');
$block['lang_poster'] = __('Poster', 'bxpress');
return $block;
}
示例6: get_url
/**
* Get correct base url for links
*/
function get_url()
{
global $xoopsModule, $xoopsModuleConfig;
if (!$xoopsModule || $xoopsModule->dirname() != 'shop') {
$mc = RMUtilities::get()->module_config('shop');
} else {
$mc = $xoopsModuleConfig;
}
if ($mc['urlmode']) {
$ret = XOOPS_URL . '/' . trim($mc['htbase'], "/") . '/';
} else {
$ret = XOOPS_URL . '/modules/shop/';
}
return $ret;
}
示例7: __construct
/**
* Constructor
* @param <string> $caption
* @param <string> $name Nombre identificador del campo
* @param <string> $date Fecha en formato 'yyyy-mm-14'
*/
function __construct($caption, $name, $date = '', $showtime = 0)
{
$this->setCaption($caption);
$this->setName($name);
$this->_date = $date;
$this->_showtime = $showtime;
if (!defined('RM_FRAME_DATETIME_CREATED')) {
define('RM_FRAME_DATETIME_CREATED', 1);
}
// Necesario para incluir el script de fechas
if (!defined('SCRIPT_PROTOTYPE_INCLUDED')) {
$util =& RMUtilities::get();
}
if (defined('EXM_IS_CP') && EXM_IS_CP == true) {
// This class must be instantiated before that the method ExmGUI::cp_head();
RMTemplate::get()->add_script(RMCURL . '/include/js/dates.js');
}
}
示例8: makeHeader
/**
* @desc Crea la cabecera del módulo
*/
public function makeHeader($title = '')
{
global $xoopsTpl, $xoopsUser;
$func = RMUtilities::get();
$mc = $func->module_config('dtransport');
$xoopsTpl->assign('dt_header_title', $title);
$header = array('cansubmit' => $this->canSubmit(), 'searchlink' => $mc['permalinks'] ? DT_URL . '/' . trim($mc['htbase'], '/') . '/search/' : DT_URL . '/?p=search');
$header['links'][] = array('title' => __('Downloads', 'dtransport'), 'link' => DT_URL);
$header['links'][] = array('title' => __('My Downloads', 'dtransport'), 'link' => $mc['permalinks'] ? DT_URL . '/cp/' : DT_URL . '/?p=cpanel');
if ($this->canSubmit()) {
$header['links'][] = array('title' => __('Submit Download', 'dtransport'), 'link' => $mc['permalinks'] ? DT_URL . '/submit/' : DT_URL . '/?p=explore&f=submit');
}
$header['links'][] = array('title' => __('Recent Downloads', 'dtransport'), 'link' => $mc['permalinks'] ? DT_URL . '/recent/' : DT_URL . '/?p=explore&f=recent');
$header['links'][] = array('title' => __('Popular Downloads', 'dtransport'), 'link' => $mc['permalinks'] ? DT_URL . '/popular/' : DT_URL . '/?p=explore&f=popular');
$header['links'][] = array('title' => __('Best Rated', 'dtransport'), 'link' => $mc['permalinks'] ? DT_URL . '/rated/' : DT_URL . '/?p=explore&f=rated');
$ev = RMEvents::get();
$header = $ev->run_event("dtransport.make.header", $header);
$xoopsTpl->assign('header', $header);
$tpl = RMTemplate::get();
$tpl->add_xoops_style('main.css', 'dtransport');
return true;
}
示例9: gsSearch
/**
* @desc Realiza una búsqueda en el módulo desde EXM
*/
function gsSearch($queryarray, $andor, $limit, $offset, $userid)
{
global $db, $myts;
include_once XOOPS_ROOT_PATH . "/modules/galleries/class/gsimage.class.php";
include_once XOOPS_ROOT_PATH . "/modules/galleries/class/gsuser.class.php";
$mc = RMUtilities::get()->module_config('galleries');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT DISTINCT c.* FROM " . $db->prefix('gs_tags') . " a INNER JOIN " . $db->prefix('gs_tagsimages') . " b INNER JOIN ";
$sql .= $db->prefix('gs_images') . " c ON (";
$sql .= "a.id_tag=b.id_tag AND b.id_image=c.id_image AND c.public=2 AND (";
$sql1 = '';
foreach ($queryarray as $k) {
$sql1 .= ($sql1 == '' ? "" : "{$andor}") . " (a.tag LIKE '%{$k}%' OR c.title LIKE '%{$k}%') ";
}
$sql1 .= "))";
$sql1 .= " ORDER BY c.created DESC LIMIT {$offset}, {$limit}";
$result = $db->queryF($sql . $sql1);
$ret = array();
$users = array();
while ($row = $db->fetchArray($result)) {
$img = new GSImage();
$img->assignVars($row);
if (!isset($users[$img->owner()])) {
$users[$img->owner()] = new GSUser($img->owner(), 1);
}
$rtn = array();
$rtn['image'] = 'images/images.png';
$link = $mc['urlmode'] ? "usr/" . $users[$img->owner()]->uname() . "/img/" . $img->id() : "user.php?id=" . "usr/" . $users[$img->owner()]->uname() . "/img/" . $img->id();
$rtn['title'] = $img->title();
$rtn['time'] = $img->created();
$rtn['uid'] = $img->owner();
$rtn['desc'] = $img->desc();
$rtn['link'] = $link;
$ret[] = $rtn;
}
return $ret;
}
示例10: mywords_search
/**
* Función para realizar búsquedas
*/
function mywords_search($qa, $andor, $limit, $offset, $userid)
{
global $xoopsUser;
$db = XoopsDatabaseFactory::getDatabaseConnection();
include_once XOOPS_ROOT_PATH . '/modules/mywords/class/mwpost.class.php';
$util =& RMUtilities::get();
$mc =& $util->module_config('mywords');
$sql = "SELECT * FROM " . $db->prefix("mw_posts");
$adds = '';
if (is_array($qa) && ($count = count($qa))) {
$adds = '';
for ($i = 0; $i < $count; $i++) {
$adds .= $adds == '' ? "(title LIKE '%{$qa[$i]}%' OR content LIKE '%{$qa[$i]}%')" : " {$andor} (title LIKE '%{$qa[$i]}%' OR content LIKE '%{$qa[$i]}%')";
}
}
$sql .= $adds != '' ? " WHERE " . $adds : '';
if ($userid > 0) {
$sql .= ($adds != '' ? " AND " : " WHERE ") . "author='{$userid}'";
}
$sql .= " ORDER BY pubdate DESC";
$i = 0;
$result = $db->query($sql, $limit, $offset);
$ret = array();
while ($row = $db->fetchArray($result)) {
$post = new MWPost();
$post->assignVars($row);
$ret[$i]['image'] = "images/post.png";
$ret[$i]['link'] = $post->permalink();
$ret[$i]['title'] = $post->getVar('title');
$ret[$i]['time'] = $post->getVar('pubdate');
$ret[$i]['uid'] = $post->getVar('author');
$ret[$i]['desc'] = substr(strip_tags($post->content()), 0, 150);
$i++;
}
return $ret;
}
示例11: mywordsBlockCats
function mywordsBlockCats($options)
{
global $xoopsModuleConfig, $xoopsModule;
$categos = array();
MWFunctions::categos_list($categos, 0, 0, $options[0]);
$block = array();
$mc = $xoopsModule && $xoopsModule->getVar('dirname') == 'mywords' ? $xoopsModuleConfig : RMUtilities::get()->module_config('mywords');
foreach ($categos as $k) {
$ret = array();
$cat = new MWCategory();
$cat->assignVars($k);
$cat->loadPosts();
$ret['id'] = $cat->id();
$ret['name'] = $cat->getVar('name');
if (isset($options[1]) && $options[1]) {
$ret['posts'] = $cat->getVar('posts');
}
$ret['indent'] = $k['indent'] * 2;
$ret['link'] = $cat->permalink();
$block['categos'][] = $ret;
}
RMTemplate::get()->add_xoops_style('mwblocks.css', 'mywords');
return $block;
}
示例12: permalink
/**
* Obtiene el enlace permanente al artículo
*/
public function permalink()
{
$mc = RMUtilities::get()->module_config('mywords');
$day = date('d', $this->getVar('pubdate'));
$month = date('m', $this->getVar('pubdate'));
$year = date('Y', $this->getVar('pubdate'));
$rtn = MWFunctions::get_url();
$rtn .= $mc['permalinks'] == 1 ? '?post=' . $this->id() : ($mc['permalinks'] == 2 ? "{$day}/{$month}/{$year}/" . $this->getVar('shortname', 'n') . "/" : "post/" . $this->id());
return $rtn;
}
示例13: dt_show_files
/**
* Muestra las características existentes de una descarga
*/
function dt_show_files($edit = 0)
{
global $xoopsOption, $db, $tpl, $xoopsTpl, $xoopsUser, $mc, $dtfunc, $page, $item, $xoopsConfig, $xoopsModuleConfig, $file;
include 'header.php';
$dtfunc->cpHeader($item, sprintf(__('%s files', 'dtransport'), $item->getVar('name')));
if ($file > 0 && $edit) {
$file = new DTFile($file);
if ($file->isNew() || $file->software() != $item->id()) {
redirect_header(DT_URL . ($mc['permalinks'] ? '/cp/files/' . $item->id() . '/' : '/?p=cpanel&action=files&id=' . $item->id()), 1, __('Specified feature does not exists!', 'dtransport'));
}
}
$tc = TextCleaner::getInstance();
$tf = new RMTimeFormatter('', "%m%/%d%/%Y% %h%:%i%");
$rmu = RMUtilities::get();
$tfiles = $db->prefix('dtrans_files');
$tgroup = $db->prefix('dtrans_groups');
$sql = "SELECT * FROM {$tfiles} WHERE id_soft=" . $item->id();
$gcache = array();
$result = $db->queryF($sql);
while ($rows = $db->fetchArray($result)) {
$fl = new DTFile();
$fl->assignVars($rows);
if (!isset($gcache[$fl->group()])) {
$gcache[$fl->group()] = new DTFileGroup($fl->group());
}
$group = $gcache[$fl->group()];
$xoopsTpl->append('files', array('id' => $fl->id(), 'title' => $fl->title(), 'date' => $tf->format($fl->date()), 'software' => $item->getVar('name'), 'remote' => $fl->remote(), 'size' => $rmu->formatBytesSize($fl->size()), 'hits' => $fl->hits(), 'date' => $tf->format($fl->date()), 'group' => $group->isNew() ? '' : $group->name(), 'links' => array('edit' => DT_URL . ($mc['permalinks'] ? '/cp/files/' . $item->getVar('nameid') . '/edit/' . $fl->id() . '/' : '/?p=cpanel&id=' . $item->id() . '&action=files&feature=' . $fl->id()), 'delete' => DT_URL . ($mc['permalinks'] ? '/cp/files/' . $item->getVar('nameid') . '/delete/' . $fl->id() . '/' : '/?p=cpanel&id=' . $item->id() . '&action=delete&feature=' . $fl->id()))));
}
$formurl = DT_URL . ($mc['permalinks'] ? '/cp/files/' . $item->id() . '/save/' . ($edit ? $file->id() : '0') . '/' : '/p=cpanel');
// files Form
$form = new RMForm($edit ? sprintf(__('Editing file of "%s"', 'dtransport'), $item->getVar('name')) : sprintf(__('New file for "%s"', 'dtransport'), $item->getVar('name')), 'frmFile', $formurl);
$form->setExtra('enctype="multipart/form-data"');
$form->addElement(new RMFormLabel(__('Download item', 'dtransport'), $item->getVar('name')));
$form->addElement(new RMFormText(__('File title', 'dtransport'), 'title', 50, 200, $edit ? $file->title() : ''), true);
//Lista de grupos
$sql = "SELECT * FROM " . $db->prefix('dtrans_groups') . " WHERE id_soft=" . $item->id();
$result = $db->query($sql);
$groups = array();
while ($rows = $db->fetchArray($result)) {
$group = new DTFileGroup();
$group->assignVars($rows);
$groups[] = array('id' => $group->id(), 'name' => $group->name());
}
$ele = new RMFormSelect(__('Group', 'dtransport'), 'group', 0, $edit ? $file->group() : '');
$ele->addOption('', __('Select group...', 'dtransport'));
foreach ($groups as $group) {
$ele->addOption($group['id'], $group['name']);
}
$form->addElement($ele);
$form->addElement(new RMFormYesNo(__('Default file', 'dtransport'), 'default', $edit ? $file->isDefault() : 0));
$form->addElement(new RMFormYesNo(__('Remote file', 'dtransport'), 'remote', $edit ? $file->remote() : 0));
$form->addElement(new RMFormFile(__('File', 'dtransport'), 'thefile', 50, $xoopsModuleConfig['size_file'] * 1024 * 1024));
if ($edit) {
$form->addElement(new RMFormLabel(__('Current file', 'dtransport'), $file->file()));
}
$form->addElement(new RMFormText(__('File URL', 'dtransport'), 'url', 50, 200, $edit ? $file->title() : ''))->setDescription(__('Used only when remote file is activated.', 'dtransport'));
$form->addElement(new RMFormHidden('action', 'save'));
$form->addElement(new RMFormHidden('id', $item->id()));
$form->addElement(new RMFormHidden('file', $edit ? $file->id() : 0));
$form->addElement(new RMFormHidden('op', 'save'));
$buttons = new RMFormButtonGroup();
$buttons->addButton('sbt', $edit ? __('Save Changes', 'dtransport') : __('Save File', 'dtransport'), 'submit');
$buttons->addButton('cancel', __('Cancel', 'dtransport'), 'button', 'onclick="window.location=\'' . (DT_URL . ($mc['permalinks'] ? '/cp/files/' . $item->id() . '/' : '/?p=cpanel&action=files&id=' . $item->id())) . '\';"');
$form->addElement($buttons);
$xoopsTpl->assign('file_form', $form->render());
$tpl->add_xoops_style('cpanel.css', 'dtransport');
$tpl->add_head_script('$(document).ready(function(){
$("a.delete").click(function(){
if(!confirm("' . __('Do you really want to delete selected file?', 'dtransport') . '")) return false;
});
});');
$xoopsTpl->assign('lang_id', __('ID', 'dtransport'));
$xoopsTpl->assign('lang_title', __('Title', 'dtransport'));
$xoopsTpl->assign('lang_group', __('Group', 'dtransport'));
$xoopsTpl->assign('lang_remote', __('Remote', 'dtransport'));
$xoopsTpl->assign('lang_size', __('Size', 'dtransport'));
$xoopsTpl->assign('lang_hits', __('Hits', 'dtransport'));
$xoopsTpl->assign('lang_date', __('Date', 'dtransport'));
$xoopsTpl->assign('lang_edit', __('Edit', 'dtransport'));
$xoopsTpl->assign('lang_delete', __('Delete', 'dtransport'));
$xoopsTpl->assign('lang_addfile', __('Add File', 'dtransport'));
$xoopsTpl->assign('edit', $edit);
include 'footer.php';
}
示例14: dt_delete_file
/**
* Elimina archivos de la base de datos y el disco duro
*/
function dt_delete_file()
{
global $xoopsSecurity, $functions;
if (!$xoopsSecurity->check()) {
$functions->dt_send_message(__('Session token not valid!', 'dtransport'), 1, 0);
}
$id = rmc_server_var($_POST, 'id', 0);
$item = rmc_server_var($_POST, 'item', 0);
$file = new DTFile($id);
if ($file->isNew()) {
$functions->dt_send_message(__('Specified file does not exists!', 'dtransport'), 1, 1);
}
$sw = new DTSoftware($item);
if ($sw->isNew()) {
$functions->dt_send_message(__('Specified item download does nto exists!', 'dtransport'), 1, 1);
}
if ($file->software() != $item) {
$functions->dt_send_message(__('This file seems not belong to specified download item!', 'dtransport'), 1, 1);
}
if (!$file->delete()) {
$functions->dt_send_message(__('File could not be deleted!', 'dtransport'), 1, 1);
}
$rmu = RMUtilities::get();
$mc = $rmu->module_config('dtransport');
$dir = $sw->getVar('secure') ? $mc['directory_secure'] : $mc['directory_insecure'];
unlink($dir . '/' . $file->file());
$functions->dt_send_message(__('File deleted successfully!', 'dtransport'), 0, 1);
}
示例15: render
public function render()
{
$util = RMUtilities::get();
return $util->image_manager($this->getName(), $this->default);
}