Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for eAccelerator & MMCache)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class cusers {
  15. var $m_on_page = 6;
  16. var $imessage = '';
  17. var $m_is_me = false;
  18. var $m_field_default = array( );
  19. var $u_relations = array( );
  20.  
  21. function init() {
  22. chtmllist::init( );
  23. global $g;
  24. global $g_user;
  25.  
  26. db::query( 'SELECT * FROM const_relation' );
  27.  
  28. while ($rel = db::fetch_row( )) {
  29. $this->u_relations[$rel['id']] = $rel['title'];
  30. }
  31.  
  32. $this->m_sql_count = 'SELECT COUNT(u.user_id) FROM user AS u ' . $this->m_sql_from_add . '';
  33. $this->m_sql = '
  34. SELECT u.*, YEAR(FROM_DAYS(TO_DAYS(\'' . date( 'Y-m-d H:i:s' ) . '\')-TO_DAYS(birth))) AS age,
  35. u.state AS state_title, u.country AS country_title, u.city AS city_title,
  36. IF(u.city_id=' . $g_user['city_id'] . ', 1, 0) +
  37. IF(u.state_id=' . $g_user['state_id'] . ', 1, 0) +
  38. IF(u.country_id=' . $g_user['country_id'] . ', 1, 0) AS near
  39. FROM user AS u
  40. ' . $this->m_sql_from_add . '
  41. ';
  42. $this->m_field['user_id'] = array( 'user_id', null );
  43. $this->m_field['photo_id'] = array( 'photo', null );
  44. $this->m_field['name'] = array( 'name', null );
  45. $this->m_field['age'] = array( 'age', null );
  46. $this->m_field['relation'] = array( 'relation', null );
  47. $this->m_field['last_visit'] = array( 'last_visit', null );
  48. $this->m_field['city_title'] = array( 'city', null );
  49. $this->m_field['state_title'] = array( 'state', null );
  50. $this->m_field['country_title'] = array( 'country', null );
  51. $this->m_field['rating'] = array( 'rating', null, 'desc' );
  52. $this->m_field_default = $this->m_field;
  53. }
  54.  
  55. function onitem($html, $row, $i, $last) {
  56. global $g;
  57. global $l;
  58. global $g_user;
  59.  
  60. if ($l['all']['blank'] == '') {
  61. $l['all']['blank'] = ' ';
  62. }
  63.  
  64. if (isset( $this->m_field_default )) {
  65. $this->m_field = $this->m_field_default;
  66. }
  67.  
  68.  
  69. if ($row['user_id'] == $g_user['user_id']) {
  70. $this->m_is_me = true;
  71. }
  72.  
  73.  
  74. if ($row['user_id'] == '') {
  75. $row['photo_id'] = '';
  76. $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');
  77. $row['name'] = (isset( $l['all'][to_php_alfabet( 'User not exists' )] ) ? $l['all'][to_php_alfabet( 'User not exists' )] : 'User not exists');
  78. }
  79.  
  80. $row['last_visit'] = time_mysql_dt2u( $row['last_visit'] );
  81.  
  82. if (( time( ) - $row['last_visit'] ) / 60 < $g['options']['online_time']) {
  83. $this->m_field['last_visit'][1] = $l['all']['online_now'];
  84. } else {
  85. $this->m_field['last_visit'][1] = date( 'd-m-y', $row['last_visit'] );
  86. }
  87.  
  88. if (( $row['user_id'] != '' && !isset( $row['photo_id'] ) )) {
  89. $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 );
  90. }
  91.  
  92.  
  93. if (( $row['photo_id'] != '' && file_exists( $g['path']['dir_files'] . 'photo/' . $row['user_id'] . '_' . $row['photo_id'] . '_s.jpg' ) )) {
  94. $this->m_field['photo_id'][1] = 'photo/' . $row['user_id'] . '_' . $row['photo_id'] . '_s.jpg';
  95. } else {
  96. if (!isset( $row['gender'] )) {
  97. $this->m_field['photo_id'][1] = 'nophoto_s.jpg';
  98. } else {
  99. $this->m_field['photo_id'][1] = 'nophoto_' . $row['gender'] . '_s.jpg';
  100. }
  101. }
  102.  
  103. $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']);
  104. $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']);
  105. $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']);
  106. $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]);
  107. $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]);
  108. $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]);
  109. $html->setvar( 'country', $this->m_field['country_title'][1] );
  110. $html->setvar( 'state', $this->m_field['state_title'][1] );
  111. $html->setvar( 'city', $this->m_field['city_title'][1] );
  112. db::query( 'SELECT * FROM const_orientation WHERE id=' . to_sql( (isset( $row['orientation'] ) ? $row['orientation'] : 0), 'Number' ) . '', 2 );
  113. $orientation_row = db::fetch_row( 2 );
  114.  
  115. if (( ( $orientation_row['free'] != 'none' && $orientation_row['free'] != '' ) && $orientation_row['free'] != 'N' )) {
  116. $row['type'] = $orientation_row['free'];
  117. $row['gold_days'] = 1;
  118. } else {
  119. if ($orientation_row['free'] == 'Y') {
  120. $row['type'] = 'platinum';
  121. $row['gold_days'] = 1;
  122. }
  123. }
  124.  
  125. if (!isset( $row['type'] )) {
  126. $row['type'] = 'platinum';
  127. }
  128.  
  129. $html->setvar( 'user_id', $row['user_id'] );
  130. $html->setvar( 'name', $row['name'] );
  131. $html->setvar( 'age', $row['age'] );
  132. $orientation = $orientation_row['title'];
  133. $l['all'][to_php_alfabet( $orientation )];
  134. $html->setvar( 'orientation', (isset( $l['all'][to_php_alfabet( $orientation )] ) ? $l['all'][to_php_alfabet( $orientation )] : $orientation) );
  135. $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']);
  136.  
  137. if ($this->m_field['relation'][1] == '') {
  138. $this->m_field['relation'][1] = $l['all']['blank'];
  139. }
  140.  
  141.  
  142. 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'] ) ) )) {
  143. $html->parse( 'im', false );
  144. $html->setblockvar( 'im_off', '' );
  145. } else {
  146. $html->parse( 'im_off', false );
  147. $html->setblockvar( 'im', '' );
  148. }
  149.  
  150.  
  151. if (( 0 < $row['gold_days'] && $row['type'] != 'none' )) {
  152. $html->parse( 'gold', false );
  153. .............................................................................................
  154. ................................................
  155. .......................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement