本文整理汇总了PHP中do_tabs函数的典型用法代码示例。如果您正苦于以下问题:PHP do_tabs函数的具体用法?PHP do_tabs怎么用?PHP do_tabs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_tabs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$range_names = array(_('24 horas'), _('48 horas'), _('una semana'), _('un mes'), _('un año'), _('todas'));
$range_values = array(1, 2, 7, 30, 365, 0);
$site_id = SitesMgr::my_id();
if (($from = check_integer('range')) >= 0 && $from < count($range_values) && $range_values[$from] > 0) {
// we use this to allow sql caching
$from_time = '"' . date("Y-m-d H:00:00", time() - 86400 * $range_values[$from]) . '"';
$from_where = "FROM blogs, links, sub_statuses WHERE id = {$site_id} and date > {$from_time} and status = 'published' and link = link_id and link_blog = blog_id";
} else {
$from_where = "FROM blogs, links, sub_statuses WHERE id = {$site_id} and status = 'published' and link = link_id and link_blog = blog_id";
}
$from_where .= " GROUP BY blog_id";
$max = max($db->get_var("select count(*) as count {$from_where} order by count desc limit 1"), 2);
//echo "MAX= $max\n";
$coef = ($max_pts - $min_pts) / ($max - 1);
do_header(_('nube de sitios web') . ' | ' . _('menéame'));
do_tabs("main", _('+ webs'), true);
print_period_tabs();
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_vertical_tags('published');
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
echo '<div class="topheading"><h2>Los sitios más enlazados</h2></div>';
echo '<div style="margin: 20px 0 20px 0; line-height: ' . $line_height . 'pt; margin-left: 50px;">';
$res = $db->get_results("select blog_url, count(*) as count {$from_where} order by count desc limit {$limit}");
if ($res) {
foreach ($res as $item) {
$blogs[$item->blog_url] = $item->count;
}
示例2: get_current_page
$page_size = 20;
$current_page = get_current_page();
$offset = ($current_page - 1) * $page_size;
if (!$current_user->user_id) {
header("Location: " . $globals['base_url']);
die;
}
$friends = $db->get_col("select friend_to from friends where friend_type = 'manual' and friend_from = {$current_user->user_id} and friend_value > 0");
if ($friends) {
$friends_list = implode(',', $friends);
$sql = "select distinct vote_link_id as link_id from votes where vote_type = 'links' and vote_user_id in ({$friends_list}) and vote_value > 0 order by vote_link_id desc";
$links = $db->get_results("{$sql} LIMIT {$offset},{$page_size}");
}
do_header(_('votadas por amigos') . ' | ' . _('menéame'));
$globals['tag_status'] = 'published';
do_tabs('main', 'friends');
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_banner_promotions();
do_best_comments();
do_vertical_tags('published');
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
if ($links) {
foreach ($links as $dblink) {
$link = Link::from_db($dblink->link_id);
$link->do_inline_friend_votes = true;
$link->print_summary();
}
示例3: memcache_madd
if ($rows > 0) {
$links = $db->get_results("{$sql} LIMIT {$offset},{$page_size}");
if ($memcache_key) {
if ($range_values[$from] > 2) {
$ttl = 86400;
} else {
$ttl = 1800;
}
memcache_madd($memcache_key . 'rows', $rows, $ttl);
memcache_madd($memcache_key, serialize($links), $ttl);
}
}
}
do_header(_('más votadas') . ' | ' . $globals['site_name'], _('populares'));
$globals['tag_status'] = 'published';
do_tabs('main', 'popular');
print_period_tabs();
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_active_stories();
do_banner_promotions();
do_last_subs('published', 5, 'link_votes');
do_best_comments();
do_vertical_tags('published');
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
if ($links) {
$counter = 0;
foreach ($links as $dblink) {
示例4: count
// It's not in cache, or memcache is disabled
$rows = $db->get_var("SELECT count(*) FROM sub_statuses WHERE {$time_link} {$status}");
$rows = min(4 * $page_size, $rows);
// Only up to 4 pages
if ($rows > 0) {
$links = $db->get_results("{$sql} LIMIT {$offset},{$page_size}");
if ($memcache_key) {
$ttl = 1800;
memcache_madd($memcache_key . 'rows', $rows, $ttl);
memcache_madd($memcache_key, serialize($links), $ttl);
}
}
}
do_header(_('más visitadas') . ' | ' . $globals['site_name'], _('más visitadas'));
$globals['tag_status'] = 'published';
do_tabs('main', 'topclicked');
print_period_tabs();
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_active_stories();
do_banner_promotions();
do_best_stories();
do_best_comments();
do_vertical_tags('published');
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
if ($links) {
$counter = 0;
foreach ($links as $dblink) {
示例5: date
$from_time = '"' . date("Y-m-d H:00:00", $globals['now'] - $globals['time_enabled_votes']) . '"';
$from_where = "FROM links WHERE link_status='queued' and link_date > {$from_time} and link_category in (" . $globals['meta_categories'] . ") ";
$tab = false;
} else {
//$from_where = "FROM links WHERE link_date > $from_time and link_status='queued'";
$from_where = "FROM links WHERE link_status='queued'";
$tab = 1;
}
break;
}
do_header(_('noticias pendientes') . ' // menéame');
do_banner_top();
echo '<div id="container">' . "\n";
do_sidebar();
echo '<div id="contents">' . "\n";
do_tabs("main", "shakeit");
print_shakeit_tabs($tab);
do_mnu_categories_horizontal($_REQUEST['category']);
// fora en posar dropdown echo '</div>'; // Left margin
// end of tabs
if ($cat) {
$from_where .= " AND link_category={$cat} ";
}
$link = new Link();
$rows = $db->get_var("SELECT count(*) {$from_where}");
$links = $db->get_col("SELECT link_id {$from_where} {$order_by} LIMIT {$offset},{$page_size}");
if ($links) {
foreach ($links as $link_id) {
$link->id = $link_id;
$link->read();
if ($offset < 1000) {
示例6: include
include('config.php');
include(mnminclude.'html1.php');
meta_get_current();
array_push($globals['post_js'], 'hoygan.js');
$page_size = 15;
$page = get_current_page();
$offset=($page-1)*$page_size;
$globals['ads'] = true;
$cat=$_REQUEST['category'];
do_header(_('últimas publicadas') . ' | menéame');
do_tabs('main','published');
if ($globals['meta_current'] > 0) {
$from_where = "FROM links WHERE link_status='published' and link_category in (".$globals['meta_categories'].") ";
print_index_tabs(); // No other view
} elseif ($current_user->user_id > 0) { // Check authenticated users
switch ($globals['meta']) {
case '_personal':
$from_time = '"'.date("Y-m-d H:00:00", $globals['now'] - $globals['time_enabled_comments']).'"';
$from_where = "FROM links WHERE link_date > $from_time and link_status='published' and link_category in (".$globals['meta_categories'].") ";
//$from_where = "FROM links WHERE link_status='published' and link_category in (".$globals['meta_categories'].") ";
print_index_tabs(7); // Show "personal" as default
break;
case '_friends':
$from_time = '"'.date("Y-m-d H:00:00", $globals['now'] - 86400*4).'"';
$from_where = "FROM links, friends WHERE link_date > $from_time and link_status='published' and friend_type='manual' and friend_from = $current_user->user_id and friend_to=link_author and friend_value > 0";
print_index_tabs(1); // Friends
示例7: do_header
}
if (!empty($link->tags)) {
$globals['tags'] = $link->tags;
}
do_header($link->title, 'post');
// Show the error if the comment couldn't be inserted
if (!empty($new_comment_error)) {
echo '<script type="text/javascript">';
echo '$(function(){alert(\'' . _('comentario no insertado') . ": {$new_comment_error}" . '\')});';
echo '</script>';
}
do_banner_top();
echo '<div id="container">' . "\n";
do_sidebar(false);
echo '<div id="contents">';
do_tabs("main", _('noticia'), true);
$link->print_summary();
switch ($tab_option) {
case 1:
case 2:
echo '<div class="comments">';
// AdSense
do_banner_story();
// Print tabs
print_story_tabs($tab_option);
// If option is "normal comments", show also last trackbakcs and pingbacks
if ($tab_option == 1) {
$trackbacks = $db->get_col("SELECT trackback_id FROM trackbacks WHERE trackback_link_id={$link->id} AND trackback_type='in' and trackback_status = 'ok' ORDER BY trackback_date DESC limit 10");
if ($trackbacks) {
echo '<fieldset><legend><a href="' . $globals['link_permalink'] . '/trackbacks">' . _('últimas relacionadas') . '</a></legend>';
echo '<ul class="tab-trackback">';
示例8: foreach
foreach ($fields as $field) {
$code .= do_tabs() . 'protected $' . $field . ";" . jump();
}
$code .= jump();
foreach ($fields as $field) {
$code .= do_tabs() . 'public function get' . ucfirst($field) . "()" . jump();
$code .= do_tabs() . "{" . jump();
$code .= do_tabs(1) . 'return $this->' . $field . ";" . jump();
$code .= do_tabs() . "}" . jump(2);
$code .= do_tabs() . 'public function set' . ucfirst($field) . '($' . $field . ")" . jump();
$code .= do_tabs() . "{" . jump();
$code .= do_tabs(1) . '$this->' . $field . ' = $' . $field . ";" . jump();
$code .= do_tabs() . "}" . jump(2);
}
$code .= do_tabs() . "public function save()" . jump();
$code .= do_tabs() . "{" . jump();
$code .= do_tabs(1) . '$this->persist($this) ' . ";" . jump();
$code .= do_tabs() . "}" . jump(2);
$code .= do_tabs() . "public static function factory()" . jump();
$code .= do_tabs() . "{" . jump();
$code .= do_tabs(1) . 'return new ' . ucfirst($className) . ";" . jump();
$code .= do_tabs() . "}" . jump(2);
$code .= do_tabs() . "public static function countItem()" . jump();
$code .= do_tabs() . "{" . jump();
$code .= do_tabs(1) . '$self = self::factory()' . ";" . jump();
$code .= do_tabs(1) . '$result = $self::countItems($self)' . ";" . jump();
$code .= do_tabs(1) . 'return $result' . ";" . jump();
$code .= do_tabs() . "}" . jump(2);
$code .= "}\n";
file_put_contents($className . ".php", $code);
// Do some magic here
示例9: trim
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'html1-mobile.php';
include mnminclude . 'linkmobile.php';
include mnminclude . 'search.php';
$page_size = 10;
$offset = (get_current_page() - 1) * $page_size;
$globals['ads'] = false;
$globals['noindex'] = true;
$_REQUEST['q'] = trim(stripslashes($_REQUEST['q']));
$response = do_search(false, $offset, $page_size);
$search_txt = htmlspecialchars($_REQUEST['q']);
do_header(sprintf(_('búsqueda de «%s»'), $search_txt));
do_tabs('main', _('búsqueda'), htmlentities($_SERVER['REQUEST_URI']));
echo '<div id="newswrap">' . "\n";
if (!empty($_REQUEST['q'])) {
echo '<div style="background:#FFE2C5;margin: 4px; padding:4px;">' . _('búsqueda') . ': <em>' . $search_txt . '</em>';
echo ' ' . _('encontrados') . ': ' . $response['rows'] . ', ' . _('tiempo total') . ': ' . sprintf("%1.3f", $response['time']) . ' ' . _('segundos') . '</div>';
}
echo '<form action="' . $globals['base_url'] . 'search.php" method="get">' . "\n";
echo '<fieldset>';
echo '<label for="search">' . _('búsqueda') . '</label>' . "\n";
echo '<div><input type="text" name="q" id="search" value="' . htmlspecialchars(strip_tags($_REQUEST['q'])) . '" /></div>';
echo '<input type="submit" value="' . _('buscar') . '" />' . "\n";
echo '</fieldset>';
echo '</form>';
$link = new LinkMobile();
if ($response['ids']) {
$rows = min($response['rows'], 1000);
示例10: trim
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'html1-mobile.php';
include mnminclude . 'linkmobile.php';
include mnminclude . 'search.php';
$page_size = 10;
$offset = (get_current_page() - 1) * $page_size;
$globals['ads'] = false;
$globals['noindex'] = true;
$_REQUEST['q'] = trim(stripslashes($_REQUEST['q']));
$response = do_search(false, $offset, $page_size);
$search_txt = htmlspecialchars($_REQUEST['q']);
do_header(sprintf(_('búsqueda de «%s»'), $search_txt));
do_tabs('main', _('búsqueda'), __($_SERVER['REQUEST_URI']));
echo '<div id="newswrap">' . "\n";
if (!empty($_REQUEST['q'])) {
echo '<div style="background:#FFE2C5;margin: 4px; padding:4px;">' . _('búsqueda') . ': <em>' . $search_txt . '</em>';
echo ' ' . _('encontrados') . ': ' . $response['rows'] . ', ' . _('tiempo total') . ': ' . sprintf("%1.3f", $response['time']) . ' ' . _('segundos') . '</div>';
}
echo '<form action="' . $globals['base_url'] . 'search.php" method="get">' . "\n";
echo '<fieldset>';
echo '<label for="search">' . _('búsqueda') . '</label>' . "\n";
echo '<div><input type="text" name="q" id="search" value="' . htmlspecialchars(strip_tags($_REQUEST['q'])) . '" /></div>';
echo '<input type="submit" value="' . _('buscar') . '" />' . "\n";
echo '</fieldset>';
echo '</form>';
if ($response['ids']) {
$rows = min($response['rows'], 1000);
foreach ($response['ids'] as $link_id) {
示例11: geo_init
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2007 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'geo.php';
geo_init('onLoad', false, 3);
do_header(_('geovisión'));
do_tabs('main', _('geovisión'), true);
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_vertical_tags();
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap"><!-- geovision.php -->' . "\n";
echo '<div class="topheading"><h2>actividad de los usuarios geolocalizados</h2></div>';
echo '<div id="map" style="width: 95%; height: 500px;margin:0 0 0 20px"></div></div>';
?>
<script type="text/javascript">
//<![CDATA[
var timestamp = 0;
var period = 10000;
var persistency = 300000;
var counter=0;
示例12: _
$globals['tags'] = $link->tags;
}
// Add canonical address
$globals['extra_head'] = '<link rel="canonical" href="' . $globals['link_permalink'] . '" />' . "\n";
// add also a rel to the comments rss
$globals['extra_head'] .= '<link rel="alternate" type="application/rss+xml" title="' . _('comentarios esta noticia') . '" href="http://' . get_server_name() . $globals['base_url'] . 'comments_rss2.php?id=' . $link->id . '" />' . "\n";
$globals['thumbnail'] = $link->has_thumb();
$globals['description'] = _('Autor') . ": {$link->username}, " . _('Resumen') . ': ' . text_to_summary($link->content, 250);
do_header($link->title, 'post');
// Show the error if the comment couldn't be inserted
if (!empty($new_comment_error)) {
echo '<script type="text/javascript">';
echo '$(function(){mDialog.notify(\'' . _('Aviso') . ": {$new_comment_error}" . '\', 5)});';
echo '</script>';
}
do_tabs("main", _('club'), true);
echo '<div id="newswrap">' . "\n";
$link->print_summary_club();
switch ($tab_option) {
case 1:
echo '<div class="comments">';
if ($tab_option == 1) {
do_comment_pages($link->comments, $current_page);
}
$comments = $db->object_iterator("SELECT" . Comment::SQL . "WHERE comment_link_id={$link->id} ORDER BY {$order_field} {$limit}", "Comment");
if ($comments) {
echo '<ol class="comments-list">';
foreach ($comments as $comment) {
echo '<li>';
$comment->print_summary_club($link, 2500, true);
echo '</li>';
示例13: do_header
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'html1.php';
do_header(_('mejores comentarios en 24 horas') . ' | ' . $globals['site_name']);
do_tabs('main', '+ ' . _('comentarios'), true);
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_best_stories();
do_best_comments();
do_vertical_tags('published');
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
echo '<div class="topheading"><h2>' . _('comentarios más valorados 24 horas') . '</h2></div>';
$last_link = 0;
$counter = 0;
echo '<div class="comments">';
$min_date = date("Y-m-d H:00:00", time() - 86000);
// about 24 hours
$comments = $db->get_results("SELECT comment_id, link_id FROM comments, links WHERE comment_date > '{$min_date}' and link_id=comment_link_id ORDER BY comment_karma desc, link_id asc limit 25");
if ($comments) {
foreach ($comments as $dbcomment) {
$link = Link::from_db($dbcomment->link_id, null, false);
示例14: do_header
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'comment.php';
$globals['ads'] = true;
do_header(_('mejores comentarios en 24 horas') . ' // menéame');
do_banner_top();
echo '<div id="container">' . "\n";
do_sidebar();
echo '<div id="contents">';
do_tabs('main', _('+ comentarios'), true);
echo '<div class="topheading"><h2>' . _('comentarios más valorados 24 horas') . '</h2></div>';
$last_link = 0;
$counter = 0;
$comment = new Comment();
$link = new Link();
echo '<div class="comments">';
$min_date = date("Y-m-d H:00:00", time() - 86000);
// about 24 hours
$comments = $db->get_results("SELECT comment_id, link_id FROM comments, links WHERE comment_date > '{$min_date}' and link_id=comment_link_id ORDER BY comment_karma desc, link_id asc limit 25");
if ($comments) {
foreach ($comments as $dbcomment) {
$link->id = $dbcomment->link_id;
$comment->id = $dbcomment->comment_id;
$link->read();
$comment->read();
示例15: array
//$range_values = array(1, 2, 7, 30, 365, 0);
$range_names = array(_('24 horas'), _('48 horas'), _('una semana'));
$range_values = array(1, 2, 7);
$from = check_integer('range');
if ($from > count($range_values) || !$range_values[$from]) {
$from = 0;
}
// we use this to allow sql caching
$from_time = '"' . date("Y-m-d H:00:00", time() - 86400 * $range_values[$from]) . '"';
$from_where = "FROM tags, links WHERE tag_lang='{$dblang}' and tag_date > {$from_time} and link_id = tag_link_id and link_status != 'discard'";
$from_where .= " GROUP BY tag_words";
$max = max($db->get_var("select count(*) as words {$from_where} order by words desc limit 1"), 2);
//echo "MAX= $max\n";
$coef = ($max_pts - $min_pts) / ($max - 1);
do_header(_('nube de etiquetas') . ' | ' . _('menéame'));
do_tabs('main', _('etiquetas'), true);
print_period_tabs();
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_best_stories();
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
echo '<div class="topheading"><h2>+ ' . $words_limit . '</h2></div>';
echo '<div style="margin: 0px 0 20px 0; line-height: ' . $line_height . 'pt; margin-left: 25px;">';
$res = $db->get_results("select tag_words, count(*) as count {$from_where} order by count desc limit {$words_limit}");
if ($res) {
foreach ($res as $item) {
$words[$item->tag_words] = $item->count;
}