PHP . SU
Программирование на PHP, MySQL и другие веб-технологии
Описание: Ошибка кодировки при загрузке файла
Поиск в теме | Версия для печати
Ник Бондарчук
Отправлено: 29 Марта, 2017 - 13:05:35
Новичок
Покинул форум
Сообщений всего: 13
Дата рег-ции: Март 2017
Помог: 0 раз(а)
quad пишет: CODE (
htmlphp ):
скопировать код в буфер обмена
<? php
include_once dirname ( __FILE__ ) . '/../php_main/lock.php' ; include_once dirname ( __FILE__ ) . '/../php_main/connect_user.php' ; include_once dirname ( __FILE__ ) . '/../php_main/functions.php' ; include_once 'content_functions.php' ;
if ( isset ( $_POST [ 'length' ] ) ) $length = escaper_mysql( $_POST [ 'length' ] ) ; if ( isset ( $_POST [ 'last_id' ] ) ) $last_id = escaper_mysql( $_POST [ 'last_id' ] ) ;
switch ( $_POST [ 'type' ] ) {
case 'people' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$country = escaper_mysql( $_POST [ 'country' ] ) ;
$city = escaper_mysql( $_POST [ 'city' ] ) ;
$year_f = escaper_mysql( $_POST [ 'year-from' ] ) ;
$year_t = escaper_mysql( $_POST [ 'year-to' ] ) ;
$gender = escaper_mysql( $_POST [ 'gender' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$people_row = mysqli_query ( $dbConnect , "SELECT * FROM network " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if (
search( $name , $people [ 'name' ] ) && search( $country , $people [ 'country' ] ) && search( $city , $people [ 'city' ] )
&& ( $year_f <= birth_to_age( $people [ 'birth' ] ) && $year_t >= birth_to_age( $people [ 'birth' ] ) )
&& ( ( $people [ 'gender' ] == $gender ) || $gender == - 1 ) && ( ( $people [ 'online' ] > time ( ) - 60 ) || ! isset ( $_POST [ 'online' ] ) ) && ( ( $people [ 'secret' ] == $_POST [ 'opened-profile' ] ) || ! isset ( $_POST [ 'opened-profile' ] ) ) ) {
$resArr [ $i ] = get_user( $people [ 'id' ] , 0 , 0) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'friend' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'clubs' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$about = escaper_mysql( $_POST [ 'descr' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$clubs_row = mysqli_query ( $dbConnect , "SELECT * FROM clubs " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $club [ 'name' ] ) && search( $about , $club [ 'description' ] ) ) {
$resArr [ $i ] = get_club( $club [ 'id' ] , 0 , 1 ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'club' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'videos' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$i = 0 ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$post_row = mysqli_query ( $dbConnect , "SELECT * FROM videos " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $video_name [ 'name' ] ) || search( $name , $video_name [ 'description' ] ) ) {
$resArr [ $i ] = get_video( $post [ 'id' ] , NULL ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'video' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'audios' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$audio_row = mysqli_query ( $dbConnect , "SELECT * FROM audios " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $audio [ 'description' ] ) ) {
$resArr [ $i ] = get_music( $get [ 'id' ] , 0 , 1) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'music' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/audio.tpl' ) ;
break ;
case 'tag' :
if ( ! isset ( $_POST [ 'dont' ] ) && $_POST [ 'dont' ] != 1 ) { $hash_array = explode ( ' ' , escaper_mysql( $_POST [ 'name' ] ) ) ;
$query = '' ;
foreach ( $hash_array as $val ) {
if ( substr ( $val , 0 , 1 ) != '#' ) $val = '#' . $val ; if ( $query != '' ) $query .= " AND ( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
else $query .= "( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
}
if ( $query != '' ) $query .= $last_id != 'NULL' ? " AND id < '$last_id ' " : "" ;
else $query = $last_id != 'NULL' ? " id < '$last_id ' " : "" ;
$i = 0 ;
$news_row = mysqli_query ( $dbConnect , "SELECT * FROM news WHERE " . $query . " ORDER BY id DESC limit $length " ) ; $resArr [ $i ++ ] = get_news( $news [ 'id' ] ) ;
$dataArr = array ( 'news' => $resArr , 'end' => ( mysqli_num_rows ( $news_row ) < $length ) ? true : false ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/news.tpl' ) ; }
break ;
}
$dataArr [ 'langs' ] = $langs ;
$dataArr [ 'main_set' ] = $global ;
$dataArr [ 'main_set' ] [ 'root' ] = _root_;
function win1251toutf( $string_a ) {
return strtr ( $str_b , array ( "U0430" => "а" , "U0431" => "б" , "U0432" => "в" , "U0433" => "г" , "U0434" => "д" , "U0435" => "е" , "U0451" => "ё" , "U0436" => "ж" , "U0437" => "з" , "U0438" => "и" ,
"U0439" => "й" , "U043A" => "к" , "U043B" => "л" , "U043C" => "м" , "U043D" => "н" , "U043E" => "о" , "U043F" => "п" ,
"U0440" => "р" , "U0441" => "с" , "U0442" => "т" , "U0443" => "у" , "U0444" => "ф" , "U0445" => "х" , "U0446" => "ц" ,
"U0447" => "ч" , "U0448" => "ш" , "U0449" => "щ" , "U044A" => "ъ" , "U044B" => "ы" , "U044C" => "ь" , "U044D" => "э" ,
"U044E" => "ю" , "U044F" => "я" , "U0410" => "А" , "U0411" => "Б" , "U0412" => "В" , "U0413" => "Г" , "U0414" => "Д" ,
"U0415" => "Е" , "U0401" => "Ё" , "U0416" => "Ж" , "U0417" => "З" , "U0418" => "И" , "U0419" => "Й" , "U041A" => "К" ,
"U041B" => "Л" , "U041C" => "М" , "U041D" => "Н" , "U041E" => "О" , "U041F" => "П" , "U0420" => "Р" , "U0421" => "С" ,
"U0422" => "Т" , "U0423" => "У" , "U0424" => "Ф" , "U0425" => "Х" , "U0426" => "Ц" , "U0427" => "Ч" , "U0428" => "Ш" ,
"U0429" => "Щ" , "U042A" => "Ъ" , "U042B" => "Ы" , "U042C" => "Ь" , "U042D" => "Э" , "U042E" => "Ю" , "U042F" => "Я" ) ) ;
}
?>
Попробуй так посмотрим что измениется[/quote]
Поставил
P.S. Можем перейти к диалогу на самом сайте если хотите?
(Добавление)
Ник Бондарчук пишет: quad пишет: CODE (
htmlphp ):
скопировать код в буфер обмена
<? php
include_once dirname ( __FILE__ ) . '/../php_main/lock.php' ; include_once dirname ( __FILE__ ) . '/../php_main/connect_user.php' ; include_once dirname ( __FILE__ ) . '/../php_main/functions.php' ; include_once 'content_functions.php' ;
if ( isset ( $_POST [ 'length' ] ) ) $length = escaper_mysql( $_POST [ 'length' ] ) ; if ( isset ( $_POST [ 'last_id' ] ) ) $last_id = escaper_mysql( $_POST [ 'last_id' ] ) ;
switch ( $_POST [ 'type' ] ) {
case 'people' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$country = escaper_mysql( $_POST [ 'country' ] ) ;
$city = escaper_mysql( $_POST [ 'city' ] ) ;
$year_f = escaper_mysql( $_POST [ 'year-from' ] ) ;
$year_t = escaper_mysql( $_POST [ 'year-to' ] ) ;
$gender = escaper_mysql( $_POST [ 'gender' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$people_row = mysqli_query ( $dbConnect , "SELECT * FROM network " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if (
search( $name , $people [ 'name' ] ) && search( $country , $people [ 'country' ] ) && search( $city , $people [ 'city' ] )
&& ( $year_f <= birth_to_age( $people [ 'birth' ] ) && $year_t >= birth_to_age( $people [ 'birth' ] ) )
&& ( ( $people [ 'gender' ] == $gender ) || $gender == - 1 ) && ( ( $people [ 'online' ] > time ( ) - 60 ) || ! isset ( $_POST [ 'online' ] ) ) && ( ( $people [ 'secret' ] == $_POST [ 'opened-profile' ] ) || ! isset ( $_POST [ 'opened-profile' ] ) ) ) {
$resArr [ $i ] = get_user( $people [ 'id' ] , 0 , 0) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'friend' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'clubs' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$about = escaper_mysql( $_POST [ 'descr' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$clubs_row = mysqli_query ( $dbConnect , "SELECT * FROM clubs " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $club [ 'name' ] ) && search( $about , $club [ 'description' ] ) ) {
$resArr [ $i ] = get_club( $club [ 'id' ] , 0 , 1 ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'club' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'videos' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$i = 0 ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$post_row = mysqli_query ( $dbConnect , "SELECT * FROM videos " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $video_name [ 'name' ] ) || search( $name , $video_name [ 'description' ] ) ) {
$resArr [ $i ] = get_video( $post [ 'id' ] , NULL ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'video' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'audios' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$audio_row = mysqli_query ( $dbConnect , "SELECT * FROM audios " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $audio [ 'description' ] ) ) {
$resArr [ $i ] = get_music( $get [ 'id' ] , 0 , 1) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'music' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/audio.tpl' ) ;
break ;
case 'tag' :
if ( ! isset ( $_POST [ 'dont' ] ) && $_POST [ 'dont' ] != 1 ) { $hash_array = explode ( ' ' , escaper_mysql( $_POST [ 'name' ] ) ) ;
$query = '' ;
foreach ( $hash_array as $val ) {
if ( substr ( $val , 0 , 1 ) != '#' ) $val = '#' . $val ; if ( $query != '' ) $query .= " AND ( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
else $query .= "( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
}
if ( $query != '' ) $query .= $last_id != 'NULL' ? " AND id < '$last_id ' " : "" ;
else $query = $last_id != 'NULL' ? " id < '$last_id ' " : "" ;
$i = 0 ;
$news_row = mysqli_query ( $dbConnect , "SELECT * FROM news WHERE " . $query . " ORDER BY id DESC limit $length " ) ; $resArr [ $i ++ ] = get_news( $news [ 'id' ] ) ;
$dataArr = array ( 'news' => $resArr , 'end' => ( mysqli_num_rows ( $news_row ) < $length ) ? true : false ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/news.tpl' ) ; }
break ;
}
$dataArr [ 'langs' ] = $langs ;
$dataArr [ 'main_set' ] = $global ;
$dataArr [ 'main_set' ] [ 'root' ] = _root_;
function win1251toutf( $string_a ) {
return strtr ( $str_b , array ( "U0430" => "а" , "U0431" => "б" , "U0432" => "в" , "U0433" => "г" , "U0434" => "д" , "U0435" => "е" , "U0451" => "ё" , "U0436" => "ж" , "U0437" => "з" , "U0438" => "и" ,
"U0439" => "й" , "U043A" => "к" , "U043B" => "л" , "U043C" => "м" , "U043D" => "н" , "U043E" => "о" , "U043F" => "п" ,
"U0440" => "р" , "U0441" => "с" , "U0442" => "т" , "U0443" => "у" , "U0444" => "ф" , "U0445" => "х" , "U0446" => "ц" ,
"U0447" => "ч" , "U0448" => "ш" , "U0449" => "щ" , "U044A" => "ъ" , "U044B" => "ы" , "U044C" => "ь" , "U044D" => "э" ,
"U044E" => "ю" , "U044F" => "я" , "U0410" => "А" , "U0411" => "Б" , "U0412" => "В" , "U0413" => "Г" , "U0414" => "Д" ,
"U0415" => "Е" , "U0401" => "Ё" , "U0416" => "Ж" , "U0417" => "З" , "U0418" => "И" , "U0419" => "Й" , "U041A" => "К" ,
"U041B" => "Л" , "U041C" => "М" , "U041D" => "Н" , "U041E" => "О" , "U041F" => "П" , "U0420" => "Р" , "U0421" => "С" ,
"U0422" => "Т" , "U0423" => "У" , "U0424" => "Ф" , "U0425" => "Х" , "U0426" => "Ц" , "U0427" => "Ч" , "U0428" => "Ш" ,
"U0429" => "Щ" , "U042A" => "Ъ" , "U042B" => "Ы" , "U042C" => "Ь" , "U042D" => "Э" , "U042E" => "Ю" , "U042F" => "Я" ) ) ;
}
?>
Попробуй так посмотрим что измениется
Поставил
P.S. Можем перейти к диалогу на самом сайте если хотите?[/quote]
Не работает
(Добавление)
Теперь поиск отказывается работать
quad
Отправлено: 29 Марта, 2017 - 13:18:37
Новичок
Покинул форум
Сообщений всего: 39
Дата рег-ции: Март 2017
Откуда: Россия
Помог: 0 раз(а)
не теперь сделай обрвтно как было
CODE (
htmlphp ):
скопировать код в буфер обмена
<? php
include_once dirname ( __FILE__ ) . '/../php_main/lock.php' ; include_once dirname ( __FILE__ ) . '/../php_main/connect_user.php' ; include_once dirname ( __FILE__ ) . '/../php_main/functions.php' ; include_once 'content_functions.php' ;
if ( isset ( $_POST [ 'length' ] ) ) $length = escaper_mysql( $_POST [ 'length' ] ) ; if ( isset ( $_POST [ 'last_id' ] ) ) $last_id = escaper_mysql( $_POST [ 'last_id' ] ) ;
switch ( $_POST [ 'type' ] ) {
case 'people' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$country = escaper_mysql( $_POST [ 'country' ] ) ;
$city = escaper_mysql( $_POST [ 'city' ] ) ;
$year_f = escaper_mysql( $_POST [ 'year-from' ] ) ;
$year_t = escaper_mysql( $_POST [ 'year-to' ] ) ;
$gender = escaper_mysql( $_POST [ 'gender' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$people_row = mysqli_query ( $dbConnect , "SELECT * FROM network " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if (
search( $name , $people [ 'name' ] ) && search( $country , $people [ 'country' ] ) && search( $city , $people [ 'city' ] )
&& ( $year_f <= birth_to_age( $people [ 'birth' ] ) && $year_t >= birth_to_age( $people [ 'birth' ] ) )
&& ( ( $people [ 'gender' ] == $gender ) || $gender == - 1 ) && ( ( $people [ 'online' ] > time ( ) - 60 ) || ! isset ( $_POST [ 'online' ] ) ) && ( ( $people [ 'secret' ] == $_POST [ 'opened-profile' ] ) || ! isset ( $_POST [ 'opened-profile' ] ) ) ) {
$resArr [ $i ] = get_user( $people [ 'id' ] , 0 , 0) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'friend' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'clubs' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$about = escaper_mysql( $_POST [ 'descr' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$clubs_row = mysqli_query ( $dbConnect , "SELECT * FROM clubs " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $club [ 'name' ] ) && search( $about , $club [ 'description' ] ) ) {
$resArr [ $i ] = get_club( $club [ 'id' ] , 0 , 1 ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'club' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'videos' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$i = 0 ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$post_row = mysqli_query ( $dbConnect , "SELECT * FROM videos " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $video_name [ 'name' ] ) || search( $name , $video_name [ 'description' ] ) ) {
$resArr [ $i ] = get_video( $post [ 'id' ] , NULL ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'video' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'audios' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$audio_row = mysqli_query ( $dbConnect , "SELECT * FROM audios " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $audio [ 'description' ] ) ) {
$resArr [ $i ] = get_music( $get [ 'id' ] , 0 , 1) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'music' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/audio.tpl' ) ;
break ;
case 'tag' :
if ( ! isset ( $_POST [ 'dont' ] ) && $_POST [ 'dont' ] != 1 ) { $hash_array = explode ( ' ' , escaper_mysql( $_POST [ 'name' ] ) ) ;
$query = '' ;
foreach ( $hash_array as $val ) {
if ( substr ( $val , 0 , 1 ) != '#' ) $val = '#' . $val ; if ( $query != '' ) $query .= " AND ( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
else $query .= "( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
}
if ( $query != '' ) $query .= $last_id != 'NULL' ? " AND id < '$last_id ' " : "" ;
else $query = $last_id != 'NULL' ? " id < '$last_id ' " : "" ;
$i = 0 ;
$news_row = mysqli_query ( $dbConnect , "SELECT * FROM news WHERE " . $query . " ORDER BY id DESC limit $length " ) ; $resArr [ $i ++ ] = get_news( $news [ 'id' ] ) ;
$dataArr = array ( 'news' => $resArr , 'end' => ( mysqli_num_rows ( $news_row ) < $length ) ? true : false ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/news.tpl' ) ; }
break ;
}
$dataArr [ 'langs' ] = $langs ;
$dataArr [ 'main_set' ] = $global ;
$dataArr [ 'main_set' ] [ 'root' ] = _root_;
?>
Ник Бондарчук
Отправлено: 29 Марта, 2017 - 13:20:13
Новичок
Покинул форум
Сообщений всего: 13
Дата рег-ции: Март 2017
Помог: 0 раз(а)
quad пишет: не теперь сделай обрвтно как было
CODE (
htmlphp ):
скопировать код в буфер обмена
<? php
include_once dirname ( __FILE__ ) . '/../php_main/lock.php' ; include_once dirname ( __FILE__ ) . '/../php_main/connect_user.php' ; include_once dirname ( __FILE__ ) . '/../php_main/functions.php' ; include_once 'content_functions.php' ;
if ( isset ( $_POST [ 'length' ] ) ) $length = escaper_mysql( $_POST [ 'length' ] ) ; if ( isset ( $_POST [ 'last_id' ] ) ) $last_id = escaper_mysql( $_POST [ 'last_id' ] ) ;
switch ( $_POST [ 'type' ] ) {
case 'people' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$country = escaper_mysql( $_POST [ 'country' ] ) ;
$city = escaper_mysql( $_POST [ 'city' ] ) ;
$year_f = escaper_mysql( $_POST [ 'year-from' ] ) ;
$year_t = escaper_mysql( $_POST [ 'year-to' ] ) ;
$gender = escaper_mysql( $_POST [ 'gender' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$people_row = mysqli_query ( $dbConnect , "SELECT * FROM network " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if (
search( $name , $people [ 'name' ] ) && search( $country , $people [ 'country' ] ) && search( $city , $people [ 'city' ] )
&& ( $year_f <= birth_to_age( $people [ 'birth' ] ) && $year_t >= birth_to_age( $people [ 'birth' ] ) )
&& ( ( $people [ 'gender' ] == $gender ) || $gender == - 1 ) && ( ( $people [ 'online' ] > time ( ) - 60 ) || ! isset ( $_POST [ 'online' ] ) ) && ( ( $people [ 'secret' ] == $_POST [ 'opened-profile' ] ) || ! isset ( $_POST [ 'opened-profile' ] ) ) ) {
$resArr [ $i ] = get_user( $people [ 'id' ] , 0 , 0) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'friend' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'clubs' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$about = escaper_mysql( $_POST [ 'descr' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$clubs_row = mysqli_query ( $dbConnect , "SELECT * FROM clubs " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $club [ 'name' ] ) && search( $about , $club [ 'description' ] ) ) {
$resArr [ $i ] = get_club( $club [ 'id' ] , 0 , 1 ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'club' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'videos' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$i = 0 ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$post_row = mysqli_query ( $dbConnect , "SELECT * FROM videos " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $video_name [ 'name' ] ) || search( $name , $video_name [ 'description' ] ) ) {
$resArr [ $i ] = get_video( $post [ 'id' ] , NULL ) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'video' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../' . ( _mobile_ ? 'tpl_app' : 'themes/' . _theme_. '/tpl' ) . '/content.tpl' ) ;
break ;
case 'audios' :
$name = escaper_mysql( $_POST [ 'name' ] ) ;
$query = $last_id != 'NULL' ? " WHERE id < '$last_id ' " : "" ;
$audio_row = mysqli_query ( $dbConnect , "SELECT * FROM audios " . $query . " ORDER BY id DESC LIMIT $length " ) ;
for ( $i = 0 ; $i < $length ; ) {
if ( search( $name , $audio [ 'description' ] ) ) {
$resArr [ $i ] = get_music( $get [ 'id' ] , 0 , 1) ;
$i ++;
}
} else break ;
}
$dataArr = array ( 'music' => $resArr , 'end' => ( $i < $length - 1 ? true : false ) ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/audio.tpl' ) ;
break ;
case 'tag' :
if ( ! isset ( $_POST [ 'dont' ] ) && $_POST [ 'dont' ] != 1 ) { $hash_array = explode ( ' ' , escaper_mysql( $_POST [ 'name' ] ) ) ;
$query = '' ;
foreach ( $hash_array as $val ) {
if ( substr ( $val , 0 , 1 ) != '#' ) $val = '#' . $val ; if ( $query != '' ) $query .= " AND ( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
else $query .= "( text LIKE '% " . $val . "%' OR text LIKE '" . $val . "%' )" ;
}
if ( $query != '' ) $query .= $last_id != 'NULL' ? " AND id < '$last_id ' " : "" ;
else $query = $last_id != 'NULL' ? " id < '$last_id ' " : "" ;
$i = 0 ;
$news_row = mysqli_query ( $dbConnect , "SELECT * FROM news WHERE " . $query . " ORDER BY id DESC limit $length " ) ; $resArr [ $i ++ ] = get_news( $news [ 'id' ] ) ;
$dataArr = array ( 'news' => $resArr , 'end' => ( mysqli_num_rows ( $news_row ) < $length ) ? true : false ) ; $dataArr [ 'tpl' ] = tpl( dirname ( __FILE__ ) . '/../themes/' . _theme_. '/tpl/news.tpl' ) ; }
break ;
}
$dataArr [ 'langs' ] = $langs ;
$dataArr [ 'main_set' ] = $global ;
$dataArr [ 'main_set' ] [ 'root' ] = _root_;
?>
сделал
Поиск в теме | Версия для печати
Страниц (2): « 1 [2]
Сейчас эту тему просматривают: 0 (гостей: 0, зарегистрированных: 0)
« Вопросы новичков »
Все гости форума могут просматривать этот раздел. Только зарегистрированные пользователи могут создавать новые темы в этом разделе. Только зарегистрированные пользователи могут отвечать на сообщения в этом разделе.
Powered by ExBB FM 1.0 RC1. InvisionExBB