Example #1
0
         $dbid = $db->insert_id();
         $db->query("UPDATE `" . PREFIX . "_communities` SET rec_num = rec_num+1 WHERE id = '{$id}'");
         //Вставляем в ленту новотсей
         $db->query("INSERT INTO `" . PREFIX . "_news` SET ac_user_id = '{$id}', action_type = 11, action_text = '{$wall_text}', obj_id = '{$dbid}', action_time = '{$server_time}'");
         //Загружаем все записи
         if (stripos($row['admin'], "u{$user_id}|") !== false) {
             $public_admin = true;
         } else {
             $public_admin = false;
         }
         $limit_select = 10;
         $pid = $id;
         include ENGINE_DIR . '/classes/wall.public.php';
         $wall = new wall();
         $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, text, public_id, add_date, fasts_num, attach, likes_num, likes_users, tell_uid, public, tell_date, tell_comm, tb2.title, photo, comments FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_communities` tb2 WHERE tb1.public_id = '{$id}' AND tb1.public_id = tb2.id AND fast_comm_id = 0 ORDER by `add_date` DESC LIMIT 0, {$limit_select}");
         $wall->template('groups/record.tpl');
         $wall->compile('content');
         $wall->select($public_admin, $server_time);
         AjaxTpl();
     }
     die;
     break;
     //################### Добавление комментария к записи ###################//
 //################### Добавление комментария к записи ###################//
 case "wall_send_comm":
     NoAjaxQuery();
     $rec_id = intval($_POST['rec_id']);
     $public_id = intval($_POST['public_id']);
     $wall_text = ajax_utf8(textFilter($_POST['wall_text']));
     //Проверка на админа и проверяем включены ли комменты
     $row = $db->super_query("SELECT tb1.fasts_num, tb2.admin, comments FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_communities` tb2 WHERE tb1.public_id = tb2.id AND tb1.id = '{$rec_id}'");
Example #2
0
             include ENGINE_DIR . '/classes/wall.php';
             $wall = new wall();
             if ($user_privacy['val_wall1'] == 1 or $user_privacy['val_wall1'] == 2 and $check_friend or $user_id == $id) {
                 $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 {$where_sql} ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
             } elseif ($wallAuthorId['author_user_id'] == $id) {
                 $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 {$where_sql} ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
             } else {
                 $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 AND tb1.author_user_id = '{$id}' ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
                 if ($wallAuthorId['author_user_id']) {
                     $Hacking = true;
                 }
             }
             //Если вызвана страница стены, не со страницы юзера
             if (!$Hacking) {
                 if ($rid or $walluid) {
                     $wall->template('wall/one_record.tpl');
                     $wall->compile('content');
                     $wall->select();
                     if ($cnt_rec['cnt'] > $gcount and $_GET['type'] == '' or $_GET['type'] == 'own') {
                         navigation($gcount, $cnt_rec['cnt'], $page_type);
                     }
                 } else {
                     $wall->template('wall/record.tpl');
                     $wall->compile('wall');
                     $wall->select();
                 }
             }
         }
 }
 $tpl->clear();
 $db->free();