Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function IndexPage( )
- {
- global $smarty;
- global $config;
- global $dbconn;
- global $user;
- global $lang;
- global $multi_lang;
- global $REFERENCES;
- global $pilot_theme;
- if ( isset( $_SERVER['PHP_SELF'] ) )
- {
- $file_name = strtolower( afterlastslash( $_SERVER['PHP_SELF'] ) );
- }
- else
- {
- $file_name = "index.php";
- }
- indexhomepage( "index" );
- createmenu( "index_page_menu" );
- createmenu( "index_user_menu" );
- createmenu( "lang_menu" );
- createmenu( "bottom_menu" );
- sendindexcontent( );
- if ( isset( $_REQUEST['back'], $_SESSION['quick_search_pars'] ) )
- {
- $data = $_SESSION['quick_search_pars'];
- $used_references = array( "realty_type", "description" );
- foreach ( $REFERENCES as $arr )
- {
- if ( in_array( $arr['key'], $used_references ) )
- {
- $$key = $multi_lang->TableKey( $arr['spr_table'] );
- if ( !empty( $data[$arr['key']] ) )
- {
- $data[$$key] = getbackdata( $data[$arr['key']] );
- }
- }
- }
- $used_references = array( "realty_type", "description" );
- foreach ( $REFERENCES as $arr )
- {
- if ( in_array( $arr['key'], $used_references ) )
- {
- $smarty->assign( $arr['key'], getrefsearcharray( $arr['spr_table'], $arr['val_table'], $data ) );
- }
- }
- $search_pref = $data;
- getlocationcontent( $data['country'], $data['region'], 1 );
- $smarty->assign( "search_pref", $search_pref );
- }
- else
- {
- getlocationcontent( "", "", 1 );
- $used_references = array( "realty_type", "description" );
- foreach ( $REFERENCES as $arr )
- {
- if ( in_array( $arr['key'], $used_references ) )
- {
- $smarty->assign( $arr['key'], getrefsearcharray( $arr['spr_table'], $arr['val_table'], "" ) );
- }
- }
- $data['qsform_more_opt'] = 1;
- }
- $day = isset( $search_pref['move_day'] ) && $search_pref['move_day'] ? $search_pref['move_day'] : date( "d" ) + 1;
- $month = isset( $search_pref['move_month'] ) && $search_pref['move_month'] ? $search_pref['move_month'] : date( "m" );
- $smarty->assign( "day", getdayselect( $day ) );
- $smarty->assign( "month", getmonthselect( $month ) );
- $smarty->assign( "use_search_by_id", getsitesettings( "use_search_by_id" ) );
- $smarty->assign( "use_new_location_search", getsitesettings( "use_new_location_search" ) );
- unset( $_SESSION['quick_search_pars'] );
- unset( $_SESSION['quick_search_arr'] );
- $area_parametres = getorderads( "index", 0 );
- $smarty->assign( "last_ads", 1 );
- if ( $area_parametres['show_type'] != "off" )
- {
- getlastads( "last_ads_num_at_page", 1, "?", $area_parametres['sorter'], $area_parametres['sorter_order'], "", $area_parametres['show_type'], $area_parametres['ads_number'], $file_name );
- }
- $_obfuscate_1DvGWVEU6i_ZgGFlc8kIf9Iuy15DFAÿÿ = getsitesettings( array( "use_radius_search", "radius_search_unit", "radius_search_length" ) );
- $_obfuscate_1DvGWVEU6i_ZgGFlc8kIf9Iuy15DFAÿÿ['radius_search_lengths'] = explode( ",", $_obfuscate_1DvGWVEU6i_ZgGFlc8kIf9Iuy15DFAÿÿ['radius_search_length'] );
- asort( &$_obfuscate_1DvGWVEU6i_ZgGFlc8kIf9Iuy15DFAÿÿ['radius_search_lengths'] );
- $smarty->assign( "radius_search_settings", $_obfuscate_1DvGWVEU6i_ZgGFlc8kIf9Iuy15DFAÿÿ );
- $smarty->assign( "data", $data );
- $smarty->assign( "area_parametres", $area_parametres );
- $smarty->assign( "from_file", "index" );
- $smarty->assign( "file_name", $file_name );
- if ( isset( $_GET['index_preview'] ) && $_GET['index_preview'] == "1" )
- {
- $smarty->assign( "colors", $_GET['colors'] );
- }
- if ( getsitesettings( "use_foreign_listings" ) )
- {
- $smarty->assign( "use_foreign_listings", 1 );
- }
- if ( strpos( $config['index_theme_path'], "/default_theme" ) != 0 )
- {
- $smarty->assign( "is_default_theme", 1 );
- }
- else
- {
- $smarty->assign( "is_default_theme", 0 );
- }
- indexnews( );
- $smarty->display( trimslash( $config['index_theme_path'] ).( "/".$pilot_theme."_theme/index_home_page.tpl" ) );
- exit( );
- }
- function LogoutUser( )
- {
- global $smarty;
- global $config;
- global $dbconn;
- global $user;
- $_obfuscate_M2poO71n = "Delete from ".ACTIVE_SESSIONS_TABLE." where id_user='".$user[0]."' and session='".session_id( )."' ";
- $rs = $dbconn->Execute( $_obfuscate_M2poO71n );
- unset( $_SESSION['return_list'] );
- sess_delete( session_id( ) );
- if ( isset( $_GET['is_admin'] ) && $_GET['is_admin'] == "1" )
- {
- header( "Location: ".$config['server'].$config['site_root']."/admin" );
- }
- else
- {
- if ( isset( $_GET['site_mode_demo'] ) )
- {
- $_obfuscate_M2poO71n = "UPDATE ".SETTINGS_TABLE." SET value='".intval( $_GET['site_mode_demo'] )."' WHERE name='site_mode'";
- $rs = $dbconn->Execute( $_obfuscate_M2poO71n );
- }
- echo "<script>location.href='".$config['server'].$config['site_root']."/'</script>";
- }
- }
- function SendIndexContent( )
- {
- global $smarty;
- global $config;
- global $dbconn;
- global $user;
- global $lang_code;
- $_obfuscate_EpN1a6ctiykÿ = 0;
- $_obfuscate_YUmJXIi2PTElnUpfLAÿÿ = getsitesettings( "index_theme_path" );
- $_obfuscate_EpN1a6ctiykÿ = gettemplatenumber( );
- $_obfuscate_M2poO71n = "SELECT value FROM ".TEXT_FIELDS_TABLE.( " WHERE name = 'index_text_".$_obfuscate_EpN1a6ctiykÿ."' AND id_lang='{$lang_code}' " );
- $rs = $dbconn->Execute( $_obfuscate_M2poO71n );
- if ( $rs && 0 < $rs->RowCount( ) )
- {
- $row = $rs->GetRowAssoc( FALSE );
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['text'] = $row['value'];
- }
- $_obfuscate_9vPNa5OA35W3s41c = getlongsettings( "index_content_".$_obfuscate_EpN1a6ctiykÿ );
- $_obfuscate__WwKzYz1wAÿÿ = ( array )json_decode( $_obfuscate_9vPNa5OA35W3s41c );
- $_obfuscate_9vPNa5OA35W3s41c = array( );
- foreach ( $_obfuscate__WwKzYz1wAÿÿ as $$key => $_obfuscate_VgKtFegÿ )
- {
- $_obfuscate_9vPNa5OA35W3s41c[$$key] = ( array )$_obfuscate_VgKtFegÿ;
- }
- $_obfuscate__WwKzYz1wAÿÿ = $_obfuscate_9vPNa5OA35W3s41c;
- if ( isset( $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['t'] ) )
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['top'] = $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['t'];
- }
- else
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['top'] = 0;
- }
- if ( isset( $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['l'] ) )
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['left'] = $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['l'];
- }
- else
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['top'] = 0;
- }
- if ( isset( $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['i'] ) )
- {
- $_obfuscate_M2poO71n = "SELECT file_name, type, comments FROM ".UPLOADS_TABLE.( " WHERE id='".$_obfuscate__WwKzYz1wAÿÿ[$lang_code]['i']."' " );
- }
- $rs = $dbconn->Execute( $_obfuscate_M2poO71n );
- if ( isset( $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['i'] ) )
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['id'] = $_obfuscate__WwKzYz1wAÿÿ[$lang_code]['i'];
- }
- $_obfuscate_MNh1cC6M = array( );
- $_obfuscate_eqN8fuIoty5m7gÿÿ = getsitesettings( "index_image_".$_obfuscate_EpN1a6ctiykÿ );
- $_obfuscate_uuIq4x2Msxi_LBljJHkÿ = explode( "x", $_obfuscate_eqN8fuIoty5m7gÿÿ );
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['width'] = $_obfuscate_uuIq4x2Msxi_LBljJHkÿ[0];
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['height'] = $_obfuscate_uuIq4x2Msxi_LBljJHkÿ[1];
- if ( $rs && 0 < $rs->RowCount( ) )
- {
- $row = $rs->GetRowAssoc( FALSE );
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['file_name'] = $row['file_name'];
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['comments'] = $row['comments'];
- if ( strstr( $row['type'], "swf" ) )
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['type'] = "swf";
- }
- else if ( strstr( $row['type'], "image" ) )
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['type'] = "image";
- }
- else if ( strstr( $row['type'], "flv" ) )
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['type'] = "flv";
- }
- }
- else
- {
- $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ['file_name'] = "";
- }
- $_obfuscate_31N3jWpbOcMvbnNwlYÿ = getsitesettings( "thems_uploades" );
- $smarty->assign( "thems_uploades", $_obfuscate_31N3jWpbOcMvbnNwlYÿ );
- $smarty->assign( "index_content", $_obfuscate_7u1xl1Rp2lHiCU1IVwÿÿ );
- return TRUE;
- }
- function IndexNews( )
- {
- global $smarty;
- global $dbconn;
- global $config;
- $_obfuscate_M2poO71n = " SELECT COUNT(*) FROM ".NEWS_TABLE.( " WHERE status='1' AND language_id='".$config['default_lang']."'" );
- $rs = $dbconn->Execute( $_obfuscate_M2poO71n );
- $_obfuscate_rJxwk7vn4KYsybYÿ = $rs->fields[0];
- $_obfuscate_VN4TB6834EeH = " limit 0, 3";
- if ( 0 < $_obfuscate_rJxwk7vn4KYsybYÿ )
- {
- $_obfuscate_M2poO71n = "\tSELECT DISTINCT id, DATE_FORMAT(date_add,'".$config['date_format']."') as date_add,\r\n\t\t\t\t\ttitle, news_link, id_channel, channel_link\r\n\t\t\t\t\tFROM ".NEWS_TABLE.( " WHERE status='1' AND language_id='".$config['default_lang']."'\r\n\t\t\t\t\tGROUP BY id ORDER BY date_ts desc, id_channel asc " ).$_obfuscate_VN4TB6834EeH;
- $rs = $dbconn->Execute( $_obfuscate_M2poO71n );
- if ( 0 < $rs->fields[0] )
- {
- $i = 0;
- while ( !$rs->EOF )
- {
- $row = $rs->GetRowAssoc( FALSE );
- $_obfuscate_PukCuwÿÿ[$i]['id'] = $row['id'];
- $_obfuscate_PukCuwÿÿ[$i]['date_add'] = $row['date_add'];
- $_obfuscate_PukCuwÿÿ[$i]['id_channel'] = $row['id_channel'];
- $_obfuscate_PukCuwÿÿ[$i]['title'] = stripslashes( unicon( $row['title'] ) );
- $_obfuscate_PukCuwÿÿ[$i]['news_link'] = $row['news_link'];
- $_obfuscate_PukCuwÿÿ[$i]['channel_link'] = $row['channel_link'];
- if ( $_obfuscate_PukCuwÿÿ[$i]['news_link'] == "" )
- {
- $_obfuscate_PukCuwÿÿ[$i]['news_link'] = $config['server'].$config['site_root']."/";
- $_obfuscate_PukCuwÿÿ[$i]['news_link'] .= $_obfuscate_PukCuwÿÿ[$i]['id_channel'] == 0 ? "{$file_name}?sel=read&news_id=".$_obfuscate_PukCuwÿÿ[$i]['id'] : "";
- }
- if ( $_obfuscate_PukCuwÿÿ[$i]['channel_link'] == "" )
- {
- $_obfuscate_PukCuwÿÿ[$i]['channel_link'] = $config['server'].$config['site_root']."/";
- }
- $rs->MoveNext( );
- ++$i;
- }
- }
- $smarty->assign( "news", $_obfuscate_PukCuwÿÿ );
- }
- }
- include( "./include/config.php" );
- include( "./common.php" );
- include( "./include/functions_index.php" );
- include( "./include/functions_auth.php" );
- include( "./include/functions_xml.php" );
- include( "./include/class.lang.php" );
- include( "./include/class.calendar_event.php" );
- include( "./include/functions_common.php" );
- crontab( );
- if ( isset( $_REQUEST['from_install'] ) && $_REQUEST['from_install'] == 1 )
- {
- include( "./include/class.news.php" );
- newsupdater( );
- header( "Location: ".$config['server'].$config['site_root']."/index.php" );
- }
- checkinstallfolder( );
- $user = auth_index_user( );
- $sel = isset( $_POST['sel'] ) ? $_POST['sel'] : isset( $_GET['sel'] ) ? $_GET['sel'] : "";
- if ( $sel != "logoff" )
- {
- if ( isset( $_COOKIE['re_login'], $_COOKIE['re_pass'] ) )
- {
- $strSQL = "SELECT id FROM ".USERS_TABLE." WHERE login='".addslashes( $_COOKIE['re_login'] )."' AND password='".addslashes( $_COOKIE['re_pass'] )."' ";
- $rs = $dbconn->Execute( $strSQL );
- if ( 0 < $rs->fields[0] )
- {
- sess_write( session_id( ), $rs->fields[0] );
- $user = auth_index_user( );
- }
- }
- }
- else
- {
- setcookie( "re_login", "", time( ) - 7200, $config['site_root']."/" );
- setcookie( "re_pass", "", time( ) - 7200, $config['site_root']."/" );
- }
- @$theme = $_POST['theme'] ? $_POST['theme'] : $_GET['theme'];
- if ( $theme )
- {
- switch ( $theme )
- {
- case "re0" :
- $templates = "re0_theme";
- break;
- case "re1" :
- $templates = "re1_theme";
- break;
- case "re2" :
- $templates = "re2_theme";
- break;
- case "re3" :
- $templates = "re3_theme";
- break;
- case "re4" :
- $templates = "re4_theme";
- break;
- $templates = "re0_theme";
- }
- $strSQL = "UPDATE ".SETTINGS_TABLE.( " SET value='/templates/".$templates."' WHERE name = 'theme_path'" );
- $rs = $dbconn->Execute( $strSQL );
- $strSQL = "UPDATE ".SETTINGS_TABLE.( " SET value='/".$templates."/css' WHERE name = 'index_theme_css_path'" );
- $rs = $dbconn->Execute( $strSQL );
- $strSQL = "UPDATE ".SETTINGS_TABLE.( " SET value='/".$templates."/images' WHERE name = 'index_theme_images_path'" );
- $rs = $dbconn->Execute( $strSQL );
- $smarty->assign( "pilot_theme", $theme );
- $redirect = str_replace( $config['server'].$config['site_root']."/", "", strip_tags( $_GET['redirect'] ) );
- if ( !$redirect )
- {
- $redirect = "index.php";
- }
- header( "Location: ".$config['server'].$config['site_root']."/".$redirect );
- }
- ( $config, $dbconn );
- $multi_lang = new MultiLang( );
- if ( ( $user[4] == 1 || isusermoderator( $user[0] ) ) && $sel != "logoff" && ( !isset( $_REQUEST['view_from_admin'] ) && !( $_REQUEST['view_from_admin'] == 1 ) ) )
- {
- echo "<script>location.href='".$config['server'].$config['site_root']."/admin/index.php'</script>";
- }
- else
- {
- if ( intval( $user[0] ) && $user[3] != 1 && $sel == "" && ( !isset( $_REQUEST['view_from_admin'] ) && !( $_REQUEST['view_from_admin'] == 1 ) ) )
- {
- if ( getsitesettings( "use_link_modifications" ) )
- {
- echo "<script>location.href='".$config['server'].$config['site_root']."/homepage/'</script>";
- }
- else
- {
- echo "<script>location.href='".$config['server'].$config['site_root']."/homepage.php'</script>";
- }
- }
- if ( $user[4] == 1 && isset( $_REQUEST['view_from_admin'] ) && $_REQUEST['view_from_admin'] == 1 && $_REQUEST['for_unreg_user'] == 1 )
- {
- $user = auth_guest_read( );
- }
- }
- switch ( $sel )
- {
- case "logoff" :
- logoutuser( );
- return 1;
- case "quick_form" :
- fromquick( );
- return 1;
- }
- indexpage( );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement