当前位置: 首页>>代码示例>>PHP>>正文


PHP ajax_utf8函数代码示例

本文整理汇总了PHP中ajax_utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP ajax_utf8函数的具体用法?PHP ajax_utf8怎么用?PHP ajax_utf8使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ajax_utf8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Hacking

             Hacking();
         }
     } else {
         Hacking();
     }
     break;
     //################### Сохранение отредактированых ###################//
 //################### Сохранение отредактированых ###################//
 case "save":
     NoAjaxQuery();
     if ($user_group[$user_info['user_group']]['addnews']) {
         //Подключаем парсер
         include ENGINE_DIR . '/classes/parse.php';
         $parse = new parse();
         $title = ajax_utf8(textFilter($_POST['title'], false, true));
         $text = $parse->BBparse(ajax_utf8(textFilter($_POST['text'])));
         $id = intval($_POST['id']);
         function BBimg($source)
         {
             return "<img src=\"{$source}\" alt=\"\" />";
         }
         $text = preg_replace("#\\[img\\](.*?)\\[/img\\]#ies", "\\BBimg('\\1')", $text);
         if (isset($title) and !empty($title) and isset($text) and !empty($text)) {
             $db->query("UPDATE `" . PREFIX . "_blog` SET title = '{$title}', story = '{$text}' WHERE id = '{$id}'");
         }
     }
     die;
     break;
     //################### Загрузка фотографии ###################//
 //################### Загрузка фотографии ###################//
 case "upload":
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:blog.php

示例2: mozg_mass_clear_cache_file

     $row = $db->super_query("SELECT duser_id, ddownload_name FROM `" . PREFIX . "_doc` WHERE did = '{$did}'");
     if ($row['duser_id'] == $user_id) {
         @unlink(ROOT_DIR . "/uploads/doc/{$user_id}/" . $row['ddownload_name']);
         $db->query("DELETE FROM `" . PREFIX . "_doc` WHERE did = '{$did}'");
         //Обновляем кол-во док. у юзера
         $db->query("UPDATE `" . PREFIX . "_users` SET user_doc_num = user_doc_num-1 WHERE user_id = '{$user_id}'");
         mozg_mass_clear_cache_file("user_{$user_id}/profile_{$user_id}|user_{$user_id}/docs");
     }
     exit;
     break;
     //################### Сохранение отред.данных ###################//
 //################### Сохранение отред.данных ###################//
 case "editsave":
     NoAjaxQuery();
     $did = intval($_POST['did']);
     $name = ajax_utf8(textFilter($_POST['name'], false, true));
     $strLn = strlen($name);
     if ($strLn > 50) {
         $name = substr($name, 0, 50);
     }
     $row = $db->super_query("SELECT duser_id FROM `" . PREFIX . "_doc` WHERE did = '{$did}'");
     if ($row['duser_id'] == $user_id and isset($name) and !empty($name)) {
         $db->query("UPDATE `" . PREFIX . "_doc`SET dname = '{$name}' WHERE did = '{$did}'");
         mozg_mass_clear_cache_file("user_{$user_id}/profile_{$user_id}|user_{$user_id}/docs");
     }
     exit;
     break;
     //################### Скачивание документа с сервера ###################//
 //################### Скачивание документа с сервера ###################//
 case "download":
     NoAjaxQuery();
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:doc.php

示例3: die

<?php

/* 
	Appointment: Статус
	File: status.php 
*/
if (!defined('MOZG')) {
    die('Hacking attempt!');
}
NoAjaxQuery();
if ($logged) {
    $user_id = $user_info['user_id'];
    $text = ajax_utf8(textFilter($_POST['text'], false, true));
    $db->query("UPDATE `" . PREFIX . "_users` SET user_status = '{$text}' WHERE user_id = '{$user_id}'");
    echo stripslashes(stripslashes(textFilter(ajax_utf8($_POST['text']))));
    //Чистим кеш
    mozg_clear_cache_file('user_' . $user_id . '/profile_' . $user_id);
    mozg_clear_cache();
}
die;
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:20,代码来源:status.php

示例4: NoAjaxQuery

         if ($new_pass == $new_pass2) {
             $db->query("UPDATE `" . PREFIX . "_users` SET user_password = '{$new_pass2}' WHERE user_id = '{$user_id}'");
         } else {
             echo '2';
         }
     } else {
         echo '1';
     }
     die;
     break;
     //################### Изменение имени ###################//
 //################### Изменение имени ###################//
 case "newname":
     NoAjaxQuery();
     $user_name = ajax_utf8(textFilter($_POST['name']));
     $user_lastname = ajax_utf8(textFilter(ucfirst($_POST['lastname'])));
     //Проверка имени
     if (isset($user_name)) {
         if (strlen($user_name) >= 2) {
             if (!preg_match("/^[a-zA-Zа-яА-Я]+\$/", $user_name)) {
                 $errors = 3;
             }
         } else {
             $errors = 2;
         }
     } else {
         $errors = 1;
     }
     //Проверка фамилии
     if (isset($user_lastname)) {
         if (strlen($user_lastname) >= 2) {
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:settings.php

示例5: wall

         $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}'");
     if ($row['comments'] or stripos($row['admin'], "u{$user_id}|") !== false and isset($wall_text) and !empty($wall_text)) {
         //Вставляем саму запись в БД
         $db->query("INSERT INTO `" . PREFIX . "_communities_wall` SET public_id = '{$user_id}', text = '{$wall_text}', add_date = '{$server_time}', fast_comm_id = '{$rec_id}'");
         $db->query("UPDATE `" . PREFIX . "_communities_wall` SET fasts_num = fasts_num+1 WHERE id = '{$rec_id}'");
         $row['fasts_num'] = $row['fasts_num'] + 1;
         if ($row['fasts_num'] > 3) {
             $comments_limit = $row['fasts_num'] - 3;
         } else {
             $comments_limit = 0;
         }
         $sql_comments = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, public_id, text, add_date, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.public_id = tb2.user_id AND tb1.fast_comm_id = '{$rec_id}' ORDER by `add_date` ASC LIMIT {$comments_limit}, 3", 1);
         //Загружаем кнопку "Показать N запсии"
         $tpl->load_template('groups/record.tpl');
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:groups.php

示例6: strtr

         $tpl->set('{privacy-text}', strtr($album_privacy[0], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Только я')));
         $tpl->set('{privacy-comment}', $album_privacy[1]);
         $tpl->set('{privacy-comment-text}', strtr($album_privacy[1], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Только я')));
         $tpl->compile('content');
         AjaxTpl();
     }
     die;
     break;
     //################### Сохранение настроек альбома ###################//
 //################### Сохранение настроек альбома ###################//
 case "save_album":
     NoAjaxQuery();
     $id = intval($_POST['id']);
     $user_id = $user_info['user_id'];
     $name = ajax_utf8(textFilter($_POST['name'], false, true));
     $descr = ajax_utf8(textFilter($_POST['descr']));
     $privacy = intval($_POST['privacy']);
     $privacy_comm = intval($_POST['privacy_comm']);
     if ($privacy <= 0 or $privacy > 3) {
         $privacy = 1;
     }
     if ($privacy_comm <= 0 or $privacy_comm > 3) {
         $privacy_comm = 1;
     }
     $sql_privacy = $privacy . '|' . $privacy_comm;
     //Проверка на существование юзера
     $chekc_user = $db->super_query("SELECT privacy FROM `" . PREFIX . "_albums` WHERE aid = '{$id}' AND user_id = '{$user_id}'");
     if ($chekc_user) {
         if (isset($name) and !empty($name)) {
             $db->query("UPDATE `" . PREFIX . "_albums` SET name = '{$name}', descr = '{$descr}', privacy = '{$sql_privacy}' WHERE aid = '{$id}'");
             echo stripslashes($name) . '|#|||#row#|||#|' . stripslashes($descr);
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:albums.php

示例7: intval

     $fid = intval($_POST['fid']);
     $row = $db->super_query("SELECT fuser_id, public_id FROM `" . PREFIX . "_communities_forum` WHERE fid = '{$fid}'");
     $row2 = $db->super_query("SELECT admin, discussion FROM `" . PREFIX . "_communities` WHERE id = '{$row['public_id']}'");
     if (stripos($row2['admin'], "u{$user_id}|") !== false) {
         $public_admin = true;
     } else {
         $public_admin = false;
     }
     if ($user_info['user_group'] == 1 or $public_admin or $row['fuser_id'] == $user_id and $row2['discussion']) {
         //Голосование
         $vote_title = ajax_utf8(textFilter($_POST['vote_title'], false, true));
         $vote_answer_1 = ajax_utf8(textFilter($_POST['vote_answer_1'], false, true));
         $ansers_list = array();
         if (isset($vote_title) and !empty($vote_title) and isset($vote_answer_1) and !empty($vote_answer_1)) {
             for ($vote_i = 1; $vote_i <= 10; $vote_i++) {
                 $vote_answer = ajax_utf8(textFilter($_POST['vote_answer_' . $vote_i], false, true));
                 $vote_answer = str_replace('|', '&#124;', $vote_answer);
                 if ($vote_answer) {
                     $ansers_list[] = $vote_answer;
                 }
             }
             $sql_answers_list = implode('|', $ansers_list);
             //Вставляем голосование в БД
             $db->query("INSERT INTO `" . PREFIX . "_votes` SET title = '{$vote_title}', answers = '{$sql_answers_list}'");
             $db->query("UPDATE `" . PREFIX . "_communities_forum` SET vote = '{$db->insert_id()}' WHERE fid = '{$fid}'");
         }
     }
     exit;
     break;
     //################### Просмотр темы ###################//
 //################### Просмотр темы ###################//
开发者ID:skypach,项目名称:skypach.ru,代码行数:31,代码来源:groups_forum.php

示例8: VALUES

                $img = '/uploads/apps/no.gif';
            } else {
                $img = '/uploads/apps/' . $sql['id'] . '/' . $sql['img'];
            }
            $text = $sex . ' приложение <a href="/apps?i=' . $sql['id'] . '" onclick="apps.view(\'' . $attach_type[1] . '\', this.href, \' \'); return false;">' . $sql['title'] . '</a>. Присоединяйся!';
            $attach = 'apps|' . $sql['id'] . '|' . $sql['img'] . '||';
            $db->query("INSERT INTO `" . PREFIX . "_wall` (author_user_id,add_date,text,attach,for_user_id) VALUES ('" . $user_id . "','" . $server_time . "','" . $text . "','" . $attach . "','" . $user_id . "')");
            $db->query("UPDATE `" . PREFIX . "_users` SET user_wall_num = user_wall_num+1 WHERE user_id = '{$user_id}'");
            //Чистим кеш
            mozg_clear_cache_file('user_' . $user_id . '/profile_' . $user_id);
            mozg_clear_cache();
            break;
            //############### Поиск по приложениям ##################
        //############### Поиск по приложениям ##################
        case "search":
            $application = $db->safesql(ajax_utf8(strip_data(urldecode($_POST['query_application']))));
            $application = strtr($application, array(' ' => '%'));
            $sql = $db->super_query("SELECT * FROM `" . PREFIX . "_apps` WHERE title LIKE '%{$application}%'", 1);
            foreach ($sql as $row_app) {
                $num = $row_app['cols'];
                //Если нету Изображение Приложения то ставим стандарт..
                if ($row_app['img']) {
                    $application_img = $config['home_url'] . 'uploads/apps/' . $row_app['id'] . '/' . $row_app['img'];
                } else {
                    $application_img = '/images/no_apps.gif';
                }
                $search_aps .= '

					<div class="apps_application apps_application2 apps_last_new" id="{id}">

					<a class="apps_mr" href="/apps?i=' . $row_app['id'] . '" onClick="apps.view(\'' . $row_app['id'] . '\', this.href, \'/apps\'); return false">
开发者ID:skypach,项目名称:skypach.ru,代码行数:31,代码来源:apps.php

示例9: strtolower

 $type = strtolower(end(explode(".", $file_name)));
 // формат файла
 if ($type == 'mp3' and $config['audio_mod_add'] == 'yes' and $file_size < 10000000) {
     $audio_dir = ROOT_DIR . '/uploads/audio/' . $user_id . '/';
     if (!is_dir($audio_dir)) {
         @mkdir($audio_dir, 0777);
         @chmod($audio_dir, 0777);
     }
     $res_type = '.' . $type;
     if (move_uploaded_file($file_tmp, $audio_dir . $file_rename . $res_type)) {
         //Узнаем исполнителя и название песни по id3
         include ENGINE_DIR . "/classes/id3v2.php";
         $id3v2 = new Id3v2();
         $res = $id3v2->read(ROOT_DIR . '/uploads/audio/' . $user_id . '/' . $file_rename . $res_type);
         $artist = ajax_utf8(textFilter($res['Artist'], false, true));
         $name = ajax_utf8(textFilter($res['Title'], false, true));
         if (isset($artist) and empty($artist)) {
             $artist = 'Неизвестный исполнитель';
         }
         if (isset($name) and empty($name)) {
             $name = 'Без названия';
         }
         $lnk = $config['home_url'] . 'uploads/audio/' . $user_id . '/' . $file_rename . $res_type;
         $db->query("INSERT INTO `" . PREFIX . "_audio` SET auser_id = '" . $user_id . "', url = '" . $lnk . "', artist = '" . $artist . "', name = '" . $name . "',  adate = '" . $server_time . "'");
         $db->query("UPDATE `" . PREFIX . "_users` SET user_audio = user_audio+1 WHERE user_id = '" . $user_id . "'");
         mozg_mass_clear_cache_file('user_' . $user_id . '/audios_profile|user_' . $user_id . '/profile_' . $user_id);
     } else {
         echo 1;
     }
 } else {
     echo 1;
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:audio.php

示例10: rand

             $db->query("INSERT INTO `" . PREFIX . "_photos_mark` SET muser_id = '" . $muser_id . "', mphoto_id = '" . $photo_id . "', mdate = '" . $server_time . "', msettings_pos = '" . $msettings_pos . "', mapprove = '" . $approve . "', mmark_user_id = '" . $user_id . "'");
             if ($user_id != $muser_id) {
                 $db->query("UPDATE `" . PREFIX . "_users` SET user_new_mark_photos = user_new_mark_photos+1 WHERE user_id = '" . $muser_id . "'");
             }
         } else {
             $db->query("INSERT INTO `" . PREFIX . "_photos_mark` SET muser_id = '" . rand(0, 100000) . "', mphoto_id = '" . $photo_id . "', mdate = '" . $server_time . "', msettings_pos = '" . $msettings_pos . "', mphoto_name = '" . $mphoto_name . "', mmark_user_id = '" . $user_id . "', mapprove = 1");
         }
     }
     mozg_clear_cache_file('photos_mark/p' . $photo_id);
     break;
     //################### Удаление отметки ###################//
 //################### Удаление отметки ###################//
 case "mark_del":
     $photo_id = intval($_POST['photo_id']);
     $muser_id = intval($_POST['user_id']);
     $mphoto_name = ajax_utf8(strip_data(textFilter($_POST['user_name'], false, true)));
     $row = $db->super_query("SELECT user_id FROM `" . PREFIX . "_photos` WHERE id = '" . $photo_id . "'");
     if ($mphoto_name and $muser_id == 0) {
         $row_mark = $db->super_query("SELECT mmark_user_id FROM `" . PREFIX . "_photos_mark` WHERE mphoto_id = '" . $photo_id . "' AND mphoto_name = '" . $mphoto_name . "'");
     } else {
         $row_mark = $db->super_query("SELECT mmark_user_id, mapprove FROM `" . PREFIX . "_photos_mark` WHERE mphoto_id = '" . $photo_id . "' AND muser_id = '" . $muser_id . "'");
     }
     if ($row['user_id'] == $user_id or $user_id == $muser_id or $user_id == $row_mark['mmark_user_id']) {
         if ($mphoto_name and $muser_id == 0) {
             $db->query("DELETE FROM `" . PREFIX . "_photos_mark` WHERE mphoto_id = '" . $photo_id . "' AND mphoto_name = '" . $mphoto_name . "'");
         } else {
             $db->query("DELETE FROM `" . PREFIX . "_photos_mark` WHERE mphoto_id = '" . $photo_id . "' AND muser_id = '" . $muser_id . "' AND mphoto_name = ''");
             if (!$row_mark['mapprove']) {
                 $db->query("UPDATE `" . PREFIX . "_users` SET user_new_mark_photos = user_new_mark_photos-1 WHERE user_id = '" . $muser_id . "'");
             }
         }
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:distinguish.php

示例11: ajax_utf8

 case "create_ads":
     //top tabs bar
     $tpl->load_template('ads/ads_top.tpl');
     $tpl->set('[create_ads]', '');
     $tpl->set('[/create_ads]', '');
     $tpl->set_block("'\\[ads_view_all\\](.*?)\\[/ads_view_all\\]'si", "");
     $tpl->set_block("'\\[ads_view_my\\](.*?)\\[/ads_view_my\\]'si", "");
     $tpl->compile('info');
     $tpl->load_template('ads/ads_create.tpl');
     $tpl->compile('content');
     break;
     //Записываем все данные в базу данных
 //Записываем все данные в базу данных
 case "add_ads":
     $title = ajax_utf8(textFilter($_POST['title']));
     $description = ajax_utf8(textFilter($_POST['description']));
     $link_photos = textFilter2($_POST['link_photos']);
     $link_site = textFilter2($_POST['link_site']);
     $category = numFilter2($_POST['category']);
     $transitions = numFilter2($_POST['transitions']);
     $ubalance = $db->super_query("SELECT user_balance FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'");
     if ($transitions <= $ubalance['user_balance']) {
         if ($title and $link_photos and $link_site and $transitions and $description) {
             $db->query("INSERT INTO `" . PREFIX . "_ads` SET settings = '{$title}', description = '{$description}', links = '{$link_site}', link = '{$link_photos}', category = '{$category}', views = '{$transitions}', user_id = '{$user_id}'");
             $db->query("UPDATE `" . PREFIX . "_users` SET user_balance=user_balance-'{$transitions}' WHERE user_id='{$user_id}'");
             echo '1';
         } else {
             echo '2';
         }
     } else {
         echo '3';
开发者ID:skypach,项目名称:skypach.ru,代码行数:31,代码来源:ads.php

示例12: NoAjaxQuery

     NoAjaxQuery();
     $qid = intval($_POST['qid']);
     if ($user_info['user_group'] == 4) {
         $row = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_support` WHERE id = '{$qid}'");
         if ($row['cnt']) {
             $db->query("UPDATE `" . PREFIX . "_support` SET sfor_user_id = 0 WHERE id = '{$qid}'");
         }
     }
     die;
     break;
     //################### Отправка ответа ###################//
 //################### Отправка ответа ###################//
 case "answer":
     NoAjaxQuery();
     $qid = intval($_POST['qid']);
     $answer = ajax_utf8(textFilter($_POST['answer']));
     $check = $db->super_query("SELECT suser_id FROM `" . PREFIX . "_support` WHERE id = '{$qid}'");
     if ($check['suser_id'] == $user_id or $user_info['user_group'] == 4 and isset($answer) and !empty($answer)) {
         if ($user_info['user_group'] == 4) {
             $auser_id = 0;
             $db->query("UPDATE `" . PREFIX . "_users` SET user_support = user_support+1 WHERE user_id = '{$check['suser_id']}'");
         } else {
             $auser_id = $user_id;
         }
         $answer = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<!--link:$1--><a href="$1" target="_blank">$1</a><!--/link-->', $answer);
         $db->query("INSERT INTO `" . PREFIX . "_support_answers` SET qid = '{$qid}', auser_id = '{$auser_id}', adate = '{$server_time}', answer = '{$answer}'");
         $db->query("UPDATE `" . PREFIX . "_support` SET sfor_user_id = '{$auser_id}', sdate = '{$server_time}' WHERE id = '{$qid}'");
         $row = $db->super_query("SELECT user_search_pref, user_photo FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'");
         $tpl->load_template('support/answer.tpl');
         if (!$auser_id) {
             $tpl->set('{name}', 'Агент поддержки');
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:support.php

示例13: NoAjaxQuery

     }
     $row = $db->super_query("SELECT user_balance FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'");
     echo "<style>#box_bottom_left_text{padding-top:6px;float:left}</style><script>\$('#box_bottom_left_text').html('У Вас <b>{$row['user_balance']} голос.</b>');</script>";
     die;
     break;
     //################### Отправка подарка в БД ###################//
 //################### Отправка подарка в БД ###################//
 case "send":
     NoAjaxQuery();
     $for_user_id = intval($_POST['for_user_id']);
     $gift = intval($_POST['gift']);
     $privacy = intval($_POST['privacy']);
     if ($privacy < 0 or $privacy > 3) {
         $privacy = 1;
     }
     $msg = ajax_utf8(textFilter($_POST['msg']));
     $gifts = $db->super_query("SELECT price FROM `" . PREFIX . "_gifts_list` WHERE img = '" . $gift . "'");
     //Выводим текущий баланс свой
     $row = $db->super_query("SELECT user_balance FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'");
     if ($gifts['price'] and $user_id != $for_user_id) {
         if ($row['user_balance'] >= $gifts['price']) {
             $db->query("INSERT INTO `" . PREFIX . "_gifts` SET uid = '{$for_user_id}', gift = '{$gift}', msg = '{$msg}', privacy = '{$privacy}', gdate = '{$server_time}', from_uid = '{$user_id}', status = 1");
             $db->query("UPDATE `" . PREFIX . "_users` SET user_balance = user_balance-{$gifts['price']} WHERE user_id = '{$user_id}'");
             $db->query("UPDATE `" . PREFIX . "_users` SET user_gifts = user_gifts+1 WHERE user_id = '{$for_user_id}'");
             //Вставляем событие в моментальные оповещания
             $row_owner = $db->super_query("SELECT user_last_visit FROM `" . PREFIX . "_users` WHERE user_id = '{$for_user_id}'");
             $update_time = $server_time - 70;
             if ($row_owner['user_last_visit'] >= $update_time) {
                 $action_update_text = "<img src=\"/uploads/gifts/{$gift}.png\" align=\"right\" width=\"50\">";
                 $db->query("INSERT INTO `" . PREFIX . "_updates` SET for_user_id = '{$for_user_id}', from_user_id = '{$user_info['user_id']}', type = '7', date = '{$server_time}', text = '{$action_update_text}', user_photo = '{$user_info['user_photo']}', user_search_pref = '{$user_info['user_search_pref']}', lnk = '/gifts{$user_info['user_id']}'");
                 mozg_create_cache("user_{$for_user_id}/updates", 1);
开发者ID:skypach,项目名称:skypach.ru,代码行数:31,代码来源:gifts.php

示例14: NoAjaxQuery

         $db->query("INSERT INTO `" . PREFIX . "_communities_wall` SET public_id = '{$sel_group}', text = '{$row['text']}', attach = '{$row['attach']}', add_date = '{$server_time}', tell_uid = '{$tell_uid}', tell_date = '{$tell_date}', public = '{$row['public']}', tell_comm = '{$comm}'");
         $dbid = $db->insert_id();
         $db->query("UPDATE `" . PREFIX . "_communities` SET rec_num = rec_num+1 WHERE id = '{$sel_group}'");
         //Вставляем в ленту новотсей
         $db->query("INSERT INTO `" . PREFIX . "_news` SET ac_user_id = '{$sel_group}', action_type = 11, action_text = '{$row['text']}', obj_id = '{$dbid}', action_time = '{$server_time}'");
     } else {
         echo 1;
     }
     die;
     break;
     //################### Если выбрано " Отправить личным сообщением" ###################//
 //################### Если выбрано " Отправить личным сообщением" ###################//
 case "message":
     NoAjaxQuery();
     $for_user_id = intval($_POST['for_user_id']);
     $tell_comm = ajax_utf8(textFilter($_POST['comm']));
     $rid = intval($_POST['rec_id']);
     if ($user_id != $for_user_id) {
         //Проверка на существование получателя
         $row = $db->super_query("SELECT user_privacy FROM `" . PREFIX . "_users` WHERE user_id = '{$for_user_id}'");
         if ($row) {
             //Приватность
             $user_privacy = xfieldsdataload($row['user_privacy']);
             //ЧС
             $CheckBlackList = CheckBlackList($for_user_id);
             //Проверка естьли запрашиваемый юзер в друзьях у юзера который смотрит стр
             if ($user_privacy['val_msg'] == 2) {
                 $check_friend = CheckFriends($for_user_id);
             }
             if (!$CheckBlackList and $user_privacy['val_msg'] == 1 or $user_privacy['val_msg'] == 2 and $check_friend) {
                 $xPrivasy = 1;
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:repost.php

示例15: explode

     $newpostedxfields[$value[0]] = $postedxfields[$value[0]];
     if ($value[2] == "select") {
         $options = explode("\r\n", $value[3]);
         $newpostedxfields[$value[0]] = $options[$postedxfields[$value[0]]] . '|1';
     }
 }
 $postedxfields = $newpostedxfields;
 foreach ($postedxfields as $xfielddataname => $xfielddatavalue) {
     if (!$xfielddatavalue) {
         continue;
     }
     $expxfielddatavalue = explode('|', $xfielddatavalue);
     if ($expxfielddatavalue[1]) {
         $xfielddatavalue = str_replace('|1', '', textFilter($xfielddatavalue));
     } else {
         $xfielddatavalue = ajax_utf8(textFilter($xfielddatavalue));
     }
     $xfielddataname = $db->safesql($xfielddataname);
     if (isset($xfielddatavalue) and !empty($xfielddatavalue)) {
         $xfielddataname = str_replace("|", "&#124;", $xfielddataname);
         $xfielddatavalue = str_replace("|", "&#124;", $xfielddatavalue);
         $filecontents[] = "{$xfielddataname}|{$xfielddatavalue}";
     }
 }
 if ($filecontents) {
     $filecontents = implode("||", $filecontents);
 } else {
     $filecontents = '';
 }
 $db->query("UPDATE `" . PREFIX . "_users` SET xfields = '{$filecontents}' WHERE user_id = '{$user_info['user_id']}'");
 mozg_clear_cache_file('user_' . $user_info['user_id'] . '/profile_' . $user_info['user_id']);
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:editprofile.php


注:本文中的ajax_utf8函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。