本文整理汇总了PHP中post_get_base_url函数的典型用法代码示例。如果您正苦于以下问题:PHP post_get_base_url函数的具体用法?PHP post_get_base_url怎么用?PHP post_get_base_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了post_get_base_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_posts_menu
function get_posts_menu($tab_selected, $username)
{
global $globals, $current_user;
if ($tab_selected != 4 && $current_user->user_id > 0) {
$username = $current_user->user_login;
}
switch ($tab_selected) {
case 2:
$id = _('popular');
break;
case 3:
$id = _('mapa');
break;
case 4:
$id = $username;
break;
case 5:
$id = _('privados');
break;
case 1:
default:
$id = _('todas');
break;
}
$items = array();
$items[] = new MenuOption(_('todas'), post_get_base_url(''), $id, _('todas las notas'));
$items[] = new MenuOption(_('popular'), post_get_base_url('_best'), $id, _('notas populares'));
if ($globals['google_maps_api']) {
$items[] = new MenuOption(_('mapa'), post_get_base_url('_geo'), $id, _('mapa animado'));
}
if (!empty($username)) {
$items[] = new MenuOption($username, post_get_base_url($username), $id, $username);
}
if ($current_user->user_id > 0) {
$items[] = new MenuOption(_('Privados'), post_get_base_url('_priv'), $id, _('mensajes privados'), array(), 'privados');
}
return $items;
}
示例2: do_redirect
function do_redirect($type)
{
global $globals, $current_user;
$url = '/';
// If everything fails, it will be redirected to the home
switch ($type) {
case 'privates':
$url = post_get_base_url('_priv');
break;
case 'posts':
$url = post_get_base_url($current_user->user_login) . '/_conversation';
break;
case 'comments':
$url = get_user_uri($current_user->user_login, 'conversation');
break;
case 'friends':
$url = get_user_uri($current_user->user_login, 'friends_new');
break;
}
header("HTTP/1.1 302 Moved");
header('Location: ' . $url);
header("Content-Length: 0");
}
示例3: do_header
function do_header($title)
{
global $if_modified, $last_modified, $dblang, $globals;
if (!$last_modified > 0) {
if ($if_modified > 0) {
$last_modified = $if_modified;
} else {
$last_modified = time();
}
}
header('X-If-Modified: ' . gmdate('D, d M Y H:i:s', $if_modified));
header('X-Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified));
if ($last_modified <= $if_modified) {
header('HTTP/1.1 304 Not Modified');
exit;
}
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified) . ' GMT');
header('Content-type: text/xml; charset=UTF-8', true);
echo '<?xml version="1.0" encoding="UTF-8"?' . '>' . "\n";
echo '<rss version="2.0" ' . "\n";
echo ' xmlns:atom="http://www.w3.org/2005/Atom"' . "\n";
echo ' xmlns:content="http://purl.org/rss/1.0/modules/content/"' . "\n";
echo ' xmlns:wfw="http://wellformedweb.org/CommentAPI/"' . "\n";
echo ' xmlns:dc="http://purl.org/dc/elements/1.1/"' . "\n";
echo ' xmlns:georss="http://www.georss.org/georss"' . "\n";
echo ' >' . "\n";
echo '<channel>' . "\n";
echo ' <title>' . $title . '</title>' . "\n";
echo ' <atom:link href="http://' . get_server_name() . __(clean_input_url($_SERVER['REQUEST_URI'])) . '" rel="self" type="application/rss+xml" />' . "\n";
echo ' <link>http://' . get_server_name() . post_get_base_url() . '</link>' . "\n";
echo "\t<image><title>" . $title . "</title><link>http://" . get_server_name() . post_get_base_url() . "</link><url>http://" . get_static_server_name() . $globals['base_url'] . "img/common/eli-rss.png</url></image>\n";
echo ' <description>' . _('Sitio colaborativo de publicación y comunicación entre blogs') . '</description>' . "\n";
echo ' <pubDate>' . date("r", $last_modified) . '</pubDate>' . "\n";
echo ' <generator>http://blog.meneame.net/</generator>' . "\n";
echo ' <language>' . $dblang . '</language>' . "\n";
}
示例4: get_hex_color
$width = 140;
$height = 120;
$avatar = 40;
$text_length = 150;
}
if (!empty($_GET['border'])) {
$border = get_hex_color($_GET['border'], '#');
} else {
$border = '#bbb';
}
$id = $db->get_var($sql);
if (!$id > 0) {
die;
}
$post = new Post();
$post->id = $id;
$post->read();
if (!$post->read) {
die;
}
echo 'document.write(\'';
echo '<a href="http://' . get_server_name() . post_get_base_url($post->username) . '" style="text-decoration: none; border: none">';
echo '<div style="overflow: hidden; background: #fff; width: ' . $width . 'px; max-height: ' . $height . 'px; border: 1px solid; border-color: ' . $border . '; ">';
echo '<div style="padding: 4px 4px 4px 4px;">';
echo '<div style="overflow: hidden; color: #666; text-align: left; font-family: sans-serif; font-size: 8pt; padding: 0; line-height: 1.1">';
echo '<img src="' . get_avatar_url($post->author, $post->avatar, $avatar) . '" width="' . $avatar . '" height="' . $avatar . '" alt="avatar" style="float:left; margin: 0 5px 4px 0;" border: none/>';
echo '<div>';
echo '<span style="color: #111;">' . $post->username . '</span><br/>';
echo addslashes(text_to_summary($post->content, $text_length));
echo '</div></div></div></div></a>';
echo '\');';
示例5: do_best_posts
function do_best_posts()
{
global $db, $globals, $dblang;
$min_date = date("Y-m-d H:00:00", $globals['now'] - 22000);
// about 6 hours
$res = $db->get_results("select post_id, post_content, user_login from posts, users where post_date > '{$min_date}' and post_user_id = user_id order by post_karma desc limit 10");
if ($res) {
echo '<div class="vertical-box">';
echo '<h4><a href="' . post_get_base_url('_best') . '">' . _('¿mejores? notas') . '</a></h4><ul>';
foreach ($res as $post) {
echo '<li>' . $post->user_login . ': <a onmouseout="tooltip.clear(event);" onclick="tooltip.clear(this);" onmouseover="return tooltip.ajax_delayed(event, \'get_post_tooltip.php\', \'' . $post->post_id . '\', 10000);" href="' . post_get_base_url($post->user_login) . '/' . $post->post_id . '">' . text_to_summary($post->post_content, 50) . '</a></li>' . "\n";
}
echo '</ul></div>';
}
}
示例6: print_summary
function print_summary($length = 0)
{
global $current_user, $globals;
if (!$this->read) {
$this->read();
}
echo '<li id="pcontainer-' . $this->id . '">';
$post_meta_class = 'comment-meta';
$post_class = 'comment-body';
echo '<div class="' . $post_class . '">';
echo '<a href="' . get_user_uri($this->username) . '"><img onmouseover="return tooltip.ajax_delayed(event, \'get_user_info.php\', ' . $this->author . ');" onmouseout="tooltip.clear(event);" class="avatar" src="' . get_avatar_url($this->author, $this->avatar, 40) . '" width="40" height="40" alt="' . $this->username . '"/></a>';
$this->print_text($length);
echo '</div>';
// The comments info bar
echo '<div class="' . $post_meta_class . '">';
// Print the votes info (left)
echo '<div class="comment-votes-info">';
// Check that the user can vote
if ($current_user->user_id > 0 && $this->author != $current_user->user_id) {
$this->print_shake_icons();
}
echo _('votos') . ': <span id="vc-' . $this->id . '">' . $this->votes . '</span>, karma: <span id="vk-' . $this->id . '">' . $this->karma . '</span>';
// Add the icon to show votes
if ($this->votes > 0 && $this->date > $globals['now'] - 30 * 86400) {
// Show votes if newer than 30 days
echo ' <a href="javascript:modal_from_ajax(\'' . $globals['base_url'] . 'backend/get_p_v.php?id=' . $this->id . '\')">';
echo '<img src="' . $globals['base_url'] . 'img/common/vote-info01.png" width="12" height="12" alt="+ info" title="' . _('¿quién ha votado?') . '"/>';
echo '</a>';
}
echo '</div>';
// Print comment info (right)
echo '<div class="comment-info">';
echo '<a href="' . post_get_base_url($this->username) . '">' . _('nota de') . ' ' . $this->username . '</a> ';
echo '(' . $this->src . ') ';
echo '(<a href="' . post_get_base_url($this->username) . '/' . $this->id . '" title="permalink">#</a>) ';
// Print dates
if (time() - $this->date > 604800) {
// 7 days
echo _('el') . get_date_time($this->date);
} else {
echo _('hace') . ' ' . txt_time_diff($this->date);
}
echo '</div></div>';
echo "</li>\n";
}
示例7: notify_user
function notify_user($from, $to, $text)
{
$sender = new User($from);
$user = new User($to);
if (!$user || !$sender) {
return;
}
if (!check_email($user->email)) {
return;
}
if (!User::get_pref($to, 'notify_priv')) {
return;
}
$url = 'http://' . get_server_name() . post_get_base_url('_priv');
$subject = "Notificación de mensaje privado de {$sender->username}";
$message = "{$sender->username} " . _('escribió') . ":\n{$url}\n\n{$text}";
require_once mnminclude . 'mail.php';
send_mail($user->email, $subject, $message);
}
示例8: do_redirection
do_redirection($url);
exit(0);
case 'posts':
$url = post_get_base_url($current_user->user_login) . '/_conversation';
do_redirection($url);
exit(0);
case 'comments':
$url = get_user_uri($current_user->user_login, 'conversation');
do_redirection($url);
exit(0);
case 'friends':
$url = get_user_uri($current_user->user_login, 'friends_new');
do_redirection($url);
exit(0);
case 'post':
$url = 'http://' . get_server_name() . post_get_base_url($id);
do_redirection($url);
exit(0);
case 'comment':
$c = new Comment();
$c->id = $id;
$url = 'http://' . get_server_name() . $c->get_relative_individual_permalink();
do_redirection($url);
exit(0);
default:
$l = Link::from_db($id, null, false);
if (!$l) {
exit(0);
}
if (!$globals['mobile'] && !$globals['mobile_version'] && $current_user->user_id > 0 && User::get_pref($current_user->user_id, 'use_bar') && $db->get_var("select blog_type from blogs where blog_id = {$l->blog}") != 'noiframe') {
if ($globals['base_bar_url']) {
示例9: FROM_UNIXTIME
if (!$date) {
$date = $globals['now'];
}
$id = (int) $db->get_var("select post_id from posts, users where user_login = '{$user}' and post_user_id = user_id and post_date < FROM_UNIXTIME({$date}) order by post_date desc limit 1");
}
if (!$id > 0) {
// Check if the user exists
$uid = (int) $db->get_var("select user_id from users where user_login = '{$user}' limit 1");
if (!$uid) {
not_found('<strong>Error: </strong>' . _('usuario inexistente'));
} else {
header('Location: http://' . get_server_name() . post_get_base_url($user));
die;
}
die;
}
} else {
$id = intval($_GET['id']);
}
} else {
die;
}
$post = new Post();
$post->id = $id;
$post->read();
if (!$post->read) {
not_found('<strong>Error: </strong>' . _('nota no encontrada'));
die;
}
header('Location: http://' . get_server_name() . post_get_base_url($post->id));
echo $link;
示例10: get_menu_items
static function get_menu_items($view, $user)
{
global $globals, $current_user;
switch ($view) {
case 'subs':
$id = _('subs');
break;
case 'history':
case 'shaken':
case 'friends_shaken':
case 'favorites':
$id = _('historias');
break;
case 'commented':
case 'favorite_comments':
case 'shaken_comments':
case 'conversation':
$id = _('comentarios');
break;
case 'friends':
case 'friend_of':
case 'ignored':
case 'friends_new':
$id = _('relaciones');
break;
case 'categories':
case 'profile':
$id = _('perfil');
break;
default:
do_error(_('opción inexistente'), 404);
break;
}
$items = array();
$items[] = new MenuOption(_('perfil'), get_user_uri($user), $id, _('información de usuario'));
$items[] = new MenuOption(_('relaciones'), get_user_uri($user, 'friends'), $id, _('amigos e ignorados'));
$items[] = new MenuOption(_('subs'), get_user_uri($user, 'subs'), $id, _('sub menéames'));
$items[] = new MenuOption(_('historias'), get_user_uri($user, 'history'), $id, _('información de envíos'));
$items[] = new MenuOption(_('comentarios'), get_user_uri($user, 'commented'), $id, _('información de comentarios'));
$items[] = new MenuOption(_('notas'), post_get_base_url($user), $id, _('página de notas'));
return $items;
}
示例11: print_summary
function print_summary($length = 0)
{
global $current_user, $globals;
if (!$this->read) {
$this->read();
}
$this->hidden = $this->karma < $globals['post_hide_karma'] || $this->user_level == 'disabled';
$this->ignored = $current_user->user_id > 0 && User::friend_exists($current_user->user_id, $this->author) < 0;
echo '<div id="pcontainer-' . $this->id . '">';
if ($this->hidden || $this->ignored) {
$post_meta_class = 'comment-meta-hidden';
$post_class = 'comment-body-hidden';
} else {
$post_meta_class = 'comment-meta';
$post_class = 'comment-body';
if ($this->karma > $globals['post_highlight_karma']) {
$post_class .= ' high';
}
}
echo '<div class="' . $post_class . '" id="pid-' . $this->id . '">';
if ($this->ignored || $this->hidden && ($current_user->user_comment_pref & 1) == 0) {
echo '» <a href="javascript:get_votes(\'get_post.php\',\'post\',\'pid-' . $this->id . '\',0,' . $this->id . ')" title="' . _('ver texto') . '">' . _('ver texto') . '</a>';
} else {
$this->print_user_avatar(40);
$this->print_text($length);
}
echo '</div>';
// The comments info bar
echo '<div class="' . $post_meta_class . '">';
// Print the votes info (left)
echo '<div class="comment-votes-info">';
// Check that the user can vote
if ($current_user->user_id > 0 && $this->author != $current_user->user_id && $this->date > time() - $globals['time_enabled_votes']) {
$this->print_shake_icons();
}
echo _('votos') . ': <span id="vc-' . $this->id . '">' . $this->votes . '</span>, ' . _('karma') . ': <span id="vk-' . $this->id . '">' . $this->karma . '</span> ';
// Add the icon to show votes
if ($this->votes > 0 && $this->date > $globals['now'] - 30 * 86400) {
// Show votes if newer than 30 days
echo '<a href="javascript:modal_from_ajax(\'' . $globals['base_url'] . 'backend/get_p_v.php?id=' . $this->id . '\')">';
echo '<img src="' . $globals['base_static'] . 'img/common/vote-info02.png" width="18" height="16" alt="+ info" title="' . _('¿quién ha votado?') . '"/>';
echo '</a>';
}
// Reply button
if ($current_user->user_id > 0) {
echo '<a href="javascript:post_reply(' . $this->id . ',\'' . $this->username . '\')" title="' . _('responder') . '"><img src="' . $globals['base_static'] . 'img/common/reply02.png" width="18" height="16"/></a>';
}
// Permalink
echo '<a href="' . post_get_base_url($this->id) . '" title="permalink"><img class="link-icon" src="' . $globals['base_static'] . 'img/common/link-02.png" width="18" height="16" alt="link" title="' . _('enlace permanente') . '"/></a>';
// If the user is authenticated, show favorite box
if ($current_user->user_id > 0) {
echo '<a id="fav-' . $this->id . '" href="javascript:get_votes(\'get_favorite_post.php\',\'' . $current_user->user_id . '\',\'fav-' . $this->id . '\',0,\'' . $this->id . '\')">' . favorite_teaser($current_user->user_id, $this, 'post') . '</a>';
}
echo '</div>';
// Print comment info (right)
echo '<div class="comment-info">';
$author = '<a href="' . post_get_base_url($this->username) . '">' . ' ' . $this->username . '</a> (' . $this->src . ')';
// Print dates
if ($globals['now'] - $this->date > 604800) {
// 7 days
printf(_('el %s %s por %s'), get_date_time($this->date), '', $author);
} else {
printf(_('hace %s %s por %s'), txt_time_diff($this->date), '', $author);
}
//$this->print_user_avatar(20);
echo '</div></div>';
echo "</div>\n";
}
示例12: do_posts_tabs
function do_posts_tabs($tab_selected, $username) {
global $globals, $current_user;
$reload_text = _('recargar');
$active = ' class="tabmain-this"';
echo '<ul class="tabmain">' . "\n";
// All
if ($tab_selected == 1) {
echo '<li'.$active.'><a href="'.post_get_base_url().'" title="'.$reload_text.'"><em>'._('todos').'</em></a></li>' . "\n";
} else {
echo '<li><a href="'.post_get_base_url().'">'._('todos').'</a></li>' . "\n";
}
// Best
if ($tab_selected == 2) {
echo '<li'.$active.'><a href="'.post_get_base_url('_best').'" title="'.$reload_text.'"><em>'._('popular').'</em></a></li>' . "\n";
} else {
echo '<li><a href="'.post_get_base_url('_best').'" title="'._('más votadas en 24 horas').'">'._('popular').'</a></li>' . "\n";
}
// GEO
if ($globals['google_maps_api']) {
if ($tab_selected == 3) {
echo '<li'.$active.'><a href="'.post_get_base_url('_geo').'" title="'.$reload_text.'"><em>'._('mapa').'</em></a></li>' . "\n";
} else {
echo '<li><a href="'.post_get_base_url('_geo').'" title="'._('geo').'">'._('mapa').'</a></li>' . "\n";
}
}
// User
if ($tab_selected == 4) {
echo '<li'.$active.'><a href="'.post_get_base_url($username).'" title="'.$reload_text.'"><em>'.$username.'</em></a></li>' . "\n";
} elseif ($current_user->user_id > 0) {
echo '<li><a href="'.post_get_base_url($current_user->user_login).'">'.$current_user->user_login.'</a></li>' . "\n";
}
// END STANDARD TABS
echo '</ul>' . "\n";
}
示例13: header
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
// The code below was made by Beldar <beldar at gmail dot com>
if (!defined('mnmpath')) {
include_once '../config.php';
header('Content-Type: text/html; charset=utf-8');
stats_increment('ajax');
}
include_once mnminclude . 'post.php';
if (!empty($_GET['id'])) {
if (preg_match('/([\\w\\.\\-_]+)-(\\d+)/', $_GET['id'], $matches) > 0) {
$user = $db->escape($matches[1]);
$date = $matches[2];
$id = (int) $db->get_var("select post_id from posts, users where user_login = '{$user}' and post_user_id = user_id and post_date < FROM_UNIXTIME({$date}) order by post_date desc limit 1");
if (!$id > 0) {
not_found('<strong>Error: </strong>' . _('usuario o nota no encontrada'));
die;
}
} else {
$id = intval($_GET['id']);
}
} else {
die;
}
$post = new Post();
$post->id = $id;
$post->read();
if (!$post->read) {
die;
}
header('Location: http://' . get_server_name() . post_get_base_url($post->username) . "/{$post->id}");
echo $link;
示例14: do_user_tabs
function do_user_tabs($option, $user)
{
global $globals, $current_user;
$active = array();
$active[$option] = 'class="tabsub-this"';
echo '<ul class="tabsub">' . "\n";
echo '<li><a ' . $active[1] . ' href="' . get_user_uri($user) . '">' . _('perfil') . '</a></li>';
echo '<li><a ' . $active[8] . ' href="' . get_user_uri($user, 'categories') . '">' . _('personalización') . '</a></li>';
echo '<li><a ' . $active[7] . ' href="' . get_user_uri($user, 'friends') . '"> <img src="' . $globals['base_url'] . 'img/common/icon_heart_bi.gif" alt="amigos e ignorados" width="16" height="16" title="' . _('amigos e ignorados') . '"/> </a></li>';
echo '<li><a ' . $active[2] . ' href="' . get_user_uri($user, 'history') . '">' . _('enviadas') . '</a></li>';
if (!$globals['bot']) {
echo '<li><a ' . $active[6] . ' href="' . get_user_uri($user, 'favorites') . '"> ' . FAV_YES . ' </a></li>';
echo '<li><a ' . $active[3] . ' href="' . get_user_uri($user, 'commented') . '">' . _('comentarios') . '</a></li>';
echo '<li><a ' . $active[4] . ' href="' . get_user_uri($user, 'shaken') . '">' . _('votadas') . '</a></li>';
//echo '<li><a '.$active[5].' href="'.get_user_uri($user, 'preferred').'">'._('autores preferidos'). '</a></li>';
}
echo '<li><a href="' . post_get_base_url($user) . '">' . _('notas') . '</a></li>';
echo '</ul>';
}
示例15: do_best_posts
function do_best_posts()
{
global $db, $globals, $dblang;
if ($globals['mobile']) {
return;
}
$output = '';
$key = 'best_posts_' . $globals['site_shortname'] . $globals['v'];
if (memcache_mprint($key)) {
return;
}
echo '<!-- Calculating ' . __FUNCTION__ . ' -->';
$min_date = date("Y-m-d H:i:00", $globals['now'] - 86400);
// about 24 hours
$res = $db->get_results("select post_id from posts, users where post_date > '{$min_date}' and post_user_id = user_id and post_karma > 0 order by post_karma desc limit 10");
if ($res) {
$objects = array();
$title = _('mejores notas');
$url = post_get_base_url('_best');
foreach ($res as $p) {
$obj = new stdClass();
$post = new Post();
$post->id = $p->post_id;
$post->read();
$obj->id = $post->id;
$obj->link = post_get_base_url() . $post->id;
$obj->user_id = $post->author;
$obj->avatar = $post->avatar;
$obj->title = text_to_summary($post->clean_content(), 80);
$obj->username = $post->username;
$obj->tooltip = 'p';
$objects[] = $obj;
}
$vars = compact('objects', 'title', 'url');
$output = Haanga::Load('best_comments_posts.html', $vars, true);
echo $output;
memcache_madd($key, $output, 300);
}
}