Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for eAccelerator & MMCache)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- class cusers {
- var $m_on_page = 6;
- var $imessage = '';
- var $m_is_me = false;
- var $m_field_default = array( );
- var $u_relations = array( );
- function init() {
- chtmllist::init( );
- global $g;
- global $g_user;
- db::query( 'SELECT * FROM const_relation' );
- while ($rel = db::fetch_row( )) {
- $this->u_relations[$rel['id']] = $rel['title'];
- }
- $this->m_sql_count = 'SELECT COUNT(u.user_id) FROM user AS u ' . $this->m_sql_from_add . '';
- $this->m_sql = '
- SELECT u.*, YEAR(FROM_DAYS(TO_DAYS(\'' . date( 'Y-m-d H:i:s' ) . '\')-TO_DAYS(birth))) AS age,
- u.state AS state_title, u.country AS country_title, u.city AS city_title,
- IF(u.city_id=' . $g_user['city_id'] . ', 1, 0) +
- IF(u.state_id=' . $g_user['state_id'] . ', 1, 0) +
- IF(u.country_id=' . $g_user['country_id'] . ', 1, 0) AS near
- FROM user AS u
- ' . $this->m_sql_from_add . '
- ';
- $this->m_field['user_id'] = array( 'user_id', null );
- $this->m_field['photo_id'] = array( 'photo', null );
- $this->m_field['name'] = array( 'name', null );
- $this->m_field['age'] = array( 'age', null );
- $this->m_field['relation'] = array( 'relation', null );
- $this->m_field['last_visit'] = array( 'last_visit', null );
- $this->m_field['city_title'] = array( 'city', null );
- $this->m_field['state_title'] = array( 'state', null );
- $this->m_field['country_title'] = array( 'country', null );
- $this->m_field['rating'] = array( 'rating', null, 'desc' );
- $this->m_field_default = $this->m_field;
- }
- function onitem($html, $row, $i, $last) {
- global $g;
- global $l;
- global $g_user;
- if ($l['all']['blank'] == '') {
- $l['all']['blank'] = ' ';
- }
- if (isset( $this->m_field_default )) {
- $this->m_field = $this->m_field_default;
- }
- if ($row['user_id'] == $g_user['user_id']) {
- $this->m_is_me = true;
- }
- if ($row['user_id'] == '') {
- $row['photo_id'] = '';
- $this->m_field['name'][1] = (isset( $l['all'][to_php_alfabet( 'User not exists' )] ) ? $l['all'][to_php_alfabet( 'User not exists' )] : 'User not exists');
- $row['name'] = (isset( $l['all'][to_php_alfabet( 'User not exists' )] ) ? $l['all'][to_php_alfabet( 'User not exists' )] : 'User not exists');
- }
- $row['last_visit'] = time_mysql_dt2u( $row['last_visit'] );
- if (( time( ) - $row['last_visit'] ) / 60 < $g['options']['online_time']) {
- $this->m_field['last_visit'][1] = $l['all']['online_now'];
- } else {
- $this->m_field['last_visit'][1] = date( 'd-m-y', $row['last_visit'] );
- }
- if (( $row['user_id'] != '' && !isset( $row['photo_id'] ) )) {
- $row['photo_id'] = db::result( 'SELECT photo_id FROM photo WHERE user_id=' . $row['user_id'] . ' ' . $g['sql']['photo_vis'] . ' ORDER BY photo_id LIMIT 1', 0, 2 );
- }
- if (( $row['photo_id'] != '' && file_exists( $g['path']['dir_files'] . 'photo/' . $row['user_id'] . '_' . $row['photo_id'] . '_s.jpg' ) )) {
- $this->m_field['photo_id'][1] = 'photo/' . $row['user_id'] . '_' . $row['photo_id'] . '_s.jpg';
- } else {
- if (!isset( $row['gender'] )) {
- $this->m_field['photo_id'][1] = 'nophoto_s.jpg';
- } else {
- $this->m_field['photo_id'][1] = 'nophoto_' . $row['gender'] . '_s.jpg';
- }
- }
- $this->m_field['city_title'][1] = ($row['city'] != '' ? (isset( $l['all'][to_php_alfabet( $row['city'] )] ) ? $l['all'][to_php_alfabet( $row['city'] )] : $row['city']) : $l['all']['blank']);
- $this->m_field['state_title'][1] = ($row['state'] != '' ? (isset( $l['all'][to_php_alfabet( $row['state'] )] ) ? $l['all'][to_php_alfabet( $row['state'] )] : $row['state']) : $l['all']['blank']);
- $this->m_field['country_title'][1] = ($row['country'] != '' ? (isset( $l['all'][to_php_alfabet( $row['country'] )] ) ? $l['all'][to_php_alfabet( $row['country'] )] : $row['country']) : $l['all']['blank']);
- $this->m_field['city_title'][1] = (( $this->m_field['city_title'][1] == '' || $this->m_field['city_title'][1] == '0' ) ? ' ' : $this->m_field['city_title'][1]);
- $this->m_field['state_title'][1] = (( $this->m_field['state_title'][1] == '' || $this->m_field['state_title'][1] == '0' ) ? ' ' : $this->m_field['state_title'][1]);
- $this->m_field['country_title'][1] = (( $this->m_field['country_title'][1] == '' || $this->m_field['country_title'][1] == '0' ) ? ' ' : $this->m_field['country_title'][1]);
- $html->setvar( 'country', $this->m_field['country_title'][1] );
- $html->setvar( 'state', $this->m_field['state_title'][1] );
- $html->setvar( 'city', $this->m_field['city_title'][1] );
- db::query( 'SELECT * FROM const_orientation WHERE id=' . to_sql( (isset( $row['orientation'] ) ? $row['orientation'] : 0), 'Number' ) . '', 2 );
- $orientation_row = db::fetch_row( 2 );
- if (( ( $orientation_row['free'] != 'none' && $orientation_row['free'] != '' ) && $orientation_row['free'] != 'N' )) {
- $row['type'] = $orientation_row['free'];
- $row['gold_days'] = 1;
- } else {
- if ($orientation_row['free'] == 'Y') {
- $row['type'] = 'platinum';
- $row['gold_days'] = 1;
- }
- }
- if (!isset( $row['type'] )) {
- $row['type'] = 'platinum';
- }
- $html->setvar( 'user_id', $row['user_id'] );
- $html->setvar( 'name', $row['name'] );
- $html->setvar( 'age', $row['age'] );
- $orientation = $orientation_row['title'];
- $l['all'][to_php_alfabet( $orientation )];
- $html->setvar( 'orientation', (isset( $l['all'][to_php_alfabet( $orientation )] ) ? $l['all'][to_php_alfabet( $orientation )] : $orientation) );
- $this->m_field['relation'][1] = (isset( $this->u_relations[$row['relation']] ) ? (isset( $l['all'][to_php_alfabet( $this->u_relations[$row['relation']] )] ) ? $l['all'][to_php_alfabet( $this->u_relations[$row['relation']] )] : $this->u_relations[$row['relation']]) : $l['all']['blank']);
- if ($this->m_field['relation'][1] == '') {
- $this->m_field['relation'][1] = $l['all']['blank'];
- }
- if (( ( ( !$this->m_is_me && 0 < $g_user['user_id'] ) && ( time( ) - $row['last_visit'] ) / 60 < $g['options']['online_time'] ) && ( payment_check_return( 'im' ) && payment_check_return( 'im', $row['type'], $row['gold_days'] ) ) )) {
- $html->parse( 'im', false );
- $html->setblockvar( 'im_off', '' );
- } else {
- $html->parse( 'im_off', false );
- $html->setblockvar( 'im', '' );
- }
- if (( 0 < $row['gold_days'] && $row['type'] != 'none' )) {
- $html->parse( 'gold', false );
- .............................................................................................
- ................................................
- .......................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement