| span style="color: #0000BB"><?php if ($_GET['post_id'] AND $_GET['user_id']) { $row = $db->super_query( "SELECT hash FROM " . PREFIX . "_subscribe WHERE news_id='{$_GET['post_id']}' AND user_id='{$_GET['user_id']}'" ); if ($row['hash'] == $_GET['hash']) { $db->query( "DELETE FROM " . PREFIX . "_subscribe WHERE news_id='{$_GET['post_id']}' AND user_id='{$_GET['user_id']}'" ); msgbox( $lang['all_info'], $lang['unsubscribe_ok']); } else { msgbox( $lang['all_info'], $lang['unsubscribe_err']); } } else { msgbox( $lang['all_info'], $lang['unsubscribe_err']); } break; default : $is_main = 0; $active = false; $user_query = ""; $thisdate = date ( "Y-m-d H:i:s", (time () + ($config['date_adjust'] * 60)) ); if (intval ( $config['no_date'] )) $where_date = " AND date < '" . $thisdate . "'"; else $where_date = ""; if ($config['allow_fixed']) $fixed = "fixed desc, "; else $fixed = ""; $config['news_number'] = intval ( $config['news_number'] ); $attachments = array (); $news_sort_by = ($config['news_sort']) ? $config['news_sort'] : "date"; $news_direction_by = ($config['news_msort']) ? $config['news_msort'] : "DESC"; $allow_list = explode ( ',', $user_group[$member_id['user_group']]['allow_cats'] ); if ($allow_list[0] != "all") { if ($config['allow_multi_category']) { $stop_list = "category regexp '[[:<:]](" . implode ( '|', $allow_list ) . ")[[:>:]]' AND "; } else { $stop_list = "category IN ('" . implode ( "','", $allow_list ) . "') AND "; } } else $stop_list = ""; function numb($sql_count){ GLOBAL $db,$_REQUEST,$config; $all=$db->super_query($sql_count); if(!$_REQUEST['cstart']){ $cst=ceil($all['count']/$config['news_number']); }else{ $cst=$_REQUEST['cstart']; }//var_dump($cstart,ceil($all['count']/$config['news_number'])); $cstart=ceil($all['count']/$config['news_number'])-$cst+1; return $cstart; } if ($user_group[$member_id['user_group']]['allow_short']) $stop_list = ""; $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE {$stop_list}approve AND allow_main" . $where_date; numb($sql_count); $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, xfields, title, category, alt_name, comm_num, allow_comm, allow_rate, fixed, rating, vote_num, news_read, flag, editdate, editor, reason, view_edit, tags FROM " . PREFIX . "_post WHERE {$stop_list}approve AND allow_main" . $where_date . " ORDER BY " . $fixed . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; $sql_news = "";?> |
|