public function __construct($caption, $name, $selected = 0)
 {
     $this->setName($name);
     $this->setCaption($caption);
     $this->selected = $selected;
     RMTemplate::get()->add_local_script('teams_field.js', 'match');
 }
Example #2
0
/**
* 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;
}
Example #3
0
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';
}
Example #4
0
/**
* @desc Muestra el formulario para agregar un nuevo sitio
*/
function edit_bookmark()
{
    global $xoopsModule, $xoopsConfig, $xoopsSecurity;
    $id = rmc_server_var($_GET, 'id', 0);
    if ($id <= 0) {
        redirectMsg('bookmarks.php', __('Site ID not provided!', 'mywords'), 1);
        die;
    }
    $book = new MWBookmark($id);
    if ($book->isNew()) {
        redirectMsg('bookmarks.php', __('Social site not exists!', 'mywords'), 1);
        die;
    }
    $temp = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/modules/mywords/images/icons');
    foreach ($temp as $icon) {
        $icons[] = array('url' => XOOPS_URL . "/modules/mywords/images/icons/{$icon}", 'name' => $icon);
    }
    MWFunctions::include_required_files();
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> &raquo; <a href="bookmarks.php">' . __('Social Sites', 'mywords') . '</a> &raquo; ' . __('Editing Social Site', 'mywords'));
    xoops_cp_header();
    $show_edit = true;
    include RMTemplate::get()->get_template('admin/mywords_bookmarks.php', 'module', 'mywords');
    RMTemplate::get()->assign('xoops_pagetitle', __('Bookmarks Management', 'mywords'));
    RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
    RMTemplate::get()->add_script('../include/js/scripts.php?file=bookmarks.js');
    xoops_cp_footer();
}
Example #5
0
/**
* @desc Muestra todos los equipos registrados
*/
function showTeams()
{
    global $db, $tpl, $xoopsModule, $xoopsConfig, $adminTemplate;
    $tpl->assign('lang_existing', _AS_TC_EXISTING);
    $tpl->assign('lang_id', _AS_TC_ID);
    $tpl->assign('lang_image', _AS_TC_IMAGE);
    $tpl->assign('lang_name', _AS_TC_NAME);
    $tpl->assign('lang_catego', _AS_TC_CATEGO);
    $tpl->assign('lang_coachs', _AS_TC_COACHS);
    $tpl->assign('lang_options', _OPTIONS);
    $tpl->assign('lang_edit', _EDIT);
    $tpl->assign('lang_delete', _DELETE);
    $tpl->assign('lang_confirmm', _AS_TC_CONFM);
    $tpl->assign('lang_confirm', _AS_TC_CONFDEL);
    $tpl->assign('lang_date', _AS_TC_DATE);
    $tpl->assign('lang_players', _AS_TC_PLAYERS);
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name");
    $teams = array();
    while ($row = $db->fetchArray($result)) {
        $team = new TCTeam();
        $team->assignVars($row);
        $cat = new TCCategory($team->category());
        $coachs = '';
        foreach ($team->coachs(true) as $coach) {
            $coachs .= $coachs == '' ? $coach->name() : '<br />' . $coach->name();
        }
        $teams[] = array('id' => $team->id(), 'name' => $team->name(), 'image' => $team->image(), 'catego' => $cat->name(), 'coachs' => $coachs, 'date' => formatTimestamp($team->created(), 'c'));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . _AS_TC_TEAMSLOC);
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_teams.php", 'module', 'team');
    xoops_cp_footer();
}
Example #6
0
/**
 * Muestra una lista de las categorías existentes
 */
function showCategos()
{
    global $xoopsModule, $xoopsSecurity;
    $row = array();
    qpArrayCategos($row);
    $categories = array();
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    foreach ($row as $k) {
        $catego = new QPCategory($k['id_cat']);
        $catego->update();
        list($num) = $db->fetchRow($db->query("SELECT COUNT(*) FROM " . $db->prefix("qpages_pages") . " WHERE cat='{$k['id_cat']}'"));
        $k['posts'] = $num;
        $k['nombre'] = str_repeat("&#8212;", $k['saltos']) . ' ' . $k['nombre'];
        $categories[] = $k;
    }
    // Event
    $categories = RMEvents::get()->run_event('qpages.categories.list', $categories);
    RMTemplate::get()->add_style('admin.css', 'qpages');
    RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
    RMTemplate::get()->add_script('../include/js/qpages.js');
    RMTemplate::get()->assign('xoops_pagetitle', __('Categories management', 'qpages'));
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> &raquo; ' . __('Categories', 'qpages'));
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/qp_categos.php", 'module', 'qpages');
    xoops_cp_footer();
}
Example #7
0
/**
* @desc Visualiza todas las licencias existentes
**/
function showLicences()
{
    global $xoopsModule, $xoopsSecurity;
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "SELECT * FROM " . $db->prefix('dtrans_licences');
    $result = $db->queryF($sql);
    $licences = array();
    while ($rows = $db->fetchArray($result)) {
        $lc = new DTLicense();
        $lc->assignVars($rows);
        $licences[] = array('id' => $lc->id(), 'name' => $lc->name(), 'url' => $lc->link(), 'type' => $lc->type());
    }
    RMTemplate::get()->add_xoops_style('admin.css', 'dtransport');
    RMTemplate::get()->add_local_script('jquery.validate.min.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('admin.js', 'dtransport');
    RMTemplate::get()->add_head('<script type="text/javascript">
            var dt_message = "' . __('Do you really want to delete selected licenses', 'dtransport') . '";
            var dt_select_message = "' . __('Select at least one licence to delete!', 'dtransport') . '";
        </script>');
    DTFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Licences Management', 'dtransport'));
    xoops_cp_header();
    include RMTemplate::get()->get_template('admin/dtrans_licenses.php', 'module', 'dtransport');
    xoops_cp_footer();
}
Example #8
0
/**
 * Mostramos las categor?as
 */
function rmmfShow()
{
    global $db;
    define('RMCLOCATION', 'categories');
    MFFunctions::toolbar();
    RMTemplate::get()->add_head("<script type='text/javascript'>\n\t\t\t<!--\n\t\t\t\tfunction decision(message, url){\n\t\t\t\t\tif(confirm(message)) location.href = url;\n\t\t\t\t}\n\t\t\t-->\n\t\t   </script>");
    $result = array();
    MFFunctions::get_categories($result);
    include_once '../class/table.class.php';
    $table = new MFTable(true);
    $table->setCellStyle("padding: 0px; padding-left: 10px; border-bottom: 1px solid #0066CC; border-right: 1px solid #0066CC; background: url(../images/bgth.jpg) repeat-x; height: 20px; color: #FFFFFF;");
    $table->openTbl('100%', '', 1);
    $table->openRow('left');
    $table->addCell(_MA_RMMF_CATEGOS, 1, 3);
    $table->closeRow();
    $table->setRowClass('head');
    $table->setCellStyle("padding: 0px; padding-left: 3px; padding-right: 3px; border-bottom: 1px solid #DBE691; border-right: 1px solid #DBE691; background: url(../images/bghead.jpg) repeat-x; height: 20px; color: #000000;");
    $table->openRow('center');
    $table->addCell(_MA_RMMF_NAME, 0, '', 'center');
    $table->addCell(_MA_RMMF_ORDER, 0, '', 'center');
    $table->addCell(_MA_RMMF_OPTIONS, 0, '', 'center');
    $table->closeRow();
    $table->setRowClass('odd,even', true);
    $table->setCellStyle('');
    foreach ($result as $k => $v) {
        $table->openRow();
        $table->addCell(($v['saltos'] <= 0 ? "<img src='../images/plus.gif' border='0' align='absmiddle' />" : str_repeat("&nbsp;", $v['saltos']) . "<img src='../images/root.gif' border='0' align='absmiddle' />") . " <strong>{$v['nombre']}</strong>", 0, '', 'left');
        $table->addCell($v['orden'], 0, '', 'center');
        $table->addCell("<a href='?op=edit&amp;id={$v['id_cat']}'>" . _MA_RMMF_EDIT . "</a> &nbsp;| &nbsp;\n\t\t\t\t\t<a href=\"javascript:decision('" . sprintf(_MA_RMMF_CONFIRM, $v['nombre']) . "','?op=del&id={$v['id_cat']}');\">" . _MA_RMMF_DELETE . "</a>", 0, '', 'center');
        $table->closeRow();
    }
    $table->closeTbl();
    xoops_cp_header();
    xoops_cp_footer();
}
Example #9
0
function cache_view_files()
{
    global $xoopsSecurity;
    RMTemplate::get()->set_help('http://redmexico.com.mx/docs/xoops-booster/archivos-del-cache');
    RMTemplate::get()->assign('xoops_pagetitle', __('Booster Zone', 'booster'));
    RMTemplate::get()->add_style('cache.css', 'rmcommon', 'plugins/booster');
    RMFunctions::create_toolbar();
    xoops_cp_header();
    $plugin = RMFunctions::get()->load_plugin('booster');
    // Get files
    $items = XoopsLists::getFileListAsArray(XOOPS_CACHE_PATH . '/booster/files');
    $files = array();
    $count_expired = 0;
    foreach ($items as $file) {
        $tmp = explode('.', $file);
        if ($tmp[1] != 'meta') {
            continue;
        }
        $content = json_decode(file_get_contents(XOOPS_CACHE_PATH . '/booster/files/' . $file), true);
        $files[] = array('id' => $tmp[0], 'url' => $content['uri'], 'date' => formatTimestamp($content['created'], 'l'), 'time' => $content['created'], 'lang' => $content['language'], 'size' => filesize(XOOPS_CACHE_PATH . '/booster/files/' . $tmp[0] . '.html'));
        $count_expired = time() - $content['created'] >= $plugin->get_config('time') ? $count_expired + 1 : $count_expired;
    }
    include RMTemplate::get()->get_template('cache_files.php', 'plugin', 'rmcommon', 'booster');
    xoops_cp_footer();
}
Example #10
0
function xt_menu_options()
{
    RMTemplate::get()->add_tool(__('Dashboard', 'xthemes'), 'index.php', 'images/dashboard.png', 'dashboard');
    RMTemplate::get()->add_tool(__('Theme Settings', 'xthemes'), 'index.php?op=config', 'images/settings.png', 'settings');
    RMTemplate::get()->add_tool(__('Catalog', 'xthemes'), 'index.php?op=catalog', 'images/catalog.png', 'catalog');
    RMTemplate::get()->add_tool(__('About', 'xthemes'), 'index.php?op=about', 'images/about.png', 'about');
}
Example #11
0
function showPlayers()
{
    global $xoopsModule, $mc, $adminTemplate, $tpl, $db;
    $gteam = TCFunctions::get('team');
    $team = new TCTeam($gteam);
    // Equipos
    $tpl->assign('team', $team->isNew() ? 0 : $team->id());
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name");
    $teams = array();
    while ($row = $db->fetchArray($result)) {
        $ct = new TCTeam();
        $ct->assignVars($row);
        $cat =& $ct->category(true);
        $teams[] = array('id' => $ct->id(), 'name' => $ct->name() . " (" . $cat->name() . ")");
    }
    // Entrenadores
    $coachs = array();
    if (!$team->isNew()) {
        foreach ($team->coachs(true) as $coach) {
            $coachs[] = array('id' => $coach->id(), 'name' => $coach->name(), 'image' => $coach->image());
        }
    }
    // Jugadores
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_players") . " WHERE team='" . $team->id() . "'");
    $players = array();
    while ($row = $db->fetchArray($result)) {
        $player = new TCPlayer();
        $player->assignVars($row);
        $players[] = array('id' => $player->id(), 'name' => $player->name(), 'image' => $player->image(), 'number' => $player->number(), 'age' => $player->age(), 'date' => formatTimestamp($player->date(), 'c'));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Jugadores', 'admin_team'));
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_players.php", 'module', 'team');
    xoops_cp_footer();
}
Example #12
0
function rmmfShow()
{
    global $db;
    define('RMCLOCATION', 'index');
    MFFunctions::toolbar();
    xoops_cp_header();
    RMTemplate::get()->add_head("<script type='text/javascript'>\n\t\t\t<!--\n\t\t\t\tfunction decision(message, url){\n\t\t\t\t\tif(confirm(message)) location.href = url;\n\t\t\t\t}\n\t\t\t-->\n\t\t   </script>");
    /**
     * @todo Create pagination
     */
    $result = $db->query("SELECT * FROM " . $db->prefix("rmmf_works") . " ORDER BY titulo");
    include_once '../class/catego.class.php';
    $items = array();
    while ($row = $db->fetchArray($result)) {
        $catego = new MFCategory($row['catego']);
        $items[] = array('title' => $row['titulo'], 'category' => $catego->getVar('nombre'), 'featured' => $row['resaltado'], 'id' => $row['id_w']);
    }
    /*
    	$table->setRowClass('odd,even', true);
    	$table->setCellStyle('');
    	
    	
    	$table->closeTbl();
    	rmmf_make_footer();*/
    include RMTemplate::get()->get_template('admin/mf-index.php', 'module', 'myfolder');
    xoops_cp_footer();
}
Example #13
0
/**
* @desc Visualiza la lista de amigos del usuario
**/
function showFriends()
{
    global $xoopsOption, $tpl, $db, $xoopsUser, $xoopsModuleConfig, $pag, $xoopsConfig;
    $xoopsOption['template_main'] = 'gs_panel_friends.html';
    include 'header.php';
    $mc =& $xoopsModuleConfig;
    GSFunctions::makeHeader();
    //Barra de Navegación
    $sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_friends') . " WHERE gsuser='******'";
    $page = isset($pag) ? $pag : '';
    $limit = 30;
    list($num) = $db->fetchRow($db->query($sql));
    if ($page > 0) {
        $page -= 1;
    }
    $start = $page * $limit;
    $tpages = (int) ($num / $limit);
    if ($num % $limit > 0) {
        $tpages++;
    }
    $pactual = $page + 1;
    if ($pactual > $tpages) {
        $rest = $pactual - $tpages;
        $pactual = $pactual - $rest + 1;
        $start = ($pactual - 1) * $limit;
    }
    if ($tpages > 1) {
        if ($mc['urlmode']) {
            $urlnav = 'cpanel/friends';
        } else {
            $urlnav = 'cpanel.php?by=cpanel/friends';
        }
        $nav = new GsPageNav($num, $limit, $start, 'pag', $urlnav, 0);
        $tpl->assign('friendsNavPage', $nav->renderNav(4, 1));
    }
    $showmax = $start + $limit;
    $showmax = $showmax > $num ? $num : $showmax;
    $tpl->assign('lang_showing', sprintf(__('Sowing friends %u to %u from %u.', 'galleries'), $start + 1, $showmax, $num));
    $tpl->assign('limit', $limit);
    $tpl->assign('pag', $pactual);
    //Fin de barra de navegación
    $sql = "SELECT * FROM " . $db->prefix('gs_friends') . " WHERE gsuser='******'";
    $sql .= " LIMIT {$start},{$limit}";
    $result = $db->query($sql);
    while ($row = $db->fetchArray($result)) {
        $xu = new XoopsUser($row['uid']);
        $tpl->append('users', array('uid' => $xu->uid(), 'uname' => $xu->uname(), 'link' => XOOPS_URL . "/modules/galleries/" . ($mc['urlmode'] ? "usr/" . $xu->uname() . "/" : "user.php?id=usr/" . $xu->uname()), 'avatar' => RMEvents::get()->run_event('rmcommon.get.avatar', $xu->email(), 0, $xu->user_avatar() != '' ? XOOPS_URL . '/uploads/avatars/' . $xu->user_avatar() : GS_URL . '/images/avatar.png')));
    }
    $tpl->assign('lang_uname', __('User name', 'galleries'));
    $tpl->assign('lang_newfriend', __('New Friend', 'galleries'));
    $tpl->assign('lang_del', __('Delete', 'galleries'));
    $tpl->assign('lang_confirm', __('Do you really wish to delete specified friend?', 'galleries'));
    $tpl->assign('lang_confirms', __('Do you really wish to delete selected friends?', 'galleries'));
    $tpl->assign('form_action_add', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/add/' : '?cp=add'));
    $tpl->assign('form_action_del', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/delete/' : '?cp=delete'));
    $tpl->assign('delete_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/deletefriend/pag/' . $pactual . '/id/' : '?cp=deletefriend&amp;page=' . $pactual . '&amp;id='));
    RMTemplate::get()->add_style('panel.css', 'galleries');
    createLinks();
    include 'footer.php';
}
Example #14
0
/**
* @desc Visualiza todas las categorías existentes
**/
function showCategories()
{
    global $xoopsModule, $xoopsSecurity;
    $categos = array();
    DTFunctions::getCategos($categos);
    $categories = array();
    foreach ($categos as $row) {
        $cat = new DTCategory();
        $cat->assignVars($row);
        $categories[] = array('id' => $cat->id(), 'name' => $cat->name(), 'parent' => $cat->parent(), 'active' => $cat->active(), 'description' => $cat->desc(), 'indent' => $row['jumps']);
    }
    unset($categos);
    RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('jquery.validate.min.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('admin.js', 'dtransport');
    RMTemplate::get()->add_head('<script type="text/javascript">
            var dt_message = "' . __('Do you really want to delete selected categories', 'dtransport') . '";
            var dt_select_message = "' . __('Select at least one category to delete!', 'dtransport') . '";
        </script>');
    RMTemplate::get()->add_xoops_style('admin.css', 'dtransport');
    DTFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Categories', 'dtransport'));
    xoops_cp_header();
    include RMTemplate::get()->get_template('admin/dtrans_categos.php', 'module', 'dtransport');
    xoops_cp_footer();
}
Example #15
0
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 . '&amp;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';
}
Example #16
0
 public function render()
 {
     global $exmConfig;
     /*$rtn = '';
     		$rtn .= '<div class="exmDateField">
                          <div id="txt_'.$this->getName().'" class="exmTextDate">'.($this->_date===null ? _RMS_CFD_SDTXT : date($this->_showtime ? $exmConfig['datestring'] : $exmConfig['dateshort'], $this->_date)).'</div>';
     		$rtn .= '<img title="'._RMS_CFD_CLICKTOSEL.'" src="'.ABSURL.'/rmcommon/images/calendar.png" alt="" class="exmfield_date_show_date" onclick="showEXMDates(\''.$this->getName().'\','.$this->_showtime.','.($this->_date===null ? "'time'" : $this->_date).');" style="cursor: pointer;" />';
     		$rtn .= '<img title="'._RMS_CFD_CLICKTOCLEAR.'" src="'.ABSURL.'/rmcommon/images/calendardel.png" alt="" onclick="clearEXMDates(\''.$this->getName().'\');" style="cursor: pointer;" />';
     		$rtn .= '<input type="hidden" name="'.$this->getName().'" id="'.$this->getName().'" value="'.($this->_date===null ? '' : $this->_date).'" /></div>';
     		if (!defined('RM_FRAME_DATETIME_DIVOK')){
     			$rtn .= "<div id='exmDatesContainer' class='exmDates'></div>";
     			define('RM_FRAME_DATETIME_DIVOK', 1);
     		}*/
     if ($this->time == 1) {
         RMTemplate::get()->add_head("\n<script type='text/javascript'>\n                \nvar " . $this->getName() . "_time = 1;\n            \n\$(function(){\n            \n\$(\"#exmdate-" . $this->getName() . "\").datetimepicker({changeMonth: true,changeYear: true, yearRange: '" . $this->year_range . "'" . ($this->options != '' ? "," . $this->options : "") . "});\n            \n});\n</script>\n            \n");
         $date = '';
         if ($this->_date > 0) {
             $date = date('m/d/Y H:i:s', $this->_date);
         }
     } elseif ($this->time == 0) {
         RMTemplate::get()->add_head("\n<script type='text/javascript'>\n            \nvar " . $this->getName() . "_time = 0;\n            \n\$(function(){\n            \n\$(\"#exmdate-" . $this->getName() . "\").datepicker({changeMonth: true,changeYear: true, yearRange: '" . $this->year_range . "'" . ($this->options != '' ? "," . $this->options : "") . "});\n            \n});\n</script>\n            \n");
         if ($this->_date > 0) {
             $date = date('m/d/Y', $this->_date);
         }
     } elseif ($this->time == 2) {
         RMTemplate::get()->add_head("\n<script type='text/javascript'>\n            \nvar " . $this->getName() . "_time = 2;\n            \n\$(function(){\n            \n\$(\"#exmdate-" . $this->getName() . "\").timepicker({changeMonth: true,changeYear: true, yearRange: '" . $this->year_range . "'" . ($this->options != '' ? "," . $this->options : "") . ", timeOnlyTitle: '" . __('Choose Time', 'rmcommon') . "'});\n            \n});\n</script>\n            \n");
         if ($this->_date != '') {
             $date = $this->_date;
         }
     }
     $rtn = "<input type='text' class='exmdates_field' name='text_" . $this->getName() . "' id=\"exmdate-" . $this->getName() . "\"' size='20' maxlength='19' value='" . $date . "' />\n                    <input type='hidden' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $date . "' />";
     return $rtn;
 }
Example #17
0
function show_rss_content()
{
    global $xoopsConfig;
    include_once $GLOBALS['xoops']->path('class/template.php');
    $tpl = new XoopsTpl();
    $module = rmc_server_var($_GET, 'mod', '');
    if ($module == '') {
        redirect_header('backend.php', 1, __('Choose an option to see its feed', 'rmcommon'));
        die;
    }
    if (!file_exists(XOOPS_ROOT_PATH . '/modules/' . $module . '/rss.php')) {
        redirect_header('backend.php', 1, __('This module does not support rss feeds', 'rmcommon'));
        die;
    }
    $GLOBALS['xoopsLogger']->activated = false;
    if (function_exists('mb_http_output')) {
        mb_http_output('pass');
    }
    header('Content-Type:text/xml; charset=utf-8');
    include XOOPS_ROOT_PATH . '/modules/' . $module . '/rss.php';
    if (!isset($rss_channel['image'])) {
        $rmc_config = RMFunctions::configs();
        $rss_channel['image']['url'] = $rmc_config['rssimage'];
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.png');
        $rss_channel['image']['width'] = $dimention[0] > 144 ? 144 : $dimention[0];
        $rss_channel['image']['height'] = $dimention[1] > 400 ? 400 : $dimention[1];
    }
    include RMTemplate::get()->get_template('rmc_rss.php', 'module', 'rmcommon');
}
Example #18
0
/**
* Modify the page output to include some new features
* 
* @param mixed $output
* @return string
*/
function cu_render_output($output)
{
    global $xoTheme, $xoopsTpl;
    if (function_exists('xoops_cp_header')) {
        return $output;
    }
    $page = $output;
    if ($xoopsTpl) {
        if (defined('COMMENTS_INCLUDED') && COMMENTS_INCLUDED) {
            RMTemplate::get()->add_xoops_style('comments.css', 'rmcommon');
        }
    }
    include_once RMTemplate::get()->tpl_path('rmc_header.php', 'rmcommon');
    $rtn .= $scripts;
    $rtn .= $styles;
    $rtn .= $heads;
    $pos = strpos($page, "<!-- RMTemplateHeader -->");
    if ($pos !== FALSE) {
        $page = str_replace('<!-- RMTemplateHeader -->', $rtn, $page);
        $page = RMEvents::get()->run_event('rmcommon.end.flush', $page);
        return $page;
    }
    $pos = strpos($page, "</head>");
    if ($pos === FALSE) {
        return $output;
    }
    $ret = substr($page, 0, $pos) . "\n";
    $ret .= $rtn;
    $ret .= substr($page, $pos);
    $ret = RMEvents::get()->run_event('rmcommon.end.flush', $ret);
    return $ret;
}
Example #19
0
function show_group_form()
{
    global $xoopsDB, $xoopsSecurity;
    $ajax = new Rmcommon_Ajax();
    $ajax->prepare_ajax_response();
    $id = RMHttpRequest::get('id', 'integer', 0);
    if ($id > 0) {
        $group = new Rmcommon_Group($id);
        if ($group->isNew()) {
            $ajax->ajax_response(__('The specified group does not exists!', 'rmcommon'), 1, 1);
        }
    } else {
        $group = new Rmcommon_Group();
    }
    $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("modules") . " ORDER BY name ASC");
    $modules = array();
    $admin_rights = $group->load_permissions('module_admin');
    $access_rights = $group->load_permissions('module_read');
    while ($row = $xoopsDB->fetchArray($result)) {
        $modules[$row['mid']] = (object) $row;
        $modules[$row['mid']]->permissions = RMPrivileges::module_permissions($row['dirname']);
        $modules[$row['mid']]->privileges = RMPrivileges::read_permissions($row['dirname'], $group->id());
        $modules[$row['mid']]->admin = isset($admin_rights[$row['mid']]);
        $modules[$row['mid']]->read = isset($access_rights[$row['mid']]);
    }
    ob_start();
    include RMTemplate::get()->get_template('rmc-groups-form.php', 'module', 'rmcommon');
    $content = ob_get_clean();
    $ajax->ajax_response($group->isNew() ? __('Create new group', 'rmcommon') : sprintf(__('Edit group "%s"', 'rmcommon'), $group->getVar('name')), 0, 1, array('content' => $content, 'width' => 'xlarge', 'color' => 'green', 'windowId' => 'window-form-groups'));
}
Example #20
0
function show_rm_plugins()
{
    $path = RMCPATH . '/plugins';
    $dir_list = XoopsLists::getDirListAsArray($path);
    $available_plugins = array();
    $installed_plugins = array();
    foreach ($dir_list as $dir) {
        if (!file_exists($path . '/' . $dir . '/' . strtolower($dir) . '-plugin.php')) {
            continue;
        }
        $phand = new RMPlugin($dir);
        // PLugin handler
        if ($phand->isNew()) {
            $phand->setVar('dir', $dir);
            $available_plugins[] = $phand;
        } else {
            $installed_plugins[] = $phand;
        }
    }
    rm_reload_plugins();
    RMFunctions::create_toolbar();
    xoops_cp_header();
    include RMTemplate::get()->get_template('rmc_plugins.php', 'module', 'rmcommon');
    xoops_cp_footer();
}
 /**
  * Get the menu for the current module
  */
 public function currentModuleMenu($m = '')
 {
     global $xoopsModule, $xoopsUser;
     if (!is_a($xoopsModule, 'XoopsModule')) {
         return false;
     } else {
         $mod = $xoopsModule;
     }
     // Check user
     if (!is_a($xoopsUser, 'XoopsUser')) {
         return false;
     }
     if (!$xoopsUser->isAdmin($mod->mid())) {
         return false;
     }
     $amenu = $mod->getAdminMenu();
     $amenu = RMEvents::get()->run_event('rmcommon.current.module.menu', $amenu);
     if ($amenu) {
         foreach ($amenu as $menu) {
             RMTemplate::get()->add_menu($menu['title'], strpos($menu['link'], 'http://') !== FALSE && strpos($menu['link'], 'ftp://') !== FALSE ? $menu['link'] : XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $menu['link'], isset($menu['icon']) ? $menu['icon'] : '', isset($menu['location']) ? $menu['location'] : '', isset($menu['options']) ? $menu['options'] : null);
             //RMTemplate::get()->add_tool($menu['title'], $menu['link'], isset($menu['icon']) ? $menu['icon'] : '');
         }
     }
     if ($mod->hasconfig()) {
         RMTemplate::get()->add_menu(__('Settings', 'rmcommon'), XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->mid(), RMTHEMEURL . '/images/settings.png', '');
     }
 }
Example #22
0
/**
* @desc Muestra la lista de categorías existentes
*/
function showCategories()
{
    global $xoopsModuleConfig, $xoopsConfig, $xoopsModule, $xoopsSecurity;
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $result = $db->query("SELECT * FROM " . $db->prefix("bxpress_categories") . " ORDER BY `order`, title");
    $categos = array();
    while ($row = $db->fetchArray($result)) {
        $catego = new bXCategory();
        $catego->assignVars($row);
        $categos[] = array('id' => $catego->id(), 'title' => $catego->title(), 'desc' => $catego->description(), 'status' => $catego->status());
    }
    bXFunctions::menu_bar();
    $form = new RMForm('', '', '');
    $groups = new RMFormGroups('', 'groups', 1, 1, 2, array(0));
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Categories', 'bxpress'));
    xoops_cp_header();
    RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('admin.js', 'bxpress');
    RMTemplate::get()->set_help('http://www.redmexico.com.mx/docs/bxpress-forums/categorias/standalone/1/');
    RMTemplate::get()->add_head('<script type="text/javascript">
        var bx_select_message = "' . __('You must select a category at least in order to run this action!', 'bxpress') . '";
        var bx_message = "' . __('Do you really want to delete selected categories?\\n\\nAll forums under this category will be deleted also!', 'bxpress') . '";
    </script>');
    include RMTemplate::get()->get_template('admin/forums_categos.php', 'module', 'bxpress');
    xoops_cp_footer();
}
Example #23
0
 /**
  * Render the current crumbs array
  * 
  * @return string
  */
 public function render()
 {
     RMTemplate::get()->add_style('breadcrumb.css', 'rmcommon');
     ob_start();
     include RMTemplate::get()->get_template('rmc_breadcrumb.php', 'module', 'rmcommon');
     $ret = ob_get_clean();
     return $ret;
 }
Example #24
0
    /**
     * Show the Users field
     * This field needs that form.css, jquery.css and forms.js would be included.
     */
    public function render()
    {
        RMTemplate::get()->add_script('forms.js', 'rmcommon', array('footer' => 1));
        RMTemplate::get()->add_script('jquery.validate.min.js', 'rmcommon', array('directory' => 'include', 'footer' => 1));
        RMTemplate::get()->add_style('forms.css', 'rmcommon');
        if (function_exists("xoops_cp_header")) {
            RMTemplate::get()->add_style('jquery.css', 'rmcommon');
        } else {
            RMTemplate::get()->add_style('jquery.css', 'rmcommon');
        }
        $rtn = "<div id='" . $this->id() . "-users-container'" . ($this->getExtra() != '' ? " " . $this->getExtra() : '') . " class='form_users_container " . ($this->multi ? 'checkbox' : 'radio') . "'>\n\t\t\t\t<ul id='" . $this->id() . "-users-list'>";
        $db = XoopsDatabaseFactory::getDatabaseConnection();
        if ($this->showall && in_array(0, $this->selected)) {
            $rtn .= "<li id='" . $this->id() . "-exmuser-0'>\n\n                        <label>\n                        <a href='javascript:;' onclick=\"users_field_name='" . $this->id() . "'; usersField.remove(0);\"><span>delete</span></a>\n                        <input type='" . ($this->multi ? 'checkbox' : 'radio') . "' name='" . ($this->multi ? $this->getName() . '[]' : $this->getName()) . "' id='" . $this->id() . "-0'\n\t\t\t\t \t\tvalue='0' checked='checked' /> " . __('All Users', 'rmcommon') . "\n                        </label></li>";
        }
        if (is_array($this->selected) && !empty($this->selected) && !(count($this->selected) == 1 && $this->selected[0] == 0)) {
            $sql = "SELECT uid,uname FROM " . $db->prefix("users") . " WHERE ";
            $sql1 = '';
            if ($this->multi) {
                foreach ($this->selected as $id) {
                    if ($id != 0) {
                        $sql1 .= $sql1 == '' ? "uid='{$id}'" : " OR uid='{$id}'";
                    }
                }
            } else {
                if ($this->selected[0] != 0) {
                    $sql1 = "uid='" . $this->selected[0] . "'";
                }
            }
            $result = $db->query($sql . $sql1);
            $selected = '';
            while ($row = $db->fetchArray($result)) {
                $rtn .= "<li id='" . $this->id() . "-exmuser-{$row['uid']}'>\n\n\t\t\t\t\t\t<label>";
                $rtn .= $this->can_change ? " <a href='#' onclick=\"users_field_name='" . $this->id() . "'; usersField.remove({$row['uid']});\"><span>delete</span></a>" : '';
                $rtn .= "<input type='" . ($this->multi ? 'checkbox' : 'radio') . "' name='" . ($this->multi ? $this->getName() . '[]' : $this->getName()) . "' id='" . $this->id() . "-" . $row['uid'] . "'\n\t\t\t\t \t\tvalue='{$row['uid']}' checked='checked' /> \n                        {$row['uname']} ";
                $rtn .= "</label></li>";
            }
        }
        $rtn .= "</ul><br />";
        if ($this->can_change) {
            $rtn .= "<button type='button' class='btn btn-info btn-sm' onclick=\"usersField.form_search_users('" . $this->id() . "'," . $this->width . "," . $this->height . "," . $this->limit . "," . intval($this->multi) . ",'" . XOOPS_URL . "');\">" . __('Users...', 'rmcommon') . "</button>";
            $rtn .= '<div class="modal fade smartb-form-dialog users-form-selector" id="' . $this->id() . '-dialog-search">
					    <div class="modal-dialog">
					        <div class="modal-content">
					            <div class="modal-header">
					                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					                <h4 class="modal-title">' . __('Select users', 'rmcommon') . '</h4>
					            </div>
					            <div class="modal-body">

					            </div>
					        </div>
					    </div>
					</div>';
        }
        $rtn .= '</div>';
        return $rtn;
    }
Example #25
0
function shop_widget_image()
{
    global $edit, $id, $product;
    $widget['title'] = __('Product Image', 'shop');
    ob_start();
    include RMTemplate::get()->get_template('widgets/shop_w_image.php', 'module', 'shop');
    $widget['content'] = ob_get_clean();
    return $widget;
}
Example #26
0
 /**
  * Render the current crumbs array
  *
  * @return string
  */
 public function render()
 {
     global $cuIcons;
     RMTemplate::get()->add_style('breadcrumb.css', 'rmcommon');
     ob_start();
     include RMTemplate::get()->path('rmc-breadcrumb.php', 'module', 'rmcommon');
     $ret = ob_get_clean();
     return $ret;
 }
Example #27
0
/**
* @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> &raquo; " . __('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();
}
 public function menu_bar()
 {
     RMTemplate::get()->add_tool(__('Dashboard', 'exmbb'), './index.php', '../images/dash.png', 'dashboard');
     RMTemplate::get()->add_tool(__('Categories', 'exmbb'), './categos.php', '../images/categos.png', 'categories');
     RMTemplate::get()->add_tool(__('Forums', 'exmbb'), './forums.php', '../images/forums.png', 'forums');
     RMTemplate::get()->add_tool(__('Announcements', 'exmbb'), './announcements.php', '../images/bell.png', 'messages');
     RMTemplate::get()->add_tool(__('Reports', 'exmbb'), './reports.php', '../images/reports.png', 'reports');
     RMTemplate::get()->add_tool(__('Prune', 'exmbb'), './prune.php', '../images/prune.png', 'prune');
 }
Example #29
0
 /**
  * Shows the initial panel with options to import
  */
 public function panel()
 {
     require XOOPS_ROOT_PATH . '/modules/mywords/include/mw-lang.php';
     RMTemplate::getInstance()->add_style('importer.min.css', 'mywords', ['id' => 'importer-css']);
     RMTemplate::getInstance()->add_script('importer.min.js', 'mywords', ['id' => 'importer-js', 'directory' => 'include', 'footer' => 1]);
     RMTemplate::getInstance()->header();
     RMTemplate::getInstance()->display('admin/mywords-importer.php');
     RMTemplate::getInstance()->footer();
 }
Example #30
0
 public function render()
 {
     RMTemplate::get()->add_local_script('swfobject.js', 'rmcommon', 'include');
     RMTemplate::get()->add_local_script('jquery.uploadify.js', 'rmcommon', 'include');
     RMTemplate::get()->add_style('uploadify.css', 'rmcommon');
     ob_start();
     include RMTemplate::get()->get_template('uploadify.js.php', 'module', 'rmcommon');
     $script = ob_get_clean();
     return $script;
 }