本文整理汇总了PHP中formatTimeStamp函数的典型用法代码示例。如果您正苦于以下问题:PHP formatTimeStamp函数的具体用法?PHP formatTimeStamp怎么用?PHP formatTimeStamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatTimeStamp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: showPages
/**
* Muestra los envíos existentes
*/
function showPages($acceso = -1)
{
global $mc, $xoopsModule, $xoopsSecurity;
$keyw = rmc_server_var($_REQUEST, 'keyw', '');
$acceso = rmc_server_var($_REQUEST, 'acceso', -1);
$cat = rmc_server_var($_REQUEST, 'cat', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("qpages_pages");
if ($acceso >= 0) {
$sql .= " WHERE acceso={$acceso}";
}
if (trim($keyw) != '') {
$sql .= ($acceso >= 0 ? " AND " : " WHERE ") . "titulo LIKE '%{$keyw}%'";
}
if (isset($cat) && $cat > 0) {
$sql .= ($acceso >= 0 || $keyw != '' ? " AND " : " WHERE ") . "cat='{$cat}'";
}
/**
* Paginacion de Resultados
*/
$page = rmc_server_var($_REQUEST, 'page', 1);
$page = $page <= 0 ? 1 : $page;
$limit = 15;
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('pages.php?cat=' . $cat . '&page={PAGE_NUM}');
$sql .= " ORDER BY id_page DESC LIMIT {$start},{$limit}";
$sql = str_replace("SELECT COUNT(*)", "SELECT *", $sql);
$result = $db->query($sql);
$pages = array();
while ($row = $db->fetchArray($result)) {
$p = new QPPage();
$p->assignVars($row);
# Enlaces para las categorías
$catego = new QPCategory($p->getCategory());
$pages[] = array('id' => $p->getID(), 'titulo' => $p->getTitle(), 'catego' => $catego->getName(), 'fecha' => formatTimeStamp($p->getDate(), 's'), 'link' => $p->getPermaLink(), 'estado' => $p->getAccess(), 'modificada' => $p->getModDate() == 0 ? '--' : formatTimestamp($p->getModDate(), 'c'), 'lecturas' => $p->getReads(), 'order' => $p->order(), 'type' => $p->type(), 'desc' => $p->getDescription());
}
/**
* Cargamos las categorias
*/
$categos = array();
qpArrayCategos($categos);
$categories = array();
foreach ($categos as $k) {
$categories[] = array('id' => $k['id_cat'], 'nombre' => $k['nombre'], 'saltos' => $k['saltos']);
}
RMTemplate::get()->add_style('admin.css', 'qpages');
RMTemplate::get()->add_script('../include/js/qpages.js');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->assign('xoops_pagetitle', __('Pages Management', 'qpages'));
xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> » ' . ($acceso < 0 ? __('All Pages', 'qpages') : ($acceso == 0 ? __('Draft pages', 'qpages') : __('Published pages', 'qpages'))));
xoops_cp_header();
include RMTemplate::get()->get_template("admin/qp_pages.php", 'module', 'qpages');
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:61,代码来源:pages.php
示例2: showAlbums
/**
* @desc Visualiza todos los albums
**/
function showAlbums()
{
global $tpl, $xoopsModule, $mc, $xoopsSecurity;
define('RMSUBLOCATION', 'sets');
$db = Database::getInstance();
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$limit = 15;
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'id_set';
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 1;
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
$query = "search={$search}&page={$page}&sort={$sort}&mode={$mode}";
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_sets');
$sql1 = '';
$words = array();
if ($search) {
//Separamos en palabras
$words = explode(" ", $search);
foreach ($words as $k) {
$k = trim($k);
if (strlen($k) <= 2) {
continue;
}
$sql1 .= $sql1 == '' ? " WHERE (title LIKE '%{$k}%' OR uname LIKE '%{$k}%')" : " OR (title LIKE '%{$k}%' OR uname LIKE '%{$k}%')";
}
}
list($num) = $db->fetchRow($db->query($sql . $sql1));
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$tpages = ceil($num / $limit);
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url("sets.php?page={PAGE_NUM}&sort={$sort}&mode={$mode}&search={$search}");
//Fin de barra de navegación
$sql = str_replace('COUNT(*)', '*', $sql);
$sql2 = $sort ? " ORDER BY {$sort} " . ($mode ? "DESC" : "ASC ") : '';
$sql2 .= " LIMIT {$start},{$limit}";
$result = $db->query($sql . $sql1 . $sql2);
$sets = array();
while ($rows = $db->fetchArray($result)) {
foreach ($words as $k) {
$rows['title'] = eregi_replace("({$k})", "<span class='searchResalte'>\\1</span>", $rows['title']);
$rows['uname'] = eregi_replace("({$k})", "<span class='searchResalte'>\\1</span>", $rows['uname']);
}
$set = new GSSet();
$set->assignVars($rows);
$sets[] = array('id' => $set->id(), 'title' => $set->title(), 'owner' => $set->uname(), 'public' => $set->isPublic(), 'date' => formatTimeStamp($set->date(), 'c'), 'pics' => $set->pics(), 'url' => $set->url());
}
GSFunctions::toolbar();
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Albums Management', 'galleries'));
RMTemplate::get()->assign('xoops_pagetitle', 'Albums Management');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\n\n var delete_warning='" . __('Do you really wish to delete selected albums?', 'galleries') . "';\n\n var delete_formats='" . __('Do you really wish to delete all images formats for this album?\\nOnly deletes formats for albums, search and others, except normal thumbnails.', 'galleries') . "';\n\n </script>");
RMTemplate::get()->add_script('../include/js/gsscripts.php?file=sets');
$cHead = '<link href="' . XOOPS_URL . '/modules/galleries/styles/admin.css" media="all" rel="stylesheet" type="text/css" />';
xoops_cp_header($cHead);
include RMTemplate::get()->get_template('admin/gs_albums.php', 'module', 'galleries');
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:60,代码来源:sets.php
示例3: showWorks
/**
* @desc Visualiza todos los trabajos existentes
**/
function showWorks()
{
global $xoopsModule, $xoopsSecurity;
$db = XoopsDatabaseFactory::getDatabaseConnection();
$page = rmc_server_var($_REQUEST, 'page', 1);
$limit = rmc_server_var($_REQUEST, 'limit', 15);
$show = rmc_server_var($_REQUEST, 'show', '');
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('pw_works');
if ($show == 'public') {
$sql .= " WHERE public=1";
} elseif ($show == 'hidden') {
$sql .= " WHERE public=0";
}
list($num) = $db->fetchRow($db->query($sql));
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url('works.php?page={PAGE_NUM}');
$sql = "SELECT * FROM " . $db->prefix('pw_works');
if ($show == 'public') {
$sql .= " WHERE public=1";
} elseif ($show == 'hidden') {
$sql .= " WHERE public=0";
}
$sql .= " ORDER BY id_work DESC LIMIT {$start}, {$limit}";
$result = $db->query($sql);
$works = array();
//Container
while ($row = $db->fetchArray($result)) {
$work = new PWWork();
$work->assignVars($row);
//Obtenemos la categoría
$cat = new PWCategory($work->category());
//Obtenemos el cliente
$user = new PWClient($work->client());
$works[] = array('id' => $work->id(), 'title' => $work->title(), 'catego' => $cat->name(), 'client' => $user->name(), 'start' => formatTimeStamp($work->start(), 's'), 'mark' => $work->mark(), 'public' => $work->isPublic(), 'description' => $work->descShort());
}
PWFunctions::toolbar();
RMTemplate::get()->add_style('admin.css', 'works');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_script('../include/js/admin_works.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar pw_message='" . __('Do you really want to delete selected works?', 'works') . "';\n\n var pw_select_message = '" . __('You must select some work before to execute this action!', 'works') . "';</script>");
xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » " . __('Works', 'works'));
xoops_cp_header();
include RMTemplate::get()->get_template("admin/pw_works.php", 'module', 'works');
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:52,代码来源:works.php
示例4: showUsers
/**
* @desc Visualiza todos los usuarios existentes
**/
function showUsers()
{
global $xoopsModule, $db, $tpl, $xoopsSecurity;
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$limit = 15;
$search = rmc_server_var($_REQUEST, 'search', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_users');
$sql1 = '';
$search = trim($search);
if ($search && strlen($search) > 2) {
$sql1 .= $sql1 == '' ? " WHERE (uname LIKE '%{$search}%')" : " OR (uname LIKE '%{$search}%')";
}
list($num) = $db->fetchRow($db->query($sql . $sql1));
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$tpages = ceil($num / $limit);
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url("users.php?page={PAGE_NUM}&search={$search}");
$showmax = $start + $limit;
$showmax = $showmax > $num ? $num : $showmax;
//Fin de barra de navegación
$sql = "SELECT * FROM " . $db->prefix('gs_users');
$sql2 = " LIMIT {$start},{$limit}";
$result = $db->query($sql . $sql1 . $sql2);
while ($rows = $db->fetchArray($result)) {
$uname = eregi_replace("({$search})", "<span class='searchResalte'>\\1</span>", $rows['uname']);
$user = new GSUser();
$user->assignVars($rows);
$users[] = array('id' => $user->id(), 'uid' => $user->uid(), 'uname' => $uname, 'quota' => RMUtilities::formatBytesSize($user->quota()), 'blocked' => $user->blocked(), 'used' => GSFunctions::makeQuota($user), 'pics' => $user->pics(), 'sets' => $user->sets(), 'date' => formatTimeStamp($user->date(), 'custom'), 'url' => $user->userUrl());
}
GSFunctions::toolbar();
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . __('Users management', 'galleries'));
RMTemplate::get()->assign('xoops_pagetitle', __('Users management', 'galleries'));
RMTemplate::get()->add_script('../include/js/gsscripts.php?file=sets&form=frm-users');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_head("<script type='text/javascript'>\nvar delete_warning='" . __('Do you really wish to delete selected users?', 'galleries') . "';\n</script>");
xoops_cp_header();
include RMTemplate::get()->get_template("admin/gs_users.php", 'module', 'galleries');
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:44,代码来源:users.php
示例5: showAnnounces
/**
* @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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:24,代码来源:announcements.php
示例6: showAnnounces
/**
* @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();
}
开发者ID:petitours,项目名称:bxpress,代码行数:24,代码来源:announcements.php
示例7: b_xoopspoll_show
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;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:40,代码来源:xoopspoll.php
示例8: b_xoopspoll_show
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;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:39,代码来源:xoopspoll.php
示例9: printf
$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) {
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:main.php
示例10: cleanMessage
}
$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 {
开发者ID:darwinv,项目名称:vogues,代码行数:31,代码来源:add_sch_message.php
示例11: get_works
/**
* 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;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:44,代码来源:pwfunctions.class.php
示例12: while
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) {
?>
开发者ID:jemeyerlop,项目名称:blog_AJAX,代码行数:31,代码来源:index.php
示例13: ucfirst
<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">
开发者ID:jemeyerlop,项目名称:blog_AJAX,代码行数:30,代码来源:listaUsuarios.php
示例14: ucfirst
<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>';
开发者ID:jemeyerlop,项目名称:blog_AJAX,代码行数:31,代码来源:listaArticulos.php
示例15: array
$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);
开发者ID:darwinv,项目名称:vogues,代码行数:31,代码来源:get_user_messages.php
示例16: showSets
/**
* @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';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:74,代码来源:cp_sets.php
示例17: ceil
//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';
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:home.php
-
An issue was discovered in Bentley MicroStation before 10.17.0.x and Bentley Vie
阅读:512|2022-07-29
-
leejaymin/Kiise-Latex-template
阅读:587|2022-08-12
-
krishnaik06/Machine-Learning-in-90-days
阅读:1113|2022-08-18
-
armancodv/building-energy-model-matlab: It is a small software which is develope
阅读:1161|2022-08-17
-
在美元的英文“dollar”里面明明没有字母“s”,为什么美元的符号($)是一条竖线穿过字
阅读:1114|2022-11-06
-
FGRibreau/import-tweets-to-mastodon: How to import tweets to mastodon (e.g. http
阅读:970|2022-08-17
-
tboronczyk/localization-middleware: PSR-15 middleware to assist primarily with l
阅读:519|2022-08-16
-
paramiko/paramiko: The leading native Python SSHv2 protocol library.
阅读:624|2022-08-15
-
长沙城南,有一所以“环保”为名的学校,从1979年创立以来,四易归属、五更其名。 这
阅读:816|2022-11-06
-
heinrichreimer/material-intro: A simple material design app intro with cool anim
阅读:426|2022-08-17
|
请发表评论