function group_read($from_where, $order_by) { global $db, $main_smarty, $view, $user, $rows, $page_size, $offset; // figure out what "page" of the results we're on $offset = (get_current_page() - 1) * $page_size; // pagesize set in the admin panel $search->pagesize = $page_size; if ($order_by == "") { $order_by = "group_date DESC"; } include_once mnminclude . 'smartyvariables.php'; global $db, $main_smarty; $rows = $db->get_var("SELECT count(*) FROM " . table_groups . " WHERE " . $from_where . " "); $group = $db->get_results("SELECT distinct(group_id) as group_id FROM " . table_groups . " WHERE " . $from_where . " ORDER BY group_status DESC, " . $order_by . " LIMIT {$offset},{$page_size} "); if ($group) { foreach ($group as $groupid) { $group_display .= group_print_summary($groupid->group_id); } $main_smarty->assign('group_display', $group_display); } if (Auto_scroll == 2 || Auto_scroll == 3) { $main_smarty->assign("scrollpageSize", $page_size); } else { $main_smarty->assign('group_pagination', do_pages($rows, $page_size, "groups", true)); } return true; }
if (isset($_GET['order'])) { $search->ords = $db->escape($_GET['order']); } $new_search = $search->new_search(); $linksum_count = $search->countsql; $linksum_sql = $search->sql; $main_smarty->assign('sql', $linksum_sql); // pagename define('pagename', 'search'); $main_smarty->assign('pagename', pagename); $fetch_link_summary = true; include './libs/link_summary.php'; // this is the code that show the links / stories if ($rows == false) { $main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Search_NoResults') . ' ' . stripslashes($search->searchTerm) . stripslashes($search->url)); $main_smarty->assign('pagename', 'noresults'); } $pages = do_pages($rows, $page_size, "search", true); if ($_REQUEST['tag']) { $pages = str_replace('/search/', '/tag/', $pages); } if (Auto_scroll == 2 || Auto_scroll == 3) { $main_smarty->assign("scrollpageSize", $page_size); } else { $main_smarty->assign('search_pagination', $pages); } $main_smarty->assign('total_row_for_search', $rows); } // show the template $main_smarty->assign('tpl_center', $the_template . '/search_center'); $main_smarty->display($the_template . '/pligg.tpl');
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(); } } do_pages(-1, $page_size); echo '</div>' . "\n"; do_footer_menu(); do_footer();
<?php $this->assign('navbar_where', $this->_confs['PLIGG_Visual_Published_News']); } ?> <?php $this->assign('header_id', "home"); ?> <div id="center"> <div class="ce-l"> <div class="ce-r"> <div class="ce-lt"> <div class="ce-br"> <div class="text"> <!-- list topics start here --> <?php global $db, $main_smarty, $page_size, $from_where, $rows, $order_by, $offset, $linksum_sql, $linksum_count, $page_size, $rows; include './libs/link_summary.php'; // this is the code that show the links / stories ?> </div> </div> </div> </div> </div> </div> <?php do_pages($rows, $page_size, "index"); // show the "page" buttons at the bottom // this will eventually be a smarty include
do_shaken(); $main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true)); break; case 'commented': do_commented(); $main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true)); break; case 'voted': // Voted do_voted(); $main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true)); break; case 'saved': // Saved do_stories(); $main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true)); break; case 'removefriend': do_removefriend(); break; case 'addfriend': do_addfriend(); break; case 'viewfriends': do_viewfriends($current_user->user_id); break; case 'viewfriends2': do_viewfriends2(); break; case 'sendmessage': do_sendmessage();
<div id="center"> <div class="ce-l"> <div class="ce-r"> <div class="ce-lt"> <div class="ce-br"> <div class="text"> <!-- list topics start here --> <?php global $db, $dblang, $globals, $main_smarty, $search, $offset, $from_where, $page_size, $link_id, $linksum_sql, $linksum_count; include './libs/link_summary.php'; // this is the code that show the links / stories ?> </div> </div> </div> </div> </div> </div> <?php do_pages($rows, $page_size, "upcoming"); // show the "page" buttons at the bottom
} echo '</tr>'; $user = new User(); $rows = $db->get_var("SELECT SQL_CACHE count(*) as count {$from_where}"); $users = $db->get_results("{$select} {$from_where} {$order_by} LIMIT {$offset},{$page_size}"); if ($users) { foreach ($users as $dbuser) { $user->id = $dbuser->user_id; $user->read(); $user->all_stats(); echo '<tr>'; echo '<td style="font-size:100%"><a href="' . get_user_uri($user->username) . '"><img class="avatar" src="' . get_avatar_url($user->id, $user->avatar, 20) . '" width="20" height="20" alt="avatar" onmouseover="return tooltip.ajax_delayed(event, \'get_user_info.php\', ' . $user->id . ');" onmouseout="tooltip.clear(event); " /> ' . $user->username . '</a></td>'; echo '<td class="short">' . $user->karma . ' '; $user->print_medals(); echo '</td>'; echo '<td class="short">' . $user->total_links . '</td>'; if ($user->total_links > 0) { echo '<td class="short">' . $user->published_links . ' (' . intval($user->published_links / $user->total_links * 100) . '%)</td>'; } else { echo '<td class="short">' . $user->published_links . ' (-)</td>'; } echo '<td class="short">' . $user->total_comments . '</td>'; echo '<td class="short">' . $user->total_votes . '</td>'; echo '</tr>'; } } echo "</table>\n\n"; do_pages($rows, $page_size, false); echo "</div>\n"; do_footer_menu(); do_footer();
$stories = $db->get_results("{$select} {$from_where} {$order_by} LIMIT {$offset},{$top_users_size}"); $link = new Link(); //$user = new User; if ($stories) { foreach ($stories as $dblink) { $link->id = $dblink->link_id; $cached_links[$dblink->link_id] = $dblink; $link->read(); $live_item['link_date'] = txt_time_diff($link->date); $live_item['link_title'] = $link->title; if (Voting_Method == 2) { $live_item['link_votes'] = $link->rating($link->id) / 2; } else { $live_item['link_votes'] = $link->votes; } $live_item['link_username'] = $dblink->user_login; $live_item['link_category'] = GetCatName($link->category); $live_item['link_category_url'] = getmyurl("queuedcategory", $link->category_safe_name()); # $live_item['link_category_url'] = $link->category_safe_name(); $live_item['link_url'] = $link->get_internal_url(); $live_items[] = $live_item; } $main_smarty->assign('live_items', $live_items); } // pagination $main_smarty->assign('live_pagination', do_pages($rows, $top_users_size, "unpublished", true)); // sidebar $main_smarty = do_sidebar($main_smarty); // show the template $main_smarty->assign('tpl_center', $the_template . '/live_unpublished_center'); $main_smarty->display($the_template . '/pligg.tpl');
function print_result() { global $response, $page_size; if ($response['ids']) { $rows = min($response['rows'], 1000); foreach ($response['ids'] as $id) { switch ($_REQUEST['w']) { case 'posts': $obj = Post::from_db($id); break; case 'comments': $obj = Comment::from_db($id); break; case 'links': default: $obj = Link::from_db($id); } if (!$obj) { continue; } $obj->basic_summary = true; switch ($_REQUEST['w']) { case 'posts': $obj->print_summary(800); break; case 'comments': if ($obj->type == 'admin' && !$current_user->admin) { continue; } $obj->print_summary(false, 800); break; case 'links': default: $obj->print_summary(); } } } do_pages($rows, $page_size); }
</div> <?php do_pages($rows, $page_size, $the_page); break; case 'voted': do_voted(); ?> </div> </div> </div> </div> </div> </div> </div> <?php do_pages($rows, $page_size, $the_page); break; case 'profile': default: ?> </div> </div> </div> </div> </div> </div> </div> <div class="pagers"> <div class="pbg"> <div class="list"> </div>
$main_smarty->assign('user_total_links', $user->total_links); $main_smarty->assign('user_published_links', $user->published_links); if ($user->total_links > 0) { $main_smarty->assign('user_published_links_percent', intval($user->published_links / $user->total_links * 100)); } else { $main_smarty->assign('user_published_links_percent', ''); } $main_smarty->assign('user_total_comments', $user->total_comments); $main_smarty->assign('user_total_votes', $user->total_votes); $main_smarty->assign('user_published_votes', $user->published_votes); if ($user->total_votes > 0) { $main_smarty->assign('user_published_votes_percent', intval($user->published_votes / $user->total_votes * 100)); } else { $main_smarty->assign('user_published_votes_percent', ''); } $main_smarty->assign('user_karma', $user->karma); $main_smarty->assign('user_avatar', get_avatar('large', "", $user->username, $user->email)); $users_table .= $main_smarty->fetch(The_Template . "/topusers_data.tpl"); } } $main_smarty->assign('users_table', $users_table); // pagename define('pagename', 'topusers'); $main_smarty->assign('pagename', pagename); // sidebar $main_smarty = do_sidebar($main_smarty); $main_smarty->assign('headers', $header_items); $main_smarty->assign('topusers_pagination', do_pages($rows, $top_users_size, "topusers", true)); // show the template $main_smarty->assign('tpl_center', $the_template . '/topusers_center'); $main_smarty->display($the_template . '/pligg.tpl');
function admin_bans($ban_type) { global $db, $globals, $offset, $page_size, $ban_text_length, $ban_comment_length, $current_user; require_once mnminclude . 'ban.php'; $key = get_security_key(); if ($current_user->user_level == "god" && check_security_key($_REQUEST["key"])) { if (!empty($_REQUEST["new_ban"])) { insert_ban($ban_type, $_POST["ban_text"], $_POST["ban_comment"], $_POST["ban_expire"]); } elseif (!empty($_REQUEST["edit_ban"])) { insert_ban($ban_type, $_POST["ban_text"], $_POST["ban_comment"], $_POST["ban_expire"], $_POST["ban_id"]); } elseif (!empty($_REQUEST["new_bans"])) { $array = preg_split("/\\s+/", $_POST["ban_text"]); $size = count($array); for ($i = 0; $i < $size; $i++) { insert_ban($ban_type, $array[$i], $_POST["ban_comment"], $_POST["ban_expire"]); } } elseif (!empty($_REQUEST["del_ban"])) { del_ban($_REQUEST["del_ban"]); } } // ex container-wide echo '<div class="genericform" style="margin:0">'; echo '<div style="float:right;">' . "\n"; echo '<form method="get" action="' . $globals['base_url'] . 'admin/bans.php">'; echo '<input type="hidden" name="admin" value="' . $ban_type . '" />'; echo '<input type="hidden" name="key" value="' . $key . '" />'; echo '<input type="text" name="s" '; if ($_REQUEST["s"]) { $_REQUEST["s"] = clean_text($_REQUEST["s"]); echo ' value="' . $_REQUEST["s"] . '" '; } else { echo ' value="' . _('buscar') . '..." '; } echo 'onblur="if(this.value==\'\') this.value=\'' . _('buscar') . '...\';" onfocus="if(this.value==\'' . _('buscar') . '...\') this.value=\'\';" />'; echo ' <input style="padding:2px;" type="image" align="top" value="' . _('buscar') . '" alt="' . _('buscar') . '" src="' . $globals['base_static'] . 'img/common/search-03.png" />'; echo '</form>'; echo '</div>'; if ($current_user->user_level == "god") { echo ' [ <a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&op=new">' . _('Nuevo ban') . '</a> ]'; echo ' [ <a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&op=news">' . _('Múltiples bans') . '</a> ]'; } if (!empty($_REQUEST["op"])) { echo '<form method="post" name="newban" action="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '">'; echo '<input type="hidden" name="key" value="' . $key . '" />'; } echo '<table class="decorated" style="font-size: 10pt">'; echo '<tr><th width="25%"><a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&'; if ($_REQUEST["s"]) { echo 's=' . $_REQUEST["s"] . '&'; } echo 'orderby=ban_text">' . $ban_type . '</a></th>'; echo '<th width="30%"><a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&'; if ($_REQUEST["s"]) { echo 's=' . $_REQUEST["s"] . '&'; } echo 'orderby=ban_comment">' . _('comentario') . '</a></th>'; echo '<th><a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&'; if ($_REQUEST["s"]) { echo 's=' . $_REQUEST["s"] . '&'; } echo 'orderby=ban_date">' . _('fecha creación') . '</a></th>'; echo '<th><a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&'; if ($_REQUEST["s"]) { echo 's=' . $_REQUEST["s"] . '&'; } echo 'orderby=ban_expire">' . _('fecha caducidad') . '</a></th>'; echo '<th>' . _('Editar / Borrar') . '</th></tr>'; switch ($_REQUEST["op"]) { case 'new': echo '<tr><td>'; echo '<input type="text" id="ban_text" name="ban_text" size="30" maxlength="' . $ban_text_length . '" value="" />'; echo ' <span id="checkit"><input type="button" id="checkbutton1" value="' . _('verificar') . '" onclick="checkfield(\'ban_' . $ban_type . '\', this.form, this.form.ban_text)"/></span>' . "\n"; echo '<br /><span id="ban_' . $ban_type . 'checkitvalue"></span>' . "\n"; echo '</td><td>'; echo '<input class="form-full" type="text" name="ban_comment" id="ban_comment" />'; echo '</td><td>'; echo '</td><td>'; echo '<select name="ban_expire" id="ban_expire">'; print_expiration_dates(); echo '</select>'; echo '</td><td>'; echo '<input type="hidden" name="new_ban" value="1" />'; echo '<input type="submit" name="submit" value="' . _('Crear ban') . '" />'; echo '</td></tr>'; break; case 'news': echo '<tr><td>'; echo '<textarea id="ban_text" name="ban_text" /></textarea>'; echo '</td><td>'; echo '<input class="form-full" type="text" name="ban_comment" id="ban_comment" />'; echo '</td><td>'; echo '</td><td>'; echo '<select name="ban_expire" id="ban_expire">'; print_expiration_dates(); echo '</select>'; echo '</td><td>'; echo '<input type="hidden" name="new_bans" value="1" />'; echo '<input type="submit" name="submit" value="' . _('Crear bans') . '" />'; echo '</td></tr>'; break; case 'edit': $ban = new Ban(); $ban->ban_id = (int) $_REQUEST["id"]; $ban->read(); echo '<tr><td>'; echo '<input type="text" name="ban_text" id="ban_text" size="30" maxlength="' . $ban_text_length . '" value="' . $ban->ban_text . '" />'; echo '</td><td>'; echo '<input type="text" class="form-full" name="ban_comment" id="ban_comment" value="' . $ban->ban_comment . '" />'; echo '</td><td>'; echo $ban->ban_date; echo '</td><td>'; echo '<select name="ban_expire" id="ban_expire">'; echo '<option value="' . $ban->ban_expire . '">' . $ban->ban_expire . '</option>'; print_expiration_dates(); echo '</select>'; echo '</td><td>'; echo '<input type="hidden" name="ban_id" value="' . $ban->ban_id . '" />'; echo '<input type="submit" name="edit_ban" value="' . _('Editar ban') . '" />'; echo '</td></tr>'; break; } if (empty($_REQUEST["op"])) { //listado de bans if (empty($_REQUEST["orderby"])) { $_REQUEST["orderby"] = "ban_text"; } else { $_REQUEST["orderby"] = preg_replace('/[^a-z_]/i', '', $_REQUEST["orderby"]); if ($_REQUEST["orderby"] == 'ban_date') { $order = "DESC"; } } $where = "WHERE ban_type='" . $ban_type . "'"; if ($_REQUEST["s"]) { $search_text = $db->escape($_REQUEST["s"]); $where .= " AND (ban_text LIKE '%{$search_text}%' OR ban_comment LIKE '%{$search_text}%')"; } $bans = $db->get_col("SELECT ban_id FROM bans " . $where . " ORDER BY " . $_REQUEST["orderby"] . " {$order} LIMIT {$offset},{$page_size}"); $rows = $db->get_var("SELECT count(*) FROM bans " . $where); if ($bans) { $ban = new Ban(); foreach ($bans as $ban_id) { $ban->ban_id = $ban_id; $ban->read(); echo '<tr>'; echo '<td onmouseover="return tooltip.ajax_delayed(event, \'get_ban_info.php\', ' . $ban->ban_id . ');" onmouseout="tooltip.clear(event);" >' . clean_text($ban->ban_text) . '</td>'; echo '<td style="overflow: hidden;white-space: nowrap;" onmouseover="return tooltip.ajax_delayed(event, \'get_ban_info.php\', ' . $ban->ban_id . ');" onmouseout="tooltip.clear(event);">' . clean_text(txt_shorter($ban->ban_comment, 50)) . '</td>'; echo '<td>' . $ban->ban_date . '</td>'; echo '<td>' . $ban->ban_expire . '</td>'; echo '<td>'; if ($current_user->user_level == "god") { echo '<a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&op=edit&id=' . $ban->ban_id . '" title="' . _('Editar') . '"><img src="' . $globals['base_static'] . 'img/common/sneak-edit-notice01.png" alt="' . 'Editar' . '" /></a>'; echo ' / '; echo '<a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&del_ban=' . $ban->ban_id . '&key=' . $key . '" title="' . _('Eliminar') . '"><img src="' . $globals['base_static'] . 'img/common/sneak-reject01.png" alt="' . 'Eliminar' . '" /></a>'; } echo '</td>'; echo '</tr>'; } } } echo '</table>'; if (!empty($_REQUEST["op"])) { echo "</form>\n"; } do_pages($rows, $page_size, false); }
$this->_vars = $_templatelite_tpl_vars; unset($_templatelite_tpl_vars); ?> <?php if ($this->_vars['pagename'] == "admin_users" || $this->_vars['pagename'] == "admin_comments" || $this->_vars['pagename'] == "admin_links" || $this->_vars['pagename'] == "admin_user_validate") { ?> <fieldset> <br /> <?php global $db, $main_smarty, $rows, $offset, $URLMethod; $oldURLMethod = $URLMethod; $URLMethod = 1; $pagesize = get_misc_data('pagesize'); do_pages($rows, $pagesize ? $pagesize : 30, $the_page); $URLMethod = $oldURLMethod; ?> </fieldset> <?php } ?> <?php echo tpl_function_checkActionsTpl(array('location' => "tpl_pligg_admin_legend_after"), $this); ?> </div> <?php if ($this->_vars['pagename'] != "admin_modules") {
?> </table> <br/> <p align="right"><input type="submit" name="submit" value="Change Status" class="log2" /></p> <input type="hidden" name="user" value="<?php echo $this->_vars['user']; ?> "> </form> <center><a href="javascript:mark_all_publish()">Mark all for Published</a> <a href="javascript:mark_all_queued()">Mark all for Queued</a> <a href="javascript:mark_all_discard()">Mark all for Discarded</a> <a href="javascript:uncheck_all()">Uncheck All</a></center> <br/> <?php global $db, $main_smarty, $rows, $offset; do_pages($rows, 25, $the_page); ?> <br/> </fieldset> <?php echo ' <SCRIPT> function mark_all_publish() { for (var i=0; i< document.bulk_moderate.length; i++) { if (document.bulk_moderate[i].value == "publish") { document.bulk_moderate[i].checked = true; } }
// get the data to be displayed $rows = $db->get_var("SELECT count(*) as count {$from_where} {$order_by}"); $comments = $db->get_results("{$select} {$from_where} {$order_by} LIMIT {$offset},{$top_users_size}"); //$comment = new Comment; //$user = new User; $link = new Link(); if ($comments) { foreach ($comments as $dbcomment) { // $comment->id = $dbcomment->comment_id; // $comment->read(); $live_item['comment_content'] = $dbcomment->comment_content; // $user->id = $comment->author; // $user->read(); $live_item['comment_author'] = $dbcomment->user_login; $live_item['comment_date'] = txt_time_diff(strtotime($dbcomment->comment_date)); $link->id = $dbcomment->link_id; $cached_links[$dbcomment->link_id] = $dbcomment; $link->read(); $live_item['comment_link_title'] = $link->title; $live_item['comment_link_url'] = $link->get_internal_url(); $live_items[] = $live_item; } $main_smarty->assign('live_items', $live_items); } // pagination $main_smarty->assign('live_pagination', do_pages($rows, $top_users_size, "comments", true)); // sidebar $main_smarty = do_sidebar($main_smarty); // show the template $main_smarty->assign('tpl_center', $the_template . '/live_comments_center'); $main_smarty->display($the_template . '/pligg.tpl');
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)); } }
} //end Advanced Search $new_search = $search->new_search(); $linksum_count = $search->countsql; $linksum_sql = $search->sql; } else { $search = new Search(); if (isset($_REQUEST['q'])) { $search->searchTerm = $db->escape(sanitize($_REQUEST['q']), 3); } } // breadcrumbs and page title $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm); $navwhere['link1'] = getmyurl('search', urlencode($search->searchTerm)); $main_smarty->assign('navbar_where', $navwhere); $main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm)); //sidebar $main_smarty = do_sidebar($main_smarty); // misc smarty $main_smarty->assign('cat_url', getmyurl("maincategory")); $main_smarty->assign('URL_rss_page', my_pligg_base . "/rsssearch.php?" . $_SERVER['QUERY_STRING']); // pagename define('pagename', 'search'); $main_smarty->assign('pagename', pagename); $fetch_link_summary = true; include './libs/link_summary.php'; // this is the code that show the links / stories $main_smarty->assign('search_pagination', do_pages($rows, $page_size, "search", true)); // show the template $main_smarty->assign('tpl_center', $the_template . '/search_center'); $main_smarty->display($the_template . '/pligg.tpl');
// make sure my_base_url is set if ($my_base_url == '') { echo '<div style="text-align:center;"><span class=error>ERROR: my_base_url is not set. Please correct this using the <a href = "/admin/admin_config.php?page=Location%20Installed">admin panel</a>. Then refresh this page.</span></div>'; } // sidebar $main_smarty = do_sidebar($main_smarty); $sql = "SELECT user_login FROM " . table_users . " ORDER BY user_id DESC LIMIT 1"; $last_user = $db->get_var($sql); $main_smarty->assign('last_user', $last_user); // misc smarty if (isset($from_text)) { $main_smarty->assign('from_text', $from_text); } if (isset($search->setmek)) { $main_smarty->assign('setmeka', $search->setmek); } else { $main_smarty->assign('setmeka', ''); } $main_smarty->assign('URL_rss_page', getmyurl('rsspage', $category_data->category_safe_name, '')); $fetch_link_summary = true; include './libs/link_summary.php'; // this is the code that show the links / stories //For Infinit scrolling and continue reading option if (Auto_scroll == 2 || Auto_scroll == 3) { $main_smarty->assign("scrollpageSize", $page_size); } else { $main_smarty->assign('link_pagination', do_pages($rows, $page_size, "published", true)); } // show the template $main_smarty->assign('tpl_center', $the_template . '/index_center'); $main_smarty->display($the_template . '/pligg.tpl');
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)); }
echo '</div>'; // Print "conversation" for a given note $answers = $db->object_iterator("SELECT" . Post::SQL . ", conversations WHERE conversation_type='post' and conversation_to = {$post_id} and post_id = conversation_from ORDER BY conversation_from asc LIMIT 100", 'Post'); if ($answers) { echo '<div style="padding-left: 40px; padding-top: 10px">'; echo '<ol class="comments-list">'; foreach ($answers as $answer) { echo '<li>'; $answer->print_summary(); echo '</li>'; $ids[] = $answer->id; } echo "</ol>"; echo '</div>' . "\n"; } } Haanga::Load('get_total_answers_by_ids.html', array('type' => 'post', 'ids' => implode(',', $ids))); // Update conversation time if ($view == 3 && $time_read > 0 && $user->id == $current_user->user_id) { Post::update_read_conversation($time_read); } } echo '</div>'; do_pages($rows, $page_size); } echo '</div>'; if ($rows > 15) { do_footer_menu(); } do_footer(); exit(0);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Pligg_Queued')); $main_smarty->assign('page_header', $thecat . $main_smarty->get_config_vars('PLIGG_Visual_Pligg_Queued')); } else { $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Queued'); $navwhere['link1'] = getmyurl('upcoming', ''); $main_smarty->assign('navbar_where', $navwhere); $main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Queued')); $main_smarty->assign('page_header', $main_smarty->get_config_vars('PLIGG_Visual_Pligg_Queued')); } $main_smarty->assign('URL_rss_page', getmyurl('rsspage', $category_data->category_safe_name, 'upcoming')); // sidebar $main_smarty = do_sidebar($main_smarty); // pagename define('pagename', 'upcoming'); $main_smarty->assign('pagename', pagename); // misc smarty if (isset($search->setmek)) { $main_smarty->assign('setmeka', $search->setmek); } else { $main_smarty->assign('setmeka', ''); } if (isset($search->ords)) { $main_smarty->assign('paorder', $search->ords); } $fetch_link_summary = true; include './libs/link_summary.php'; // this is the code that show the links / stories $main_smarty->assign('link_pagination', do_pages($rows, $page_size, "upcoming", true)); // show the template $main_smarty->assign('tpl_center', $the_template . '/upcoming_center'); $main_smarty->display($the_template . '/pligg.tpl');