/** * 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(); }
/** * @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(); }
/** * @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(); }
/** * @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(); }
/** * @desc Muestra la lista de los anuncios existentes */ function showAnnounces() { global $db, $xoopsModule, $xoopsSecurity; $result = $db->query("SELECT * FROM " . $db->prefix("bxpress_announcements") . " ORDER BY date"); $announcements = array(); while ($row = $db->fetchArray($result)) { $an = new bXAnnouncement(); $an->assignVars($row); $announcements[] = array('id' => $an->id(), 'text' => TextCleaner::getInstance()->truncate($an->text(), 100), 'date' => formatTimestamp($an->date()), 'expire' => formatTimeStamp($an->expire()), 'where' => constant('BX_FWHERE' . $an->where()), 'wherelink' => $an->where() == 1 ? '../forum.php?id=' . $an->forum() : '../', 'by' => $an->byName()); } $announcements = RMEvents::get()->run_event('bxpress.announcements.list', $announcements); RMTemplate::get()->set_help('http://www.redmexico.com.mx/docs/bxpress-forums/anuncios/standalone/1/'); bXFunctions::menu_bar(); xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Announcements Management', 'bxpress')); xoops_cp_header(); RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include'); RMTemplate::get()->add_style('admin.css', 'bxpress'); RMTemplate::get()->add_local_script('admin.js', 'bxpress'); include RMTemplate::get()->get_template("admin/forums_announcements.php", 'module', 'bxpress'); xoops_cp_footer(); }
/** * @desc Muestra la lista de los anuncios existentes */ function showAnnounces() { global $db, $xoopsModule, $xoopsSecurity; $result = $db->query("SELECT * FROM " . $db->prefix("mod_bxpress_announcements") . " ORDER BY date"); $announcements = array(); while ($row = $db->fetchArray($result)) { $an = new bXAnnouncement(); $an->assignVars($row); $announcements[] = array('id' => $an->id(), 'text' => TextCleaner::getInstance()->truncate($an->text(), 100), 'date' => formatTimestamp($an->date()), 'expire' => formatTimeStamp($an->expire()), 'where' => constant('BX_FWHERE' . $an->where()), 'wherelink' => $an->where() == 1 ? '../forum.php?id=' . $an->forum() : '../', 'by' => $an->byName()); } $announcements = RMEvents::get()->run_event('bxpress.announcements.list', $announcements); RMTemplate::get()->add_help(__('Announcements Help', 'bxpress'), '#'); $bc = RMBreadCrumb::get(); $bc->add_crumb(__('Announcements Management', 'bxpress')); xoops_cp_header(); RMTemplate::get()->add_script('jquery.checkboxes.js', 'rmcommon', array('directory' => 'include')); RMTemplate::get()->add_style('admin.css', 'bxpress'); RMTemplate::get()->add_script('admin.js', 'bxpress'); include RMTemplate::get()->get_template("admin/forums-announcements.php", 'module', 'bxpress'); xoops_cp_footer(); }
function b_xoopspoll_show() { //echo "a"; global $xoopsUser; $block = array(); $polls =& XoopsPoll::getAll(array('display=1'), true, 'weight ASC, end_time DESC'); $count = count($polls); $block['lang_vote'] = _PL_VOTE; $block['lang_results'] = _PL_RESULTS; $block['lang_expires'] = _PL_WILLEXPIRE; $block['lang_expired'] = _PL_HASEXPIRED; for ($i = 0; $i < $count; $i++) { $options_arr =& XoopsPollOption::getAllByPollId($polls[$i]->getVar('poll_id')); $option_type = 'radio'; $option_name = 'option_id'; if ($polls[$i]->getVar('multiple') == 1) { $option_type = 'checkbox'; $option_name .= '[]'; } $totalVotes=$polls[$i]->getVar('votes'); $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; if ( XoopsPollLog::hasVoted($polls[$i]->getVar('poll_id'), xoops_getenv('REMOTE_ADDR'),$uid)){ $hasVoted=1; }else{ $hasVoted=0; } foreach ($options_arr as $option) { $percent = intval(100 * $option->getVar("option_count") / $totalVotes).'%'; $options[] = array('id' => $option->getVar('option_id'), 'text' => $option->getVar('option_text'), 'count' => $option->getVar('option_count'), 'percent'=>$percent, 'color'=>$option->getVar('option_color')); } $poll = array('id' => $polls[$i]->getVar('poll_id'), 'question' => $polls[$i]->getVar('question'), 'option_type' => $option_type, 'option_name' => $option_name, 'options' => $options,'has_expired'=>$polls[$i]->hasExpired(), 'votes' => $polls[$i]->getVar('votes'), 'has_voted'=>$hasVoted, 'end_time'=>formatTimeStamp($polls[$i]->getVar('end_time'), "m")); $block['polls'][] =& $poll; unset($options); unset($poll); } return $block; }
function b_xoopspoll_show() { global $xoopsUser; $block = array(); $polls =& XoopsPoll::getAll(array('display=1'), true, 'weight ASC, end_time DESC'); $count = count($polls); $block['lang_vote'] = _PL_VOTE; $block['lang_results'] = _PL_RESULTS; $block['lang_expires'] = _PL_WILLEXPIRE; $block['lang_expired'] = _PL_HASEXPIRED; $block['lang_comments'] = _PL_COMMENTS; $block['lang_comment'] = _PL_COMMENT; $block['url'] = "http" . (!empty($_SERVER['HTTPS']) ? "s" : "") . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; for ($i = 0; $i < $count; $i++) { $options_arr =& XoopsPollOption::getAllByPollId($polls[$i]->getVar('poll_id')); $option_type = 'radio'; $option_name = 'option_id'; if ($polls[$i]->getVar('multiple') == 1) { $option_type = 'checkbox'; $option_name .= '[]'; } $totalVotes = $polls[$i]->getVar('votes'); $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; if (XoopsPollLog::hasVoted($polls[$i]->getVar('poll_id'), xoops_getenv('REMOTE_ADDR'), $uid)) { $hasVoted = 1; } else { $hasVoted = 0; } foreach ($options_arr as $option) { $percent = intval(100 * $option->getVar("option_count") / $totalVotes) . '%'; $options[] = array('id' => $option->getVar('option_id'), 'text' => $option->getVar('option_text'), 'count' => $option->getVar('option_count'), 'percent' => $percent, 'color' => $option->getVar('option_color')); } $poll = array('id' => $polls[$i]->getVar('poll_id'), 'question' => $polls[$i]->getVar('question'), 'option_type' => $option_type, 'option_name' => $option_name, 'options' => $options, 'has_expired' => $polls[$i]->hasExpired(), 'votes' => $polls[$i]->getVar('votes'), 'has_voted' => $hasVoted, 'totalVotes' => sprintf(_PL_TOTALVOTES, $totalVotes), 'comments' => XoopsPoll::getcomments($polls[$i]->getVar('poll_id')), 'end_time' => formatTimeStamp($polls[$i]->getVar('end_time'), "m"), 'comment_mode' => XoopsPollLog::commentMode()); $block['polls'][] =& $poll; unset($options); unset($poll); } return $block; }
$fuser_avatar = $foundusers[$j]->getVar("user_avatar") ? "<img src='" . XOOPS_UPLOAD_URL . "/" . $foundusers[$j]->getVar("user_avatar") . "' alt='' />" : " "; $fuser_name = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : " "; echo "<tr class='{$class}'><td align='center'><input type='checkbox' name='memberslist_id[]' id='memberslist_id[]' value='" . $foundusers[$j]->getVar("uid") . "' /><input type='hidden' name='memberslist_uname[" . $foundusers[$j]->getVar("uid") . "]' id='memberslist_uname[]' value='" . $foundusers[$j]->getVar("uname") . "' /></td>"; echo "<td>{$fuser_avatar}</td><td><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $foundusers[$j]->getVar("uid") . "'>" . $foundusers[$j]->getVar("uname") . "</a></td><td>" . $fuser_name . "</td><td align='center'><a href='mailto:" . $foundusers[$j]->getVar("email") . "'><img src='" . XOOPS_URL . "/images/icons/email.gif' border='0' alt='"; printf(_SENDEMAILTO, $foundusers[$j]->getVar("uname", "E")); echo "' /></a></td><td align='center'><a href='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $foundusers[$j]->getVar("uid") . "\",\"pmlite\",450,370);'><img src='" . XOOPS_URL . "/images/icons/pm.gif' border='0' alt='"; printf(_SENDPMTO, $foundusers[$j]->getVar("uname", "E")); echo "' /></a></td><td align='center'>"; if ($foundusers[$j]->getVar("url", "E") != "") { echo "<a href='" . $foundusers[$j]->getVar("url", "E") . "' target='_blank'><img src='" . XOOPS_URL . "/images/icons/www.gif' border='0' alt='" . _VISITWEBSITE . "' /></a>"; } else { echo " "; } echo "</td><td align='center'>" . formatTimeStamp($foundusers[$j]->getVar("user_regdate"), "s") . "</td><td align='center'>"; if ($foundusers[$j]->getVar("last_login") != 0) { echo formatTimeStamp($foundusers[$j]->getVar("last_login"), "m"); } else { echo " "; } echo "</td><td align='center'>" . $foundusers[$j]->getVar("posts") . "</td>"; echo "<td align='center'><a href='" . XOOPS_URL . "/modules/system/admin.php?fct=users&uid=" . $foundusers[$j]->getVar("uid") . "&op=modifyUser'>" . _EDIT . "</a></td></tr>\n"; } echo "<tr class='foot'><td><select name='fct'><option value='users'>" . _DELETE . "</option><option value='mailusers'>" . _AM_SENDMAIL . "</option>"; $group = !empty($_POST['group']) ? intval($_POST['group']) : 0; if ($group > 0) { $member_handler =& xoops_gethandler('member'); $add2group =& $member_handler->getGroup($group); echo "<option value='groups' selected='selected'>" . sprintf(_AM_ADD2GROUP, $add2group->getVar('name')) . "</option>"; } echo "</select> "; if ($group > 0) {
} $message = cleanMessage($_POST['message'], $max_chars, $userid); if (!is_numeric($message) || $message > 5) { $fields = array('userid' => $userid, 'message' => $message, 'img' => $img, 'time_start' => $_POST['time_start'], 'time_end' => $_POST['time_end'], 'days' => $_POST['days'], 'hour' => $_POST['hour'], 'publish_fb' => $_POST['publish_fb'], 'publish_tw' => $_POST['publish_tw'], 'publish_fbp' => $_POST['publish_fbp'], 'publish_fbgp' => $_POST['publish_group']); if (is_array($fields = makeTimes($fields))) { if ($_POST['edit'] == true) { unset($fields['userid']); if ($hdb->doUpdate($table, $fields, " id=" . $hdb->quote($_POST['mes_id']) . " AND userid=" . $hdb->quote($userid))) { $return = array("e" => 0, "c" => array("i" => $_POST['mes_id'], "m" => $fields['message'], "p" => $fields['img'], "ts_es" => formatTimeStamp($fields['time_start']), "ts_en" => date('Y-m-d', $fields['time_start']), "te_es" => formatTimeStamp($fields['time_end']), "te_en" => date('Y-m-d', $fields['time_end']), "t_p" => $fields['img'], "d" => $fields['days'], "h" => formatHour($fields['hour']), "tw" => $fields['publish_tw'], "fb" => $fields['publish_fb'], "fbp" => $fields['publish_fbp'], "gp" => $fields['publish_fbgp'])); } else { error_log($hdb->errorInfo()); $return = array("e" => 2); } } else { if ($hdb->doInsert($table, $fields)) { $return = array("e" => 0, "c" => array("i" => $hdb->lastInsertId(), "m" => $fields['message'], "p" => $fields['img'], "ts_es" => formatTimeStamp($fields['time_start']), "ts_en" => date('Y-m-d', $fields['time_start']), "te_es" => formatTimeStamp($fields['time_end']), "te_en" => date('Y-m-d', $fields['time_end']), "t_p" => $fields['img'], "d" => $fields['days'], "h" => formatHour($fields['hour']), "tw" => $fields['publish_tw'], "fb" => $fields['publish_fb'], "fbp" => $fields['publish_fbp'], "gp" => $fields['publish_fbgp'])); } else { error_log($hdb->errorInfo()); $return = array("e" => 2); } } } else { $return = array("e" => $fields); } } else { $return = array("e" => $message); } } else { $return = array("e" => 1); } } else {
/** * Get works based on given parameters */ public function get_works($limit, $category = null, $public = 1, $object = true, $order = "created DESC") { global $xoopsModule, $xoopsModuleConfig; include_once XOOPS_ROOT_PATH . '/modules/works/class/pwwork.class.php'; include_once XOOPS_ROOT_PATH . '/modules/works/class/pwcategory.class.php'; include_once XOOPS_ROOT_PATH . '/modules/works/class/pwclient.class.php'; $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = "SELECT * FROM " . $db->prefix('pw_works') . " WHERE public={$public}"; $sql .= $category > 0 ? " AND catego='{$category}'" : ''; $sql .= $order != '' ? " ORDER BY {$order}" : ''; $sql .= " LIMIT 0,{$limit}"; if ($xoopsModule && $xoopsModule->dirname() == 'works') { $mc =& $xoopsModuleConfig; } else { $mc = RMUtilities::module_config('works'); } $result = $db->query($sql); $works = array(); while ($row = $db->fetchArray($result)) { $work = new PWWork(); $work->assignVars($row); $ret = array(); if (!isset($categos[$work->category()])) { $categos[$work->category()] = new PWCategory($work->category()); } if (!isset($clients[$work->client()])) { $clients[$work->client()] = new PWClient($work->client()); } $ret = array('id' => $work->id(), 'title' => $work->title(), 'desc' => $work->descShort(), 'catego' => $categos[$work->category()]->name(), 'client' => $clients[$work->client()]->name(), 'link' => $work->link(), 'created' => formatTimeStamp($work->created(), 's'), 'created_time' => $work->created(), 'image' => XOOPS_UPLOAD_URL . '/works/ths/' . $work->image(), 'rating' => PWFunctions::rating($work->rating()), 'featured' => $work->mark(), 'linkcat' => $categos[$work->category()]->link(), 'metas' => $work->get_metas()); if ($object) { $w = new stdClass(); foreach ($ret as $var => $value) { $w->{$var} = $value; } $works[] = $w; } else { $works[] = $ret; } } return $works; }
while ($fila = $result->fetch_assoc()) { ?> <tr> <td><a target="_blank" href="articulo.php?id=<?php echo $fila['articulo_id']; ?> " title="Ver más"><?php echo ucfirst($fila['articulo_titulo']); ?> </a></td> <td><?php echo ucfirst($fila['cat_nombre']); ?> </td> <td><?php echo formatTimeStamp($fila['articulo_fecha_creacion']); ?> </td> </tr> <?php } // echo $query; ?> </table> </div> <div class="paginacion"> <?php if ($p_actual > 2) { ?>
<tr> <td><?php echo ucfirst($fila['usuario_nombre']); ?> </td> <td><?php echo ucfirst($fila['usuario_apellido']); ?> </td> <td><?php echo ucwords($fila['usuario_correo']); ?> </td> <td><?php echo formatTimeStamp($fila['usuario_fecha_registro']); ?> </td> <td class="eliminar"><?php echo '<a href="eliminarUsuarios.php?usuario_id=' . $fila[usuario_id] . '&usuario_nombre=' . $fila[usuario_nombre] . '&usuario_apellido=' . $fila[usuario_apellido] . '">×</a>'; ?> </td> </tr> <?php } ?> </table> </div> <div class="paginacion">
<td><?php echo ucfirst($fila['cat_nombre']); ?> </td> <td><?php echo ucwords($fila['usuario_nombre'] . ' ' . $fila['usuario_apellido']); ?> </td> <td><?php echo formatTimeStamp($fila['articulo_fecha_creacion']); ?> </td> <td><?php //es posible que la imagen no registre modificaciones hasta el momento: if ($fila['articulo_fecha_modificacion'] != '') { echo formatTimeStamp($fila['articulo_fecha_modificacion']); } else { echo 'Sin modificar'; } ?> </td> <td><?php if ($fila['articulo_estado'] == 1) { echo 'Visible'; } elseif ($fila['articulo_estado'] == 2) { echo 'Oculta'; } ?> </td> <td class="eliminar"><?php echo '<a href="eliminarArticulos.php?id=' . $fila[articulo_id] . '&articulo_url=' . $fila[articulo_url] . '&articulo_titulo=' . $fila[articulo_titulo] . '">×</a>';
$months = array("Enero" => "January", "Febrero" => "February", "Marzo" => "March", "Abril" => "April", "Mayo" => "May", "Junio" => "June", "Julio" => "July", "Agosto" => "August", "Septiembre" => "September", "Octubre" => "October", "Noviembre" => "November", "Diciembre" => "December"); $day = date("d", $timestamp); $year = date("Y", $timestamp); $month = date("F", $timestamp); $month = array_search($month, $months); return "{$day} {$month}, {$year}"; } function formatHour($hour) { $hour = explode(":", $hour); if ($hour[0] > 12) { $h = $hour[0] - 12; $t = " PM"; } else { $h = $hour[0]; $t = " AM"; } return $h . ":" . $hour[1] . $t; } $query = "SELECT * FROM manager_messages_scheduled WHERE userid = {$uid}"; if ($res = $db->query($query)) { while ($pub = $res->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { $pub_object = new publicaciones($pub['id']); $pubi = array("i" => $pub['id'], "m" => $pub['message'], "p" => $pub['img'], "ts_es" => formatTimeStamp($pub['time_start'], true), "ts_en" => date('Y-m-d', $pub['time_start']), "te_es" => formatTimeStamp($pub['time_end'], true), "te_en" => date('Y-m-d', $pub['time_end']), "t_p" => $pub['img'], "d" => $pub['days'], "h" => formatHour($pub['hour']), "tw" => $pub['publish_tw'], "fb" => $pub['publish_fb'], "fbp" => $pub['publish_fbp'], "gp" => $pub['publish_fbgp']); $sn[] = $pubi; } $return = array("e" => 0, "sn" => $sn); } else { $return = array("e" => 1); } echo json_encode($return);
/** * @desc Visualiza todos los albumes existentes del usuario **/ function showSets($edit = 0) { global $xoopsOption, $tpl, $db, $xoopsUser, $xoopsModuleConfig, $page, $xoopsConfig, $id; $xoopsOption['template_main'] = 'gs_panel_sets.html'; include 'header.php'; $mc =& $xoopsModuleConfig; $limit = rmc_server_var($_REQUEST, 'limit', 15); GSFunctions::makeHeader(); $link = GSFunctions::get_url() . ($mc['urlmode'] ? '/cpanel/sets/pag/' . $page : '/cpanel.php?s=cpanel/sets/' . $page); if ($edit) { //Verificamos que el album sea válido if ($id <= 0) { redirect_header($link, 1, __('Album ID is not valid!', 'galleries')); die; } //Verificamos que el album exista $set = new GSSet($id); if ($set->isNew()) { redirect_header($link, 1, __('Specified album does not exists!', 'galleries')); die; } $tpl->assign('title', $set->title()); $tpl->assign('public', $set->isPublic()); $tpl->assign('edit', $edit); $tpl->assign('id', $id); $tpl->assign('action_editset', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/saveeditset/pag/' . $page . '/' : '?cp=saveeditset&pag=' . $page)); } //Barra de Navegación $sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_sets') . " WHERE owner='" . $xoopsUser->uid() . "'"; list($num) = $db->fetchRow($db->query($sql)); $page = $page <= 0 ? 1 : $page; list($num) = $db->fetchRow($db->query($sql)); $start = $num <= 0 ? 0 : ($page - 1) * $limit; $tpages = ceil($num / $limit); $nav = new RMPageNav($num, $limit, $page, 5); $nav->target_url(GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/sets/pag/{PAGE_NUM}/' : '?cp=sets&pag={PAGE_NUM}')); //Fin de barra de navegación $sql = "SELECT * FROM " . $db->prefix('gs_sets') . " WHERE owner='" . $xoopsUser->uid() . "'"; $sql .= " LIMIT {$start},{$limit}"; $result = $db->query($sql); while ($rows = $db->fetchArray($result)) { $set = new GSSet(); $set->assignVars($rows); $tpl->append('sets', array('id' => $set->id(), 'name' => $set->title(), 'owner' => $set->owner(), 'uname' => $set->uname(), 'public' => $set->isPublic(), 'date' => formatTimeStamp($set->date(), 's'), 'pics' => $set->pics(), 'link' => $set->url())); } $tpl->assign('lang_setexists', __('My Albums', 'galleries')); $tpl->assign('lang_id', __('ID', 'galleries')); $tpl->assign('lang_name', __('Name', 'galleries')); $tpl->assign('lang_date', __('Date', 'galleries')); $tpl->assign('lang_public', __('Privacy:', 'galleries')); $tpl->assign('lang_options', _OPTIONS); $tpl->assign('lang_edit', _EDIT); $tpl->assign('lang_del', _DELETE); $tpl->assign('lang_confirm', __('Do you really wish to delete specified album?', 'galleries')); $tpl->assign('lang_confirms', __('Do you really wish to delete selected albums?', 'galleries')); $tpl->assign('lang_newset', __('Add Album', 'galleries')); $tpl->assign('lang_editset', __('Edit Album', 'galleries')); $tpl->assign('lang_yes', __('Yes', 'galleries')); $tpl->assign('lang_no', __('No', 'galleries')); $tpl->assign('lang_pics', __('Pictures', 'galleries')); $tpl->assign('lang_privateme', __('Private', 'galleries')); $tpl->assign('lang_privatef', __('Friends', 'galleries')); $tpl->assign('lang_publicset', __('Public', 'galleries')); RMTemplate::get()->add_style('panel.css', 'galleries'); $tpl->assign('action_addset', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/saveset/pag/' . $page . '/' : '?cp=saveset')); $tpl->assign('pag', $page); $tpl->assign('action_delset', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/deleteset/pag/' . $page . '/' : '?cp=deleteset')); $tpl->assign('edit_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/editset/pag/' . $page . '/id/' : '?cp=editset&pag=' . $page . '&id=')); createLinks(); include 'footer.php'; }
//Obtenemos los trabajos recientes $sql = "SELECT * FROM " . $db->prefix('pw_works') . " WHERE public=1 ORDER BY created DESC LIMIT {$start},{$limit}"; $result = $db->query($sql); // Numero de resultados en esta página $t = $db->getRowsNum($result); $tpl->assign('page_total', $t); $tpl->assign('per_col', ceil($t / 2)); $categos = array(); $clients = array(); while ($row = $db->fetchArray($result)) { $recent = new PWWork(); $recent->assignVars($row); if (!isset($categos[$recent->category()])) { $categos[$recent->category()] = new PWCategory($recent->category()); } if (!isset($clients[$recent->client()])) { $clients[$recent->client()] = new PWClient($recent->client()); } $tpl->append('works', array('id' => $recent->id(), 'title' => $recent->title(), 'desc' => $recent->descShort(), 'catego' => $categos[$recent->category()]->name(), 'client' => $clients[$recent->client()]->businessName(), 'link' => $recent->link(), 'created' => formatTimeStamp($recent->created(), 's'), 'image' => XOOPS_UPLOAD_URL . '/works/ths/' . $recent->image(), 'rating' => PWFunctions::rating($recent->rating()), 'featured' => $recent->mark(), 'linkcat' => $categos[$recent->category()]->link(), 'metas' => $recent->get_metas())); } $tpl->assign('lang_works', __('Our Work', 'works')); $tpl->assign('lang_catego', __('Cetegory:', 'works')); $tpl->assign('lang_date', __('Date:', 'works')); $tpl->assign('lang_client', __('Customer:', 'works')); $tpl->assign('lang_allsrecent', __('View all recent works', 'works')); $tpl->assign('link_recent', PW_URL . ($mc['urlmode'] ? '/recent/' : '/recent.php')); $tpl->assign('link_featured', PW_URL . ($mc['urlmode'] ? '/featured/' : '/featured.php')); $thSize = $mc['image_ths']; $tpl->assign('width', $thSize[0] + 10); $tpl->assign('lang_featured', __('Featured', 'works')); include 'footer.php';
$query = "SELECT * FROM blog_categorias\n WHERE cat_id<>'1'\n ORDER BY cat_nombre LIMIT {$desfase}, {$cpp}"; //se excluye el cat_id 1 porque es la categoría stand_by y no se debe eliminar ni modificar $result = $bd->query($query); //procesar resultado while ($fila = $result->fetch_assoc()) { ?> <tr> <td><a href="modificarCategorias.php?cid=<?php echo $fila['cat_id']; ?> " title="Modificar categoría"><?php echo $fila['cat_nombre']; ?> </a></td> <td><?php echo formatTimeStamp($fila['cat_fecha_creacion']); ?> </td> <td class="eliminar"><?php echo '<a href="eliminarCategorias.php?id=' . $fila[cat_id] . '&cat_nombre=' . $fila[cat_nombre] . '">×</a>'; ?> </td> </tr> <?php } ?> </table> </div> <div class="paginacion"> <?php if ($p_actual > 2) {
} elseif ($comments_arr[$i]->getVar('com_uid') == 0 && $comments_arr[$i]->getVar('com_user') != '') { if ($comments_arr[$i]->getVar('com_url') != '') { $comments_poster_uname = '<div class="pad2 marg2"><a href="' . $comments_arr[$i]->getVar('com_url') . '">' . $comments_arr[$i]->getVar('com_user') . '</a> ( <a href="mailto:' . $comments_arr[$i]->getVar('com_email') . '">' . $comments_arr[$i]->getVar('com_email') . '</a> ) ' . '</div>'; } else { $comments_poster_uname = '<div class="pad2 marg2">' . $comments_arr[$i]->getVar('com_user') . ' ( <a href="mailto:' . $comments_arr[$i]->getVar('com_email') . '">' . $comments_arr[$i]->getVar('com_email') . '</a> ) ' . '</div>'; } } // End edit by voltan $comments_icon = $comments_arr[$i]->getVar('com_icon') == '' ? '/images/icons/no_posticon.gif' : '/images/subject/' . htmlspecialchars($comments_arr[$i]->getVar('com_icon'), ENT_QUOTES); $comments_icon = '<img src="' . XOOPS_URL . $comments_icon . '" alt="" />'; $comments['comments_id'] = $com_id; $comments['comments_poster'] = $comments_poster_uname; $comments['comments_icon'] = $comments_icon; $comments['comments_title'] = '<a href="admin.php?fct=comments&op=comments_jump&com_id=' . $comments_arr[$i]->getVar("com_id") . '">' . $comments_arr[$i]->getVar("com_title"); $comments['comments_ip'] = $comments_arr[$i]->getVar('com_ip'); $comments['comments_date'] = formatTimeStamp($comments_arr[$i]->getVar('com_created')); $comments['comments_text'] = $myts->undoHtmlSpecialChars($comments_arr[$i]->getVar('com_text')); $comments['comments_status'] = @$status_array2[$comments_arr[$i]->getVar('com_status')]; $comments['comments_date_created'] = formatTimestamp($comments_arr[$i]->getVar('com_created'), 'm'); $comments['comments_modid'] = @$module_array[$comments_arr[$i]->getVar('com_modid')]; //$comments['comments_view_edit_delete'] = '<img class="cursorpointer" onclick="display_dialog('.$com_id.', true, true, \'slide\', \'slide\', 300, 500);" src="images/icons/view.png" alt="'._AM_SYSTEM_COMMENTS_VIEW.'" title="'._AM_SYSTEM_COMMENTS_VIEW.'" /><a href="admin/comments/comment_edit.php?com_id='.$com_id.'"><img src="./images/icons/edit.png" border="0" alt="'._EDIT.'" title="'._EDIT.'"></a><a href="admin/comments/comment_delete.php?com_id='.$com_id.'"><img src="./images/icons/delete.png" border="0" alt="'._DELETE.'" title="'._DELETE.'"></a>'; $xoopsTpl->append_by_ref('comments', $comments); $xoopsTpl->append_by_ref('comments_popup', $comments); unset($comments); } if ($comments_count > $comments_limit) { include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $nav = new XoopsPageNav($comments_count, $comments_limit, $comments_start, 'comments_start', 'fct=comments&comments_module=' . $comments_module . '&comments_status=' . $comments_status); $xoopsTpl->assign('nav', $nav->renderNav()); } }
function LinksModLink($lid) { global $NPDS_Prefix, $hlpfile, $f_meta_nom, $f_titre, $adminimg; include "header.php"; GraphicAdmin($hlpfile); global $anonymous; $result = sql_query("SELECT cid, sid, title, url, description, name, email, hits FROM " . $NPDS_Prefix . "links_links WHERE lid='{$lid}'"); adminhead($f_meta_nom, $f_titre, $adminimg); echo '<h3>' . adm_translate("Modifier le lien") . ' - ' . $lid . '</h3>'; list($cid, $sid, $title, $url, $xtext, $name, $email, $hits) = sql_fetch_row($result); $title = stripslashes($title); $xtext = stripslashes($xtext); echo ' <form action="admin.php" method="post" name="adminForm"> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="title">' . adm_translate("Titre de la Page") . '</label> <div class="col-sm-8"> <input class="form-control" type="text" name="title" id="title" value="' . $title . '" maxlength="100" required="required" /> <span class="help-block text-xs-right"><span id="countcar_title"></span></span> </div> </div> </div> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="url">' . adm_translate("URL de la Page") . '</label> <div class="col-sm-8"> <div class="input-group"> <span class="input-group-btn"> <button class="btn btn-secondary" ><a href="' . $url . '" target="_blank"><i class="fa fa-external-link fa-lg"></i></a></button> </span> <input class="form-control" type="text" name="url" id="url" value="' . $url . '" maxlength="100" required="required" /> </div> <span class="help-block text-xs-right"><span id="countcar_url"></span></span> </div> </div> </div> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="xtext">' . adm_translate("Description") . '</label> <div class="col-sm-8"> <textarea class="form-control" name="xtext" rows="10">' . $xtext . '</textarea> </div> </div> </div>'; echo aff_editeur("xtext", "false"); echo ' <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="name">' . adm_translate("Nom") . '</label> <div class="col-sm-8"> <input class="form-control" type="text" name="name" id="name" maxlength="100" value="' . $name . '" /> <span class="help-block text-xs-right"><span id="countcar_name"></span></span> </div> </div> </div> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="email">' . adm_translate("E-mail") . '</label> <div class="col-sm-8"> <input class="form-control" type="email" name="email" id="email" maxlength="100" value="' . $email . '" /> <span class="help-block text-xs-right"><span id="countcar_email"></span></span> </div> </div> </div> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="hits">' . adm_translate("Nombre de Hits") . '</label> <div class="col-sm-8"> <input class="form-control" type="number" name="hits" value="' . $hits . '" min="0" max="99999999999" /> </div> </div> </div> <div class="form-group"> <div class="row">'; $result2 = sql_query("SELECT cid, title FROM " . $NPDS_Prefix . "links_categories ORDER BY title"); echo ' <input type="hidden" name="lid" value="' . $lid . '" /> <label class="form-control-label col-sm-4 " for="hits">' . adm_translate("Catégorie") . '</label> <div class="col-sm-8"> <select class="c-select form-control" name="cat">'; while (list($ccid, $ctitle) = sql_fetch_row($result2)) { $sel = ""; if ($cid == $ccid and $sid == 0) { $sel = "selected"; } echo '<option value="' . $ccid . '" ' . $sel . '>' . aff_langue($ctitle) . '</option>'; $result3 = sql_query("SELECT sid, title FROM " . $NPDS_Prefix . "links_subcategories WHERE cid='{$ccid}' ORDER BY title"); while (list($ssid, $stitle) = sql_fetch_row($result3)) { $sel = ""; if ($sid == $ssid) { $sel = "selected"; } echo "<option value=\"{$ccid}-{$ssid}\" {$sel}>" . aff_langue($ctitle) . " / " . aff_langue($stitle) . "</option>"; } } echo ' </select> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-offset-4 col-sm-8"> <input type="hidden" name="op" value="LinksModLinkS" /> <button class="btn btn-primary col-xs-6" type="submit"><i class="fa fa-check fa-lg"></i> ' . adm_translate("Modifier") . ' </button> <button href="admin.php?op=LinksDelLink&lid=' . $lid . '" class="btn btn-danger col-xs-6"><i class="fa fa-trash-o fa-lg"></i> ' . adm_translate("Effacer") . '</button> </div> </div> </div> </form>'; //Modify or Add Editorial $resulted2 = sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $NPDS_Prefix . "links_editorials WHERE linkid='{$lid}'"); $recordexist = sql_num_rows($resulted2); if ($recordexist == 0) { echo ' <h3>' . adm_translate("Ajouter un Editorial") . '</h3> <form action="admin.php" method="post"> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="editorialtitle">' . adm_translate("Titre") . '</label> <div class="col-sm-8"> <input class="form-control" type="text" name="editorialtitle" id="editorialtitle" maxlength="100" /> <span class="help-block text-xs-right"><span id="countcar_editorialtitle"></span></span> </div> </div> </div> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="editorialtext">' . adm_translate("Texte complet") . '</label> <div class="col-sm-8"> <textarea class="form-control" name="editorialtext" rows="10"></textarea> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-offset-4 col-sm-8"> <input type="hidden" name="linkid" value="' . $lid . '" /> <input type="hidden" name="op" value="LinksAddEditorial" /> <button class="btn btn-primary col-xs-12" type="submit"><i class="fa fa-plus-square fa-lg"></i> ' . adm_translate("Ajouter un Editorial") . '</button> </div> </div> </div>'; } else { while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($resulted2)) { $editorialtitle = stripslashes($editorialtitle); $editorialtext = stripslashes($editorialtext); echo ' <h3>' . adm_translate("Modifier l'Editorial") . '</h3> - ' . adm_translate("Auteur") . ' : ' . $adminid . ' : ' . formatTimeStamp($editorialtimestamp); echo ' <form action="admin.php" method="post"> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="editorialtitle">' . adm_translate("Titre") . '</label> <div class="col-sm-8"> <input class="form-control" type="text" name="editorialtitle" id="editorialtitle" value="' . $editorialtitle . '" maxlength="100" /> <span class="help-block text-xs-right"><span id="countcar_editorialtitle"></span></span> </div> </div> </div> <div class="form-group"> <div class="row"> <label class="form-control-label col-sm-4 " for="editorialtext">' . adm_translate("Texte complet") . '</label> <div class="col-sm-8"> <textarea class="form-control" name="editorialtext" rows="10">' . $editorialtext . '</textarea> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-offset-4 col-sm-8"> <input type="hidden" name="linkid" value="' . $lid . '" /> <input type="hidden" name="op" value="LinksModEditorial" /> <button class="btn btn-primary col-xs-6" type="submit"><i class="fa fa-check fa-lg"></i> ' . adm_translate("Modifier") . '</button> <button href="admin.php?op=LinksDelEditorial&linkid=' . $lid . '" class="btn btn-danger col-xs-6"><i class="fa fa-trash-o fa-lg"></i> ' . adm_translate("Effacer") . '</button> </div> </div> </div>'; } } echo ' </form>'; adminfieldinp($result); adminfieldinp($resulted2); adminfoot('fv', '', '', ''); }
} else { if ($refreshtime < 3600) { $refreshtimes = intval($refreshtime / 60); $message = $refreshtimes == 1 ? _MA_MYPOINTS_LMINUTE : _MA_MYPOINTS_LMINUTES; } else { if ($refreshtime < 86400) { $refreshtimes = intval($refreshtime / 3600); $message = $refreshtimes == 1 ? _MA_MYPOINTS_LHOUR : _MA_MYPOINTS_LHOURS; } else { $refreshtimes = intval($refreshtime / 86400); $message = $refreshtimes == 1 ? _MA_MYPOINTS_LDAY : _MA_MYPOINTS_LDAYS; } } } $xoopsTpl->assign('updatemessage', sprintf(_MA_MYPOINTS_UPDATEMESSAGE, $refreshtimes, $message)); $xoopsTpl->assign('sincemessage', sprintf(_MA_MYPOINTS_SINCEMESSAGE, formatTimeStamp($since, "m", $xoopsConfig['server_TZ']))); $criteria = new CriteriaCompo(new Criteria('pluginisactive', 1)); //$criteria->add(new Criteria('plugintype', 'items'), 'AND'); $criteria->setSort('pluginmulti'); $criteria->setOrder('DESC'); $plugins = $plugin_handler->getObjects($criteria); unset($criteria); if ($details == 1) { foreach ($plugins as $plugin) { $myplugins[]['pluginname'] = $plugin->getVar('pluginname'); } $xoopsTpl->assign('plugins', $myplugins); } $criteria = new CriteriaCompo(); $criteria->setSort('userpoints'); $criteria->setOrder('DESC');
/** * @desc Formatea la fecha */ public function formatDate($time) { global $mc; $real = time() - $time; $today = date('G', time()) * 3600; $today += date('i', time()) * 60; $today += date('s', time()); if ($real <= $today) { return sprintf(__('Today %s', 'bxpress'), date('H:i:s', $time)); } elseif ($real <= $today - 86400) { return sprintf(__('Yesterday %s', 'bxpress'), date('H:i:s', $time)); } else { return formatTimeStamp($time); } }
} else { $userdata['email'] = " "; } if ($xoopsUser) { $userdata['pmlink'] = "<a href='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $foundusers[$j]->getVar("uid") . "\",\"pmlite\",450,370);'><img src='" . XOOPS_URL . "/images/icons/pm.gif' border='0' alt='" . sprintf(_SENDPMTO, $foundusers[$j]->getVar("uname", "E")) . "' /></a>"; } else { $userdata['pmlink'] = " "; } if ($foundusers[$j]->getVar("url", "E") != "") { $userdata['website'] = "<a href='" . $foundusers[$j]->getVar("url", "E") . "' target='_blank'><img src='" . XOOPS_URL . "/images/icons/www.gif' border='0' alt='" . _VISITWEBSITE . "' /></a>"; } else { $userdata['website'] = " "; } $userdata['registerdate'] = formatTimeStamp($foundusers[$j]->getVar("user_regdate"), "s"); if ($foundusers[$j]->getVar("last_login") != 0) { $userdata['lastlogin'] = formatTimeStamp($foundusers[$j]->getVar("last_login"), "m"); } else { $userdata['lastlogin'] = "******"; } $userdata['posts'] = $foundusers[$j]->getVar("posts"); if ($iamadmin) { $userdata['adminlink'] = "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=users&uid=" . $foundusers[$j]->getVar("uid") . "&op=modifyUser'>" . _EDIT . "</a> | <a href='" . XOOPS_URL . "/modules/system/admin.php?fct=users&op=delUser&uid=" . $foundusers[$j]->getVar("uid") . "'>" . _DELETE . "</a>"; } $xoopsTpl->append('users', $userdata); } $totalpages = ceil($total / $limit); if ($totalpages > 1) { $hiddenform = "<form name='findnext' action='index.php' method='post'>"; foreach ($_POST as $k => $v) { $hiddenform .= "<input type='hidden' name='" . $myts->oopsHtmlSpecialChars($k) . "' value='" . $myts->makeTboxData4PreviewInForm($v) . "' />\n"; }
$pagenav_args .= '&sortby=' . $sortby; } $num_users = $xoopsDB->getRowsNum($result); //number of users per sorted and limit query if ($totalcount > 0) { while ($userinfo = $xoopsDB->fetchArray($result)) { $userinfo = new XoopsUser($userinfo['uid']); $user = array(); $avatar = $userinfo->user_avatar(); if ($avatar == 'blank.gif' && $xoopsModuleConfig['defaultavatar']) { $user['avatar'] = "<img src='" . XOOPS_URL . "/modules/membership/images/davatar.gif' alt='' width='64' height='64' />"; } else { $user['avatar'] = "<img src='" . XOOPS_URL . "/uploads/" . $userinfo->user_avatar() . "' alt='' width='64' height='64' />"; } $user['nickname'] = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $userinfo->uid() . "'>" . $userinfo->uname("E") . "</a>"; $user['regdate'] = formatTimeStamp($userinfo->user_regdate(), "m"); $showmail = 0; if ($userinfo->user_viewemail()) { $showmail = 1; } else { if ($is_admin) { $showmail = 1; } } if ($showmail) { $user['email'] = "<a href='mailto:" . $userinfo->email("E") . "'>"; $user['email'] .= "<img src='" . XOOPS_URL . "/images/icons/email.gif' border='0' alt='" . sprintf(_SENDEMAILTO, $userinfo->uname("E")) . "' /></a>"; } else { $user['email'] = ""; } if ($xoopsUser) {
$modversion['blocks'][$i]['template'] = "smartsection_items_menu.html"; $i++; $modversion['blocks'][$i]['file'] = "latest_files.php"; $modversion['blocks'][$i]['name'] = _MI_SSECTION_LATESTFILES; $modversion['blocks'][$i]['description'] = "List of latest uploaded files"; $modversion['blocks'][$i]['show_func'] = "smartsection_latest_files_show"; $modversion['blocks'][$i]['edit_func'] = "smartsection_latest_files_edit"; $modversion['blocks'][$i]['options'] = "datesub|5|0"; $modversion['blocks'][$i]['template'] = "smartsection_latest_files.html"; $i++; $modversion['blocks'][$i]['file'] = "date_to_date.php"; $modversion['blocks'][$i]['name'] = _MI_SSECTION_DATE_TO_DATE; $modversion['blocks'][$i]['description'] = "List article from a selected date to another"; $modversion['blocks'][$i]['show_func'] = "smartsection_date_to_date_show"; $modversion['blocks'][$i]['edit_func'] = "smartsection_date_to_date_edit"; $modversion['blocks'][$i]['options'] = formatTimeStamp(time(), 'm/j/Y') . "|" . formatTimeStamp(time(), 'm/j/Y'); $modversion['blocks'][$i]['template'] = "smartsection_date_to_date.html"; /* We need to comment this out has it require a smarty plugin not present in the core... * We will find a solution later... $i++; $modversion['blocks'][6]['file'] = "items_tree.php"; $modversion['blocks'][6]['name'] = _MI_SSECTION_ITEMSTREE; $modversion['blocks'][6]['description'] = "Display the category and items tree"; $modversion['blocks'][6]['show_func'] = "smartsection_items_tree_show"; $modversion['blocks'][6]['edit_func'] = "smartsection_items_tree_edit"; $modversion['blocks'][6]['template'] = "smartsection_items_tree.html"; $modversion['blocks'][6]['options'] = "0|weight|ASC|-1|1"; */ // Templates $i = 0;
/** * @desc Visualiza todas la imágenes de favoritos **/ function showBookMarks() { global $xoopsOption, $tpl, $db, $xoopsUser, $xoopsModuleConfig, $pag, $xoopsConfig; $xoopsOption['template_main'] = 'gs_panel_bookmarks.html'; include 'header.php'; $mc =& $xoopsModuleConfig; GSFunctions::makeHeader(); //Barra de Navegación $sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_favourites') . " a INNER JOIN " . $db->prefix('gs_images') . " b ON ("; $sql .= " a.id_image=b.id_image AND a.uid='" . $xoopsUser->uid() . "')"; $page = isset($pag) ? $pag : ''; $limit = 10; 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/bookmarks/'; } else { $urlnav = '?cpanel=bookmarks'; } $nav = new RMPageNav($num, $limit, $pactual, 5); $nav->target_url(GSFunctions::get_url() . $urlnav . ($mc['urlmode'] ? 'pag/{PAGE_NUM}/' : '&pag={PAGE_NUM}')); $tpl->assign('bookmarksNavPage', $nav->render(false)); } $showmax = $start + $limit; $showmax = $showmax > $num ? $num : $showmax; if ($num > 0) { $tpl->assign('lang_showing', sprintf(__('Showing pictures %u to %u from %u'), $start + 1, $showmax, $num)); } $tpl->assign('limit', $limit); $tpl->assign('pag', $pactual); //Fin de barra de navegación $sql = "SELECT * FROM " . $db->prefix('gs_favourites') . " a INNER JOIN " . $db->prefix('gs_images') . " b ON ("; $sql .= " a.id_image=b.id_image AND a.uid='" . $xoopsUser->uid() . "')"; $sql .= " LIMIT {$start},{$limit}"; $result = $db->query($sql); $users = array(); while ($rows = $db->fetchArray($result)) { $img = new GSImage(); $img->assignVars($rows); if (!isset($users[$img->owner()])) { $users[$img->owner()] = new GSUser($img->owner(), 1); } $urlimg = $users[$img->owner()]->filesURL() . '/ths/' . $img->image(); $link = $users[$img->owner()]->userURL() . 'img/' . $img->id() . '/'; $tpl->append('images', array('id' => $img->id(), 'title' => $img->title(false), 'desc' => $img->desc(), 'public' => $img->isPublic(), 'image' => $urlimg, 'created' => formatTimeStamp($img->created(), 's'), 'owner' => $img->owner(), 'uname' => $users[$img->owner()]->uname(), 'link' => $link)); } $tpl->assign('lang_exist', __('Existing Bookmarks', 'galleries')); $tpl->assign('lang_id', __('ID', 'galleries')); $tpl->assign('lang_title', __('Title', 'galleries')); $tpl->assign('lang_date', __('Created', 'galleries')); $tpl->assign('lang_owner', __('by user', 'galleries')); $tpl->assign('lang_image', __('Picture', 'galleries')); $tpl->assign('lang_public', __('Public', 'galleries')); $tpl->assign('lang_options', __('Options', 'galleries')); $tpl->assign('lang_edit', __('Edit', 'galleries')); $tpl->assign('lang_del', __('Delete', 'galleries')); $tpl->assign('lang_confirm', __('Do you really wish to deleted selected favorite?', 'galleries')); $tpl->assign('lang_confirms', __('Do you really wish to deleted selected favorites?', 'galleries')); $tpl->assign('delete_link', GSFunctions::get_url() . $xoopsModuleConfig['urlmode'] ? 'cp/delbookmarks/' : '?cp=delbookmarks'); RMTemplate::get()->add_style('panel.css', 'galleries'); createLinks(); include 'footer.php'; }
$posters = array(); while ($row = $db->fetchArray($result)) { $topic = new bXTopic(); $topic->assignVars($row); $last = new bXPost($topic->lastPost()); if (!isset($posters[$topic->poster])) { $posters[$topic->poster] = new RMUser($topic->poster); } if (!isset($posters[$last->uid])) { $posters[$last->uid] = new RMUser($last->uid); } $poster = $posters[$topic->poster]; $last_poster = $posters[$last->uid]; $lastpost = array(); if (!$last->isNew()) { $lastpost['date'] = formatTimeStamp($last->date(), __('M d, Y')); $lastpost['time'] = $last->date(); $lastpost['id'] = $last->id(); $lastpost['poster'] = array('uid' => $last->uid, 'uname' => $last->poster_name, 'name' => $last_poster->name != '' ? $last_poster->name : $last_poster->uname, 'email' => $last_poster->email, 'avatar' => RMEvents::get()->run_event('rmcommon.get.avatar', $last_poster->getVar('email'), 50), 'link' => XOOPS_URL . '/userinfo.php?uid=' . $last_poster->uid); if ($xoopsUser) { $lastpost['new'] = $last->date() > $xoopsUser->getVar('last_login') && time() - $last->date() < $xoopsModuleConfig['time_new']; } else { $lastpost['new'] = time() - $last->date() <= $xoopsModuleConfig['time_new']; } } $tpages = ceil($topic->replies() / $xoopsModuleConfig['perpage']); if ($tpages > 1) { $pages = bXFunctions::paginateIndex($tpages); } else { $pages = null; }
$nav = new RMPageNav($num, $limit, $pactual); $nav->target_url($forum->permalink() . '&pag={PAGE_NUM}'); $tpl->assign('itemsNavPage', $nav->render(false)); } $sql = str_replace("COUNT(*)", '*', $sql); $sql .= " ORDER BY sticky DESC,"; $sql .= $xoopsModuleConfig['order_post'] ? " last_post " : " date "; $sql .= " DESC LIMIT {$start},{$limit}"; $result = $db->query($sql); while ($row = $db->fetchArray($result)) { $topic = new bXTopic(); $topic->assignVars($row); $last = new bXPost($topic->lastPost()); $lastpost = array(); if (!$last->isNew()) { $lastpost['date'] = formatTimeStamp($last->date(), 'c'); $lastpost['by'] = sprintf(__('By: %s', 'bxpress'), $last->uname()); $lastpost['id'] = $last->id(); if ($xoopsUser) { $lastpost['new'] = $last->date() > $xoopsUser->getVar('last_login') && time() - $last->date() < $xoopsModuleConfig['time_new']; } else { $lastpost['new'] = time() - $last->date() <= $xoopsModuleConfig['time_new']; } } $tpages = ceil($topic->replies() / $xoopsModuleConfig['perpage']); if ($tpages > 1) { $pages = bXFunctions::paginateIndex($tpages); } else { $pages = null; } $tpl->append('topics', array('id' => $topic->id(), 'title' => $topic->title(), 'replies' => $topic->replies(), 'views' => $topic->views(), 'by' => sprintf(__('By: %s', 'bxpress'), $topic->posterName()), 'last' => $lastpost, 'popular' => $topic->replies() >= $forum->hotThreshold(), 'sticky' => $topic->sticky(), 'pages' => $pages, 'tpages' => $tpages, 'closed' => $topic->status()));
/** * Muestra los envíos existentes */ function showPosts($aprovado = -1) { global $db, $xoopsSecurity, $xoopsModule, $xoopsModuleConfig; $mc =& $xoopsModuleConfig; $keyw = ''; $op = ''; $cat = 0; $status = ''; foreach ($_REQUEST as $k => $v) { ${$k} = $v; } $tbl1 = $db->prefix("mod_mywords_posts"); $tbl2 = $db->prefix("mod_mywords_catpost"); $and = false; if ($cat > 0) { $sql = "SELECT COUNT(*) FROM {$tbl1} a, {$tbl2} b WHERE b.cat='{$cat}' AND a.id_post=b.post"; $and = true; } else { $sql = "SELECT COUNT(*) FROM " . $db->prefix("mod_mywords_posts"); } if (isset($status) && $status != '') { define('RMCSUBLOCATION', $status); $sql .= $and ? " AND a.status='{$status}'" : " WHERE status='{$status}'"; $and = true; } if (isset($author) && $author > 0) { $sql .= $and ? " AND a.author={$author}" : " WHERE author={$author}"; $and = true; } if (trim($keyw) != '') { $sql .= $and ? " AND title LIKE '%{$keyw}%'" : " WHERE title LIKE '%{$keyw}%'"; } /** * Paginacion de Resultados */ $page = rmc_server_var($_GET, 'page', 1); $limit = isset($limit) && $limit > 0 ? $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('posts.php?limit=' . $limit . '&page={PAGE_NUM}'); $sql .= " ORDER BY id_post DESC LIMIT {$start},{$limit}"; $sql = str_replace("SELECT COUNT(*)", "SELECT *", $sql); $result = $db->query($sql); $posts = array(); while ($row = $db->fetchArray($result)) { $post = new MWPost(); $post->assignVars($row); # Enlace para el artículo $day = date('d', $post->getVar('pubdate')); $month = date('m', $post->getVar('pubdate')); $year = date('Y', $post->getVar('pubdate')); $postlink = MWFunctions::get_url(); $postlink .= $mc['permalinks'] == 1 ? '?post=' . $post->id() : ($mc['permalinks'] == 2 ? "{$day}/{$month}/{$year}/" . $post->getVar('shortname') . "/" : "post/" . $post->id()); $posts[] = array('id' => $post->id(), 'title' => $post->getVar('title'), 'date' => $post->getVar('pubdate') > 0 ? formatTimeStamp($post->getVar('pubdate')) : '<em>' . __('Not published', 'mywords') . '</em>', 'created' => formatTimeStamp($post->getVar('created')), 'comments' => $post->getVar('comments'), 'uid' => $post->getVar('author'), 'uname' => $post->getVar('authorname'), 'link' => $postlink, 'status' => $post->getVar('status'), 'categories' => $post->get_categories_names(true, ',', true, 'admin'), 'tags' => $post->tags(false), 'reads' => $post->getVar('reads')); } // Published count $sql = "SELECT COUNT(*) FROM " . $db->prefix("mod_mywords_posts") . " WHERE status='publish'"; list($pub_count) = $db->fetchRow($db->query($sql)); // Drafts count $sql = "SELECT COUNT(*) FROM " . $db->prefix("mod_mywords_posts") . " WHERE status='draft'"; list($draft_count) = $db->fetchRow($db->query($sql)); // Pending count $sql = "SELECT COUNT(*) FROM " . $db->prefix("mod_mywords_posts") . " WHERE status='pending'"; list($pending_count) = $db->fetchRow($db->query($sql)); // Confirm message RMTemplate::get()->add_head('<script type="text/javascript"> function post_del_confirm(post, id){ var string = "' . __('Do you really want to delete \\"%s\\"', 'mywords') . '"; string = string.replace("%s", post); var ret = confirm(string); if (ret){ $("#form-posts input[type=checkbox]").removeAttr("checked"); $("#post-"+id).attr("checked","checked"); $("#posts-op").val("delete"); $("#form-posts").submit(); } } </script>'); RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js'); MWFunctions::include_required_files(); $title_by_status = ''; switch ($status) { case 'publish': $title_by_status = __('Published Posts', 'mywords'); break; case 'draft': $title_by_status = __('Drafts', 'mywords'); break; case 'waiting': $title_by_status = __('Pending of Review', 'dtransport'); break; } if ($title_by_status != '') { RMBreadCrumb::get()->add_crumb(__('Posts management', 'mywords'), 'posts.php'); RMBreadCrumb::get()->add_crumb($title_by_status); RMTemplate::get()->assign('xoops_pagetitle', sprintf(__('Posts Management: %s', 'mywords'), $title_by_status)); } else { RMBreadCrumb::get()->add_crumb(__('Posts management', 'mywords')); RMTemplate::get()->assign('xoops_pagetitle', __('Posts Management', 'mywords')); } xoops_cp_header(); include_once '../templates/admin/mywords-posts.php'; xoops_cp_footer(); }
$query = "SELECT\n \t\tblog_comentarios.comentario_usuario_id_autor,\n \t\tblog_comentarios.comentario_texto,\n \t\tblog_comentarios.comentario_fecha_creacion,\n \t\tblog_usuarios.usuario_id,\n \t\tblog_usuarios.usuario_nombre,\n \t\tblog_usuarios.usuario_apellido\n \t\tFROM blog_comentarios\n INNER JOIN blog_usuarios\n ON blog_comentarios.comentario_usuario_id_autor = blog_usuarios.usuario_id\n WHERE comentario_articulo_id='{$articulo_id}'\n ORDER BY comentario_fecha_creacion DESC LIMIT {$desfase}, {$com_pp}"; $result = $bd->query($query); //procesar resultado while ($fila = $result->fetch_assoc()) { ?> <div class="comentario"> <p><?php echo '<span class="destacado">' . ucwords($fila[usuario_nombre] . ' ' . $fila[usuario_apellido]) . '</span> dijo:'; ?> </p> <p><?php echo $fila[comentario_texto]; ?> </p> <p class="destacado"><?php echo formatTimeStamp($fila[comentario_fecha_creacion]); ?> </p> </div> <?php } ?> </div> <div class="paginacion"> <?php if ($p_actual > 2) { ?> <a href="<?php echo $_SERVER['PHP_SELF'] . "?page=" . ($p_actual - 1) . "&id=" . $articulo_id; ?> " class="ant">« Anterior</a>