本文整理汇总了PHP中RMPageNav::target_url方法的典型用法代码示例。如果您正苦于以下问题:PHP RMPageNav::target_url方法的具体用法?PHP RMPageNav::target_url怎么用?PHP RMPageNav::target_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RMPageNav
的用法示例。
在下文中一共展示了RMPageNav::target_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_editors
/**
* Mostramos la lista de editores junto con
* el formulario para crear nuevos editores
*/
function show_editors()
{
global $tpl, $xoopsUser, $xoopsSecurity, $xoopsModule;
MWFunctions::include_required_files();
xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> » ' . __('Editors', 'mywords'));
RMTemplate::get()->assign('xoops_pagetitle', __('Editors Management', 'mywords'));
include_once RMCPATH . '/class/form.class.php';
foreach ($_REQUEST as $k => $v) {
${$k} = $v;
}
$db = XoopsDatabaseFactory::getDatabaseConnection();
list($num) = $db->fetchRow($db->query("SELECT COUNT(*) FROM " . $db->prefix("mw_editors")));
$page = rmc_server_var($_GET, 'page', 1);
$limit = isset($limit) && $limit > 0 ? $limit : 15;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('editors.php?page={PAGE_NUM}');
$result = $db->query("SELECT * FROM " . $db->prefix("mw_editors") . " ORDER BY name LIMIT {$start},{$limit}");
$editores = array();
while ($row = $db->fetchArray($result)) {
$ed = new MWEditor();
$ed->assignVars($row);
$tpl->append('editors', $ed);
}
xoops_cp_header();
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_script('../include/js/scripts.php?file=editors.js');
include RMTemplate::get()->get_template('admin/mywords_editors.php', 'module', 'mywords');
xoops_cp_footer();
}
示例2: showEdits
/**
* @desc Muestra una lista con los elementos editados esperando aprovación
*/
function showEdits()
{
global $xoopsModule, $db, $adminTemplate, $tpl, $mc;
$sql = "SELECT * FROM " . $db->prefix("rd_edits");
list($num) = $db->fetchRow($db->query($sql));
$page = rmc_server_var($_REQUEST, 'page', 1);
$limit = 15;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('edits.php?page={PAGE_NUM}');
$sql = "SELECT * FROM " . $db->prefix("rd_edits") . " ORDER BY `modified` DESC LIMIT {$start},{$limit}";
$result = $db->query($sql);
$sections = array();
while ($row = $db->fetchArray($result)) {
$edit = new RDEdit();
$edit->assignVars($row);
$sec = new RDSection($edit->getVar('id_sec'));
$sections[] = array('id' => $edit->id(), 'section' => array('id' => $sec->id(), 'title' => $sec->getVar('title'), 'link' => $sec->permalink()), 'title' => $edit->getVar('title'), 'date' => RMTimeFormatter::get()->format($edit->getVar('modified'), __('%M% %d%, %Y%', 'docs')), 'uname' => $edit->getVar('uname'));
}
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Waiting Content', 'docs'));
xoops_cp_header();
RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
RMTemplate::get()->add_local_script('admin.js', 'docs', 'include');
RMTemplate::get()->add_style('admin.css', 'docs');
include RMEvents::get()->run_event("docs.waiting.template", RMTemplate::get()->get_template("admin/rd_waiting.php", 'module', 'docs'));
xoops_cp_footer();
}
示例3: search_resources
function search_resources()
{
global $xoopsConfig, $xoopsUser, $page, $xoopsTpl;
$keyword = rmc_server_var($_GET, 'keyword', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("rd_resources") . " WHERE (title LIKE '%{$keyword}%' OR description LIKE '%{$keyword}%') AND public=1 AND approved=1";
list($num) = $db->fetchRow($db->query($sql));
$page = rmc_server_var($_GET, 'page', 1);
$limit = 15;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url(RDFunctions::make_link('search') . '?keyword=' . $keyword . '&page={PAGE_NUM}');
$sql = "SELECT * FROM " . $db->prefix("rd_resources") . " WHERE (title LIKE '%{$keyword}%' OR description LIKE '%{$keyword}%') AND public=1 AND approved=1 LIMIT {$start}, {$limit}";
$result = $db->query($sql);
$resources = array();
while ($row = $db->fetchArray($result)) {
$res = new RDResource();
$res->assignVars($row);
$resources[] = array('id' => $res->id(), 'title' => $res->getVar('title'), 'desc' => TextCleaner::truncate($res->getVar('description'), 100), 'link' => $res->permalink(), 'created' => $res->getVar('created'), 'owner' => $res->getVar('owner'), 'uname' => $res->getVar('owname'), 'reads' => $res->getVar('reads'));
}
RDFunctions::breadcrumb();
RMBreadCrumb::get()->add_crumb(__('Browsing recent Documents', 'docs'));
RMTemplate::get()->add_style('docs.css', 'docs');
include 'header.php';
$xoopsTpl->assign('xoops_pagetitle', sprintf(__('Search results for "%s"', 'docs'), $keyword));
include RMEvents::get()->run_event('docs.template.search', RMTemplate::get()->get_template('rd_search.php', 'module', 'docs'));
include 'footer.php';
}
示例4: get_modules_ajax
function get_modules_ajax()
{
XoopsLogger::getInstance()->activated = false;
XoopsLogger::getInstance()->renderingEnabled = false;
$db = Database::getInstance();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("modules");
$page = rmc_server_var($_POST, 'page', 1);
$limit = RMFunctions::configs('mods_number');
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('javascript:;" onclick="get_mods_page({PAGE_NUM})');
$sql = 'SELECT * FROM ' . $db->prefix('modules') . " ORDER BY mid, weight LIMIT {$start},{$limit}";
$result = $db->query($sql);
$installed_mods = array();
while ($row = $db->fetchArray($result)) {
$mod = new XoopsModule();
$mod->assignVars($row);
$installed_mods[] = $mod;
}
include RMTemplate::get()->get_template('rmc_mods_installed.php', 'module', 'rmcommon');
die;
}
示例5: cm_show_messages
/**
* Shows all messages sent by users and stored in database
*/
function cm_show_messages()
{
global $xoopsDB, $xoopsModuleConfig, $xoopsSecurity;
// Styles
RMTemplate::get()->add_style('admin.css', 'contact');
// Pagination
$page = rmc_server_var($_GET, 'page', 1);
$page = $page <= 0 ? 1 : $page;
$result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("contactme"));
list($num) = $xoopsDB->fetchRow($result);
$limit = $xoopsModuleConfig['limit'];
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('index.php?page={PAGE_NUM}');
// Get messages
$messages = array();
$result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("contactme") . " ORDER BY id_msg DESC LIMIT {$start},{$limit}");
$time = new RMTimeFormatter(0, __('%M% %d%, %Y%', 'contact'));
while ($row = $xoopsDB->fetchArray($result)) {
$msg = new CTMessage();
$msg->assignVars($row);
if ($msg->getVar('xuid')) {
$user = new XoopsUser($msg->getVar('xuid'));
}
$messages[] = array('id' => $msg->id(), 'subject' => $msg->getVar('subject'), 'ip' => $msg->getVar('ip'), 'email' => $msg->getVar('email'), 'name' => $msg->getVar('name'), 'company' => $msg->getVar('org'), 'body' => $msg->getVar('body'), 'phone' => $msg->getVar('phone'), 'register' => $msg->getVar('register'), 'xuid' => $msg->getVar('xuid'), 'uname' => $msg->getVar('xuid') > 0 ? $user->uname() : '', 'date' => $time->format($msg->getVar('date')));
}
RMTemplate::get()->add_local_script('admin.js', 'contact');
RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon');
xoops_cp_header();
include RMTemplate::get()->get_template('admin/ct_dashboard.php', 'module', 'contact');
xoops_cp_footer();
}
示例6: showTags
/**
* @desc Visualiza todas los etiquetas existentes
**/
function showTags()
{
global $xoopsModule, $xoopsSecurity, $xoopsModuleConfig;
$db = Database::getInstance();
$mc =& $xoopsModuleConfig;
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$page = $page < 1 ? 1 : $page;
$limit = 15;
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_tags');
$sql1 = '';
$words = array();
if ($search) {
//Separamos en palabras
$words = explode(" ", $search);
foreach ($words as $k) {
$k = trim($k);
if (strlen($k) < $mc['min_tag'] || strlen($k) > $mc['max_tag']) {
continue;
}
$sql1 .= $sql1 == '' ? " WHERE (tag LIKE '%{$k}%')" : " OR (tag LIKE '%{$k}%')";
}
}
list($num) = $db->fetchRow($db->query($sql . $sql1));
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$tpages = ceil($num / $limit);
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url("tags.php?search=" . urlencode($search) . "&page={PAGE_NUM}");
$showmax = $start + $limit;
$showmax = $showmax > $num ? $num : $showmax;
//Fin de barra de navegación
$sql = "SELECT * FROM " . $db->prefix('gs_tags');
$sql2 = " LIMIT {$start},{$limit}";
$result = $db->query($sql . $sql1 . $sql2);
$tags = array();
while ($rows = $db->fetchArray($result)) {
foreach ($words as $k) {
$rows['tag'] = eregi_replace("({$k})", "<span class='searchResalte'>\\1</span>", $rows['tag']);
}
$tag = new GSTag();
$tag->assignVars($rows);
//Obtenemos todas las imágenes pertenecientes a la etiqueta
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_tagsimages') . " WHERE id_tag=" . $tag->id();
list($pics) = $db->fetchRow($db->query($sql));
$tags[] = array('id' => $tag->id(), 'name' => $tag->tag(), 'pics' => $pics, 'url' => $tag->url());
}
GSFunctions::toolbar();
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Tags Management', 'galleries'));
RMTemplate::get()->assign('xoops_pagetitle', __('Tags Management', 'galleries'));
$cHead = '<link href="' . XOOPS_URL . '/modules/galleries/styles/admin.css" media="all" rel="stylesheet" type="text/css" />';
xoops_cp_header($cHead);
include RMTemplate::get()->get_template("admin/gs_tags.php", 'module', 'galleries');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_script('../include/js/gsscripts.php?file=sets&form=frm-tags');
RMTemplate::get()->add_script('../include/js/gsscripts.php?file=tags');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar delete_warning='" . __('Do you really wish to delete selected tags?', 'galleries') . "';\n</script>");
xoops_cp_footer();
}
示例7: showPages
/**
* Muestra los envíos existentes
*/
function showPages($acceso = -1)
{
global $mc, $xoopsModule, $xoopsSecurity;
$keyw = rmc_server_var($_REQUEST, 'keyw', '');
$acceso = rmc_server_var($_REQUEST, 'acceso', -1);
$cat = rmc_server_var($_REQUEST, 'cat', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("qpages_pages");
if ($acceso >= 0) {
$sql .= " WHERE acceso={$acceso}";
}
if (trim($keyw) != '') {
$sql .= ($acceso >= 0 ? " AND " : " WHERE ") . "titulo LIKE '%{$keyw}%'";
}
if (isset($cat) && $cat > 0) {
$sql .= ($acceso >= 0 || $keyw != '' ? " AND " : " WHERE ") . "cat='{$cat}'";
}
/**
* Paginacion de Resultados
*/
$page = rmc_server_var($_REQUEST, 'page', 1);
$page = $page <= 0 ? 1 : $page;
$limit = 15;
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('pages.php?cat=' . $cat . '&page={PAGE_NUM}');
$sql .= " ORDER BY id_page DESC LIMIT {$start},{$limit}";
$sql = str_replace("SELECT COUNT(*)", "SELECT *", $sql);
$result = $db->query($sql);
$pages = array();
while ($row = $db->fetchArray($result)) {
$p = new QPPage();
$p->assignVars($row);
# Enlaces para las categorías
$catego = new QPCategory($p->getCategory());
$pages[] = array('id' => $p->getID(), 'titulo' => $p->getTitle(), 'catego' => $catego->getName(), 'fecha' => formatTimeStamp($p->getDate(), 's'), 'link' => $p->getPermaLink(), 'estado' => $p->getAccess(), 'modificada' => $p->getModDate() == 0 ? '--' : formatTimestamp($p->getModDate(), 'c'), 'lecturas' => $p->getReads(), 'order' => $p->order(), 'type' => $p->type(), 'desc' => $p->getDescription());
}
/**
* Cargamos las categorias
*/
$categos = array();
qpArrayCategos($categos);
$categories = array();
foreach ($categos as $k) {
$categories[] = array('id' => $k['id_cat'], 'nombre' => $k['nombre'], 'saltos' => $k['saltos']);
}
RMTemplate::get()->add_style('admin.css', 'qpages');
RMTemplate::get()->add_script('../include/js/qpages.js');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->assign('xoops_pagetitle', __('Pages Management', 'qpages'));
xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> » ' . ($acceso < 0 ? __('All Pages', 'qpages') : ($acceso == 0 ? __('Draft pages', 'qpages') : __('Published pages', 'qpages'))));
xoops_cp_header();
include RMTemplate::get()->get_template("admin/qp_pages.php", 'module', 'qpages');
xoops_cp_footer();
}
示例8: showAlbums
/**
* @desc Visualiza todos los albums
**/
function showAlbums()
{
global $tpl, $xoopsModule, $mc, $xoopsSecurity;
define('RMSUBLOCATION', 'sets');
$db = Database::getInstance();
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$limit = 15;
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'id_set';
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 1;
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
$query = "search={$search}&page={$page}&sort={$sort}&mode={$mode}";
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_sets');
$sql1 = '';
$words = array();
if ($search) {
//Separamos en palabras
$words = explode(" ", $search);
foreach ($words as $k) {
$k = trim($k);
if (strlen($k) <= 2) {
continue;
}
$sql1 .= $sql1 == '' ? " WHERE (title LIKE '%{$k}%' OR uname LIKE '%{$k}%')" : " OR (title LIKE '%{$k}%' OR uname LIKE '%{$k}%')";
}
}
list($num) = $db->fetchRow($db->query($sql . $sql1));
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$tpages = ceil($num / $limit);
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url("sets.php?page={PAGE_NUM}&sort={$sort}&mode={$mode}&search={$search}");
//Fin de barra de navegación
$sql = str_replace('COUNT(*)', '*', $sql);
$sql2 = $sort ? " ORDER BY {$sort} " . ($mode ? "DESC" : "ASC ") : '';
$sql2 .= " LIMIT {$start},{$limit}";
$result = $db->query($sql . $sql1 . $sql2);
$sets = array();
while ($rows = $db->fetchArray($result)) {
foreach ($words as $k) {
$rows['title'] = eregi_replace("({$k})", "<span class='searchResalte'>\\1</span>", $rows['title']);
$rows['uname'] = eregi_replace("({$k})", "<span class='searchResalte'>\\1</span>", $rows['uname']);
}
$set = new GSSet();
$set->assignVars($rows);
$sets[] = array('id' => $set->id(), 'title' => $set->title(), 'owner' => $set->uname(), 'public' => $set->isPublic(), 'date' => formatTimeStamp($set->date(), 'c'), 'pics' => $set->pics(), 'url' => $set->url());
}
GSFunctions::toolbar();
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Albums Management', 'galleries'));
RMTemplate::get()->assign('xoops_pagetitle', 'Albums Management');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\n\n var delete_warning='" . __('Do you really wish to delete selected albums?', 'galleries') . "';\n\n var delete_formats='" . __('Do you really wish to delete all images formats for this album?\\nOnly deletes formats for albums, search and others, except normal thumbnails.', 'galleries') . "';\n\n </script>");
RMTemplate::get()->add_script('../include/js/gsscripts.php?file=sets');
$cHead = '<link href="' . XOOPS_URL . '/modules/galleries/styles/admin.css" media="all" rel="stylesheet" type="text/css" />';
xoops_cp_header($cHead);
include RMTemplate::get()->get_template('admin/gs_albums.php', 'module', 'galleries');
xoops_cp_footer();
}
示例9: m_show_teams
function m_show_teams()
{
global $xoopsModule, $xoopsSecurity;
$db = XoopsDatabaseFactory::getDatabaseConnection();
$id = rmc_server_var($_REQUEST, 'id', 0);
if ($id > 0) {
MCHFunctions::page_from_item($id, 'team');
}
$page = rmc_server_var($_REQUEST, 'page', 1);
$page = $page <= 0 ? 1 : $page;
$limit = 15;
$category = rmc_server_var($_REQUEST, 'category', 0);
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('mch_teams');
if ($category > 0) {
$sql .= " WHERE category={$category}";
}
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('teams.php?page={PAGE_NUM}');
$teams = array();
$result = $db->query("SELECT * FROM " . $db->prefix("mch_teams") . ($category > 0 ? " WHERE category={$category}" : '') . " ORDER BY `wins`,active LIMIT {$start},{$limit}");
$cache_cat = array();
while ($row = $db->fetchArray($result)) {
$team = new MCHTeam();
$team->assignVars($row);
if (isset($cache_cat[$team->getVar('category')])) {
$cat = $cache_cat[$team->getVar('category')];
} else {
$cache_cat[$team->getVar('category')] = new MCHCategory($team->getVar('category'));
$cat = $cache_cat[$team->getVar('category')];
}
$date = new RMTimeFormatter(0, __('%M% %d%, %Y%', 'match'));
$teams[] = array('id' => $team->id(), 'link' => $team->permalink(), 'name' => $team->getVar('name'), 'active' => $team->getVar('active'), 'wins' => $team->getVar('wins'), 'nameid' => $team->getVar('nameid'), 'info' => $team->getVar('info'), 'created' => $date->format($team->getVar('created')), 'category' => array('id' => $cat->id(), 'name' => $cat->getVar('name'), 'link' => $cat->permalink()));
}
// Categories
$categories = array();
MCHFunctions::categories_tree($categories);
// Event
$teams = RMEvents::get()->run_event('match.list.teams', $teams);
MCHFunctions::toolbar();
xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » " . __('Teams', 'match'));
RMTemplate::get()->assign('xoops_pagetitle', __('Teams', 'match'));
RMTemplate::get()->add_style('admin.css', 'match');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_local_script('admin_match.js', 'match');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar mch_message='" . __('Do you really want to delete selected teams?\\nAll players and coaches assigned to this team will be deleted also.\\n\\nIf you no want to lose data, then reassign players and coaches before to delete this team.', 'match') . "';\n\n var mch_select_message = '" . __('You must select some team before to execute this action!', 'match') . "';</script>");
xoops_cp_header();
$match_extra_options = RMEvents::get()->run_event('match.more.options');
include RMTemplate::get()->get_template("admin/mch_teams.php", 'module', 'match');
xoops_cp_footer();
}
示例10: showWorks
/**
* @desc Visualiza todos los trabajos existentes
**/
function showWorks()
{
global $xoopsModule, $xoopsSecurity;
$db = XoopsDatabaseFactory::getDatabaseConnection();
$page = rmc_server_var($_REQUEST, 'page', 1);
$limit = rmc_server_var($_REQUEST, 'limit', 15);
$show = rmc_server_var($_REQUEST, 'show', '');
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('pw_works');
if ($show == 'public') {
$sql .= " WHERE public=1";
} elseif ($show == 'hidden') {
$sql .= " WHERE public=0";
}
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('works.php?page={PAGE_NUM}');
$sql = "SELECT * FROM " . $db->prefix('pw_works');
if ($show == 'public') {
$sql .= " WHERE public=1";
} elseif ($show == 'hidden') {
$sql .= " WHERE public=0";
}
$sql .= " ORDER BY id_work DESC LIMIT {$start}, {$limit}";
$result = $db->query($sql);
$works = array();
//Container
while ($row = $db->fetchArray($result)) {
$work = new PWWork();
$work->assignVars($row);
//Obtenemos la categoría
$cat = new PWCategory($work->category());
//Obtenemos el cliente
$user = new PWClient($work->client());
$works[] = array('id' => $work->id(), 'title' => $work->title(), 'catego' => $cat->name(), 'client' => $user->name(), 'start' => formatTimeStamp($work->start(), 's'), 'mark' => $work->mark(), 'public' => $work->isPublic(), 'description' => $work->descShort());
}
PWFunctions::toolbar();
RMTemplate::get()->add_style('admin.css', 'works');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_script('../include/js/admin_works.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar pw_message='" . __('Do you really want to delete selected works?', 'works') . "';\n\n var pw_select_message = '" . __('You must select some work before to execute this action!', 'works') . "';</script>");
xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » " . __('Works', 'works'));
xoops_cp_header();
include RMTemplate::get()->get_template("admin/pw_works.php", 'module', 'works');
xoops_cp_footer();
}
示例11: showImages
function showImages()
{
global $xoopsModule, $db, $xoopsSecurity;
$work = rmc_server_var($_REQUEST, 'work', 0);
//Verificamos que el trabajo sea válido
if ($work <= 0) {
redirectMsg('./works.php', __('Provided work ID is not valid!', 'works'), 1);
die;
}
//Verificamos que el trabajo exista
$work = new PWWork($work);
if ($work->isNew()) {
redirectMsg('./works.php', __('Specified work does not exists!', 'admin_work'), 1);
die;
}
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('pw_images') . " WHERE work='" . $work->id() . "'";
list($num) = $db->fetchRow($db->query($sql));
$page = rmc_server_var($_REQUEST, 'page', 1);
$page = $page <= 0 ? 1 : $page;
$limit = 10;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('images.php?page={PAGE_NUM}&work=' . $work->id());
$sql = "SELECT * FROM " . $db->prefix('pw_images') . " WHERE work='" . $work->id() . "'";
$sql .= " LIMIT {$start},{$limit}";
$result = $db->query($sql);
$images = array();
while ($row = $db->fetchArray($result)) {
$img = new PWImage();
$img->assignVars($row);
$images[] = array('id' => $img->id(), 'title' => $img->title(), 'image' => $img->image(), 'work' => $img->work(), 'desc' => $img->desc());
}
$images = RMEvents::get()->run_event('works.list.images', $images, $work);
$form_fields = '';
$form_fields = RMEvents::get()->run_event('works.images.form.fields', $form_fields, $work);
PWFunctions::toolbar();
xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » " . __('Work Images', 'works'));
RMTemplate::get()->assign('xoops_pagetitle', $work->title() . ' » Work Images', 'admin_mywords');
RMTemplate::get()->add_style('admin.css', 'works');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar pw_message='" . __('Do you really want to delete selected images?', 'works') . "';\n\n var pw_select_message = '" . __('You must select an image before to execute this action!', 'works') . "';</script>");
xoops_cp_header();
include RMTemplate::get()->get_template("admin/pw_images.php", 'module', 'works');
xoops_cp_footer();
}
示例12: shop_show_products
/**
* Show the list of existing products with options to mage them
*/
function shop_show_products()
{
global $xoopsModuleConfig, $xoopsConfig, $xoopsSecurity;
$db = XoopsDatabaseFactory::getDatabaseConnection();
$page = rmc_server_var($_REQUEST, 'page', 1);
$limit = 15;
$bname = rmc_server_var($_REQUEST, 'bname', '');
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('shop_products');
if ($bname != '') {
$sql .= " WHERE name LIKE '%{$bname}%'";
}
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('products.php?page={PAGE_NUM}&bname=' . $bname);
$sql = str_replace("COUNT(*)", '*', $sql);
$sql .= " ORDER BY id_product DESC LIMIT {$start}, {$limit}";
$result = $db->query($sql);
$products = array();
//Container
$tf = new RMTimeFormatter('', '%M%/%d%/%Y% - %h%:%i%');
while ($row = $db->fetchArray($result)) {
$product = new ShopProduct();
$product->assignVars($row);
$products[] = array('id' => $product->id(), 'name' => $product->getVar('name'), 'image' => $product->getVar('image') != '' ? XOOPS_UPLOAD_URL . '/minishop/ths/' . $product->getVar('image') : '', 'price' => $product->getVar('price'), 'type' => $product->getVar('type') ? __('Digital', 'shop') : __('Normal', 'shop'), 'stock' => $product->getVar('available'), 'created' => $product->getVar('created') ? $tf->format($product->getVar('created')) : '', 'modified' => $product->getVar('modified') > 0 ? $tf->format($product->getVar('modified')) : '');
}
$products = RMEvents::get()->run_event("shop.list.products", $products, $start, $limit);
RMTemplate::get()->add_style('admin.css', 'shop');
RMTemplate::get()->add_local_script('admin.js', 'shop');
RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
RMTemplate::get()->add_head('<script type="text/javascript">
var shop_select_message = "' . __('Select at least one product in order to run this action!', 'shop') . '";
var shop_message = "' . __('Do you really wish to delete selected products?', 'shop') . '";
</script>');
// Show GUI
xoops_cp_header();
include RMTemplate::get()->get_template('admin/shop_products.php', 'module', 'shop');
xoops_cp_footer();
}
示例13: showUsers
/**
* @desc Visualiza todos los usuarios existentes
**/
function showUsers()
{
global $xoopsModule, $db, $tpl, $xoopsSecurity;
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$limit = 15;
$search = rmc_server_var($_REQUEST, 'search', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_users');
$sql1 = '';
$search = trim($search);
if ($search && strlen($search) > 2) {
$sql1 .= $sql1 == '' ? " WHERE (uname LIKE '%{$search}%')" : " OR (uname LIKE '%{$search}%')";
}
list($num) = $db->fetchRow($db->query($sql . $sql1));
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$tpages = ceil($num / $limit);
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url("users.php?page={PAGE_NUM}&search={$search}");
$showmax = $start + $limit;
$showmax = $showmax > $num ? $num : $showmax;
//Fin de barra de navegación
$sql = "SELECT * FROM " . $db->prefix('gs_users');
$sql2 = " LIMIT {$start},{$limit}";
$result = $db->query($sql . $sql1 . $sql2);
while ($rows = $db->fetchArray($result)) {
$uname = eregi_replace("({$search})", "<span class='searchResalte'>\\1</span>", $rows['uname']);
$user = new GSUser();
$user->assignVars($rows);
$users[] = array('id' => $user->id(), 'uid' => $user->uid(), 'uname' => $uname, 'quota' => RMUtilities::formatBytesSize($user->quota()), 'blocked' => $user->blocked(), 'used' => GSFunctions::makeQuota($user), 'pics' => $user->pics(), 'sets' => $user->sets(), 'date' => formatTimeStamp($user->date(), 'custom'), 'url' => $user->userUrl());
}
GSFunctions::toolbar();
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Users management', 'galleries'));
RMTemplate::get()->assign('xoops_pagetitle', __('Users management', 'galleries'));
RMTemplate::get()->add_script('../include/js/gsscripts.php?file=sets&form=frm-users');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar delete_warning='" . __('Do you really wish to delete selected users?', 'galleries') . "';\n</script>");
xoops_cp_header();
include RMTemplate::get()->get_template("admin/gs_users.php", 'module', 'galleries');
xoops_cp_footer();
}
示例14: show_resources
/**
* @desc Muestra todas las publicaciones existentes
**/
function show_resources()
{
global $xoopsModule, $xoopsConfig, $xoopsSecurity;
$query = rmc_server_var($_REQUEST, 'query', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
//Navegador de páginas
$sql = "SELECT COUNT(*) FROM " . $db->prefix('rd_resources');
if ($query) {
$sql .= " WHERE title LIKE '%query%'";
}
list($num) = $db->fetchRow($db->queryF($sql));
$page = rmc_server_var($_REQUEST, 'page', 1);
$limit = 15;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('resources.php?page={PAGE_NUM}');
//Fin navegador de páginas
$sql = "SELECT * FROM " . $db->prefix('rd_resources') . ($query != '' ? " WHERE title LIKE '%{$query}%'" : '') . " ORDER BY `created` DESC LIMIT {$start},{$limit}";
$result = $db->queryF($sql);
$resources = array();
while ($rows = $db->fetchArray($result)) {
$res = new RDResource();
$res->assignVars($rows);
$resources[] = array('id' => $res->id(), 'title' => $res->getVar('title'), 'created' => formatTimestamp($res->getVar('created'), 'm'), 'public' => $res->getVar('public'), 'quick' => $res->getVar('quick'), 'approvededit' => $res->getVar('editor_approve'), 'featured' => $res->getVar('featured'), 'approved' => $res->getVar('approved'), 'owname' => $res->getVar('owname'), 'owner' => $res->getVar('owner'), 'description' => $res->getVar('description'), 'sections' => $res->sections_count(), 'notes' => $res->notes_count(), 'figures' => $res->figures_count());
}
RMTemplate::get()->add_style('admin.css', 'docs');
RMTemplate::get()->assign('xoops_pagetitle', __('Documents', 'docs'));
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_script(XOOPS_URL . '/modules/docs/include/js/admin.js');
RMTemplate::get()->add_head('<script type="text/javascript">
var rd_message = "' . __('Do you really wish to delete selected Documents?', 'docs') . '";
var rd_select_message = "' . __('You must select an element before to do this action!', 'docs') . '";
</script>');
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Documents', 'docs'));
RDFunctions::toolbar();
xoops_cp_header();
include RMTemplate::get()->get_template('admin/rd_resources.php', 'module', 'docs');
xoops_cp_footer();
}
示例15: m_show_championships
function m_show_championships()
{
global $xoopsModule, $xoopsSecurity;
$page = rmc_server_var($_REQUEST, 'page', 1);
$page = $page <= 0 ? 1 : $page;
$limit = 15;
$db = XoopsDatabaseFactory::getDatabaseConnection();
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('mch_champs');
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('champ.php?page={PAGE_NUM}');
$champs = array();
$sql = str_replace('COUNT(*)', '*', $sql);
$sql .= ' ORDER BY start DESC,name ASC';
$result = $db->query($sql);
$timef = new RMTimeFormatter('', "%M% %d%, %Y%");
while ($row = $db->fetchArray($result)) {
$champ = new MCHChampionship();
$champ->assignVars($row);
$champs[] = array('id' => $champ->id(), 'link' => $champ->permalink(), 'name' => $champ->getVar('name'), 'nameid' => $champ->getVar('nameid'), 'start' => $timef->format($champ->getVar('start')), 'end' => $timef->format($champ->getVar('end')), 'description' => $champ->getVar('description'), 'current' => $champ->getVar('current'));
}
$form = new RMForm('', '', '');
$editor = new RMFormEditor('', 'description', '98%', '200px', '', 'html');
$start = new RMFormDate('', 'start', time());
$end = new RMFormDate('', 'end', time());
MCHFunctions::toolbar();
xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » " . __('Championships', 'match'));
RMTemplate::get()->assign('xoops_pagetitle', __('Championships', 'match'));
RMTemplate::get()->add_style('admin.css', 'match');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_local_script('admin_match.js', 'match');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar mch_message='" . __('Do you really want to delete selected championships?', 'match') . "';\n\n var mch_select_message = '" . __('You must select some championships before to execute this action!', 'match') . "';</script>");
xoops_cp_header();
$match_extra_options = RMEvents::get()->run_event('match.more.options');
include RMTemplate::get()->get_template("admin/mch_champs.php", 'module', 'match');
xoops_cp_footer();
}