本文整理汇总了PHP中Link::print_summary方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::print_summary方法的具体用法?PHP Link::print_summary怎么用?PHP Link::print_summary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::print_summary方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group_shared
function group_shared($requestID, $catId, $flag = 0)
{
global $db, $main_smarty, $the_template, $page_size, $cached_links;
if (!is_numeric($requestID)) {
die;
}
$link = new Link();
$group_shared_display = "";
if ($catId) {
$child_cats = '';
// do we also search the subcategories?
if (Independent_Subcategories == true) {
$child_array = '';
// get a list of all children and put them in $child_array.
children_id_to_array($child_array, table_categories, $catId);
if ($child_array != '') {
// build the sql
foreach ($child_array as $child_cat_id) {
$child_cat_sql .= ' OR `link_category` = ' . $child_cat_id . ' ';
if (Multiple_Categories) {
$child_cat_sql .= ' OR ac_cat_id = ' . $child_cat_id . ' ';
}
}
}
}
if (Multiple_Categories) {
$child_cat_sql .= " OR ac_cat_id = {$catId} ";
}
$from_where .= " AND (link_category={$catId} " . $child_cat_sql . ")";
}
$offset = (get_current_page() - 1) * $page_size;
if ($flag == 1) {
$sql = "SELECT SQL_CALC_FOUND_ROWS b.* FROM " . table_group_shared . " a\r\n\t\t\t\t LEFT JOIN " . table_links . " b ON link_id=share_link_id\r\n\t\t\t\t WHERE share_group_id = {$requestID} AND !ISNULL(link_id) {$from_where} \r\n\t\t\t\t GROUP BY link_id\r\n\t\t\t\t ORDER BY link_published_date DESC, link_date DESC ";
} else {
$sql = "SELECT SQL_CALC_FOUND_ROWS b.* FROM " . table_group_shared . " a\r\n\t\t\t\t LEFT JOIN " . table_links . " b ON link_id=share_link_id\r\n\t\t\t\t WHERE share_group_id = {$requestID} AND !ISNULL(link_id) {$from_where} \r\n\t\t\t\t GROUP BY link_id\r\n\t\t\t\t ORDER BY link_published_date DESC, link_date DESC LIMIT {$offset}, {$page_size}";
}
// Search on additional categories
if ($catId && Multiple_Categories) {
$sql = str_replace("WHERE", " LEFT JOIN " . table_additional_categories . " ON ac_link_id=link_id WHERE", $sql);
}
$links = $db->get_results($sql);
$rows = $db->get_var("SELECT FOUND_ROWS()");
if ($flag == 1) {
return $rows;
}
if ($links) {
foreach ($links as $dblink) {
$link->id = $dblink->link_id;
$cached_links[$dblink->link_id] = $dblink;
$link->read();
$group_shared_display .= $link->print_summary('summary', true);
}
}
$main_smarty->assign('group_shared_display', $group_shared_display);
//for auto scrolling
if (Auto_scroll == 2 || Auto_scroll == 3) {
$main_smarty->assign("scrollpageSize", $page_size);
$main_smarty->assign('total_row', $rows);
if ($catId) {
$main_smarty->assign('catID', $catId);
}
$main_smarty->assign('total_row', $rows);
} else {
$main_smarty->assign('group_story_pagination', do_pages($rows, $page_size, 'group_story', true));
}
}
示例2: do_shaken
function do_shaken()
{
global $db, $rows, $user, $offset, $page_size, $globals;
if ($globals['bot']) {
return;
}
do_user_subheader(array(_('envíos propios') => get_user_uri($user->username, 'history'), _('votados') => get_user_uri($user->username, 'shaken'), _('favoritos') => get_user_uri($user->username, 'favorites'), _('votados por amigos') => get_user_uri($user->username, 'friends_shaken')), 1, 'rss2.php?voted_by=' . $user->id, _('votadas en rss2'));
$link = new Link();
$rows = -1;
//$db->get_var("SELECT count(*) FROM votes WHERE vote_type='links' and vote_user_id=$user->id");
$links = $db->get_results("SELECT vote_link_id as id, vote_value FROM votes WHERE vote_type='links' and vote_user_id={$user->id} ORDER BY vote_date DESC LIMIT {$offset},{$page_size}");
if ($links) {
foreach ($links as $linkdb) {
$link->id = $linkdb->id;
$link->read();
if ($link->author == $user->id) {
continue;
}
echo '<div style="max-width: 60em">';
$link->print_summary('short', 0, false);
if ($linkdb->vote_value < 0) {
echo '<div class="box" style="z-index:1;margin:0 0 -5x 0;background:#FF3333;position:relative;top:-5px;left:85px;width:8em;padding: 1px 1px 1px 1px;border-color:#f00;opacity:0.9;text-align:center;font-size:0.9em;color:#fff;text-shadow: 0 1px 0 #000">';
echo get_negative_vote($linkdb->vote_value);
echo "</div>\n";
}
echo "</div>\n";
}
echo '<br/><span style="color: #FF6400;"><strong>' . _('Nota') . '</strong>: ' . _('sólo se visualizan los votos de los últimos meses') . '</span><br />';
}
}
示例3: print_period_tabs
$rows = min(100, $db->get_var("SELECT count(*) FROM links"));
}
if ($rows == 0) {
do_error(_('no hay noticias seleccionadas'), 500);
}
$links = $db->get_results("{$sql} LIMIT {$offset},{$page_size}");
if ($memcache_key) {
memcache_madd($memcache_key . 'rows', $rows, 1800);
memcache_madd($memcache_key, $links, 1800);
}
}
if ($links) {
foreach ($links as $dblink) {
$link->id = $dblink->link_id;
$link->read();
$link->print_summary('short');
}
}
do_pages($rows, $page_size);
echo '</div>';
do_footer_menu();
do_footer();
function print_period_tabs()
{
global $globals, $current_user, $range_values, $range_names;
if (!($current_range = check_integer('range')) || $current_range < 1 || $current_range >= count($range_values)) {
$current_range = 0;
}
echo '<ul class="subheader">' . "\n";
for ($i = 0; $i < count($range_values); $i++) {
if ($i == $current_range) {
示例4: do_commented
function do_commented()
{
global $db, $main_smarty, $rows, $user, $offset, $page_size, $cached_links;
$output = '';
$link = new Link();
$rows = $db->get_var("SELECT count(*) FROM " . table_links . ", " . table_comments . " WHERE comment_status='published' AND comment_user_id={$user->id} AND comment_link_id=link_id");
$links = $db->get_results("SELECT DISTINCT * FROM " . table_links . ", " . table_comments . " WHERE comment_status='published' AND comment_user_id={$user->id} AND comment_link_id=link_id AND (link_status='published' OR link_status='queued') ORDER BY link_date DESC LIMIT {$offset},{$page_size}");
if ($links) {
foreach ($links as $dblink) {
$link->id = $dblink->link_id;
$cached_links[$dblink->link_id] = $dblink;
$link->read();
$output .= $link->print_summary('summary', true);
}
}
$main_smarty->assign('user_page', $output);
}
示例5: print_shakeit_tabs
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) {
$link->print_summary('full', 16);
} else {
$link->print_summary('full');
}
}
}
do_pages($rows, $page_size);
echo '</div>' . "\n";
do_footer();
function print_shakeit_tabs($option = -1)
{
global $globals, $current_user, $db;
$active = array();
if ($option > 0) {
$active[$option] = 'class="tabsub-this"';
}
示例6: do_shaken
function do_shaken()
{
global $db, $rows, $user, $offset, $page_size;
$link = new Link();
echo '<h2>' . _('noticias votadas') . '</h2>';
$rows = $db->get_var("SELECT count(*) FROM links, votes WHERE vote_type='links' and vote_user_id={$user->id} AND vote_link_id=link_id and vote_value > 0");
$links = $db->get_col("SELECT link_id FROM links, votes WHERE vote_type='links' and vote_user_id={$user->id} AND vote_link_id=link_id and vote_value > 0 ORDER BY link_date DESC LIMIT {$offset},{$page_size}");
if ($links) {
foreach ($links as $link_id) {
$link->id = $link_id;
$link->read();
$link->print_summary('short');
}
}
}
示例7: report_dupe
function report_dupe($url) {
global $globals;
$link = new Link;
if(($found = $link->duplicates($url))) {
$dupe = new Link;
$dupe->id = $found;
$dupe->read();
echo '<p class="error"><strong>'._('noticia repetida').'</strong></p> ';
echo '<p class="error-text">'._('disculpas').'</p>';
$dupe->print_summary();
echo '<br style="clear: both;" /><br/>' . "\n";
echo '<form class="genericform" action="">';
echo '<input class="button" type="button" onclick="window.history.go(-1)" value="« '._('retroceder').'" />';
echo '</form>'. "\n";
echo '</div>'. "\n";
return true;
}
return false;
}
示例8: group_shared
function group_shared($requestID)
{
global $db, $main_smarty, $the_template, $page_size, $cached_links;
if (!is_numeric($requestID)) {
die;
}
$link = new Link();
$group_shared_display = "";
//$group_shared_display .= "SELECT link_id FROM " . table_links . " WHERE link_group_id=$requestID";
//$links = $db->get_col("SELECT link_id FROM " . table_links . " WHERE link_share_id = $requestID");
$rows = $db->get_var("SELECT COUNT(share_link_id) FROM " . table_group_shared . " WHERE share_group_id = {$requestID}");
$links = $db->get_results("SELECT * FROM " . table_group_shared . " WHERE share_group_id = {$requestID}");
if ($links) {
foreach ($links as $dblink) {
$link->id = $dblink->link_id;
$cached_links[$dblink->link_id] = $dblink;
$link->read();
$group_shared_display .= $link->print_summary('summary', true);
}
}
$main_smarty->assign('group_shared_display', $group_shared_display);
$main_smarty->assign('group_story_pagination', do_pages($rows, $page_size, 'group_story', true));
}
示例9: foreach
}
}
// end link cache setup
}
global $display_grouplinks;
if (!isset($link_summary_output)) {
$link_summary_output = '';
}
if ($new_search) {
foreach ($new_search as $link_id) {
$link->id = $link_id;
$link->read();
if ($display_grouplinks) {
$link->link_group_id = 0;
}
$link_summary_output .= $link->print_summary('summary', true);
}
} else {
if ($links) {
foreach ($links as $link_id) {
$link->id = $link_id;
$link->read();
$link_summary_output .= $link->print_summary('summary', true);
}
}
}
if (isset($fetch_link_summary) && $fetch_link_summary == true) {
$main_smarty->assign('link_summary_output', $link_summary_output);
} else {
echo $link_summary_output;
}
示例10: Link
<?php
global $new_search;
$link = new Link();
if ($new_search) {
//$rows = count($new_search);
$rows = $new_search['count'];
$new_search = $new_search['rows'];
if ($new_search) {
foreach ($new_search as $link_id) {
$link->id = $link_id;
$link->read();
$link->print_summary('summary');
}
}
} else {
$rows = $db->get_var($linksum_count);
$links = $db->get_col($linksum_sql);
if ($links) {
foreach ($links as $link_id) {
$link->id = $link_id;
$link->read();
$link->print_summary('summary');
}
}
}
示例11: do_commented
function do_commented () {
global $db, $rows, $user, $offset, $page_size;
$link = new Link;
echo '<h2>'._('noticias comentadas').'</h2>';
$rows = $db->get_var("SELECT count(distinct comment_link_id) FROM comments WHERE comment_user_id=$user->id");
$links = $db->get_col("SELECT DISTINCT link_id FROM links, comments WHERE comment_user_id=$user->id AND comment_link_id=link_id ORDER BY link_date DESC LIMIT $offset,$page_size");
if ($links) {
foreach($links as $link_id) {
$link->id=$link_id;
$link->read();
$link->print_summary('short');
}
}
}
示例12: do_shaken
function do_shaken()
{
global $db, $rows, $user, $offset, $page_size, $globals;
if ($globals['bot']) {
return;
}
$link = new Link();
$rows = $db->get_var("SELECT count(*) FROM links, votes WHERE vote_type='links' and vote_user_id={$user->id} AND vote_link_id=link_id and vote_value > 0");
$links = $db->get_col("SELECT link_id FROM links, votes WHERE vote_type='links' and vote_user_id={$user->id} AND vote_link_id=link_id and vote_value > 0 ORDER BY link_date DESC LIMIT {$offset},{$page_size}");
if ($links) {
echo '<div class="bookmarks-export-user-stories">';
echo '<a href="' . $globals['base_url'] . 'link_bookmark.php?user_id=' . $user->id . '&option=shaken" title="' . _('exportar bookmarks en formato Mozilla') . '"><img src="' . $globals['base_url'] . 'img/common/bookmarks-export-01.png" alt="Mozilla bookmark"/></a>';
echo ' <a href="' . $globals['base_url'] . 'rss2.php?voted_by=' . $user->id . '" title="' . _('noticias votadas en rss2') . '"><img src="' . $globals['base_url'] . 'img/common/rss-button01.png" alt="rss2"/></a>';
echo '</div>';
foreach ($links as $link_id) {
$link->id = $link_id;
$link->read();
$link->print_summary('short');
}
echo '<br/><span class="credits-strip-text"><strong>' . _('Nota') . '</strong>: ' . _('sólo se visualizan los votos de los últimos meses') . '</span><br />';
}
}
示例13: sprintf
echo '<div style="font-size:85%;margin-top: 5px">';
echo _('encontrados') . ': ' . $response['rows'] . ', ' . _('tiempo total') . ': ' . sprintf("%1.3f", $response['time']) . ' ' . _('segundos');
echo ' <a href="' . $globals['base_url'] . $rss_program . '?' . htmlspecialchars($_SERVER['QUERY_STRING']) . '" rel="rss"><img src="' . $globals['base_static'] . 'img/common/feed-icon-001.png" width="18" height="18" alt="rss2" style="vertical-align:top"/></a>';
echo '</div>';
}
echo '</fieldset>';
echo '</div>';
if ($response['ids']) {
$rows = min($response['rows'], 1000);
foreach ($response['ids'] as $id) {
$obj->id = $id;
$obj->read();
$obj->basic_summary = true;
switch ($_REQUEST['w']) {
case 'posts':
$obj->print_summary(300);
break;
case 'comments':
if ($obj->type == 'admin' && !$current_user->admin) {
continue;
}
$obj->print_summary(false, 300);
break;
case 'links':
default:
$obj->print_summary();
}
}
}
do_pages($rows, $page_size);
echo '</div>';
示例14: do_commented
function do_commented()
{
global $db, $rows, $user, $offset, $page_size;
$link = new Link();
$rows = $db->get_var("SELECT count(*) FROM " . table_links . ", " . table_comments . " WHERE comment_user_id={$user->id} AND comment_link_id=link_id");
$links = $db->get_col("SELECT DISTINCT link_id FROM " . table_links . ", " . table_comments . " WHERE comment_user_id={$user->id} AND comment_link_id=link_id AND link_status != 'discard' ORDER BY link_date DESC LIMIT {$offset},{$page_size}");
if ($links) {
foreach ($links as $link_id) {
$link->id = $link_id;
$link->read();
$link->print_summary('summary');
}
}
}
示例15:
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">';
require_once mnminclude . 'trackback.php';