本文整理汇总了PHP中RMUtilities类的典型用法代码示例。如果您正苦于以下问题:PHP RMUtilities类的具体用法?PHP RMUtilities怎么用?PHP RMUtilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RMUtilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mw_widget_image
/**
* Provides a widget to specify the default image for posts
*/
function mw_widget_image()
{
global $xoopsSecurity, $xoopsModuleConfig, $xoopsUser, $rm_config;
$id = rmc_server_var($_REQUEST, 'id', 0);
$type = rmc_server_var($_REQUEST, 'type', '');
$op = rmc_server_var($_REQUEST, 'op', '');
$edit = $op == 'edit' ? 1 : 0;
$widget = array();
$widget['title'] = __('Default Image', 'mywords');
$util = new RMUtilities();
if ($edit) {
//Verificamos que el software sea válido
if ($id <= 0) {
$params = '';
}
$post = new MWPost($id);
if ($post->isNew()) {
$params = '';
} else {
$params = $post->getVar('image');
}
} else {
$params = '';
}
$widget['content'] = '<form name="frmDefimage" id="frm-defimage" method="post">';
$widget['content'] .= $util->image_manager('image', $params);
$widget['content'] .= '</form>';
return $widget;
}
示例2: qpages_search
/**
* Función para realizar búsquedas
*/
function qpages_search($qa, $andor, $limit, $offset, $userid)
{
global $xoopsUser, $mc;
include_once XOOPS_ROOT_PATH . '/modules/qpages/class/qppage.class.php';
$mc = RMUtilities::module_config('qpages');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT * FROM " . $db->prefix("qpages_pages");
$adds = '';
if (is_array($qa) && ($count = count($qa))) {
$adds = '';
for ($i = 0; $i < $count; $i++) {
$adds .= $adds == '' ? "(titulo LIKE '%{$qa[$i]}%' OR titulo_amigo LIKE '%{$qa[$i]}%')" : " {$andor} (titulo LIKE '%{$qa[$i]}%' OR titulo_amigo LIKE '%{$qa[$i]}%')";
}
}
$sql .= $adds != '' ? " WHERE {$adds}" : '';
if ($userid > 0) {
$sql .= ($adds != '' ? " AND " : " WHERE ") . "uid='{$userid}'";
}
$sql .= " ORDER BY modificado DESC";
$i = 0;
$result = $db->query($sql);
$ret = array();
while ($row = $db->fetchArray($result)) {
$page = new QPPage();
$page->assignVars($row);
$ret[$i]['image'] = "images/page.png";
$ret[$i]['link'] = $mc['links'] == 0 ? 'page.php?page=' . $page->getFriendTitle() : $page->getFriendTitle() . '/';
$ret[$i]['title'] = $page->getTitle();
$ret[$i]['time'] = $page->getDate();
$ret[$i]['uid'] = $page->uid();
$ret[$i]['desc'] = $page->getDescription();
$i++;
}
return $ret;
}
示例3: qpagesBlockPages
/**
* Mostramos las página existentes
*/
function qpagesBlockPages($options)
{
global $xoopsConfig;
include_once XOOPS_ROOT_PATH . '/modules/qpages/class/qppage.class.php';
$db =& XoopsDatabaseFactory::getDatabaseConnection();
$mc =& RMUtilities::module_config('qpages');
if (!defined('QP_URL')) {
define('QP_URL', XOOPS_URL . ($mc['links'] ? $mc['basepath'] : '/modules/qpages'));
}
$sql = "SELECT * FROM " . $db->prefix("qpages_pages");
if ($options[0] > 0) {
$sql .= " WHERE cat='{$options['0']}'";
}
$sql .= " ORDER BY fecha DESC LIMIT 0,{$options['1']}";
$block = array();
$result = $db->query($sql);
while ($row = $db->fetchArray($result)) {
$page = new QPPage();
$page->assignVars($row);
$rtn = array();
$rtn['id'] = $page->getID();
$rtn['titulo'] = $page->getTitle();
$rtn['link'] = $page->getPermaLink();
$block['pages'][] = $rtn;
}
return $block;
}
示例4: pwSearch
/**
* @desc Realiza una búsqueda en el módulo desde EXM
*/
function pwSearch($queryarray, $andor, $limit, $offset, $userid)
{
global $myts;
include_once XOOPS_ROOT_PATH . "/modules/works/class/pwwork.class.php";
$mc = RMUtilities::module_config('works');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT a.* FROM " . $db->prefix('pw_works') . " a INNER JOIN " . $db->prefix('pw_clients') . " b ON (a.public=1 AND a.client=b.id_client AND (";
$sql1 = '';
if (is_array($queryarray)) {
foreach ($queryarray as $k) {
$sql1 .= ($sql1 == '' ? "" : "{$andor}") . " (a.title LIKE '%{$k}%' OR a.short LIKE '%{$k}%' OR b.name LIKE '%{$k}%' OR b.business_name LIKE '%{$k}%') ";
}
}
$sql1 .= "))";
$sql1 .= " GROUP BY a.id_work ORDER BY a.created DESC LIMIT {$offset}, {$limit}";
$result = $db->queryF($sql . $sql1);
$ret = array();
while ($row = $db->fetchArray($result)) {
$work = new PWWork();
$work->assignVars($row);
$rtn = array();
$rtn['image'] = 'images/works.png';
$rtn['title'] = $work->title();
$rtn['time'] = $work->created();
$rtn['uid'] = '';
$rtn['desc'] = $work->descShort();
$rtn['link'] = $work->link();
$ret[] = $rtn;
}
return $ret;
}
示例5: rd_block_resources
/**
* Este archivo permite controlar el bloque o los bloques
* Bloques Existentes:
*
* 1. Publicaciones Recientes
* 2. Publicaciones Populares (Mas Leídas)
* 3. Publicaciones Mejor Votadas
*/
function rd_block_resources($options)
{
global $xoopsModule;
include_once XOOPS_ROOT_PATH . '/modules/docs/class/rdresource.class.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
$mc = RMUtilities::module_config('docs');
$sql = "SELECT * FROM " . $db->prefix("rd_resources") . ' WHERE public=1 AND approved=1';
switch ($options[0]) {
case 'recents':
$sql .= " ORDER BY created DESC";
break;
case 'popular':
$sql .= " ORDER BY `reads` DESC";
break;
}
$sql .= " LIMIT 0, " . ($options[1] > 0 ? $options[1] : 5);
$result = $db->query($sql);
$block = array();
while ($row = $db->fetchArray($result)) {
$res = new RDResource();
$res->assignVars($row);
$ret = array();
$ret['id'] = $res->id();
$ret['title'] = $res->getVar('title');
if ($options[2]) {
$ret['desc'] = $options[3] == 0 ? $res->getVar('description') : TextCleaner::truncate($res->getVar('description'), $options[3]);
}
$ret['link'] = $res->permalink();
$ret['author'] = sprintf(__('Created by %s', 'docs'), '<strong>' . $res->getVar('owname') . '</strong>');
$ret['reads'] = sprintf(__('Viewed %s times', 'docs'), '<strong>' . $res->getVar('reads') . '</strong>');
$block['resources'][] = $ret;
}
RMTemplate::get()->add_style('blocks.css', 'docs');
return $block;
}
示例6: 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;
}
示例7: pw_comments_show
function pw_comments_show($options)
{
global $xoopsModule, $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . '/modules/works/class/pwwork.class.php';
include_once XOOPS_ROOT_PATH . '/modules/works/class/pwclient.class.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
if (isset($xoopsModule) && $xoopsModule->dirname() == 'works') {
$mc =& $xoopsModuleConfig;
} else {
$mc =& RMUtilities::module_config('works');
}
$sql = "SELECT * FROM " . $db->prefix('pw_works') . " WHERE comment<>'' ORDER BY " . ($options[1] ? " created DESC " : " RAND() ");
$sql .= " LIMIT 0," . $options[0];
$result = $db->query($sql);
$clients = array();
while ($row = $db->fetchArray($result)) {
$work = new PWWork();
$work->assignVars($row);
if (!isset($clients[$work->client()])) {
$clients[$work->client()] = new PWClient($work->client(), 1);
}
$client =& $clients[$work->client()];
$rtn = array();
$rtn['client'] = $client->businessName();
$rtn['link'] = $work->link();
$rtn['comment'] = $work->comment();
$block['works'][] = $rtn;
}
return $block;
}
示例8: permalink
public function permalink()
{
$mc = RMUtilities::module_config('shop');
$rtn = ShopFunctions::get_url();
$rtn .= $mc['urlmode'] == 0 ? 'product.php?id=' . $this->id() : $this->getVar('nameid') . '/';
return $rtn;
}
示例9: permalink
/**
* Obtiene el enlace a la categor?a
*/
public function permalink()
{
$mc = RMUtilities::module_config('shop');
$link = ShopFunctions::get_url();
$link .= $mc['urlmode'] == 0 ? '?cat=' . $this->id() : 'category/' . $this->path();
return $link;
}
示例10: pw_categories_show
function pw_categories_show($options)
{
global $xoopsModule, $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . '/modules/works/class/pwwork.class.php';
include_once XOOPS_ROOT_PATH . '/modules/works/class/pwclient.class.php';
include_once XOOPS_ROOT_PATH . '/modules/works/class/pwcategory.class.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
if (isset($xoopsModule) && $xoopsModule->dirname() == 'works') {
$mc =& $xoopsModuleConfig;
} else {
$mc =& RMUtilities::module_config('works');
}
$db = XoopsDatabaseFactory::getDatabaseConnection();
$result = $db->query("SELECT * FROM " . $db->prefix("pw_categos") . " ORDER BY name");
$block = array();
while ($row = $db->fetchArray($result)) {
$cat = new PWCategory();
$cat->assignVars($row);
$ret = array();
$ret['name'] = $row['name'];
$ret['link'] = $cat->link();
$block['categos'][] = $ret;
}
return $block;
}
示例11: showForm
function showForm()
{
global $db, $xoopsOption, $xoopsUser, $mc, $tpl, $xoopsConfig, $xoopsModuleConfig, $user, $xoopsSecurity;
$xoopsOption['template_main'] = "gs_submit.html";
$xoopsOption['module_subpage'] = 'submit';
include 'header.php';
GSFunctions::makeHeader();
$mc =& $xoopsModuleConfig;
$tpl->assign('lang_uploadyour', __('Upload your Pictures', 'galleries'));
$tpl->assign('lang_step1', __('Step 1:', 'galleries'));
$tpl->assign('lang_step2', __('Step 2:', 'galleries'));
$tpl->assign('lang_step3', __('Step 3:', 'galleries'));
$tpl->assign('lang_step4', __('Step 4:', 'galleries'));
$tpl->assign('lang_choose', __('Select Files', 'galleries'));
$tpl->assign('lang_privacy', __('Set Privacy', 'galleries'));
$tpl->assign('lang_privateme', __('Private (<em>Only you will seee these pictures</em>)', 'galleries'));
$tpl->assign('lang_privatef', __('For Friends (<em>Only you and your friends will see these pictures</em>)', 'galleries'));
$tpl->assign('lang_public', __('Public (<em>Pictures will visible for all</em>)'));
$tpl->assign('lang_upload', __('Upload Files', 'galleries'));
$tpl->assign('lang_clicktou', __('Click to Upload', 'galleries'));
$tpl->assign('lang_tagsesp', __('Specify tags to use', 'galleries'));
$tpl->assign('lang_tagsdesc', __('Separate each tag with a comma (,).', 'galleries'));
$tpl->assign('lang_maxsize', sprintf(__('The maximum file size allowed is <strong>%s</strong>.', 'galleries'), RMUtilities::formatBytesSize($mc['size_image'] * 1024)));
$tpl->assign('used_graph', GSFunctions::makeQuota($user, false));
$tpl->assign('form_action', GSFunctions::get_url() . ($mc['urlmode'] ? 'submit/' : '?submit=submit'));
$tpl->assign('token', $xoopsSecurity->getTokenHTML());
$used = round($user->usedQuota() / $user->quota() * 100) . '%';
$tpl->assign('lang_used', sprintf(__('You have used <strong>%s</strong> of <strong>%s</strong> available. You left <strong>%s</strong>', 'galleries'), $used, RMUtilities::formatBytesSize($user->quota()), RMUtilities::formatBytesSize($user->usedQuota() >= $user->quota() ? 0 : $user->quota() - $user->usedQuota())));
RMTemplate::get()->add_xoops_style('submit.css', 'galleries');
include 'footer.php';
}
示例12: permalink
public function permalink()
{
$mc = RMSettings::module_settings('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;
}
示例13: 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;
}
示例14: xoops_module_pre_uninstall_galleries
function xoops_module_pre_uninstall_galleries($mod)
{
$dir = RMUtilities::module_config('galleries', 'storedir');
if (is_dir($dir)) {
RMUtilities::delete_directory($dir);
}
return true;
}
示例15: 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;
}