$smalixl_start_time_1st = microtime(true); function get_client_ip() { $ipaddress = ''; if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) && $_SERVER['HTTP_CLIENT_IP'] ) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && $_SERVER['HTTP_X_FORWARDED_FOR'] ) $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; else if( isset( $_SERVER['HTTP_X_FORWARDED'] ) && $_SERVER['HTTP_X_FORWARDED'] ) $ipaddress = $_SERVER['HTTP_X_FORWARDED']; else if( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) && $_SERVER['HTTP_FORWARDED_FOR'] ) $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; else if( isset( $_SERVER['HTTP_FORWARDED'] ) && $_SERVER['HTTP_FORWARDED'] ) $ipaddress = $_SERVER['HTTP_FORWARDED']; else if( isset( $_SERVER['REMOTE_ADDR'] ) && $_SERVER['REMOTE_ADDR'] ) $ipaddress = $_SERVER['REMOTE_ADDR']; else $ipaddress = '127.0.0.1'; return $ipaddress; } $_SERVER['REMOTE_ADDR'] = get_client_ip(); /* if ( !strlen( $_SERVER['REMOTE_ADDR'] ) || $_SERVER['REMOTE_ADDR'] = "127.0.0.1" ) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED']; } */ include ("smali_db_info.php"); include ("smali_config.php"); include ("smali_functions.php"); include ("smali_products.php"); $access_setting['out'] = 0; $access_setting['rank'] = 0; /* $smali['portguard_login'] = ""; $smali['portguard_logout'] = ""; $smali['portguard_message'] = ""; */ if (isset($_GET['out'])){ $access_setting['out'] = $_GET['out']; //$smali['portguard_message'] = $input_settings['portguard_login_msg_out']; } if ( isset( $input_settings['ip_referred'][$_SERVER['REMOTE_ADDR']] ) ) { header ( "Location: ".$input_settings['ip_referred'][$_SERVER['REMOTE_ADDR']] ); } if ( isset( $input_settings['ip_user_id'][$_SERVER['REMOTE_ADDR']] ) ) { $access_setting['ip_user_id'] = $input_settings['ip_user_id'][$_SERVER['REMOTE_ADDR']]; } if ( isset( $input_settings['ip_banned'][$_SERVER['REMOTE_ADDR']] ) ) { $access_setting['ip_banned'] = $input_settings['ip_banned'][$_SERVER['REMOTE_ADDR']]; } $session_variables = smali_access( $access_setting ); //echo "

\$session_variables['status'] = ".$session_variables['status']."

"; //echo "

\$session_variables['access'] = ".$session_variables['access']."

"; /* foreach ( $session_variables as $key => $val ) { echo "\$session_variables['".$key."'] = ".$val."
"; } */ if ( $session_variables['error'] && $session_variables['error'] < 3 && !isset ( $input_settings['ip_user_id'][$_SERVER['REMOTE_ADDR']] ) ) { if ( $session_variables['error'] == 4 ) { echo "SMALI 3 - Error: ".$session_variables['error'].":
\nUnable to save session id.
"; } else if ( $session_variables['error'] == 3 ) { echo "SMALI 3 - Error: ".$session_variables['error'].":
\nUnable to save session id.
"; } else if ( $session_variables['error'] == 2 ) { echo "SMALI 3 - Error: ".$session_variables['error'].":
\nUnable to connect to ".$system_settings['database']." (database) at ".$system_settings['db_host']." (server).
"; } else { echo "SMALI 3 - Error: ".$session_variables['error'].":
\nUnable to connect to ".$system_settings['db_host']." (server).
"; } } else { // F鰎um h閞na ?gegnum URL-i?og p鰏sum a?ekkert birtist tvisvar, og bara ?seinna nota? $_SERVER['QUERY_STRING'] = ""; foreach ( $_GET AS $key => $val ) { //echo "\$_GET['".$key."'] = \n".$val."\n
"; $_SERVER['QUERY_STRING'] .= $key."=".$val."&"; } $_SERVER['QUERY_STRING'] = substr( $_SERVER['QUERY_STRING'], 0, ( strlen( $_SERVER['QUERY_STRING'] ) - 1 ) ); //echo "

\$_SERVER['QUERY_STRING']] = ".$_SERVER['QUERY_STRING']."

"; if ( isset( $_GET[$input_settings['var_ads_id_name']] ) && $_GET[$input_settings['var_ads_id_name']] ) { $ads_settings['clicked_id'] = $_GET[$input_settings['var_ads_id_name']]; smalixl_ads ($ads_settings); } $group_name[0] = ""; $group_info[0] = ""; $sql_query = "SELECT * FROM ".$db_table['system_groups']." WHERE id=".$input_settings['group_id']." AND stat='1' AND type='0' LIMIT 1"; //echo $sql_query."
"; $result = mysqli_query( $sql_connection, $sql_query); $stat = false; while ( $row = mysqli_fetch_array ($result) ) { $group_name[$row['id']] = cleanMe ( $row['group_name'], "HTMLStrip" ); $group_info[$row['id']] = $row['group_info']; $stat = true; } mysqli_free_result ($result); if ($stat) { $smali['frontpage'] = false; $web_settings_array = webpage_settings( $group_info[$input_settings['group_id']]); if ( !isset ( $_GET[$input_settings['var_id_name']] ) ) { $_GET[$input_settings['var_id_name']] = $web_settings_array['default-path']; } if ( $_GET[$input_settings['var_id_name']] == $web_settings_array['default-path'] ) { $smali['frontpage'] = true; } $smali['menu'] = ""; $smali['menu_quick'] = ""; $smali['menu_top'] = ""; $smali['menu_top_sub'] = ""; $smali['menu_sub'] = ""; $smali['menu_body'] = ""; $smali['menu_mobile'] = ""; $smali['menu_list'] = ""; if ( $session_variables['rank'] == 3 ) { $sql_query = "SELECT id, mother_id, menu_status, window, valid_from, valid_to, header_title, url FROM ".$db_table['webs']." WHERE group_id=".$input_settings['group_id']." ORDER BY ordering"; } else { if ( $session_variables['user_id'] ) { $sql_query = "SELECT COUNT(".$db_table['system_access'].".id) "; $sql_query .= "FROM ".$db_table['system_access']." "; $sql_query .= "WHERE ".$input_settings['group_id']."=".$db_table['system_access'].".sgroup_id "; $sql_query .= "AND 0=".$db_table['system_access'].".unit_id "; $sql_group_search = ""; foreach ( $session_variables['groups'] as $group_id => $group_rank ) { if ( $group_rank == 2 ) { $sql_group_search .= "".$db_table['system_access'].".ugroup_id='".$group_id."' OR "; } } if ( strlen ( $sql_group_search ) ) { $sql_group_search = substr($sql_group_search, 0, strlen($sql_group_search) - 3 ); $sql_group_search = "AND ( ".$sql_group_search ." )"; } $sql_query .= $sql_group_search; $result = mysqli_query( $sql_connection, $sql_query); $total = 0; foreach ( $result as $key => $val ) { //echo $key." => ".$val."
"; foreach ( $val as $key2 => $val2 ) { //echo $key2." => ".$val2."
"; $total = $val2; } } //$total = mysql_result($result, 0); } else { $total = 0; } if ( $total ) { $sql_query = "SELECT id, mother_id, menu_status, window, valid_from, valid_to, header_title, url, settings FROM ".$db_table['webs']." WHERE group_id=".$input_settings['group_id']." ORDER BY ordering"; } else { $sql_query = "SELECT ".$db_table['webs'].".id, ".$db_table['webs'].".mother_id, ".$db_table['webs'].".menu_status, ".$db_table['webs'].".window, ".$db_table['webs'].".valid_from, ".$db_table['webs'].".valid_to, ".$db_table['webs'].".header_title, ".$db_table['webs'].".url, ".$db_table['webs'].".settings "; $sql_query .= "FROM ".$db_table['webs'].", ".$db_table['system_access']." "; $sql_query .= "WHERE ".$db_table['webs'].".group_id=".$input_settings['group_id']." "; $sql_query .= "AND ".$db_table['webs'].".id=".$db_table['system_access'].".unit_id "; $sql_query .= "AND ".$input_settings['group_id']."=".$db_table['system_access'].".sgroup_id "; if ( $session_variables['user_id'] ) { $sql_query .= "AND ( ".$session_variables['user_id']."=".$db_table['system_access'].".user_id OR ( 0=".$db_table['system_access'].".user_id AND 0=".$db_table['system_access'].".ugroup_id )"; $sql_group_search = " "; foreach ( $session_variables['groups'] as $group_id => $group_rank ) { $sql_group_search .= " OR ".$db_table['system_access'].".ugroup_id='".$group_id."'"; } $sql_group_search .= " ) "; $sql_query .= $sql_group_search; } else { $sql_query .= "AND 0=".$db_table['system_access'].".ugroup_id AND 0=".$db_table['system_access'].".user_id "; } $sql_query .= "ORDER BY ".$db_table['webs'].".ordering"; } } $result = mysqli_query( $sql_connection, $sql_query); $pages = false; $inherit = false; while ($row = mysqli_fetch_array ($result)) { $inherit[$row['id']] = $row['mother_id']; $pages[$row['id']]['mother_id'] = $row['mother_id']; $pages[$row['id']]['menu_status'] = $row['menu_status']; $pages[$row['id']]['window'] = $row['window']; $pages[$row['id']]['valid_from'] = $row['valid_from']; $pages[$row['id']]['valid_to'] = $row['valid_to']; $pages[$row['id']]['header_title'] = cleanMe ( $row['header_title'], "HTMLStrip" ); $pages[$row['id']]['url'] = $row['url']; $pages[$row['id']]['settings'] = webpage_settings( $row['settings'] ); } mysqli_free_result ($result); $smali['pages'] = $pages; $smali['menu_ids'] = $expand = webtree_expand ( $inherit, $_GET[$input_settings['var_id_name']] ); $smali['header_title'] = ""; $smali['mother_id'] = 0; $smali['menu_status'] = 0; $smali['header_description'] = ""; $smali['href'] = ""; $smali['id'] = ""; $smali['mother_id'] = ""; $smali['ordering'] = ""; $smali['user_id'] = ""; $smali['menu_status'] = ""; $smali['window'] = ""; $smali['valid_from'] = ""; $smali['valid_to'] = ""; $smali['counter'] = ""; $smali['counter_screen'] = ""; $smali['time_created'] = ""; $smali['time_changed'] = ""; $smali['header_title'] = ""; $smali['header_keywords'] = ""; $smali['header_description'] = ""; $smali['header_extra'] = ""; $smali['url'] = ""; $smali['body'] = ""; $smali['trigger'] = ""; $smali['settings'] = ""; $smali['articles'] = ""; $smali['articles_view'] = ""; $smali['articles_javascript'] = ""; $smali['images_javascript'] = ""; $smali['products'] = ""; $smali['products_basket'] = ""; $smali['products_javascript'] = ""; $smali['login'] = ""; $smali['login_edit'] = ""; $smali['quotation'] = ""; $sql_query = "SELECT * FROM ".$db_table['webs']." WHERE id=".$_GET[$input_settings['var_id_name']]." AND group_id=".$input_settings['group_id']." LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { $smali['id'] = $row['id']; $smali['mother_id'] = $row['mother_id']; $smali['ordering'] = $row['ordering']; $smali['window'] = $row['window']; $smali['valid_from'] = $row['valid_from']; $smali['valid_to'] = $row['valid_to']; $smali['time_created'] = $row['time_created']; $smali['time_changed'] = $row['time_changed']; $smali['header_title'] = cleanMe ( $row['header_title'], "HTMLStrip", "no"); $smali['header_keywords'] = cleanMe ( $row['header_keywords'], "HTMLStrip", "no"); $smali['header_description'] = cleanMe ( $row['header_description'], "HTMLStrip", "no"); $smali['header_extra'] = cleanMe ( $row['header_extra'], "HTML" ); $smali['url'] = cleanMe ( $row['url'], "URL"); $smali['body'] = cleanMe ( $row['body'], "HTML" ); $smali['trigger'] = cleanMe ( $row['trigger'], "URL"); $webpage_settings = $row['settings']; } mysqli_free_result ($result); if ( isset($pages[$smali['id']]) && $smali['id'] && !$smali['valid_from'] || ( $smali['valid_from'] <= date("YmdHi") && date("YmdHi") <= $smali['valid_to'] ) ) { $webpage_settings_array = webpage_settings($webpage_settings); if ( isset($webpage_settings_array['config-file']) && $webpage_settings_array['config-file'] ) { $former_group_id = $input_settings['group_id']; @include ($system_settings['default_files'].$webpage_settings_array['config-file']); $input_settings['group_id'] = $former_group_id; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //echo "

\$webpage_settings_array['login'] = ".$webpage_settings_array['login']."

"; if ( $webpage_settings_array['login'] == 1 ) { if ( $session_variables['access'] ) { if ( $session_variables['status'] == 1 ) { $smali['login'] = $input_settings['pr_login_msg_success']; // H閞na uppf鎟um vi?verslunart鰂luna ef h鷑 er til sta餫r... if ( isset( $db_table['product_transaction'] ) ) { $sql_query_update = "UPDATE `".$db_table['product_transaction']."` SET ".$db_table['product_transaction'].".`user_id`=".$session_variables['user_id']." WHERE "; $sql_query_update .= " ".$db_table['product_transaction'].".`session_id`='".$session_variables['session']."' "; $sql_query_update .= " AND ".$db_table['product_transaction'].".`ip_address`='".$session_variables['ip']."' "; $sql_query_update .= " AND ".$db_table['product_transaction'].".`user_id`=0 "; //echo "

".$sql_query_update."

"; $result = mysqli_query( $sql_connection, $sql_query_update ); } } $smali['login'] .= $input_settings['pr_logout'][0]; if ( strlen( $input_settings['pr_logout_force_path'] ) ) { $smali['login'] .= "".$input_settings['pr_logout'][1].""; } else { $smali['login'] .= "".$input_settings['pr_logout'][1].""; } $smali['login'] .= $input_settings['pr_logout'][2]; } else { $smali['login'] .= $input_settings['pr_login_log_text_top']; $pr_un_error = 0; ////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////// // H閞na b鷘m vi?til n齮t lykilor?og sendum ?til notandans if ( isset( $_GET['np'] ) && isset( $_POST['pr_un_send'] ) ) { $_POST['pr_un'] = cleanMe( $_POST['pr_un'] , "HTMLStrip" ); $pr_un_error = errorCheck ( $_POST['pr_un'], "email" ); if ( $this_error ) { $smali['login'] .= $input_settings['pr_login_np_msg_error_1']; $_GET['np'] = 3; } else { // Athugum hvort ?er til $pr_un_user_id = 0; $sql_query = "SELECT * FROM ".$db_table['users']." WHERE username='".$_POST['pr_un']."' LIMIT 1"; $sql_result = mysqli_query( $sql_connection, $sql_query); while ($row = mysqli_fetch_array ($sql_result)) { $pr_un_user_id = $row['id']; } mysqli_free_result ($sql_result); if ( $pr_un_user_id ) { $new_password = substr ( md5 ( rand ( ) ), 0, 8 ); $sql_query = "UPDATE ".$db_table['users']." SET ".$db_table['users'].".`pw`=PASSWORD('".$new_password."') WHERE ".$db_table['users'].".`id`='".$pr_un_user_id."' LIMIT 1"; //echo "\$sql_query = ".$sql_query."
"; if ( mysqli_query( $sql_connection, $sql_query ) ) { $pr_un_mail_from = $input_settings['pr_login_np_email_from']; $mail_subject = $input_settings['pr_login_np_email_subject']; $mail_body = $input_settings['pr_login_np_email_body_1']; $mail_body .= $new_password; $mail_body .= $input_settings['pr_login_np_email_body_2']; if ( isset( $system_settings['smtp_host'] ) && strlen( $system_settings['smtp_host'] ) ) { // Notum SMTP-a餱er餴na vi?a?tengjast smtp_mailer( $_POST['pr_un'], $_POST['pr_un'], $mail_subject, $mail_body, $mail_body, $pr_un_mail_from, $pr_un_mail_from ); } else { @mail ( $_POST['pr_un'], $mail_subject, $mail_body, "From: ".$pr_un_mail_from ); } $smali['login'] .= $input_settings['pr_login_np_msg_success']; $_GET['np'] = 0; log_use( $_POST['pr_un'].$input_settings['pr_login_newpass_log'], $pr_un_user_id ); } } else { $smali['login'] .= $input_settings['pr_login_np_msg_error_2']; $_GET['np'] = 3; } } } if ( isset( $_GET['np'] ) && $_GET['np'] ) { // Ef tta er ?fyrsta sinn e餫 gar ?kemur villa if ( $_GET['np'] < 3 ) { $smali['login'] .= $input_settings['pr_login_np_msg_out']; // 辝tta kemur alltaf fyrir ofan } $smali['login'] .= $input_settings['pr_login_np'][0]; $smali['login'] .= "
"; $smali['login'] .= $input_settings['pr_login_np'][1]; $smali['login'] .= ""; $smali['login'] .= ""; $smali['login'] .= $input_settings['pr_login_np'][2]; if ( isset( $input_settings['pr_login_np_button'] ) && strlen( $input_settings['pr_login_np_button'] ) ) { $smali['login'] .= $input_settings['pr_login_np_button']; } else { $smali['login'] .= ""; } $smali['login'] .= $input_settings['pr_login_np'][3]; $smali['login'] .= "
"; $smali['login'] .= $input_settings['pr_login_np'][4]; $smali['login'] .= ""; } else { $_SERVER['QUERY_STRING'] = str_replace( "&out=1", "", $_SERVER['QUERY_STRING'] ); $_SERVER['QUERY_STRING'] = str_replace( "out=1", "", $_SERVER['QUERY_STRING'] ); $_SERVER['QUERY_STRING'] = str_replace( "&np=1", "", $_SERVER['QUERY_STRING'] ); $_SERVER['QUERY_STRING'] = str_replace( "np=1", "", $_SERVER['QUERY_STRING'] ); $_SERVER['QUERY_STRING'] = str_replace( "&np=2", "", $_SERVER['QUERY_STRING'] ); $_SERVER['QUERY_STRING'] = str_replace( "np=2", "", $_SERVER['QUERY_STRING'] ); if ( strlen( $_SERVER['QUERY_STRING'] ) < 2 ) { $_SERVER['QUERY_STRING'] = ""; } if ( !isset( $_POST['pr_un'] ) ) { $_POST['pr_un'] .= $input_settings['pr_login_username_default']; } if ( $session_variables['status'] == 3 ) { $smali['login'] .= $input_settings['pr_login_msg_out']; } else if ( $session_variables['status'] == 2 ) { $smali['login'] .= $input_settings['pr_login_msg_error']; } else { $smali['login'] .= $input_settings['pr_login_log_text_in']; } $smali['login'] .= $input_settings['pr_login'][0]; $smali['login'] .= "
"; $smali['login'] .= $input_settings['pr_login'][1]; $smali['login'] .= ""; $smali['login'] .= ""; $smali['login'] .= ""; $smali['login'] .= $input_settings['pr_login'][2]; $smali['login'] .= ""; $smali['login'] .= $input_settings['pr_login'][3]; if ( isset( $input_settings['pr_login_button'] ) && strlen( $input_settings['pr_login_button'] ) ) { $smali['login'] .= $input_settings['pr_login_button']; } else { $smali['login'] .= ""; } $smali['login'] .= $input_settings['pr_login'][4]; $smali['login'] .= "
"; $smali['login'] .= $input_settings['pr_login'][5]; $smali['login'] .= ""; if ( isset( $webpage_settings_array['login-forgot-password'] ) && $webpage_settings_array['login-forgot-password'] == 1 ) { $smali['login'] .= $input_settings['pr_login_newpass'][0]; $smali['login'] .= "".$input_settings['pr_login_newpass'][1].""; $smali['login'] .= $input_settings['pr_login_newpass'][2]; } } } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ( isset( $webpage_settings_array['login-new'] ) && $webpage_settings_array['login-new'] == 1 ) { $login_edit_settings['login_new_confirmation'] = $webpage_settings_array['login-new-confirmation']; $login_edit_settings['login_new_username_force'] = $webpage_settings_array['login-new-username-force']; $login_edit_settings['new_login_target_id'] = $webpage_settings_array['new-login-target-id']; $login_edit_settings['login_new_users_groups'] = $webpage_settings_array['login-new-users-groups']; $login_edit_settings['new_login_terms_target_id'] = $webpage_settings_array['new-login-terms-target-id']; $login_edit_settings['login_new_box_render'][0] = $webpage_settings_array['login-new-box-render0']; $login_edit_settings['login_new_box_render'][1] = $webpage_settings_array['login-new-box-render1']; $login_edit_settings['login_new_box_render'][2] = $webpage_settings_array['login-new-box-render2']; $login_edit_settings['login_new_box_render'][3] = $webpage_settings_array['login-new-box-render3']; $login_edit_settings['login_new_box_render'][4] = $webpage_settings_array['login-new-box-render4']; $login_edit_settings['login_new_box_render'][5] = $webpage_settings_array['login-new-box-render5']; $login_edit_settings['login_new_box_render'][6] = $webpage_settings_array['login-new-box-render6']; $login_edit_settings['login_new_box_render'][7] = $webpage_settings_array['login-new-box-render7']; $login_edit_settings['login_new_box_render'][8] = $webpage_settings_array['login-new-box-render8']; $login_edit_settings['login_new_box_render'][9] = $webpage_settings_array['login-new-box-render9']; $login_edit_settings['login_new_confirmation'] = $webpage_settings_array['login-new-confirmation']; $login_edit_settings['login_new_captcha'] = $webpage_settings_array['login-new-captcha']; $login_edit_settings['login_new_password'] = $webpage_settings_array['login-new-password']; $login_edit_settings['login_new_box_render_country'] = $webpage_settings_array['login-new-box-render-country']; $login_edit_settings['login_new_box_render_postcode'] = $webpage_settings_array['login-new-box-render-postcode']; $login_edit_settings['login_new_box_render_age'] = $webpage_settings_array['login-new-box-render-age']; $login_edit_settings['login_new_box_render_age_year'] = $webpage_settings_array['login-new-box-render-age-year']; $login_edit_settings['tok_number'] = $input_settings['tok_number']; $login_edit_settings['admin_email'] = $input_settings['admin_email']; $login_edit_settings['admin_email_name'] = $input_settings['admin_email_name']; $login_edit_settings['email_subject_admin'] = $input_settings['email_subject_admin']; $login_edit_settings['email_subject_password'] = $input_settings['email_subject_password']; $login_edit_settings['email_subject_confirm'] = $input_settings['email_subject_confirm']; $login_edit_settings['email_body_admin'] = $input_settings['email_body_admin']; $login_edit_settings['email_body_admin1'] = $input_settings['email_body_admin1']; $login_edit_settings['email_body_admin2'] = $input_settings['email_body_admin2']; $login_edit_settings['email_body_confirm'] = $input_settings['email_body_confirm']; $login_edit_settings['email_body_password'] = $input_settings['email_body_password']; $login_edit_settings['email_body_footer'] = $input_settings['email_body_footer']; $login_edit_settings['email_body_footer'] = $input_settings['email_body_footer']; $login_edit_settings['text_no_user_group'] = $input_settings['text_no_user_group']; $login_edit_settings['text_new_headline'] = $input_settings['text_new_headline']; $login_edit_settings['text_edit_headline'] = $input_settings['text_edit_headline']; $login_edit_settings['text_edit'] = $input_settings['text_edit']; $login_edit_settings['text_new'] = $input_settings['text_new']; $login_edit_settings['text_success'] = $input_settings['text_success']; $login_edit_settings['text_success_2'] = $input_settings['text_success_2']; $login_edit_settings['text_success_1'] = $input_settings['text_success_1']; $login_edit_settings['text_success_0'] = $input_settings['text_success_0']; $login_edit_settings['text_success_0_password_email'] = $input_settings['text_success_0_password_email']; $login_edit_settings['text_log_success'] = $input_settings['text_log_success']; $login_edit_settings['text_edit_success'] = $input_settings['text_edit_success']; $login_edit_settings['text_edit_log_success'] = $input_settings['text_edit_log_success']; $login_edit_settings['text_captcha_error'] = $input_settings['text_captcha_error']; $login_edit_settings['text_username_in_use'] = $input_settings['text_username_in_use']; $login_edit_settings['text_boxes_error'] = $input_settings['text_boxes_error']; $login_edit_settings['text_database_error'] = $input_settings['text_database_error']; $login_edit_settings['text_critical_error'] = $input_settings['text_critical_error']; $login_edit_settings['text_password_javascript_alert'] = $input_settings['text_password_javascript_alert']; $login_edit_settings['text_label_username_2'] = $input_settings['text_label_username_2']; $login_edit_settings['text_label_username_1'] = $input_settings['text_label_username_1']; $login_edit_settings['text_label_username_0'] = $input_settings['text_label_username_0']; $login_edit_settings['text_label_password_0'] = $input_settings['text_label_password_0']; $login_edit_settings['text_label_password_1'] = $input_settings['text_label_password_1']; $login_edit_settings['text_label_password_2'] = $input_settings['text_label_password_2']; $login_edit_settings['text_label_password_3'] = $input_settings['text_label_password_3']; $login_edit_settings['text_label_password_4'] = $input_settings['text_label_password_4']; $login_edit_settings['text_label_name'] = $input_settings['text_label_name']; $login_edit_settings['text_label_social_id'] = $input_settings['text_label_social_id']; $login_edit_settings['text_label_comnpany'] = $input_settings['text_label_comnpany']; $login_edit_settings['text_label_address'] = $input_settings['text_label_address']; $login_edit_settings['text_label_postcode_0'] = $input_settings['text_label_postcode_0']; $login_edit_settings['text_label_postcode_1'] = $input_settings['text_label_postcode_1']; $login_edit_settings['text_label_postcode_3'] = $input_settings['text_label_postcode_3']; $login_edit_settings['text_label_country'] = $input_settings['text_label_country']; $login_edit_settings['text_label_phone'] = $input_settings['text_label_phone']; $login_edit_settings['text_label_fax'] = $input_settings['text_label_fax']; $login_edit_settings['text_label_email'] = $input_settings['text_label_email']; $login_edit_settings['text_label_website'] = $input_settings['text_label_website']; $login_edit_settings['text_label_terms_0'] = $input_settings['text_label_terms_0']; $login_edit_settings['text_label_terms_1'] = $input_settings['text_label_terms_1']; $login_edit_settings['text_label_terms_2'] = $input_settings['text_label_terms_2']; $login_edit_settings['text_label_captcha_0'] = $input_settings['text_label_captcha_0']; $login_edit_settings['text_label_captcha_1'] = $input_settings['text_label_captcha_1']; $login_edit_settings['text_button_reset'] = $input_settings['text_button_reset']; $login_edit_settings['text_button_save'] = $input_settings['text_button_save']; $smali['login_edit'] = smalixl_login_edit( $login_edit_settings ); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $discussions_connection_group_type = 0; $smali_first_visit_id = 0; if ( isset($input_settings['ip_skip_counter'][$_SERVER['REMOTE_ADDR']]) ){ $counter_settings['ip_skip_counter'] = $input_settings['ip_skip_counter'][$_SERVER['REMOTE_ADDR']]; } if ( isset( $input_settings['accepted_language'] ) && isset( $input_settings['language_refer'] ) ) { $counter_settings['accepted_language'] = $input_settings['accepted_language']; $counter_settings['language_refer'] = $input_settings['language_refer']; } $counter_settings['group_id'] = $web_settings_array['counter-id']; $counter_settings['page_id'] = $_GET[$input_settings['var_id_name']]; $counter_settings['cookie_language_name'] = $input_settings['cookie_language_name']; $counter_settings = counter( $counter_settings ); if ( strlen($smali['url']) ) { header("Location: ".$smali['url']); } if ( isset( $webpage_settings_array['sub'] ) ) { if ( substr_count ($webpage_settings_array['sub'], "]") ) { $subs_expl = explode("]", $webpage_settings_array['sub']); foreach ( $subs_expl as $key => $val ) { if ( substr_count ($val, "=[") ) { $subs2_expl = explode("=[", $val); $smali['sub'][$subs2_expl[0]] = $subs2_expl[1]; unset($subs2_expl); } } } else { $smali['sub'][0] = ""; } } else { $smali['sub'][0] = ""; } $menus_settings['selected_id'] = $_GET[$input_settings['var_id_name']]; $menus_settings['expand'] = $expand; $menus_settings['array'] = $pages; $menus_settings['var_name'] = $input_settings['var_id_name']; $menus_settings['menu'] = $input_settings['menu']; $menus_settings['menu_top'] = $input_settings['menu_top']; $menus_settings['menu_top_sub'] = $input_settings['menu_top_sub']; $menus_settings['menu_quick'] = $input_settings['menu_quick']; $menus_settings['menu_body'] = $input_settings['menu_body']; $menus_settings['menu_spacer_src'] = $input_settings['menu_spacer_src']; $menus_settings['menu_spacer_width'] = $input_settings['menu_spacer_width']; $menus_settings['sub_menu_skip'] = $webpage_settings_array['sub-menu-skip']; // H閞na rf a?b鎡a vi? $menus_settings['top_sub_menu_skip'] = $webpage_settings_array['top-menu-sub']; // 辝ssu var breytt $menus_settings['top_menu_skip'] = $webpage_settings_array['top-menu-skip']; $top_menu_skip_level = 0; if ( isset ( $inherit[$menus_settings['top_menu_skip']] ) ) { $i_mother_id = $inherit[$menus_settings['top_menu_skip']]; if ( $i_mother_id ) { while ( $i_mother_id ) { $top_menu_skip_level++; $i_mother_id = $inherit[$i_mother_id]; } } } $menus_settings['top_menu_skip_level'] = $top_menu_skip_level; $menus = webtree( $menus_settings ); if ( isset($webpage_settings_array['top-menu']) && !$webpage_settings_array['top-menu'] ) { $smali['menu_top'] = ""; } if ( isset($webpage_settings_array['top-menu-sub']) && !$webpage_settings_array['top-menu-sub'] ) { $smali['menu_top_sub'] = ""; } if ( isset( $webpage_settings_array['body-menu-show'] ) && $webpage_settings_array['body-menu-show'] ) { $menus_settings['body-menu-show'] = $webpage_settings_array['body-menu-show']; $menus_settings['body-menu-id'] = $webpage_settings_array['body-menu-id']; $menus_settings['body-menu-type'] = $webpage_settings_array['body-menu-type'] = 1; webtree_body( $menus_settings ); } $menus_settings['body-menu-show'] = 1; $menus_settings['body-menu-id'] = 0; $menus_settings['body-menu-type'] = $input_settings['menu_mobile_expand']; $menus_settings['menu_mobile'] = $input_settings['menu_mobile']; webtree_body_mobile( $menus_settings ); /////////////////////////////////////////////////////////////////////////////////// // VEFVERSLUN :: BEGIN $products_list_settings['only_user'] = 0; if ( isset( $webpage_settings_array['products-users-show-others'] ) && isset( $_GET['uid'] ) && $_GET['uid'] ) { $products_list_settings['only_user'] = $_GET['uid']; if ( $webpage_settings_array['products-users-show-others'] == 4 ) { $smali['products'] .= $input_settings['products']['text_after_performer']; } else if ( $webpage_settings_array['products-users-show-others'] == 3 ) { $smali['products'] .= $input_settings['products']['text_after_wholesaler']; } else if ( $webpage_settings_array['products-users-show-others'] == 2 ) { $smali['products'] .= $input_settings['products']['text_after_translator']; } else if ( $webpage_settings_array['products-users-show-others'] ) { $smali['products'] .= $input_settings['products']['text_after_producer']; } else if ( !$webpage_settings_array['products-users-show-others'] ) { $smali['products'] .= $input_settings['products']['text_after_author']; } $products_list_settings['only_user_type'] = $webpage_settings_array['products-users-show-others']; } if ( isset( $_GET['bpid'] ) || isset( $webpage_settings_array['products-basket-normal'] ) && $webpage_settings_array['products-basket-normal'] ) { //echo "\$webpage_settings_array['products-basket-normal'] = ".$webpage_settings_array['products-basket-normal']."
"; $settings_products_basket = $input_settings['products_basket']; $settings_products_basket_overview = $input_settings['products_basket_overview']; $settings_products_basket_overview['show_user_info'] = $settings_products_basket['show_user_info'] = $webpage_settings_array['products-basket-show-customer']; $settings_products_basket_overview['basket_target_id'] = $settings_products_basket['basket_target_id'] = $webpage_settings_array['products-basket-small-target-id']; ////////////////////////////////////////////////////////////////////// // H閞na rf a?s鎘ja gr鷓puheiti?fyrir verslunina, tta er ?gegnum stillingar vefsins $settings_products_basket_overview['group_id'] = $settings_products_basket['group_id'] = 4; // ATHUGA BETUR ME?轊TTA // ////////////////////////////////////////////////////////////////////// if ( isset( $_GET['bstep'] ) ) { $bstep_next = $_GET['bstep'] + 1; } else { $_GET['bstep'] = 1; $bstep_next = 2; } $smali['products'] .= "
\n"; if ( $_GET['bstep'] == 3 ) { if ( isset( $_POST['payment_id'] ) ) { //echo "C00: Vistum grei餾lum鰃uleikann
"; // Vistum grei餾lum醫a $sql_query_update = "UPDATE `".$db_table['product_transaction']."` SET `payment_type`='".$_POST['payment_id']."' WHERE "; $sql_query_update .= " `".$db_table['product_transaction']."`.`user_id`=".$session_variables['user_id']." AND `buying_stat`='0'"; //echo "S00: ".$sql_query_update."
"; mysqli_query( $sql_connection, $sql_query_update ); } if ( isset( $_POST['delivery_info'] ) && strlen( $_POST['delivery_info'] ) ) { //echo "C10: Vistum Sendingarm鰃uleikann
"; // Vistum sendanda $sql_query_update = "UPDATE `".$db_table['product_transaction']."` SET `delivery_info`='".$_POST['delivery_info']."' WHERE "; $sql_query_update .= " `".$db_table['product_transaction']."`.`user_id`=".$session_variables['user_id']." AND `buying_stat`='0'"; //echo "S02: ".$sql_query_update."
"; mysqli_query( $sql_connection, $sql_query_update ); } // G鰊gum fr?p鰊tuninni //echo "C10: Vistum p鰊tunina
"; //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// // Vistum sendanda - 辝tta rf a?sko餫 betur! $sql_query_update = "UPDATE `".$db_table['product_transaction']."` SET `buying_stat`='1', `date_confirmed`='".date( "YmdHis" )."' WHERE "; // H閞na rf a?koma kaupdagsetning $sql_query_update .= " `".$db_table['product_transaction']."`.`user_id`=".$session_variables['user_id']." AND `buying_stat`='0'"; //echo "S02: ".$sql_query_update."
"; mysqli_query( $sql_connection, $sql_query_update ); //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// $settings_products_basket_overview['bstep'] = 3; $settings_products_basket_overview['selected_id'] = 0; // Heiti??breytunni til ss a?opna k鰎funa $settings_products_basket_overview['group_id'] = $settings_products_basket['group_id']; $settings_products_basket_overview['html_extension'] = ""; $smali['products'] .= smalixl_products_basket_overview_confirmed( $settings_products_basket_overview ); } else if ( $_GET['bstep'] == 2 ) { // Finnum 鷗 og vistum afsl醫tark箴a if ( isset( $_POST['coupon'] ) ) { $_POST['coupon'] = cleanMe( $_POST['coupon'], "database" ); // Er ssi coupon til? $current_date = date( "YmdHi" ); $sql_query = "SELECT * FROM ".$db_table['product_coupon']." WHERE `code`='".$_POST['coupon']."' AND `stat`='1' AND `date_from`<='".$current_date."' AND `date_to`>='".$current_date."' AND `group_id`='".$settings_products_basket_overview['group_id']."' LIMIT 1"; //echo $sql_query."
"; $result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $result ) ) { $coupon_id = $row['id']; $coupon_valid = true; //echo "Finnum afsl醫ttinn: ".$row['title']."
"; // Ef afsl醫turinn tengist bara 醟ve餹um notanda if ( $row['user_id'] && $row['user_id'] != $session_variables['user_id'] ) { $coupon_valid = false; //echo "辝ssi afsl醫tar er skr狃ur ?einn 醟ve餴nn notanda, sem er ekki ssi
"; } // Ef afsl醫turinn tengist bara 醟ve餴nni notendagr鷓pu if ( $row['user_group_id'] ) { // Athugum h閞 hvort vi餶omandi er ?ssari gr鷓pu $ir = false; $sql_query_2nd = "SELECT * FROM ".$db_table['users_bridge']." WHERE `user_id`='".$session_variables['user_id']."' AND `group_id`='".$row['user_group_id']."' LIMIT 1"; //echo $sql_query_2nd."
"; $result_2nd = mysqli_query( $sql_connection, $sql_query_2nd ); while ( $row_2nd = mysqli_fetch_array( $result_2nd ) ) { $ir = true; } mysqli_free_result( $result_2nd ); if ( $ir == false ) { $coupon_valid = false; //echo "辝ssi afsl醫tar er skr狃ur ?eina 醟ve餹a notendagr鷓pu, sem er ekki ssi
"; } } // H閞na b鷘m vi?til array me?鰈lum im v鰎um sem ssi afsl醫tur n鎟 til. if ( $row['product_id'] ) { $coupon_product_id[$row['product_id']] = true; //echo "轪?er bara ssi vara: ".$row['product_id']."
"; } else if ( $row['category_id'] ) { //echo "轪?er bara v鰎ur ?ssum flokki vara: ".$row['category_id']."
"; $sql_query_2nd = "SELECT * FROM ".$db_table['product_bridge_categories']." WHERE `cat_id`='".$session_variables['user_id']."'"; //echo $sql_query_2nd."
"; $result_2nd = mysqli_query( $sql_connection, $sql_query_2nd ); while ( $row_2nd = mysqli_fetch_array( $result_2nd ) ) { $coupon_product_id[$row_2nd['product_id']] = true; //echo "辝tta eru v鰎ur ?v鰎uflokknum: ".$row_2nd['product_id']."
"; } mysqli_free_result( $result_2nd ); } /* --> 辝tta setjum vi?beint ?smalixl_products_basket_overview(), r sem h閞 a?ofan $_POST['quantity_max'] = $row['quantity_max']; $_POST['quantity_used'] = $row['quantity_used']; $_POST['quantity_each'] = $row['quantity_each']; $_POST['discount_max'] = $row['discount_max']; $_POST['discount_fraction'] = $row['discount_fraction']; */ } mysqli_free_result( $result ); if ( $coupon_valid ) { $sql_query = "SELECT ".$db_table['product_transaction'].".* FROM ".$db_table['product_transaction']." WHERE ".$db_table['product_transaction'].".`user_id`=".$session_variables['user_id']." AND `buying_stat`='0'"; // H閞na rf a?tryggja a??s?bara ?sem er ?k鰎funni, ekki ?sem er afgreitt //echo $sql_query."
"; $result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $result ) ) { $update_product = false; //echo "辝ssi f鎟sla finnst ?k鰎fu: ".$row['product_id']."
"; if ( isset( $coupon_product_id ) && is_array( $coupon_product_id ) ) { foreach ( $coupon_product_id as $key => $val ) { if ( $key == $row['product_id'] ) { // Uppf鎟um ssa f鎟slu $update_product = true; break; } } //echo "Setjum afsl鎡ti bara ?醟ve餹ar v鰎ur ?k鰎funni!
"; // H閞na rennum vi?yfir ssar v鰎ur ?k鰎funni og setjum coupon_id vi?tilteknar v鰎ur sem uppfylla product_id. } else { // skr醬m afsl鎡ti ?ssar v鰎ur //echo "Setjum afsl鎡ti ?ALLAR v鰎ur ?k鰎funni, eins og ssa!
"; $update_product = true; // H閞na rennum vi?yfir ssar v鰎ur ?k鰎funni og setjum coupon_id vi?hvern reitt. // Gerum h閞 update } if ( $update_product == true ) { // Vi?rfum a?finna $coupon_id $sql_query_update = "UPDATE `".$db_table['product_transaction']."` SET `coupon_id`='".$coupon_id."' WHERE `id`='".$row['id']."' limit 1"; //echo $sql_query_update."
"; mysqli_query( $sql_connection, $sql_query_update ); } } mysqli_free_result( $result ); } } // Vistum afhendingarm醫a $sql_query_update = "UPDATE `".$db_table['product_transaction']."` SET `delivery_type`='".$_POST['shipping_id']."' WHERE "; $sql_query_update .= " `".$db_table['product_transaction']."`.`user_id`=".$session_variables['user_id']." AND `buying_stat`='0'"; //echo $sql_query_update."
"; mysqli_query( $sql_connection, $sql_query_update ); $smali['products'] .= smalixl_products_basket_overview( $settings_products_basket_overview ); $smali['products'] .= "
"; $smali['products'] .= "Senda til (ef heimilisfang er anna?:
"; $smali['products'] .= ""; $smali['products'] .= "
"; $smali['products'] .= "
"; $smali['products'] .= "Grei餾lum醫i: "; $smali_products_payments_input['selected_id'] = 0; // Heiti??breytunni til ss a?opna k鰎funa $smali_products_payments_input['var_name'] = "payment_id"; // Heiti??breytunni til ss a?opna k鰎funa $smali_products_payments_input['group_id'] = $settings_products_basket['group_id']; $smali_products_payments_input['html_extension'] = ""; $smali_products_payments_output = smali_products_payments( $smali_products_payments_input ); $smali['products'] .= $smali_products_payments_output['menu']; $smali['products'] .= "
"; $smali['products'] .= "
"; } else if ( $_GET['bstep'] == 1 ) { $smali['products'] .= smalixl_products_basket( $settings_products_basket ); $smali['products'] .= "Afsl醫tark箴i: "; $smali['products'] .= "
"; $smali['products'] .= "Afhendingarm醫i: "; $smali_products_shipping_input['selected_id'] = 0; // Heiti??breytunni til ss a?opna k鰎funa $smali_products_shipping_input['var_name'] = "shipping_id"; // Heiti??breytunni til ss a?opna k鰎funa $smali_products_shipping_input['group_id'] = $settings_products_basket['group_id']; $smali_products_shipping_input['html_extension'] = ""; $smali_products_shipping_output = smali_products_shipping( $smali_products_shipping_input ); $smali['products'] .= $smali_products_shipping_output['menu']; } if ( $_GET['bstep'] == 2 && $session_variables['user_id'] ) { $smali['products'] .= "
"; $smali['products'] .= "Sta餱esta"; $smali['products'] .= "
"; } if ( $_GET['bstep'] == 1 && $session_variables['user_id'] ) { $smali['products'] .= "
"; $smali['products'] .= "Afhending og grei餾la"; $smali['products'] .= "
"; } else if ( $_GET['bstep'] == 1 && !$smali['user_id'] ) { $smali['products'] .= "
"; $smali['products'] .= "Innskr醤ingar er krafist 狃ur en haldi?er 醘ram."; $smali['products'] .= "
"; } if ( $_GET['bstep'] == 2 ) { $smali['products'] .= "
"; $smali['products'] .= "Til baka ?k鰎fu"; $smali['products'] .= "
"; } $smali['products'] .= "
"; } if ( isset( $webpage_settings_array['products-basket-small'] ) && strlen( $webpage_settings_array['products-basket-small'] ) ) { $settings_products_basket_small = $input_settings['products_basket_small']; $settings_products_basket_small['target_pid'] = $webpage_settings_array['products-basket-small-target-id']; $settings_products_basket_small['basket_target_id'] = $webpage_settings_array['products-basket-small-target-id']; $smali['products_basket'] = smalixl_products_basket_small( $settings_products_basket_small ); } if ( ( isset( $webpage_settings_array['products-category'] ) && strlen( $webpage_settings_array['products-category'] ) ) || $products_list_settings['only_user'] ) { if ( isset( $_GET['ugid'] ) ) { $smali['products'] .= smalixl_products_users_list(); } else { if ( isset( $_GET['gid'] ) ) { $products_input['selected_id'] = $_GET['gid'] * 1; $products_input['basket_target_id'] = $webpage_settings_array['products-basket-small-target-id']; $smali['products'] .= smalixl_product_view( $products_input ); if ( isset( $authors_array ) && is_array( $authors_array ) ) { foreach ( $authors_array AS $key => $val ) { //echo "

Finnum allar b鎘ur h閞 eftir sama h鰂und nr. ".$key."

"; $products_list_settings['only_user'] = $key; } } $products_list_settings['skip_product_id'] = $products_input['selected_id']; $products_list_settings['title'] = $input_settings['products']['text_same_author']; } else { //$products_list_settings['title'] = "

A餽ar b鎘ur ?sama flokki:

"; } $products_list_settings['cat_id'] = $webpage_settings_array['products-category']; //echo "

A00: ".$products_list_settings['cat_id']."

"; $products_list_settings['link_base'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; // H閞na er stilling fyrir yfirlit: $products_list_settings['render'] = "[:image:]|[:price_brutto:]|[:buy_button:]"; $products_list_settings['buy_button'] = ""; $products_list_settings['html_begin'] = "
"; $products_list_settings['html_between'][0] = "
"; // fyrir framan mynd $products_list_settings['html_between'][1] = "
Ver?"; // fyrir framan fyrirs鰃n $products_list_settings['html_between'][2] = " kr.
"; // fyrir framan hnapp $products_list_settings['html_between'][3] = "
"; $products_list_settings['html_between'][4] = ""; $products_list_settings['html_between'][5] = ""; $products_list_settings['html_between'][6] = ""; $products_list_settings['html_between'][7] = ""; $products_list_settings['html_between'][8] = ""; $products_list_settings['html_between'][9] = ""; $products_list_settings['html_between'][10] = ""; $products_list_settings['html_end'] = "
"; $products_list_settings['basket_target_id'] = $webpage_settings_array['products-basket-small-target-id']; $smali['products'] .= smalixl_products_list( $products_list_settings ); } } // VEFVERSLUN :: END /////////////////////////////////////////////////////////////////////////////////// // TILVITNANIR :: BEGIN $smali['quotation'] = ""; if ( isset( $webpage_settings_array['quotation-id'] ) && $webpage_settings_array['quotation-id'] ) { if ( $webpage_settings_array['quotation-year'] ) { //$smali['quotation'] .= "...醩amt d醤ardegi h鰂undar"; } $quotation = ""; $quotation_author = ""; $sql_query = "SELECT `".$db_table['quotations']."`.`quotation`, `".$db_table['quotations']."`.`author_id` FROM `".$db_table['quotations']."` WHERE `".$db_table['quotations']."`.`stat`=1 AND `".$db_table['quotations']."`.`group_id`='".$webpage_settings_array['quotation-id']."' ORDER BY RAND() LIMIT 1"; //echo "

".$sql_query."

"; $sql_result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $sql_result ) ) { $quotation = cleanMe( $row['quotation'], "HTML" ); $author_id = $row['author_id']; } mysqli_free_result ($sql_result); if ( !isset( $input_settings['quotations']['box_before'] ) ) { // Sj醠fgefi?gildi ef tta er ekki skilgreint ?smali_config.php $input_settings['quotations']['box_before'] = "
"; $input_settings['quotations']['box_after'] = "
"; $input_settings['quotations']['quote_before'] = "
"; $input_settings['quotations']['quote_after'] = "
"; $input_settings['quotations']['author_before'] = "
"; $input_settings['quotations']['author_after'] = "
"; $input_settings['quotations']['year_before'] = "
("; $input_settings['quotations']['year_between'] = "~"; $input_settings['quotations']['year_after'] = ")
"; } if ( strlen( $quotation ) ) { $smali['quotation'] .= $input_settings['quotations']['box_before']; $smali['quotation'] .= $input_settings['quotations']['quote_before']; $smali['quotation'] .= $quotation; $smali['quotation'] .= $input_settings['quotations']['quote_after']; $sql_query = "SELECT `".$db_table['quotations_authors']."`.* FROM `".$db_table['quotations_authors']."` WHERE `".$db_table['quotations_authors']."`.`id`=".$author_id." LIMIT 1"; //echo "

".$sql_query."

"; $quotation_author = ""; $sql_result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $sql_result ) ) { $quotation_author = cleanMe( $row['name'], "HTML" ); $quotation_born = cleanMe( $row['born'], "HTML" ); $quotation_dead = cleanMe( $row['dead'], "HTML" ); } mysqli_free_result ( $sql_result ); if ( $webpage_settings_array['quotation-author'] && strlen( $quotation_author ) ) { $smali['quotation'] .= $input_settings['quotations']['author_before']; $smali['quotation'] .= $quotation_author; $smali['quotation'] .= $input_settings['quotations']['author_after']; } if ( $webpage_settings_array['quotation-year'] && $quotation_born ) { $smali['quotation'] .= $input_settings['quotations']['year_before']; $smali['quotation'] .= $quotation_born; $smali['quotation'] .= $input_settings['quotations']['year_between']; $smali['quotation'] .= $quotation_dead; $smali['quotation'] .= $input_settings['quotations']['year_after']; } $smali['quotation'] .= $input_settings['quotations']['box_after']; } } // TILVITNANIR :: END /////////////////////////////////////////////////////////////////////////////////// // KANNANIR :: BEGIN $smali['poll'] = ""; if ( isset( $webpage_settings_array['poll-id'] ) && $webpage_settings_array['poll-id'] ) { $vote_mother_id = 0; if ( isset($_POST[$input_settings['polls']['var_name']]) ) { $vote_mother_id = 0; foreach ($_POST[$input_settings['polls']['var_name']] as $key => $val ) { $vote_mother_id = $key; $vote_answer_id = $val; } $sql_insert = "UPDATE ".$db_table['polls']." SET result=result+1 WHERE id=".$vote_answer_id." LIMIT 1"; @mysqli_query( $sql_connection, $sql_insert); if ( $webpage_settings_array['poll-vote'] == 2 ) { setcookie ($vote_mother_id, 1, time()+(2592000*60)); } else if ( $webpage_settings_array['poll-vote'] == 1 ) { setcookie ($vote_mother_id, 1); } else { } } $poll_settings = $input_settings['polls']; $poll_settings['voted_id'] = $vote_mother_id; $poll_settings['poll-id'] = $webpage_settings_array['poll-id']; if ( strlen( $_SERVER['QUERY_STRING'] ) ) { $poll_settings['url_extension'] = "?".$_SERVER['QUERY_STRING']; } $poll_settings['order_type'] = $webpage_settings_array['poll-type']; $poll_settings['result_type'] = $webpage_settings_array['poll-result']; $poll_settings['total'] = $webpage_settings_array['poll-result-type']; $poll_settings['text_empty'] = $input_settings['polls']['no_poll']; $smali['poll'] = smalixl_poll ($poll_settings); } $smali['ads'][0] = ""; if ( isset($webpage_settings_array['ads-groups']) && $webpage_settings_array['ads-groups'] ) { $ads_settings['ads-groups'] = $webpage_settings_array['ads-groups']; $ads_settings['order'] = $webpage_settings_array['ads-type']; $smali['ads'] = smalixl_ads ($ads_settings); } $smali['emails'] = ""; if ( isset($webpage_settings_array['emails-groups']) && $webpage_settings_array['emails-groups'] ) { $emails_settings = $input_settings['emails']; $emails_settings['emails-groups'] = $webpage_settings_array['emails-groups']; $emails_settings['emails-appearance'] = $webpage_settings_array['emails-appearance']; if ( strlen( $webpage_settings_array['emails-target'] ) ) { $emails_settings['emails-target'] = $webpage_settings_array['emails-target']; } $emails_settings['show-pin'] = $webpage_settings_array['emails-pin']; $emails_settings['text'][0] = $webpage_settings_array['emails-text-1']; $emails_settings['text'][1] = $webpage_settings_array['emails-text-2']; $emails_settings['text'][2] = $webpage_settings_array['emails-text-3']; $emails_settings['text'][3] = $webpage_settings_array['emails-text-4']; $emails_settings['emails-confirm'] = $webpage_settings_array['emails-confirm']; $smali['emails'] = smalixl_emails ($emails_settings); } $smali['users'] = ""; $smali['users_view'] = ""; $smali['users_searchbox'] = ""; if ( isset($webpage_settings_array['users-groups']) && $webpage_settings_array['users-groups'] ) { if ( isset( $_GET[$input_settings['var_user_id_name']] ) ) { $sql_query = "SELECT ".$db_table['users'].".* "; $sql_query .= " FROM ".$db_table['users'].", ".$db_table['users_groups'].", ".$db_table['users_bridge']." "; $sql_query .= " WHERE ".$db_table['users'].".id=".$_GET[$input_settings['var_user_id_name']]." "; $sql_query .= "AND ".$db_table['users_bridge'].".user_id=".$db_table['users'].".id AND ".$db_table['users'].".stat=1 "; $sql_query .= "AND ".$db_table['users_groups'].".id=".$db_table['users_bridge'].".group_id AND ".$db_table['users'].".stat=1 "; $users_search_string = ""; if ( substr_count ($webpage_settings_array['users-groups'], "-") ) { $users_groups_expl = explode("-", $webpage_settings_array['users-groups']); foreach ( $users_groups_expl as $key => $val ) { $users_search_string .= " ".$db_table['users_groups'].".id=".$val." OR "; } $users_search_string = " AND ( ".substr ($users_search_string, 0, strlen( $users_search_string ) - 3 )." ) ";; } else { $users_search_string = " AND ".$db_table['users_groups'].".id=".$webpage_settings_array['users-groups']." "; } $sql_query .= $users_search_string; $sql_query .= "LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); $i = 0; while ( $row = mysqli_fetch_array ($result) ) { $i++; $user_photo_id = $row['photo_id']; $users_temp['username'] = $input_settings['users']['selected']['username'][0]; $users_temp['username'] .= $row['username']; $user_username = cleanMe ( $row['username'], "HTMLStrip" ); $users_temp['username'] .= $input_settings['users']['selected']['username'][1]; $users_temp['name'] = $input_settings['users']['selected']['name'][0]; $users_temp['name'] .= cleanMe ( $row['name'], "HTMLStrip" )." "; $user_name = $row['name']; $users_temp['name'] .= $input_settings['users']['selected']['name'][1]; $users_temp['social_id'] = $input_settings['users']['selected']['social_id'][0]; if ( strlen( $input_settings['users']['selected']['social_id_sep'] && strlen( $row['social_id'] ) ) ) { $users_temp['social_id'] .= substr( cleanMe ( $row['social_id'], "HTMLStrip" ), 0, 6).$input_settings['users']['selected']['social_id_sep'].substr($row['social_id'], 6, 4); } else { $users_temp['social_id'] .= cleanMe ( $row['social_id'], "HTMLStrip" ); } $users_temp['social_id'] .= $input_settings['users']['selected']['social_id'][1]; $users_temp['company'] = $input_settings['users']['selected']['company'][0]; $users_temp['company'] .= cleanMe ( $row['company'], "HTMLStrip" ); $users_temp['company'] .= $input_settings['users']['selected']['company'][1]; $users_temp['address'] = $input_settings['users']['selected']['address'][0]; $users_temp['address'] .= cleanMe ( $row['address'], "HTMLStrip" ); $users_temp['address'] .= $input_settings['users']['selected']['address'][1]; $users_temp['postcode'] = $input_settings['users']['selected']['postcode'][0]; $users_temp['postcode'] .= cleanMe ( $row['postcode'], "HTMLStrip" ); $users_temp['postcode'] .= $input_settings['users']['selected']['postcode'][1]; $users_temp['area'] = $input_settings['users']['selected']['area'][0]; if ( $row['country'] == "IS" ) { $users_temp['area'] .= cleanMe( postnumer( "area", "date", $row['postcode'] ), "HTMLStrip" ); } else { $users_temp['area'] .= cleanMe( $row['area'], "HTMLStrip" ); } $users_temp['area'] .= $input_settings['users']['selected']['area'][1]; $users_temp['country'] = $input_settings['users']['selected']['country'][0]; $users_temp['country'] .= show_country ("", "", "", $row['country']); $users_temp['country'] .= $input_settings['users']['selected']['country'][1]; $users_temp['phones'] = $input_settings['users']['selected']['phones'][0]; if ( strlen( $input_settings['users']['selected']['phones_sep'] ) ) { $row['phones'] = cleanMe ( $row['phones'], "HTMLStrip" ); $row['phones'] = str_replace ( " ", $input_settings['users']['selected']['phones_sep'], $row['phones'] ); $row['phones'] = str_replace ( "; ", $input_settings['users']['selected']['phones_sep'], $row['phones'] ); $row['phones'] = str_replace ( ";", $input_settings['users']['selected']['phones_sep'], $row['phones'] ); } $users_temp['phones'] .= $row['phones']; $users_temp['phones'] .= $input_settings['users']['selected']['phones'][1]; $users_temp['fax'] = $input_settings['users']['selected']['fax'][0]; if ( strlen( $input_settings['users']['selected']['fax_sep'] ) ) { $row['fax'] = str_replace ( " ", $input_settings['users']['selected']['fax_sep'], $row['fax'] ); $row['fax'] = str_replace ( "; ", $input_settings['users']['selected']['fax_sep'], $row['fax'] ); $row['fax'] = str_replace ( ";", $input_settings['users']['selected']['fax_sep'], $row['fax'] ); } $users_temp['fax'] .= cleanMe ( $row['fax'], "HTMLStrip" ); $users_temp['fax'] .= $input_settings['users']['selected']['fax'][1]; $users_temp['email'] = $input_settings['users']['selected']['email'][0]; if ( substr_count ($row['email'], ";") ) { $email_expl = explode(";", $row['email']); $e = 0; foreach ( $email_expl as $key => $val ) { $e++; $val = str_replace ( " ", "", $val ); $users_temp['email'] .= "".$val.""; if ( $e < count( $email_expl ) ) { $users_temp['email'] .= $input_settings['users']['selected']['email_sep']; } } } else { $users_temp['email'] .= "".$row['email'].""; } $users_temp['email'] .= $input_settings['users']['selected']['email'][1]; $users_temp['website'] = $input_settings['users']['selected']['website'][0]; if ( substr_count ($row['website'], ";") ) { $website_expl = explode(";", $row['website']); $e = 0; foreach ( $website_expl as $key => $val ) { $e++; $val = str_replace ( " ", "", $val ); $users_temp['website'] .= "".$val.""; if ( $e < count( $website_expl ) ) { $users_temp['website'] .= $input_settings['users']['selected']['email_sep']; } } } else { $users_temp['website'] .= "".$row['website'].""; } $users_temp['website'] .= $input_settings['users']['selected']['website'][1]; $users_temp['text1'] = $input_settings['users']['selected']['text1'][0]; $users_temp['text1'] .= cleanMe ( $row['text1'], "HTMLStrip" ); $users_temp['text1'] .= $input_settings['users']['selected']['text1'][1]; $users_temp['text2'] = $input_settings['users']['selected']['text2'][0]; $users_temp['text2'] .= cleanMe ( $row['text2'], "HTMLStrip" ); $users_temp['text2'] .= $input_settings['users']['selected']['text2'][1]; $users_temp['text3'] = $input_settings['users']['selected']['text3'][0]; $users_temp['text3'] .= cleanMe ( $row['text3'], "HTMLStrip" ); $users_temp['text3'] .= $input_settings['users']['selected']['text3'][1]; } mysqli_free_result ($result); if ( $i ) { $users_temp['image'] = $input_settings['users']['selected']['image'][0]; if ( $user_photo_id ) { $sql_query = "SELECT type, folder_id, file, header, settings FROM ".$db_table['files']." "; $sql_query .= "WHERE id=".$user_photo_id." LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); $pi = 0; while ( $row = mysqli_fetch_array ($result) ) { $pi++; $img_description = cleanMe( $row['description'], "HTMLStrip" ); $folder_id = $row['folder_id']; $file = $row['file']; $file_type = $row['type']; $file_header = $row['header']; $file_settings = webpage_settings( $row['settings'] ); $input_img_article['file'] = $file; $input_img_article['settings'] = $file_settings; $input_img_article['folder_id'] = $folder_id; $input_img_article['images_size'] = $input_settings['users']['selected']['images_size']; $input_img_article['file_type'] = $file_type; $input_img_article['file_header'] = $file_header; $output_img_article = find_image ( $input_img_article ); $users_temp['image'] .= "".$output_img_article['image'].""; } mysqli_free_result ($result); if ( !$pi ) { $users_temp['image'] .= $input_settings['users']['normal']['no_image']; } } else { $users_temp['image'] .= $input_settings['users']['selected']['no_image']; } $users_temp['image'] .= $input_settings['users']['selected']['image'][1]; $users_temp_array = explode ("|", $input_settings['users']['selected']['order']); foreach ( $users_temp_array as $key => $val ) { if ( $val == "[:image:]" ) { $smali['users_view'] .= $users_temp['image']; } else if ( $val == "[:username:]" ) { $smali['users_view'] .= $users_temp['username']; } else if ( $val == "[:name:]" ) { $smali['users_view'] .= $users_temp['name']; } else if ( $val == "[:social_id:]" ) { $smali['users_view'] .= $users_temp['social_id']; } else if ( $val == "[:company:]" ) { $smali['users_view'] .= $users_temp['company']; } else if ( $val == "[:address:]" ) { $smali['users_view'] .= $users_temp['address']; } else if ( $val == "[:postcode:]" ) { $smali['users_view'] .= $users_temp['postcode']; } else if ( $val == "[:area:]" ) { $smali['users_view'] .= $users_temp['area']; } else if ( $val == "[:country:]" ) { $smali['users_view'] .= $users_temp['country']; } else if ( $val == "[:phones:]" ) { $smali['users_view'] .= $users_temp['phones']; } else if ( $val == "[:fax:]" ) { $smali['users_view'] .= $users_temp['fax']; } else if ( $val == "[:email:]" ) { $smali['users_view'] .= $users_temp['email']; } else if ( $val == "[:website:]" ) { $smali['users_view'] .= $users_temp['website']; } else if ( $val == "[:text1:]" ) { $smali['users_view'] .= $users_temp['text1']; } else if ( $val == "[:text2:]" ) { $smali['users_view'] .= $users_temp['text2']; } else if ( $val == "[:text3:]" ) { $smali['users_view'] .= $users_temp['text3']; } } } else { $smali['users_view'] .= $input_settings['users']['selected']['no_user']; } } else { $word_search_string = ""; $users_search_string = ""; $postcode_search_string = ""; $country_search_string = ""; if ( !isset($_GET['number']) ) { $_GET['number'] = 0; } if (isset($_POST['amount'])) { cleanMe ( $_POST['amount'], "number" ); if ( $_POST['amount'] == 0 ) { $_POST['amount'] = 1; } setcookie("amount", $_POST['amount']); } else if (isset($_COOKIE['amount'])) { $_POST['amount'] = $_COOKIE['amount']; } else { $_POST['amount'] = $input_settings['search_amount']; setcookie("amount", $_POST['amount']); } if ( $webpage_settings_array['users-appearance'] ) { if (isset($_POST['search_string'])) { $_POST['search_string'] = cleanMe ($_POST['search_string'], "database"); $_POST['search_string'] = str_replace ("%20", " ", $_POST['search_string']); $_POST['search_string'] = str_replace ("\%", "", $_POST['search_string']); setcookie("search_string", $_POST['search_string']); } else if (isset($_COOKIE['search_string'])) { $_POST['search_string'] = $_COOKIE['search_string']; } else { $_POST['search_string'] = ""; } if (isset($_POST['postcode'])) { $_POST['postcode'] = cleanString ($_POST['postcode'], "toNumber", "no"); setcookie("postcode", $_POST['postcode']); } else if (isset($_COOKIE['postcode'])) { $_POST['postcode'] = $_COOKIE['postcode']; } else { $_POST['postcode'] = 0; } if (isset($_POST['country'])) { $_POST['country'] = cleanString ($_POST['country'], "toDatabase", "no"); setcookie("country", $_POST['country']); } else if (isset($_COOKIE['country'])) { $_POST['country'] = $_COOKIE['country']; } else { $_POST['country'] = 0; } if ( strlen($_POST['search_string']) ) { $word_search_string = " AND ( ".$db_table['users'].".name LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".username LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".social_id LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".address LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".postcode LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".area LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".text1 LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".text2 LIKE '%".$_POST['search_string']."%' OR ".$db_table['users'].".text3 LIKE '%".$_POST['search_string']."%' )"; } $postcode_search_string = ""; if ( $_POST['postcode'] ) { $postcode_search_string = " AND ".$db_table['users'].".postcode='".$_POST['postcode']."' "; } $country_search_string = ""; if ( $_POST['country'] ) { $country_search_string = " AND ".$db_table['users'].".country='".$_POST['country']."' "; } $smali['users_searchbox'] = $input_settings['users']['searchbox'][0]; $smali['users_searchbox'] .= "
"; $smali['users_searchbox'] .= $input_settings['users']['searchbox'][1]; $smali['users_searchbox'] .= postnumer ("dropmenu", "postcode", $_POST['postcode'], 101, 902, $input_settings['users']['area_text']); $smali['users_searchbox'] .= $input_settings['users']['searchbox'][2]; $smali['users_searchbox'] .= show_country ("country", $_POST['country'], 0, "", "", $input_settings['users']['country_text']); $smali['users_searchbox'] .= $input_settings['users']['searchbox'][3]; $smali['users_searchbox'] .= ""; $smali['users_searchbox'] .= $input_settings['users']['searchbox'][4]; $smali['users_searchbox'] .= ""; $smali['users_searchbox'] .= $input_settings['users']['searchbox'][5]; $smali['users_searchbox'] .= $input_settings['users']['search_button']; $smali['users_searchbox'] .= $input_settings['users']['searchbox'][6]; } $users_search_string = ""; if ( substr_count ($webpage_settings_array['users-groups'], "-") ) { $users_groups_expl = explode("-", $webpage_settings_array['users-groups']); foreach ( $users_groups_expl as $key => $val ) { $users_search_string .= " ".$db_table['users_groups'].".id=".$val." OR "; } $users_search_string = " AND ( ".substr ($users_search_string, 0, strlen( $users_search_string ) - 3 )." ) ";; } else { $users_search_string = " AND ".$db_table['users_groups'].".id=".$webpage_settings_array['users-groups']." "; } $sql_query = "SELECT COUNT(".$db_table['users'].".id) "; $sql_query .= " FROM ".$db_table['users'].", ".$db_table['users_groups'].", ".$db_table['users_bridge']." "; $sql_query .= " WHERE ".$db_table['users_bridge'].".user_id=".$db_table['users'].".id AND ".$db_table['users'].".stat=1 "; $sql_query .= "AND ".$db_table['users_groups'].".id=".$db_table['users_bridge'].".group_id AND ".$db_table['users'].".stat=1 "; $sql_query .= $users_search_string.$word_search_string.$postcode_search_string.$country_search_string; $result = mysqli_query( $sql_connection, $sql_query); foreach ( $result as $key => $val ) { //echo $key." => ".$val."
"; foreach ( $val as $key2 => $val2 ) { //echo $key2." => ".$val2."
"; $total_rows = $val2; } } //$total_rows = mysql_result($result, 0); mysqli_free_result ($result); $sql_query = "SELECT DISTINCT ".$db_table['users'].".* "; $sql_query .= " FROM ".$db_table['users'].", ".$db_table['users_groups'].", ".$db_table['users_bridge']." "; $sql_query .= " WHERE ".$db_table['users_bridge'].".user_id=".$db_table['users'].".id AND ".$db_table['users'].".stat=1 "; $sql_query .= "AND ".$db_table['users_groups'].".id=".$db_table['users_bridge'].".group_id AND ".$db_table['users'].".stat=1 "; $sql_query .= $users_search_string.$word_search_string.$postcode_search_string.$country_search_string; // // H閞na rf a?koma hvernig eigi a?ra餫 notendum: eftir notendanafni, sv骛i e餫 eigin nafni // if ( $webpage_settings_array['users-appearance'] ) { if ( substr_count ( $input_settings['users']['normal']['order'], "[:username:]" ) ) { $sql_query .= "ORDER BY ".$db_table['users'].".username LIMIT ".$_GET['number'].", ".$_POST['amount']; } else { $sql_query .= "ORDER BY ".$db_table['users'].".name LIMIT ".$_GET['number'].", ".$_POST['amount']; } } else { $sql_query .= "ORDER BY ".$db_table['users'].".name"; } //echo "A00: ".$sql_query."
"; $result = mysqli_query( $sql_connection, $sql_query); $i = 0; $users_temp[0]['username'] = ""; $temp = $input_settings['users']['normal']['before']; $s = 0; while ( $row = mysqli_fetch_array ($result) ) { $s++; $users_temp[$row['id']]['username'] = $row['username']; $users_temp_array = explode ("|", $input_settings['users']['normal']['order']); foreach ( $users_temp_array as $key => $val ) { if ( $val == "[:image:]" ) { $temp .= $input_settings['users']['normal']['image'][0]; if ( $row['photo_id'] ) { $sql_query_sub = "SELECT type, folder_id, file, header, settings FROM ".$db_table['files']." "; $sql_query_sub .= "WHERE id=".$row['photo_id']." LIMIT 1"; $result_sub = mysqli_query( $sql_connection, $sql_query_sub); $pi = 0; while ( $row_sub = mysqli_fetch_array ($result_sub) ) { $pi++; $img_description = cleanMe( $row_sub['description'], "HTMLStrip" ); $folder_id = $row_sub['folder_id']; $file = $row_sub['file']; $file_type = $row_sub['type']; $file_header = $row_sub['header']; $file_settings = webpage_settings( $row_sub['settings'] ); $input_img_article['file'] = $file; $input_img_article['settings'] = $file_settings; $input_img_article['folder_id'] = $folder_id; $input_img_article['images_size'] = $input_settings['users']['normal']['images_size']; $input_img_article['file_type'] = $file_type; $input_img_article['file_header'] = $file_header; $output_img_article = find_image ( $input_img_article ); if ( $input_settings['users']['normal']['image_target'] ) { $temp .= "".$output_img_article['image']." "; } else { $temp .= "".$output_img_article['image']." "; } } mysqli_free_result ($result_sub); if ( !$pi ) { $temp .= $input_settings['users']['normal']['no_image']." "; } } else { $temp .= $input_settings['users']['normal']['no_image']; } $temp .= $input_settings['users']['normal']['image'][1]; } else if ( $val == "[:username:]" ) { $temp .= $input_settings['users']['normal']['username'][0]; $temp .= "".$row['username']." "; $temp .= $input_settings['users']['normal']['username'][1]; } else if ( $val == "[:name:]" ) { $temp .= $input_settings['users']['normal']['name'][0]; $temp .= "".$row['name']." "; $temp .= $input_settings['users']['normal']['name'][1]; } else if ( $val == "[:social_id:]" ) { $temp .= $input_settings['users']['normal']['social_id'][0]; if ( strlen( $input_settings['users']['selected']['social_id_sep'] && strlen( $row['social_id'] ) ) ) { $temp .= substr($row['social_id'], 0, 6).$input_settings['users']['normal']['social_id_sep'].substr($row['social_id'], 6, 4); } else { $temp .= $row['social_id']; } $temp .= $input_settings['users']['normal']['social_id'][1]; } else if ( $val == "[:company:]" ) { $temp .= $input_settings['users']['normal']['company'][0]; $temp .= $row['company']; $temp .= $input_settings['users']['normal']['company'][1]; } else if ( $val == "[:address:]" ) { $temp .= $input_settings['users']['normal']['address'][0]; $temp .= $row['address']." "; $temp .= $input_settings['users']['normal']['address'][1]; } else if ( $val == "[:postcode:]" ) { $temp .= $input_settings['users']['normal']['postcode'][0]; $temp .= $row['postcode']; $temp .= $input_settings['users']['normal']['postcode'][1]; } else if ( $val == "[:area:]" ) { $temp .= $input_settings['users']['normal']['area'][0]; $temp .= $row['area']; $temp .= $input_settings['users']['normal']['area'][1]; } else if ( $val == "[:country:]" ) { $temp .= $input_settings['users']['normal']['country'][0]; $temp .= show_country ("", "", "", $row['country']); $temp .= $input_settings['users']['normal']['country'][1]; } else if ( $val == "[:phones:]" ) { $temp .= $input_settings['users']['normal']['phones'][0]; if ( strlen( $input_settings['users']['normal']['phones_sep'] ) ) { $row['phones'] = str_replace ( " ", $input_settings['users']['normal']['phones_sep'], $row['phones'] ); } $temp .= $row['phones']." "; $temp .= $input_settings['users']['normal']['phones'][1]; } else if ( $val == "[:fax:]" ) { if ( strlen( $input_settings['users']['normal']['fax_sep'] ) ) { $row['fax'] = str_replace ( " ", $input_settings['users']['normal']['fax_sep'], $row['fax'] ); } $temp .= $row['fax']." "; $temp .= $input_settings['users']['normal']['fax'][1]; } else if ( $val == "[:email:]" ) { $temp .= $input_settings['users']['normal']['email'][0]; if ( substr_count ($row['email'], ";") ) { $email_expl = explode(";", $row['email']); $e = 0; foreach ( $email_expl as $key => $val ) { $e++; $val = str_replace ( " ", "", $val ); $temp .= "".$val.""; $temp .= " "; if ( $e < count( $email_expl ) ) { $temp .= $input_settings['users']['normal']['email_sep']; } } } else { $temp .= "".$row['email']." "; } $temp .= $input_settings['users']['normal']['email'][1]; } else if ( $val == "[:website:]" ) { $temp .= $input_settings['users']['normal']['website'][0]; if ( substr_count ($row['website'], ";") ) { $website_expl = explode(";", $row['website']); $e = 0; foreach ( $website_expl as $key => $val ) { $e++; $val = str_replace ( " ", "", $val ); $temp .= "".$val.""; $temp .= " "; if ( $e < count( $website_expl ) ) { $temp .= $input_settings['users']['normal']['email_sep']; } } } else { $temp .= "".$row['website']." "; } $temp .= $input_settings['users']['normal']['website'][1]; } else if ( $val == "[:text1:]" ) { $temp .= $input_settings['users']['normal']['text1'][0]; $temp .= $row['text1']." "; $temp .= $input_settings['users']['normal']['text1'][1]; } else if ( $val == "[:text2:]" ) { $temp .= $input_settings['users']['normal']['text2'][0]; $temp .= $row['text2']." "; $temp .= $input_settings['users']['normal']['text2'][1]; } else if ( $val == "[:text3:]" ) { $temp .= $input_settings['users']['normal']['text3'][0]; $temp .= $row['text3']." "; $temp .= $input_settings['users']['normal']['text3'][1]; } } } mysqli_free_result ($result); $temp .= $input_settings['users']['normal']['after']; if ( $s ) { if ( $webpage_settings_array['users-appearance'] ) { $pn_settings['total'] = $total_rows; $pn_settings['dose'] = $_POST['amount']; $pn_settings['current_dose'] = $_GET['number']; $pn_settings['link_extension'] = "&".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]; $pn_output = previous_next ($pn_settings); $smali['users'] .= $input_settings['users']['normal']['table'][0]; $smali['users'] .= $pn_output[0]; $smali['users'] .= $input_settings['users']['normal']['table'][1]; $smali['users'] .= $temp; $smali['users'] .= $input_settings['users']['normal']['table'][2]; $smali['users'] .= $pn_output[1]; $smali['users'] .= $input_settings['users']['normal']['table'][3]; } else { $smali['users'] .= $input_settings['users']['normal']['table'][0]; $smali['users'] .= $input_settings['users']['normal']['table'][1]; $smali['users'] .= $temp; $smali['users'] .= $input_settings['users']['normal']['table'][2]; $smali['users'] .= $input_settings['users']['normal']['table'][3]; } } else { $smali['users'] .= $input_settings['users']['no_users_found']; } } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Fr閠tir ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $smali['articles_searchbox'] = ""; $smali['articles'] = ""; $smali['articles_view'] = ""; $date_settings_news['day_name'] = $date_settings['day_name'] = $input_settings['date_day_name']; if ( ( isset( $_GET['cid'] ) || isset( $_GET['icid'] ) ) && !$webpage_settings_array['news-list'] ) { $webpage_settings_array['news-groups'] = 0; } if ( isset( $_GET['icid'] ) ) { $sql_query = "SELECT ".$db_table['articlesimg'].".*, ".$db_table['files'].".type, ".$db_table['files'].".folder_id, ".$db_table['files'].".file FROM ".$db_table['articlesimg'].", ".$db_table['files']." "; $sql_query .= "WHERE ".$db_table['articlesimg'].".id=".$_GET['icid']." AND ".$db_table['articlesimg'].".file_id=".$db_table['files'].".id LIMIT 1"; //echo "

E01: ".$sql_query."

"; $result = mysqli_query( $sql_connection, $sql_query ); $j = 0; $smali['articles_view'] .= $input_settings['articles']['image_selected'][0]; while ( $row = mysqli_fetch_array ($result) ) { $j++; $id = $row['id']; $cast_id = $row['cast_id']; $file_id = $row['file_id']; $ordering = $row['ordering']; $description = $row['description']; $type = $row['type']; $img_input['src'] = $system_settings['default_files_http'].$row['folder_id']."/".$row['file']; $img_input['hspace'] = 1; $img_input['alt'] = cleanMe ( $row['description'], "HTML" ); $output = image_display ($img_input); $smali['articles_view'] .= $input_settings['articles']['image_selected'][1]; $smali['articles_view'] .= $output['echo']; $smali['articles_view'] .= $input_settings['articles']['image_selected'][2]; $smali['articles_view'] .= cleanMe ( $row['description'], "HTML" ); $smali['articles_view'] .= $input_settings['articles']['image_selected'][3]; } mysqli_free_result ($result); $smali['articles_view'] .= $input_settings['articles']['image_selected'][4]; if ( !$j ) { $smali['articles_view'] .= $input_settings['articles']['image_selected_not_found']; } } else if ( isset( $_GET['cid'] ) ) { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Valin fr閠t // H閞na finnum vi?allar gr鷓purnar sem tengjast ssari fr閠t $group_article_id_search = ""; $sql_query = "SELECT `".$db_table['articles_bridge']."`.* "; $sql_query .= "FROM `".$db_table['articles_bridge']."` "; $sql_query .= "WHERE `".$db_table['articles_bridge']."`.`article_id`='".$_GET['cid']."'"; //echo "

A00: \$sql_query = ".$sql_query."

"; $sql_result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $sql_result ) ) { $group_article_id_search .= " `".$db_table['system_groups']."`.`id`='".$row['group_system']."' OR "; } mysqli_free_result( $sql_result ); $group_article_id_search = substr( $group_article_id_search, 0, strlen( $group_article_id_search ) - 3 ); $sql_query = "SELECT `".$db_table['system_groups']."`.* "; $sql_query .= "FROM `".$db_table['system_groups']."` "; $sql_query .= "WHERE `".$db_table['system_groups']."`.`stat`=1 AND `".$db_table['system_groups']."`.`type`='1' AND ( ".$group_article_id_search." ) ORDER BY `group_name`"; //echo "

A20: \$sql_query = ".$sql_query."

"; $sql_result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $sql_result ) ) { $articles_group_array_top[$row['id']]['group_name'] = $row['group_name']; $articles_group_array_top[$row['id']]['group_info'] = $row['group_info']; } mysqli_free_result( $sql_result ); $sql_query = "SELECT ".$db_table['articles'].".*, ".$db_table['users'].".username, ".$db_table['users'].".email "; $sql_query .= " FROM ".$db_table['articles'].", ".$db_table['system_groups'].", ".$db_table['users']." "; $sql_query .= " WHERE ".$db_table['articles'].".id=".$_GET['cid']." "; $sql_query .= "AND ".$db_table['users'].".id=".$db_table['articles'].".user_id AND ".$db_table['articles'].".stat>0 "; $sql_query .= "LIMIT 1"; //echo "

E01: ".$sql_query."

"; $result = mysqli_query( $sql_connection, $sql_query ); $date_settings_news['type'] = "stamp"; $date_settings_news['render'] = $input_settings['articles']['selected']['date_render']; $i = 0; while ( $row = mysqli_fetch_array ($result) ) { $i++; $date_settings_news['date'] = $row['time_created']; $news_temp['group'] = $input_settings['articles']['selected']['group'][0]; foreach ( $articles_group_array_top as $this_group_id => $this_group_val ) { $news_group_settings = webpage_settings( $this_group_val['group_info'] ); if ( isset ( $webpage_settings_array['news-group-open'] ) && strlen ( $webpage_settings_array['news-group-open'] ) ) { $news_temp['group'] .= "".$this_group_val['group_name'].""; } else if ( strlen( $news_group_settings['group-path'] ) ) { $news_temp['group'] .= "".$this_group_val['group_name'].""; } else { $news_temp['group'] .= $this_group_val['group_name']; } //$news_temp['group'] .= $this_group_val['group_name']; if ( isset( $input_settings['articles']['selected']['group_seperator'] ) ) { $news_temp['group'] .= $input_settings['articles']['selected']['group_seperator']; $substr_deduction = strlen( $input_settings['articles']['selected']['group_seperator'] ); } else { $news_temp['group'] .= ", "; $substr_deduction = 2; } } $news_temp['group'] = substr( $news_temp['group'], 0, strlen( $news_temp['group'] ) - $substr_deduction ); /* */ $news_temp['group'] .= $input_settings['articles']['selected']['group'][1]; $news_temp['date'] = $input_settings['articles']['selected']['date'][0].date_menu($date_settings_news).$input_settings['articles']['selected']['date'][1]; $news_temp['headline'] = $input_settings['articles']['selected']['headline'][0].cleanMe ($row['headline'], "HTMLStrip" ).$input_settings['articles']['selected']['headline'][1]; $news_temp['subheadline'] = ""; if ( strlen( $row['subheadline'] ) ) { $news_temp['subheadline'] = $input_settings['articles']['selected']['subheadline'][0].cleanMe ($row['subheadline'], "HTMLStrip" ).$input_settings['articles']['selected']['subheadline'][1]; } if ( strlen(cleanMe ($row['cast'], "HTML" )) < 7 ) { $news_temp['cast'] = $input_settings['articles']['selected']['cast'][0].cleanMe ($row['introduction'], "HTMLStrip" ).$input_settings['articles']['selected']['cast'][1]; } else { $news_temp['cast'] = $input_settings['articles']['selected']['cast'][0].cleanMe ($row['cast'], "HTML" ).$input_settings['articles']['selected']['cast'][1]; } $news_temp['author'] = $input_settings['articles']['selected']['author'][0]."".$row['username']."".$input_settings['articles']['selected']['author'][1]; } mysqli_free_result ($result); if ( $i ) { $sql_query = "SELECT ".$db_table['articlesimg'].".*, ".$db_table['files'].".type, ".$db_table['files'].".folder_id, ".$db_table['files'].".file, ".$db_table['files'].".header, ".$db_table['files'].".settings FROM ".$db_table['articlesimg'].", ".$db_table['files']." "; $sql_query .= "WHERE ".$db_table['articlesimg'].".cast_id=".$_GET[$input_settings['var_cast_id_name']]." AND ".$db_table['articlesimg'].".file_id=".$db_table['files'].".id ORDER BY ".$db_table['articlesimg'].".ordering"; //echo "

E00: ".$sql_query."

"; $result = mysqli_query( $sql_connection, $sql_query ); $j = 0; $images_temp = $input_settings['articles']['images_before']; while ( $row = mysqli_fetch_array( $result ) ) { /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // Myndir byrja /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// $j++; $id = $row['id']; $cast_id = $row['cast_id']; $file_id = $row['file_id']; $ordering = $row['ordering']; ///////////////////////////////////////////////////////// // New - begin $description = cleanMe( $row['description'], "HTMLStrip" ); $folder_id = $row['folder_id']; $file = $row['file']; $file_type = $row['type']; $file_header = $row['header']; $file_settings = webpage_settings( $row['settings'] ); $input_img_article['file'] = $file; $input_img_article['settings'] = $file_settings; $input_img_article['folder_id'] = $folder_id; $input_img_article['images_size'] = $input_settings['articles']['images_size']; $input_img_article['file_type'] = $file_type; $input_img_article['file_header'] = $file_header; $input_img_article['description'] = $description; $output_img_article = find_image( $input_img_article ); // New - end ///////////////////////////////////////////////////////// //$images_temp .= "
\n"; $images_temp .= "
\n"; //$images_temp .= $input_settings['articles']['selected']['image'][1]; if ( $webpage_settings_array['news-images-open'] == 2 ) { $images_temp .= "".$output_img_article['image'].""; // H閞na rf a?rendera javascript if ( !strlen( $smali['articles_javascript'] ) ) { $smali['articles_javascript'] = "if ( document.images ) {\n"; $smali['articles_javascript'] .= "\t\t\tvar myPicTitle = new Array();\n"; $smali['articles_javascript'] .= "\t\t\tvar myPicText = new Array();\n"; } $img_input_large['src'] = $system_settings['default_files_http'].$row['folder_id']."/".$row['file']; $output_large = image_display ( $img_input_large ); $smali['articles_javascript'] .= "\t\t\tpic".$j." = new Image(".$output_large['width'].",".$output_large['height'].");\n"; $smali['articles_javascript'] .= "\t\t\tpic".$j.".src = '".$system_settings['default_files_http'].$row['folder_id']."/".$row['file']."';\n"; $smali['articles_javascript'] .= "\t\t\tmyPicText[".$j."] = '".addslashes( $description )."';\n"; } else if ( $webpage_settings_array['news-images-open'] ) { $images_temp .= "".$file_output.""; } else { $images_temp .= "".$file_output.""; } if ( strlen( $description ) ) { $images_temp .= $input_settings['articles']['images_text_before']; $images_temp .= $description; $images_temp .= $input_settings['articles']['images_text_after']; } $images_temp .= "
"; } mysqli_free_result ($result); if ( $webpage_settings_array['news-images-open'] == 2 && $j ) { $smali['articles_javascript'] .= "\t\t}\n"; $smali['articles_javascript'] .= "\t\tvar total_images = ".$j.";\n"; } $images_temp .= $input_settings['articles']['images_after']; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // Myndir enda /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// $news_temp_array = explode ("|", $input_settings['articles']['selected']['order']); foreach ( $news_temp_array as $key => $val ) { if ( $val == "[:image:]" && $j ) { $smali['articles_view'] .= $images_temp; } else if ( $val == "[:group:]" ) { $smali['articles_view'] .= $news_temp['group']; } else if ( $val == "[:date:]" ) { $smali['articles_view'] .= $news_temp['date']; } else if ( $val == "[:headline:]" ) { $smali['articles_view'] .= $news_temp['headline']; } else if ( $val == "[:subheadline:]" ) { $smali['articles_view'] .= $news_temp['subheadline']; } else if ( $val == "[:cast:]" ) { $smali['articles_view'] .= $news_temp['cast']; } else if ( $val == "[:author:]" ) { $smali['articles_view'] .= $news_temp['author']; } } } else { $smali['articles_view'] .= $input_settings['articles']['selected']['not_found']; } } $news_search_string = ""; if ( isset( $webpage_settings_array['news-groups'] ) && $webpage_settings_array['news-groups'] ) { ////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////// // H閞na leitum vi?a?fr閠tagr鷓punum // Finnum h閞 fyrst allar gr鷓pur sem eiga a?vera h閞na $sql_query = "SELECT `".$db_table['system_groups']."`.`id`, `".$db_table['system_groups']."`.`group_name`, `".$db_table['system_groups']."`.`group_info` "; $sql_query .= "FROM `".$db_table['system_groups']."` "; $sql_query .= "WHERE `".$db_table['system_groups']."`.`stat`=1 AND `".$db_table['system_groups']."`.`type`='1'"; //echo "

A00: \$sql_query = ".$sql_query."

"; $sql_result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $sql_result ) ) { $articles_group_array[$row['id']]['group_name'] = $row['group_name']; $articles_group_array[$row['id']]['group_info'] = $row['group_info']; } mysqli_free_result( $sql_result ); //echo "

Z00: \$webpage_settings_array['news-groups'] = ".$webpage_settings_array['news-groups']."

"; if ( substr_count ($webpage_settings_array['news-groups'], "-") ) { $news_groups_expl = explode("-", $webpage_settings_array['news-groups']); foreach ( $news_groups_expl as $key => $val ) { if ( isset( $articles_group_array[$val] ) ) { if ( isset( $articles_group_array[$val] ) ) { // Til a?tryggja a?髒irkar gr鷓pur birtist $news_search_string .= " ".$db_table['articles_bridge'].".group_system=".$val." OR "; } } } $news_search_string = " AND ( ".substr ($news_search_string, 0, strlen( $news_search_string ) - 3 )." ) "; } else { if ( isset( $articles_group_array[$webpage_settings_array['news-groups']] ) ) { // Til a?tryggja a?髒irkar gr鷓pur birtist $news_search_string = " AND ".$db_table['articles_bridge'].".group_system=".$webpage_settings_array['news-groups']." "; } else { $news_search_string = " AND ".$db_table['articles_bridge'].".group_system=0 "; } } ////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////// } $news_search_string .= " AND ".$db_table['articles'].".stat>0 "; if ( isset($webpage_settings_array['news-shared']) && $webpage_settings_array['news-shared'] ) { $news_search_string .= " AND ".$db_table['articles'].".shared=1 "; } //echo "

Z01: \$webpage_settings_array['news-groups'] = ".$webpage_settings_array['news-groups']."

"; if ( isset( $webpage_settings_array['news-groups'] ) && $webpage_settings_array['news-groups'] ) { $date_settings['day_name'] = $input_settings['date_day_name']; if ( $webpage_settings_array['news-appearance'] ) { // Listi - Leit $skip_date_search = false; if ( isset( $_GET['date_to'] ) && isset( $_GET['date_from'] ) ) { $date_from = $_GET['date_from']; $date_to = $_GET['date_to']; } else if ( isset( $_POST['date_from_year'] ) ) { $_POST['date_from_year'] = cleanMe ( $_POST['date_from_year'], "number" ); $_POST['date_to_year'] = cleanMe ( $_POST['date_to_year'], "number" ); $date_from = $_POST['date_from_year'].$_POST['date_from_month'].$_POST['date_from_day']."0000"; $date_to = $_POST['date_to_year'].$_POST['date_to_month'].$_POST['date_to_day']."2400"; } else { if ( isset( $webpage_settings_array['news-date-from'] ) && $webpage_settings_array['news-date-from'] ) { $date_from = $webpage_settings_array['news-date-from']; $date_to = $webpage_settings_array['news-date-to']; } else { $date_from = date("YmdHi", mktime(0, 0, 0, date("m"), date("d")-$input_settings['search_days_offset'], date("Y"))); $date_to = date("Ymd")."2400"; $skip_date_search = true; } } $current_date = date("YmdHi"); if ( $current_date < $date_from ) { $date_from = $current_date; } if ( $current_date < $date_to ) { $date_to = $current_date; } $date_settings['date'] = $date_from; if ( $skip_date_search ) { $news_search_string = "WHERE ".$db_table['articles'].".time_created<=".$date_to." ".$news_search_string; } else { $news_search_string = "WHERE ".$date_from."<=".$db_table['articles'].".time_created AND ".$db_table['articles'].".time_created<=".$date_to." ".$news_search_string; } if ( !isset($_GET['number']) ) { $_GET['number'] = 0; } if (isset($_POST['amount'])) { cleanMe ( $_POST['amount'], "number" ); if ( $_POST['amount'] == 0 ) { $_POST['amount'] = 1; } setcookie("amount", $_POST['amount']); } else if (isset($_COOKIE['amount'])) { $_POST['amount'] = $_COOKIE['amount']; } else { $_POST['amount'] = $input_settings['search_amount']; setcookie("amount", $_POST['amount']); } $date_settings['var_name_year'] = "date_from_year"; $date_settings['var_name_month'] = "date_from_month"; $date_settings['var_name_day'] = "date_from_day"; $date_settings['render'] = "[:day:][:month:][:year:]"; $date_settings['year_type'] = 1; if (isset($_POST['search_string'])) { $_POST['search_string'] = cleanMe ($_POST['search_string'], "databaseStrip" ); $_POST['search_string'] = str_replace ("%20", " ", $_POST['search_string']); $_POST['search_string'] = str_replace ("\%", "", $_POST['search_string']); setcookie("search_string", $_POST['search_string']); } else if (isset($_COOKIE['search_string'])) { $_POST['search_string'] = $_COOKIE['search_string']; } else { $_POST['search_string'] = ""; } if ( strlen($_POST['search_string']) ) { $news_search_string .= " AND ("; $news_search_string .= "".$db_table['articles'].".headline LIKE '%". $_POST['search_string']."%' "; $news_search_string .= "OR ".$db_table['articles'].".subheadline LIKE '%". $_POST['search_string']."%' "; $news_search_string .= "OR ".$db_table['articles'].".introduction LIKE '%". $_POST['search_string']."%' "; $news_search_string .= "OR ".$db_table['articles'].".cast LIKE '%". $_POST['search_string']."%') "; } $smali['articles_searchbox'] = $input_settings['articles']['searchbox'][0]; $smali['articles_searchbox'] .= ""; $smali['articles_searchbox'] .= $input_settings['articles']['searchbox'][1]; $date_settings['date'] = $date_from; $smali['articles_searchbox'] .= date_menu ( $date_settings ); $smali['articles_searchbox'] .= $input_settings['articles']['searchbox'][2]; $date_settings['date'] = $date_to; $date_settings['var_name_year'] = "date_to_year"; $date_settings['var_name_month'] = "date_to_month"; $date_settings['var_name_day'] = "date_to_day"; $smali['articles_searchbox'] .= date_menu ( $date_settings ); $smali['articles_searchbox'] .= $input_settings['articles']['searchbox'][3]; $smali['articles_searchbox'] .= ""; $smali['articles_searchbox'] .= $input_settings['articles']['searchbox'][4]; $smali['articles_searchbox'] .= ""; $smali['articles_searchbox'] .= $input_settings['articles']['searchbox'][5]; $smali['articles_searchbox'] .= $input_settings['articles']['search_button']; $smali['articles_searchbox'] .= $input_settings['articles']['searchbox'][6]; // Finnum h閞 allar gr鷓purnar sem tengjast greinum /* $sql_query = "SELECT `".$db_table['system_groups']."`.`id`, `".$db_table['system_groups']."`.`group_name`, `".$db_table['system_groups']."`.`group_info` "; $sql_query .= "FROM `".$db_table['system_groups']."` "; $sql_query .= "WHERE `".$db_table['system_groups']."`.`stat`=1 AND `".$db_table['system_groups']."`.`type`='1'"; //echo "

A00: \$sql_query = ".$sql_query."

"; $sql_result = mysqli_query( $sql_connection, $sql_query ); while ( $row = mysqli_fetch_array( $sql_result ) ) { $articles_group_array[$row['id']]['group_name'] = $row['group_name']; $articles_group_array[$row['id']]['group_info'] = $row['group_info']; } mysqli_free_result( $sql_result ); */ $sql_query = "SELECT COUNT(*) FROM ".$db_table['articles'].", ".$db_table['articles_bridge']." ".$news_search_string." AND ".$db_table['articles_bridge'].".article_id=".$db_table['articles'].".id"; //echo "

B00: \$sql_query = ".$sql_query."

"; $result = mysqli_query( $sql_connection, $sql_query); foreach ( $result as $key => $val ) { //echo $key." => ".$val."
"; foreach ( $val as $key2 => $val2 ) { //echo $key2." => ".$val2."
"; $total_rows = $val2; } } //$total_rows = mysql_result($result, 0); mysqli_free_result ($result); // Finnum h閞 allar gr鷓purnar sem tengjast ssu - en tta rf a?vera ?s閞 f鎟slu 鷗 af a餱er餫fr骛inni $sql_query = "SELECT ".$db_table['articles'].".id, ".$db_table['articles_bridge'].".group_system "; $sql_query .= " FROM ".$db_table['articles'].", ".$db_table['articles_bridge'].", ".$db_table['users']." "; $sql_query .= " ".$news_search_string." AND ".$db_table['articles_bridge'].".article_id=".$db_table['articles'].".id AND ".$db_table['users'].".id=".$db_table['articles'].".user_id "; $sql_query .= " ORDER BY ".$db_table['articles'].".time_created DESC LIMIT ".$_GET['number'].", ".$_POST['amount']; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { $article_id_group[$row['id']][$row['group_system']] = true; } mysqli_free_result ($result); $sql_query = "SELECT ".$db_table['articles'].".*, ".$db_table['users'].".username, ".$db_table['users'].".email, ".$db_table['articles_bridge'].".group_system "; $sql_query .= " FROM ".$db_table['articles'].", ".$db_table['articles_bridge'].", ".$db_table['users']." "; $sql_query .= " ".$news_search_string." AND ".$db_table['articles_bridge'].".article_id=".$db_table['articles'].".id AND ".$db_table['users'].".id=".$db_table['articles'].".user_id "; $sql_query .= " ORDER BY ".$db_table['articles'].".time_created DESC LIMIT ".$_GET['number'].", ".$_POST['amount']; //echo "

C00: \$sql_query = ".$sql_query."

"; $result = mysqli_query( $sql_connection, $sql_query); $temp = ""; $date_settings['type'] = $time_settings['type'] = "stamp"; $date_settings['day_name'] = $input_settings['articles']['searchbox_result']['date_day_name']; $date_settings['render'] = $input_settings['articles']['searchbox_result']['date']; $time_settings['render'] = $input_settings['articles']['searchbox_result']['hour']; $s = 0; $user_article_ids[0] = true; // 辝tta er teljari til ss a?ganga 鷕 skugga um a?sama fr閠tin birtist bara einu sinni while ( $row = mysqli_fetch_array ($result) ) { if ( !isset( $user_article_ids[$row['id']] ) ) { $user_article_ids[$row['id']] = true; $news_group_settings = webpage_settings($row['group_info']); $s++; $temp .= $input_settings['articles']['searchbox_result']['table_row']['begin']; $date_settings['date'] = $time_settings['date'] = $row['time_created']; if ( $webpage_settings_array['news-hour'] ) { $temp .= $input_settings['articles']['searchbox_result']['table_row']['hour_begin']; $temp .= date_menu($time_settings); $temp .= $input_settings['articles']['searchbox_result']['table_row']['hour_end']; } if ( $webpage_settings_array['news-date'] ) { $temp .= $input_settings['articles']['searchbox_result']['table_row']['date_begin']; $temp .= date_menu($date_settings); $temp .= $input_settings['articles']['searchbox_result']['table_row']['date_end']; } if ( $webpage_settings_array['news-group'] ) { $temp .= $input_settings['articles']['searchbox_result']['table_row']['group_begin']; /* if ( isset ( $webpage_settings_array['news-group-open'] ) && strlen ( $webpage_settings_array['news-group-open'] ) ) { $temp .= "".$row['group_name'].""; } else if ( strlen( $news_group_settings['group-path'] ) ) { $temp .= "".$row['group_name'].""; } else { $temp .= cleanMe ( $row['group_name'], "HTMLStrip" ); } */ $this_group_temp = ""; foreach ( $article_id_group[$row['id']] as $this_group_id => $this_val ) { $news_group_settings = webpage_settings( $articles_group_array[$this_group_id]['group_info'] ); if ( isset ( $webpage_settings_array['news-group-open'] ) && strlen ( $webpage_settings_array['news-group-open'] ) ) { $this_group_temp .= "".$articles_group_array[$this_group_id]['group_name'].""; } else if ( strlen( $news_group_settings['group-path'] ) ) { $this_group_temp .= "".$articles_group_array[$this_group_id]['group_name'].""; } else { $this_group_temp .= cleanMe ( $articles_group_array[$this_group_id]['group_name'], "HTMLStrip" ); } if ( isset( $input_settings['articles']['searchbox_result']['group_seperator'] ) ) { $this_group_temp .= $input_settings['articles']['searchbox_result']['group_seperator']; $substr_deduction = strlen( $input_settings['articles']['searchbox_result']['group_seperator'] ); } else { $this_group_temp .= ", "; $substr_deduction = 2; } } $this_group_temp = substr( $this_group_temp, 0, strlen( $this_group_temp ) - $substr_deduction ); $temp .= $this_group_temp; $temp .= $input_settings['articles']['searchbox_result']['table_row']['group_end']; } $temp .= $input_settings['articles']['searchbox_result']['table_row']['cast_begin']; $temp .= $input_settings['articles']['searchbox_result']['table_row']['headline_begin']; if ( isset ( $webpage_settings_array['news-article-open'] ) && strlen ( $webpage_settings_array['news-article-open'] ) ) { $news_link = $webpage_settings_array['news-article-open']; } else { $news_link = $news_group_settings['article-path']; } if ( strstr( $news_link, "?" ) ) { $temp .= ""; } else { $temp .= ""; } $temp .= cleanMe ( $row['headline'], "HTMLStrip" ).""; $temp .= $input_settings['articles']['searchbox_result']['table_row']['headline_end']; if ( strlen($row['subheadline']) ) { $temp .= $input_settings['articles']['searchbox_result']['table_row']['subheadline_begin']; $temp .= cleanMe ( $row['subheadline'], "HTMLStrip" ); $temp .= $input_settings['articles']['searchbox_result']['table_row']['subheadline_end']; } if ( !strlen($row['introduction']) ) { $temp .= $row['cast']; } else { $temp .= cleanMe ( $row['introduction'], "HTMLStrip" ); } if ( $webpage_settings_array['news-author'] ) { $temp .= $input_settings['articles']['searchbox_result']['table_row']['author_begin']; if ( $webpage_settings_array['news-author-email'] ) { $temp .= ""; } $temp .= cleanMe ( $row['username'], "HTMLStrip" ); if ( $webpage_settings_array['news-author-email'] ) { $temp .= ""; } $temp .= $input_settings['articles']['selected']['author'][1]; $temp .= $input_settings['articles']['searchbox_result']['table_row']['author_end']; } $temp .= $input_settings['articles']['searchbox_result']['table_row']['cast_end']; $temp .= $input_settings['articles']['searchbox_result']['table_row']['end']; } } mysqli_free_result ($result); if ( $s ) { if ( $skip_date_search ) { $total_rows = $_POST['amount']; } $pn_settings['total'] = $total_rows; $pn_settings['dose'] = $_POST['amount']; $pn_settings['current_dose'] = $_GET['number']; $pn_settings['link_extension'] = "&".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]."&date_from=".$date_from."&date_to=".$date_to; if ( isset ( $input_settings['articles']['searchbox_result']['navigation_text'][0] ) ) { $pn_settings['text']['p'][0] = $input_settings['articles']['searchbox_result']['navigation_text'][0]; $pn_settings['text']['p'][1] = "-"; $pn_settings['text']['p'][2] = ""; $pn_settings['text']['n'][0] = $input_settings['articles']['searchbox_result']['navigation_text'][2]; $pn_settings['text']['n'][1] = "-"; $pn_settings['text']['n'][2] = ""; $pn_settings['text']['uc'][0] = ""; $pn_settings['text']['uc'][1] = "-"; $pn_settings['text']['uc'][2] = $input_settings['articles']['searchbox_result']['navigation_text'][1]; $pn_settings['text']['uc'][3] = ""; $pn_settings['text']['lc'][0] = ""; $pn_settings['text']['lc'][1] = " "; $pn_settings['text']['lc'][2] = ""; } $pn_output = previous_next ($pn_settings); $smali['articles'] .= $input_settings['articles']['searchbox_result']['table'][0]; $smali['articles'] .= $pn_output[0]; $smali['articles'] .= $input_settings['articles']['searchbox_result']['table'][1]; $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_begin']; $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][0]; if ( $webpage_settings_array['news-hour'] ) { $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][1]; } if ( $webpage_settings_array['news-date'] ) { $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][2]; } if ( $webpage_settings_array['news-group'] ) { $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][3]; } $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][4]; if ( $webpage_settings_array['news-author'] ) { $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][5]; } $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_head'][6]; $smali['articles'] .= $temp; $smali['articles'] .= $input_settings['articles']['searchbox_result']['table_end']; $smali['articles'] .= $input_settings['articles']['searchbox_result']['table'][2]; $smali['articles'] .= $pn_output[1]; $smali['articles'] .= $input_settings['articles']['searchbox_result']['table'][3]; } else { $smali['articles'] .= $webpage_settings_array['news-search-text']; } } else { if ( substr_count ($input_settings['articles']['render'], "|") ) { $news_render_expl = explode("|", $input_settings['articles']['render']); $total_news = 0; foreach ( $news_render_expl as $key => $val ) { if ( substr_count ($val, "ad-") ) { $news_ad_render[$key] = $val; } else { $news_render[$key] = $val * 1; $total_news += $news_render[$key]; } } } else { $news_render_expl[0] = $total_news = $input_settings['articles']['render']; } $articles_date_search_string = " ".$db_table['articles'].".time_created<=".date("YmdHi")." "; /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // H閞na er ger?breyting ?fj鰈d sem er s髏tur til ss a?f?tta r閠t - athuga  hvort tta skili s閞 nokku??alltof m鰎gum fr閠tum $total_news_fixed_amount = $total_news * 6; /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// $articles_limit_search_string = " LIMIT 0, ".$total_news_fixed_amount; if ( isset( $webpage_settings_array['news-date-from'] ) && $webpage_settings_array['news-date-from'] ) { $date_from = $webpage_settings_array['news-date-from']; $date_to = $webpage_settings_array['news-date-to']; $current_date = date("YmdHi"); if ( $current_date < $date_from ) { $date_from = $current_date; } if ( $current_date < $date_to ) { $date_to = $current_date; } $articles_date_search_string = " ".$date_from."<=".$db_table['articles'].".time_created AND ".$db_table['articles'].".time_created<=".$date_to." "; $articles_limit_search_string = " "; } $sql_query = "SELECT ".$db_table['articles'].".*, ".$db_table['users'].".username, ".$db_table['users'].".email, ".$db_table['articles_bridge'].".group_system "; $sql_query .= " FROM ".$db_table['articles'].", ".$db_table['articles_bridge'].", ".$db_table['users']." "; $sql_query .= " WHERE ".$articles_date_search_string." ".$news_search_string." AND ".$db_table['articles_bridge'].".article_id=".$db_table['articles'].".id AND ".$db_table['users'].".id=".$db_table['articles'].".user_id "; $sql_query .= " ORDER BY ".$db_table['articles'].".time_created DESC, ".$db_table['articles'].".stat DESC ".$articles_limit_search_string; //echo "

D00: \$sql_query = ".$sql_query."++

"; $result = mysqli_query( $sql_connection, $sql_query); $date_settings['type'] = $time_settings['type'] = "stamp"; $news_group_settings = ""; $s = 0; $user_article_ids[0] = true; // 辝tta er teljari til ss a?ganga 鷕 skugga um a?sama fr閠tin birtist bara einu sinni while ( $row = mysqli_fetch_array ($result) ) { if ( !isset( $user_article_ids[$row['id']] ) ) { $user_article_ids[$row['id']] = true; unset($news_group_settings); $news_group_settings = webpage_settings( $articles_group_array[$row['group_system']]['group_info'] ); $l = 0; if ( isset( $input_settings['articles'][$row['stat']] ) ) { $l = $row['stat']; } $temp[$s] = $input_settings['articles'][$l]['before_articles']; $news_temp_array = explode ("|", $input_settings['articles'][$l]['order']); foreach ( $news_temp_array as $key => $val ) { if ( $val == "[:image:]" ) { $sql_query_img = "SELECT ".$db_table['articlesimg'].".*, ".$db_table['files'].".type, ".$db_table['files'].".folder_id, ".$db_table['files'].".file, ".$db_table['files'].".settings FROM ".$db_table['articlesimg'].", ".$db_table['files']." "; $sql_query_img .= "WHERE ".$db_table['articlesimg'].".cast_id=".$row['id']." AND ".$db_table['articlesimg'].".file_id=".$db_table['files'].".id ORDER BY ".$db_table['articlesimg'].".ordering LIMIT 1"; $result_img = mysqli_query( $sql_connection, $sql_query_img); $j = 0; $pi = 0; while ( $row_img = mysqli_fetch_array ($result_img) ) { if ( !$pi ) { $temp[$s] .= $input_settings['articles'][$l]['images_before']; $pi++; } $id = $row_img['id']; $cast_id = $row_img['cast_id']; $file_id = $row_img['file_id']; $ordering = $row_img['ordering']; $img_description = cleanMe( $row_img['description'], "HTMLStrip" ); $folder_id = $row_img['folder_id']; $file = $row_img['file']; $file_type = $row_img['type']; $file_header = $row_img['header']; $file_settings = webpage_settings( $row_img['settings'] ); ///////////////////////////////////////////////////////// // New - begin $input_img_article['file'] = $file; $input_img_article['settings'] = $file_settings; $input_img_article['folder_id'] = $folder_id; $input_img_article['images_size'] = $input_settings['articles'][$l]['images_size']; $input_img_article['file_type'] = $file_type; $input_img_article['file_header'] = $file_header; $input_img_article['description'] = $img_description; $output_img_article = find_image ( $input_img_article ); // New - end ///////////////////////////////////////////////////////// if ( $input_settings['articles']['images_skip_force_size'] ) { $temp[$s] .= "
\n"; } else { $temp[$s] .= "
\n"; } $news_link = $news_group_settings['article-path']; if ( strstr( $news_link, "?" ) ) { $temp[$s] .= ""; } else if ( strlen($news_link) ) { $temp[$s] .= ""; } $temp[$s] .= $output_img_article['image']; $temp[$s] .= ""; $temp[$s] .= $input_settings['articles'][$l]['images_text_before']; $temp[$s] .= $img_description; $temp[$s] .= $input_settings['articles'][$l]['images_text_after']; $temp[$s] .= "
\n"; } mysqli_free_result( $result_img ); if ( $pi ) { $temp[$s] .= $input_settings['articles'][$l]['images_after']; } } else if ( $val == "[:group:]" ) { if ( $webpage_settings_array['news-group'] ) { $temp[$s] .= $input_settings['articles'][$l]['group'][0]; if ( isset ( $webpage_settings_array['news-group-open'] ) && strlen ( $webpage_settings_array['news-group-open'] ) ) { $temp[$s] .= "".$articles_group_array[$row['group_system']]['group_name'].""; } else if ( strlen( $news_group_settings['group-path'] ) ) { $temp[$s] .= "".$articles_group_array[$row['group_system']]['group_name'].""; } else { $temp[$s] .= cleanMe ( $articles_group_array[$row['group_system']]['group_name'], "HTMLStrip" ); } $temp[$s] .= $input_settings['articles'][$l]['group'][1]; } } else if ( $val == "[:date:]" ) { $date_settings['render'] = $input_settings['articles'][$l]['date_render']; $date_settings['date'] = $time_settings['date'] = $row['time_created']; if ( $webpage_settings_array['news-date'] ) { $temp[$s] .= $input_settings['articles'][$l]['date'][0]; $temp[$s] .= date_menu($date_settings); $temp[$s] .= $input_settings['articles'][$l]['date'][1]; } } else if ( $val == "[:headline:]" ) { $temp[$s] .= $input_settings['articles'][$l]['headline'][0]; if ( isset ( $webpage_settings_array['news-article-open'] ) && strlen ( $webpage_settings_array['news-article-open'] ) ) { $news_link = $webpage_settings_array['news-article-open']; } else { $news_link = $news_group_settings['article-path']; } if ( strstr( $news_link, "?" ) ) { $temp[$s] .= ""; } else { $temp[$s] .= ""; } $temp[$s] .= cleanMe ( $row['headline'], "HTMLStrip" ).""; $temp[$s] .= $input_settings['articles'][$l]['headline'][1]; } else if ( $val == "[:subheadline:]" ) { if ( strlen($row['subheadline']) ) { $temp[$s] .= $input_settings['articles'][$l]['subheadline'][0]; $temp[$s] .= cleanMe ( $row['subheadline'], "HTMLStrip" ); $temp[$s] .= $input_settings['articles'][$l]['subheadline'][1]; } } else if ( $val == "[:cast:]" ) { $temp[$s] .= $input_settings['articles'][$l]['cast'][0]; if ( !strlen($row['introduction']) ) { $temp[$s] .= cleanMe( $row['cast'], "HTML" ); } else { $temp[$s] .= cleanMe( $row['introduction'], "HTML" ); } $temp[$s] .= $input_settings['articles'][$l]['cast'][1]; } else if ( $val == "[:author:]" ) { if ( $webpage_settings_array['news-author'] ) { $temp[$s] .= $input_settings['articles'][$l]['author'][0]; if ( $webpage_settings_array['news-author-email'] ) { $temp[$s] .= ""; } $temp[$s] .= cleanMe ( $row['username'], "HTMLStrip" ); if ( $webpage_settings_array['news-author-email'] ) { $temp[$s] .= ""; } $temp[$s] .= $input_settings['articles'][$l]['author'][1]; } } else if ( $val == "[:button:]" ) { $temp[$s] .= $input_settings['articles'][$l]['button'][0]; if ( isset ( $webpage_settings_array['news-article-open'] ) && strlen ( $webpage_settings_array['news-article-open'] ) ) { $news_link = $webpage_settings_array['news-article-open']; } else { $news_link = $news_group_settings['article-path']; } if ( strstr( $news_link, "?" ) ) { $temp[$s] .= ""; } else { $temp[$s] .= ""; } $temp[$s] .= $input_settings['articles']['button']; $temp[$s] .= ""; $temp[$s] .= $input_settings['articles'][$l]['button'][1]; } } $temp[$s] .= $input_settings['articles'][$l]['after_articles']; $s++; } } mysqli_free_result ($result); if ( $s ) { $n = 0; $a = 0; $t = 0; $smali['articles'] .= $input_settings['articles']['begin']; foreach ( $news_render_expl as $key => $val ) { if ( substr_count ($val, "ad-") ) { $ad_id = substr($val, 3, strlen($val)); if ( isset( $smali['ads'][$ad_id] ) ) { $smali['articles'] .= $input_settings['articles']['before_ads']; $smali['articles'] .= $smali['ads'][$ad_id]; $smali['articles'] .= $input_settings['articles']['after_ads']; } $a++; } else { $n = 0; while ( $n < $val ) { if ( isset($temp[$n]) ) { if ( isset($temp[$t]) ) { $smali['articles'] .= $temp[$t]; } $t++; } $n++; } } } $smali['articles'] .= $input_settings['articles']['end']; } else { $smali['articles'] .= $webpage_settings_array['news-search-text']; } } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Dagskr? ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $smali['schedules_searchbox'] = ""; $smali['schedules'] = ""; $smali['schedules_view'] = ""; $smali['schedules_calendar'] = ""; $smali['schedules_navigation'] = ""; $show_schedule = true; if ( isset( $_GET[$input_settings['var_schedule_id_name']] ) ) { $sql_query = "SELECT ".$db_table['schedules'].".*, ".$db_table['system_groups'].".group_name, ".$db_table['system_groups'].".group_info, ".$db_table['users'].".username, ".$db_table['users'].".email "; $sql_query .= " FROM ".$db_table['schedules'].", ".$db_table['system_groups'].", ".$db_table['users']." "; $sql_query .= " WHERE ".$db_table['schedules'].".id=".$_GET[$input_settings['var_schedule_id_name']]." "; $sql_query .= "AND ".$db_table['users'].".id=".$db_table['schedules'].".user_id AND ".$db_table['schedules'].".stat>0 "; $sql_query .= "AND ".$db_table['system_groups'].".id=".$db_table['schedules'].".group_id AND ".$db_table['schedules'].".stat>0 "; $sql_query .= "LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); $date_settings_schedules['type'] = "stamp"; $date_settings_schedules['render'] = $input_settings['schedules']['selected']['date_render']; $schedules_group_settings = ""; $i = 0; while ( $row = mysqli_fetch_array ($result) ) { unset($schedules_group_settings); $schedules_group_settings = webpage_settings($row['group_info']); $i++; $schedules_temp['group'] = $input_settings['schedules']['selected']['group'][0]; if ( strlen( $schedules_group_settings['group-path'] ) ) { $schedules_temp['group'] .= "".cleanMe ( $row['group_name'], "HTMLStrip" ).""; } else { $schedules_temp['group'] .= cleanMe ( $row['group_name'], "HTMLStrip" ); } $schedules_temp['group'] .= $input_settings['schedules']['selected']['group'][1]; $date_settings_schedules['date'] = $row['date_from']; $schedules_temp['date'] = $input_settings['schedules']['selected']['date'][0].date_menu($date_settings_schedules); if ( $row['date_to'] != $row['date_from']) { $date_settings_schedules['date'] = $row['date_to']; $schedules_temp['date'] .= $input_settings['schedules']['selected']['date'][1].date_menu($date_settings_schedules); } $schedules_temp['date'] .= $input_settings['schedules']['selected']['date'][2]; $schedules_temp['headline'] = $input_settings['schedules']['selected']['headline'][0].cleanMe ( $row['headline'], "HTMLStrip" ).$input_settings['schedules']['selected']['headline'][1]; $schedules_temp['location'] = $input_settings['schedules']['selected']['location'][0].$row['location'].$input_settings['schedules']['selected']['location'][1]; $schedules_temp['url'] = $input_settings['schedules']['selected']['url'][0]."".$row['url']."".$input_settings['schedules']['selected']['url'][1]; if ( strlen(cleanString ( cleanMe ( $row['description'], "HTMLStrip" ), "toDatabase", "no")) < 7 ) { $schedules_temp['description'] = $input_settings['schedules']['selected']['description'][0].cleanMe ( $row['introduction'], "HTMLStrip" ).$input_settings['schedules']['selected']['description'][1]; } else { $schedules_temp['description'] = $input_settings['schedules']['selected']['description'][0].cleanMe ( $row['description'], "HTML" ).$input_settings['schedules']['selected']['description'][1]; } $schedules_temp['author'] = $input_settings['schedules']['selected']['author'][0]."".$row['username']."".$input_settings['schedules']['selected']['author'][1]; } mysqli_free_result ($result); if ( $i ) { $schedules_temp_array = explode ("|", $input_settings['schedules']['selected']['order']); foreach ( $schedules_temp_array as $key => $val ) { if ( $val == "[:group:]" ) { $smali['schedules_view'] .= $schedules_temp['group']; } else if ( $val == "[:date:]" ) { $smali['schedules_view'] .= $schedules_temp['date']; } else if ( $val == "[:headline:]" ) { $smali['schedules_view'] .= $schedules_temp['headline']; } else if ( $val == "[:location:]" ) { $smali['schedules_view'] .= $schedules_temp['location']; } else if ( $val == "[:url:]" ) { $smali['schedules_view'] .= $schedules_temp['url']; } else if ( $val == "[:description:]" ) { $smali['schedules_view'] .= $schedules_temp['description']; } else if ( $val == "[:author:]" ) { $smali['schedules_view'] .= $schedules_temp['author']; } } } else { $smali['schedules_view'] .= $input_settings['schedules']['selected']['notfound']; } if ( isset( $_GET[$input_settings['var_schedule_id_name']] ) && !$webpage_settings_array['schedules-list'] ) { $show_schedule = false; } } $schedules_search_string = ""; if ( isset($webpage_settings_array['schedules-groups']) && $webpage_settings_array['schedules-groups'] ) { if ( substr_count ($webpage_settings_array['schedules-groups'], "-") ) { $schedules_groups_expl = explode("-", $webpage_settings_array['schedules-groups']); foreach ( $schedules_groups_expl as $key => $val ) { $schedules_search_string .= " ".$db_table['schedules'].".group_id=".$val." OR "; } $schedules_search_string = " AND ( ".substr ($schedules_search_string, 0, strlen( $schedules_search_string ) - 3 )." ) ";; } else { $schedules_search_string = " AND ".$db_table['schedules'].".group_id=".$webpage_settings_array['schedules-groups']." "; } } $schedules_search_string .= " AND ".$db_table['schedules'].".stat=1 "; if ( isset($webpage_settings_array['schedules-shared']) && $webpage_settings_array['schedules-shared'] ) { $schedules_search_string .= " AND ".$db_table['schedules'].".shared=1 "; } if ( isset( $webpage_settings_array['schedules-calendar'] ) && $webpage_settings_array['schedules-calendar'] == 1 ) { $show_schedule = false; } if ( isset( $webpage_settings_array['schedules-groups'] ) && $webpage_settings_array['schedules-groups'] && $show_schedule ) { if ( isset( $_GET['year'] ) ) { $date_from = $_GET['year']; $date_to = $_GET['year']; if ( isset( $_GET['month'] ) ) { if ( strlen($_GET['month']) == 2) { $date_from .= $_GET['month']; $date_to .= $_GET['month']; } else { $date_from .= "0".$_GET['month']; $date_to .= "0".$_GET['month']; } if ( isset( $_GET['day'] ) ) { if ( strlen($_GET['day']) == 2) { $date_from .= $_GET['day']; $date_to .= $_GET['day']; } else { $date_from .= "0".$_GET['day']; $date_to .= "0".$_GET['day']; } } else { $date_from .= "01"; $date_to .= "31"; } $date_from = $date_from."0000"; $date_to = $date_to."2400"; } else { $date_from = $_GET['year']."01010000"; $date_to = $_GET['year']."12312400"; } } else if ( isset( $_GET['date_to'] ) && isset( $_GET['date_from'] ) ) { $date_from = $_GET['date_from']; $date_to = $_GET['date_to']; } else if ( isset( $_POST['date_from_year'] ) ) { $_POST['date_from_year'] = cleanMe ( $_POST['date_from_year'], "number" ); $_POST['date_to_year'] = cleanMe ( $_POST['date_to_year'], "number" ); $date_from = $_POST['date_from_year'].$_POST['date_from_month'].$_POST['date_from_day']."0000"; $date_to = $_POST['date_to_year'].$_POST['date_to_month'].$_POST['date_to_day']."2400"; } else { $date_to = date("YmdHi", mktime(24, 0, 0, date("m"), date("d")+$input_settings['search_days_offset'], date("Y"))); $date_from = date("Ymd")."0000"; } $date_settings['date'] = $date_from; $schedules_date_search = "( (".$date_from."<=".$db_table['schedules'].".date_from AND ".$db_table['schedules'].".date_from<=".$date_to." ) OR (".$date_from."<=".$db_table['schedules'].".date_to AND ".$db_table['schedules'].".date_to<=".$date_to." ) OR (".$date_from.">=".$db_table['schedules'].".date_from AND ".$db_table['schedules'].".date_to>=".$date_to." ) )"; if ( $webpage_settings_array['schedules-appearance'] ) { $schedules_search_string = "WHERE ".$schedules_date_search.$schedules_search_string; if ( !isset($_GET['number']) ) { $_GET['number'] = 0; } if (isset($_POST['amount'])) { $_POST['amount'] = cleanMe ( $_POST['amount'], "number" ); if ( $_POST['amount'] == 0 ) { $_POST['amount'] = 1; } setcookie("amount", $_POST['amount']); } else if (isset($_COOKIE['amount'])) { $_POST['amount'] = $_COOKIE['amount']; } else { $_POST['amount'] = $input_settings['search_amount']; setcookie("amount", $_POST['amount']); } $date_settings['var_name_year'] = "date_from_year"; $date_settings['var_name_month'] = "date_from_month"; $date_settings['var_name_day'] = "date_from_day"; $date_settings['render'] = "[:day:][:month:][:year:]"; $date_settings['year_type'] = 1; if (isset($_POST['search_string'])) { $_POST['search_string'] = cleanString ($_POST['search_string'], "toDatabase", "no"); $_POST['search_string'] = str_replace ("%20", " ", $_POST['search_string']); $_POST['search_string'] = str_replace ("\%", "", $_POST['search_string']); setcookie("search_string", $_POST['search_string']); } else if (isset($_COOKIE['search_string'])) { $_POST['search_string'] = $_COOKIE['search_string']; } else { $_POST['search_string'] = ""; } if ( strlen($_POST['search_string'] ) ) { if ( strlen( $_POST['search_string'] ) ) { $schedules_search_string .= " AND ("; } else { $schedules_search_string .= " ("; } $schedules_search_string .= "".$db_table['schedules'].".headline LIKE '%". $_POST['search_string']."%' "; $schedules_search_string .= "OR ".$db_table['schedules'].".introduction LIKE '%". $_POST['search_string']."%' "; $schedules_search_string .= "OR ".$db_table['schedules'].".location LIKE '%". $_POST['search_string']."%' "; $schedules_search_string .= "OR ".$db_table['schedules'].".url LIKE '%". $_POST['search_string']."%' "; $schedules_search_string .= "OR ".$db_table['schedules'].".description LIKE '%". $_POST['search_string']."%') "; } $smali['schedules_searchbox'] = $input_settings['schedules']['searchbox'][0]; $smali['schedules_searchbox'] .= ""; $smali['schedules_searchbox'] .= $input_settings['schedules']['searchbox'][1]; $date_settings['date'] = $date_from; $smali['schedules_searchbox'] .= date_menu ( $date_settings ); $smali['schedules_searchbox'] .= $input_settings['schedules']['searchbox'][2]; $date_settings['date'] = $date_to; $date_settings['var_name_year'] = "date_to_year"; $date_settings['var_name_month'] = "date_to_month"; $date_settings['var_name_day'] = "date_to_day"; $smali['schedules_searchbox'] .= date_menu ( $date_settings ); $smali['schedules_searchbox'] .= $input_settings['schedules']['searchbox'][3]; $smali['schedules_searchbox'] .= ""; $smali['schedules_searchbox'] .= $input_settings['schedules']['searchbox'][4]; $smali['schedules_searchbox'] .= ""; $smali['schedules_searchbox'] .= $input_settings['schedules']['searchbox'][5]; $smali['schedules_searchbox'] .= $input_settings['schedules']['search_button']; $smali['schedules_searchbox'] .= $input_settings['schedules']['searchbox'][6]; $sql_query = "SELECT COUNT(*) FROM ".$db_table['schedules']." ".$schedules_search_string; $result = mysqli_query( $sql_connection, $sql_query); foreach ( $result as $key => $val ) { //echo $key." => ".$val."
"; foreach ( $val as $key2 => $val2 ) { //echo $key2." => ".$val2."
"; $total_rows = $val2; } } //$total_rows = mysql_result($result, 0); mysqli_free_result ($result); $sql_query = "SELECT ".$db_table['schedules'].".*, ".$db_table['system_groups'].".group_name, ".$db_table['system_groups'].".group_info, ".$db_table['users'].".username, ".$db_table['users'].".email "; $sql_query .= " FROM ".$db_table['schedules'].", ".$db_table['system_groups'].", ".$db_table['users']." "; $sql_query .= " ".$schedules_search_string." AND ".$db_table['system_groups'].".id=".$db_table['schedules'].".group_id AND ".$db_table['users'].".id=".$db_table['schedules'].".user_id "; $sql_query .= " ORDER BY ".$db_table['schedules'].".date_to LIMIT ".$_GET['number'].", ".$_POST['amount']; $result = mysqli_query( $sql_connection, $sql_query); $j = 1; $temp = ""; $date_settings['type'] = $time_settings['type'] = "stamp"; $date_settings['day_name'] = $input_settings['schedules']['searchbox_result']['date_day_name']; $date_settings['render'] = $input_settings['schedules']['searchbox_result']['date']; $time_settings['render'] = $input_settings['schedules']['searchbox_result']['hour']; $schedules_group_settings = ""; $s = 0; while ( $row = mysqli_fetch_array ($result) ) { unset($schedules_group_settings); $schedules_group_settings = webpage_settings($row['group_info']); $s++; if ($j == 0){ $j = 1; } else { $j = 0; } $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['begin']; $date_settings['date'] = $time_settings['date'] = $row['date_from']; if ( $webpage_settings_array['schedules-hour'] ) { $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['hour_begin']; $temp .= date_menu($time_settings); $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['hour_end']; } if ( $webpage_settings_array['schedules-date'] ) { $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['date_begin']; $temp .= date_menu($date_settings); $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['date_end']; } if ( $webpage_settings_array['schedules-group'] || $webpage_settings_array['schedules-location'] ) { $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['group_begin']; $gg = 0; if ( strlen( $row['group_name'] ) && $webpage_settings_array['schedules-group'] ) { $gg = 1; if ( strlen( $schedules_group_settings['group-path'] ) ) { $temp .= "".cleanMe ( $row['group_name'], "HTMLStrip" ).""; } else { $temp .= cleanMe ( $row['group_name'], "HTMLStrip" ); } } if ( strlen( $row['location'] ) && $webpage_settings_array['schedules-location'] ) { if ( $gg ) { $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['group_middle']; } $temp .= cleanMe ( $row['location'], "HTMLStrip" ); } $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['group_end']; } $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['description_begin']; $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['headline_begin']; $schedules_link = $schedules_group_settings['schedules-path']; if ( strstr( $schedules_link, "?" ) ) { $schedules_link .= "&"; } else { $schedules_link .= "?"; } $temp .= ""; $temp .= $row['headline'].""; $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['headline_end']; if ( !strlen($row['introduction']) ) { $temp .= $row['description']; } else { $temp .= cleanMe ( $row['introduction'], "HTMLStrip" ); } if ( strlen($row['url']) ) { $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['url_begin']; $temp .= "".$row['url'].""; $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['url_end']; } if ( $webpage_settings_array['schedules-author'] ) { $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['author_begin']; if ( $webpage_settings_array['schedules-author-email'] ) { $temp .= ""; } $temp .= cleanMe ( $row['username'], "HTMLStrip" ); if ( $webpage_settings_array['schedules-author-email'] ) { $temp .= ""; } $temp .= $input_settings['schedules']['selected']['author'][1]; $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['author_end']; } $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['description_end']; $temp .= $input_settings['schedules']['searchbox_result']['table_row'][$j]['end']; } mysqli_free_result ($result); if ( $s ) { $pn_settings['total'] = $total_rows; $pn_settings['dose'] = $_POST['amount']; $pn_settings['current_dose'] = $_GET['number']; $pn_settings['link_extension'] = "&".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]."&date_from=".$date_from."&date_to=".$date_to; $pn_output = previous_next ($pn_settings); $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table'][0]; $smali['schedules'] .= $pn_output[0]; $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table'][1]; $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_begin']; $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_head'][0]; if ( $webpage_settings_array['schedules-hour'] ) { $smali['schedules'] .= $input_settings['articles']['searchbox_result']['table_head'][1]; } if ( $webpage_settings_array['schedules-date'] ) { $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_head'][2]; } if ( $webpage_settings_array['schedules-group'] || $webpage_settings_array['schedules-location'] ) { $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_head'][3]; } $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_head'][4]; if ( $webpage_settings_array['schedules-author'] ) { $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_head'][5]; } $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_head'][6]; $smali['schedules'] .= $temp; $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table_end']; $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table'][2]; $smali['schedules'] .= $pn_output[1]; $smali['schedules'] .= $input_settings['schedules']['searchbox_result']['table'][3]; } else { $smali['schedules'] .= $webpage_settings_array['schedules-search-text']; } } else { if ( substr_count ($input_settings['schedules']['render'], "|") ) { $schedules_render_expl = explode("|", $input_settings['schedules']['render']); $total_schedules = 0; foreach ( $schedules_render_expl as $key => $val ) { if ( substr_count ($val, "ad-") ) { $schedules_ad_render[$key] = $val; } else { $schedules_render[$key] = $val * 1; $total_schedules += $schedules_render[$key]; } } } else { $schedules_render_expl[0] = $total_schedules = $input_settings['schedules']['render']; } $sql_query = "SELECT ".$db_table['schedules'].".*, ".$db_table['system_groups'].".group_name, ".$db_table['system_groups'].".group_info, ".$db_table['users'].".username, ".$db_table['users'].".email "; $sql_query .= " FROM ".$db_table['schedules'].", ".$db_table['system_groups'].", ".$db_table['users']." WHERE "; if ( isset( $_GET['year'] ) ) { $sql_query .= " ".$schedules_date_search." "; $sql_query .= " AND ".$db_table['system_groups'].".id=".$db_table['schedules'].".group_id AND ".$db_table['users'].".id=".$db_table['schedules'].".user_id ".$schedules_search_string; } else { $sql_query .= " ".$db_table['schedules'].".date_to>=".date("YmdHi")." AND ".$db_table['system_groups'].".id=".$db_table['schedules'].".group_id AND ".$db_table['users'].".id=".$db_table['schedules'].".user_id ".$schedules_search_string; } $sql_query .= " AND ".$db_table['system_groups'].".stat>0 ORDER BY ".$db_table['schedules'].".date_from LIMIT 0, ".$total_schedules; $result = mysqli_query( $sql_connection, $sql_query ); $date_settings['type'] = $time_settings['type'] = "stamp"; $schedules_group_settings = ""; $s = 0; unset($temp); while ( $row = mysqli_fetch_array ($result) ) { unset($schedules_group_settings); $schedules_group_settings = webpage_settings($row['group_info']); $temp[$s] = $input_settings['schedules']['before_schedules']; $schedules_temp_array = explode ("|", $input_settings['schedules']['order']); $schedules_link = $schedules_group_settings['schedules-path']; if ( strstr( $schedules_link, "?" ) ) { $schedules_link .= "&"; } else { $schedules_link .= "?"; } foreach ( $schedules_temp_array as $key => $val ) { if ( $val == "[:group:]" ) { if ( $webpage_settings_array['schedules-group'] ) { $temp[$s] .= $input_settings['schedules']['group'][0]; if ( strlen( $schedules_group_settings['group-path'] ) ) { $temp[$s] .= "".cleanMe ( $row['group_name'], "HTMLStrip" ).""; } else { $temp[$s] .= cleanMe ( $row['group_name'], "HTMLStrip" ); } $temp[$s] .= $input_settings['schedules']['group'][1]; } } else if ( $val == "[:date_from:]" ) { $date_settings['render'] = $input_settings['schedules']['date_render']; $date_settings['date'] = $time_settings['date'] = $row['date_from']; if ( $webpage_settings_array['schedules-date'] ) { $temp[$s] .= $input_settings['schedules']['date_from'][0]; $temp[$s] .= date_menu($date_settings); $temp[$s] .= $input_settings['schedules']['date_from'][1]; } } else if ( $val == "[:date_to:]" ) { $date_settings['render'] = $input_settings['schedules']['date_render']; $date_settings['date'] = $time_settings['date'] = $row['date_to']; if ( $webpage_settings_array['schedules-date'] ) { if ( $row['date_to'] != $row['date_from'] ) { $temp[$s] .= $input_settings['schedules']['date_to'][0]; $temp[$s] .= date_menu($date_settings); $temp[$s] .= $input_settings['schedules']['date_to'][1]; } } } else if ( $val == "[:headline:]" ) { $temp[$s] .= $input_settings['schedules']['headline'][0]; $temp[$s] .= ""; $temp[$s] .= cleanMe ( $row['headline'], "HTMLStrip" ).""; $temp[$s] .= $input_settings['schedules']['headline'][1]; } else if ( $val == "[:location:]" ) { if ( strlen($row['location']) ) { $temp[$s] .= $input_settings['schedules']['location'][0]; $temp[$s] .= cleanMe ( $row['location'], "HTMLStrip" ); $temp[$s] .= $input_settings['schedules']['location'][1]; } } else if ( $val == "[:url:]" ) { if ( strlen($row['url']) ) { $temp[$s] .= $input_settings['schedules']['url'][0]; $temp[$s] .= ""; $temp[$s] .= $row['url']; $temp[$s] .= ""; $temp[$s] .= $input_settings['schedules']['url'][1]; } } else if ( $val == "[:description:]" ) { $temp[$s] .= $input_settings['schedules']['description'][0]; if ( !strlen(cleanMe ( $row['introduction'], "HTMLStrip" )) ) { $temp[$s] .= cleanMe ( $row['description'], "HTMLStrip" ); } else { $temp[$s] .= cleanMe ( $row['introduction'], "HTMLStrip" ); } $temp[$s] .= $input_settings['schedules']['description'][1]; } else if ( $val == "[:author:]" ) { if ( $webpage_settings_array['schedules-author'] ) { $temp[$s] .= $input_settings['schedules']['author'][0]; if ( $webpage_settings_array['schedules-author-email'] ) { $temp[$s] .= ""; } $temp[$s] .= cleanMe ( $row['username'], "HTMLStrip" ); if ( $webpage_settings_array['schedules-author-email'] ) { $temp[$s] .= ""; } $temp[$s] .= $input_settings['schedules']['author'][1]; } } else if ( $val == "[:button:]" ) { $temp[$s] .= $input_settings['schedules']['button2'][0]; $temp[$s] .= ""; $temp[$s] .= $input_settings['schedules']['button']; $temp[$s] .= ""; $temp[$s] .= $input_settings['schedules']['button2'][1]; } } $temp[$s] .= $input_settings['schedules']['after_schedules']; $s++; } mysqli_free_result ($result); if ( $s ) { $n = 0; $a = 0; $t = 0; $smali['schedules'] .= $input_settings['schedules']['begin']; foreach ( $schedules_render_expl as $key => $val ) { if ( substr_count ($val, "ad-") ) { $ad_id = substr($val, 3, strlen($val)); if ( isset( $smali['ads'][$ad_id] ) ) { $smali['schedules'] .= $input_settings['schedules']['before_ads']; $smali['schedules'] .= $smali['ads'][$ad_id]; $smali['schedules'] .= $input_settings['schedules']['after_ads']; } $a++; } else { $n = 0; while ( $n < $val ) { if ( isset($temp[$n]) ) { if ( isset($temp[$t]) ) { $smali['schedules'] .= $temp[$t]; } $t++; } $n++; } } } $smali['schedules'] .= $input_settings['schedules']['end']; } else { $smali['schedules'] .= $webpage_settings_array['schedules-search-text']; } } } if ( isset($webpage_settings_array['schedules-calendar']) && $webpage_settings_array['schedules-calendar'] ) { if ( isset( $_GET['month'] ) ) { $today_year = $_GET['year']; $today_month = $_GET['month']; } else { $today_year = date("Y"); $today_month = date("n"); } if ( !isset( $date_from ) ) { $date_from = date ("YmdHi"); } if ( !isset( $date_to ) ) { $date_to = date ("YmdHi"); } $today_day = date("j"); $today_days_amount = date("t", mktime(0, 0, 0, $today_month, 1, $today_year)); $start_weekday = date("w", mktime(0, 0, 0, $today_month, 1, $today_year)); $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][0]; if ( strlen( $webpage_settings_array['schedules-calendar-path'] ) ) { if ( strstr( $webpage_settings_array['schedules-calendar-path'], "?" ) ) { $calendar_link = $webpage_settings_array['schedules-calendar-path']; } else { $calendar_link = $webpage_settings_array['schedules-calendar-path']."?"; } } else { $calendar_link = $_SERVER['PHP_SELF']."?".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]; } $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][1]; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['months'][$today_month]." ".$today_year; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][2]; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][3]; $wd = 0; while ($wd < 7) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][4]; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['weekdays'][$wd]; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][5]; $wd++; } $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][6]; $d = 1; $wd = 0; $p_year = $today_year; $n_year = $today_year; if ( $today_month == 1 ) { $p_month = 12; $p_year = $today_year-1; } else { $p_month = $today_month-1; } if ( $today_month == 12 ) { $n_month = 1; $n_year = $today_year+1; } else { $n_month = $today_month+1; } if ( substr ( $date_from, 0, 8 ) == substr ( $date_to, 0, 8 ) && strlen($date_from) ) { $nav_year = substr ( $date_from, 0, 4 ); $nav_month = substr ( $date_from, 4, 2 ) * 1; $nav_day = substr ( $date_from, 6, 2 ) * 1; $nav_weekday = date("w", mktime(0, 0, 0, $nav_month, $nav_day, $nav_year)); if ( $nav_month == 1 && $nav_day == 1 ) { $p_nav_year = $nav_year - 1; $p_nav_month = 12; $p_nav_day = 31; } else if ( $nav_day == 1 ) { $p_nav_year = $nav_year; $p_nav_month = $nav_month - 1; $p_nav_day = date("t", mktime(0, 0, 0, $p_nav_month, 1, $p_nav_year)); } else { $p_nav_year = $nav_year; $p_nav_month = $nav_month; $p_nav_day = $nav_day - 1; } $max_day = date("t", mktime(0, 0, 0, $nav_month, 1, $nav_year)); if ( $nav_month == 12 && $nav_day == 31 ) { $n_nav_year = $nav_year + 1; $n_nav_month = 1; $n_nav_day = 1; } else if ( $nav_day == $max_day ) { $n_nav_year = $nav_year; $n_nav_month = $nav_month + 1; $n_nav_day = 1; } else { $n_nav_year = $nav_year; $n_nav_month = $nav_month; $n_nav_day = $nav_day + 1; } $smali['schedules_navigation'] = $input_settings['schedules']['calendar']['navigation']['table'][0]; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['button_day_before']; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['table'][1]; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['weekdays'][$nav_weekday]." ".$nav_day.". ".$input_settings['schedules']['calendar']['navigation']['months'][$nav_month]." ".$nav_year; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['table'][2]; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['button_day_next']; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['table'][3]; } else if ( substr ( $date_from, 0, 6 ) == substr ( $date_to, 0, 6 ) && strlen($date_from) ) { $nav_year = substr ( $date_from, 0, 4 ); $nav_month = substr ( $date_from, 4, 2 ) * 1; if ( $nav_month == 1 ) { $p_nav_year = $nav_year - 1; $p_nav_month = 12; } else { $p_nav_year = $nav_year; $p_nav_month = $nav_month - 1; } if ( $nav_month == 12 ) { $n_nav_year = $nav_year + 1; $n_nav_month = 1; } else { $n_nav_year = $nav_year; $n_nav_month = $nav_month + 1; } $smali['schedules_navigation'] = $input_settings['schedules']['calendar']['navigation']['table'][0]; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['button_month_before']; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['table'][1]; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['months'][$nav_month]." ".$nav_year; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['table'][2]; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['button_month_next']; $smali['schedules_navigation'] .= ""; $smali['schedules_navigation'] .= $input_settings['schedules']['calendar']['navigation']['table'][3]; } if ( strlen( $p_month ) < 2 ) { $date_from = $p_year."0".$p_month."200000"; } else { $date_from = $p_year.$p_month."200000"; } if ( strlen( $n_month ) < 2 ) { $date_to = $n_year."0".$n_month."072400"; } else { $date_to = $n_year.$n_month."072400"; } $schedules_search_string = ""; if ( isset($webpage_settings_array['schedules-groups']) && $webpage_settings_array['schedules-groups'] ) { if ( substr_count ($webpage_settings_array['schedules-groups'], "-") ) { $news_groups_expl = explode("-", $webpage_settings_array['schedules-groups']); foreach ( $schedules_groups_expl as $key => $val ) { $schedules_search_string .= " ".$db_table['schedules'].".group_id=".$val." OR "; } $schedules_search_string = " AND ( ".substr ($schedules_search_string, 0, strlen( $schedules_search_string ) - 3 )." ) ";; } else { $schedules_search_string = " AND ".$db_table['schedules'].".group_id=".$webpage_settings_array['schedules-groups']." "; } } $schedules_search_string .= " AND ".$db_table['schedules'].".stat=1 "; if ( isset($webpage_settings_array['schedules-shared']) && $webpage_settings_array['schedules-shared'] ) { $schedules_search_string .= " AND ".$db_table['schedules'].".shared=1 "; } $sql_query = "SELECT ".$db_table['schedules'].".id, ".$db_table['schedules'].".date_from, ".$db_table['schedules'].".date_to FROM ".$db_table['schedules'].", ".$db_table['system_groups']." WHERE ".$db_table['system_groups'].".stat>0 AND ".$db_table['system_groups'].".id=".$db_table['schedules'].".group_id AND ( (".$date_from."<=".$db_table['schedules'].".date_from AND ".$db_table['schedules'].".date_from<=".$date_to." ) OR (".$date_from."<=".$db_table['schedules'].".date_to AND ".$db_table['schedules'].".date_to<=".$date_to." ) OR (".$date_from.">=".$db_table['schedules'].".date_from AND ".$db_table['schedules'].".date_to>=".$date_to." ) ) ".$schedules_search_string; $result = mysqli_query( $sql_connection, $sql_query ); $finished = false; while ( $row = mysqli_fetch_array ($result) ) { $date_substr = $date_from; if ( $date_from < $row['date_from'] ) { $date_substr = $row['date_from']; } if ( $row['date_to'] < $date_to ) { } $date_substr = substr ($date_substr, 0, 8); $di = 0; while ( $di <= 50 ) { $di++; $occupied_days[$date_substr] = true; if ( substr ($date_substr, 4, 8) == "1231" ) { $date_substr = substr ($date_substr, 0, 4)."0101"; $date_substr += 10000; } else if ( substr ($date_substr, 6, 8) == 31 ) { $date_substr = substr ($date_substr, 0, 6)."01"; $date_substr += 100; } else { $date_substr += 1; } if ( substr ($row['date_to'], 0, 8) < $date_substr || substr ($date_to, 0, 8) < $date_substr) { break; } } if ( 50 <= count($occupied_days) ) { break; } } mysqli_free_result ($result); if ( $start_weekday ) { $bd = date("t", mktime(0, 0, 0, $today_month-1, $today_day, $today_year)); $bd -= $start_weekday - 1; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][7]; while ( $wd < $start_weekday ) { $date_stamp = $p_year; if ( strlen ( $p_month ) < 2 ) { $date_stamp .= "0".$p_month; } else { $date_stamp .= $p_month; } if ( strlen ( $bd ) < 2 ) { $date_stamp .= "0".$bd; } else { $date_stamp .= $bd; } if ( $bd == $today_day && $p_month == date("m") && $p_year == date("Y") ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['today']; if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; } } else if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['active']; $smali['schedules_calendar'] .= ""; } else { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['normal']; } $smali['schedules_calendar'] .= $bd; if ( $bd == $today_day && $p_month == date("m") && $p_year == date("Y") ) { if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; } $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['today']; } else if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['active']; } else { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['normal']; } $bd++; $wd++; } } while ($d <= $today_days_amount ) { $date_stamp = $today_year; if ( strlen ( $today_month ) < 2 ) { $date_stamp .= "0".$today_month; } else { $date_stamp .= $today_month; } if ( strlen ( $d ) < 2 ) { $date_stamp .= "0".$d; } else { $date_stamp .= $d; } if ( $wd == 0 ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][7]; } if ( $d == $today_day && $today_month == date("m") && $today_year == date("Y") ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['today']; if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; } } else if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['active']; $smali['schedules_calendar'] .= ""; } else { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['normal']; } $smali['schedules_calendar'] .= $d; if ( $d == $today_day && $today_month == date("m") && $today_year == date("Y") ) { if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; } $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['today']; } else if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['active']; } else { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['normal']; } $d++; $wd++; if ( $wd == 7 ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][10]; $wd = 0; } } if ( $wd ) { $d = 0; while ( $wd <= 6 ) { $d++; $date_stamp = $n_year; if ( strlen ( $n_month ) < 2 ) { $date_stamp .= "0".$n_month; } else { $date_stamp .= $n_month; } if ( strlen ( $d ) < 2 ) { $date_stamp .= "0".$d; } else { $date_stamp .= $d; } if ( $d == $today_day && $n_month == date("m") && $n_year == date("Y") ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['today']; if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; } } else if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['active']; $smali['schedules_calendar'] .= ""; } else { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][8]['normal']; } $smali['schedules_calendar'] .= $d; if ( $d == $today_day && $n_month == date("m") && $n_year == date("Y") ) { if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; } $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['today']; } else if ( isset( $occupied_days[$date_stamp] ) ) { $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['active']; } else { $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][9]['normal']; } $wd++; } $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][10]; } $calendar_link_2nd = $_SERVER['PHP_SELF']."?".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['button_month_before']; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['button_today']; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['button_month_next']; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= ""; $smali['schedules_calendar'] .= $input_settings['schedules']['calendar']['table'][14]; } if ( !isset( $webpage_settings_array['schedules-groups'] ) || !strlen( $webpage_settings_array['schedules-groups'] ) || !$webpage_settings_array['schedules-groups'] || !$show_schedule ) { $smali['schedules_navigation'] = ""; } $smali['followers'][0] = ""; $smali['followers-top'] = ""; $smali['followers-left'] = ""; $smali['followers-right'] = ""; $smali['followers-bottom'] = ""; $search_string = ""; $follower_top_exp = explode(" ", $webpage_settings_array['follower-top']); foreach ( $follower_top_exp as $key => $val ) { $val = 1 * $val; if ( strlen($val) && is_int($val) && $val) { $search_string .= " id=".$val." OR "; $follower_top[$val] = ""; } } $follower_left_exp = explode(" ", $webpage_settings_array['follower-left']); foreach ( $follower_left_exp as $key => $val ) { $val = 1 * $val; if ( strlen($val) && is_int($val) && $val) { $search_string .= " id=".$val." OR "; $follower_left[$val] = ""; } } $follower_right_exp = explode(" ", $webpage_settings_array['follower-right']); foreach ( $follower_right_exp as $key => $val ) { $val = 1 * $val; if ( strlen($val) && is_int($val) && $val) { $search_string .= " id=".$val." OR "; $follower_right[$val] = ""; } } $follower_bottom_exp = explode(" ", $webpage_settings_array['follower-bottom']); foreach ( $follower_bottom_exp as $key => $val ) { $val = 1 * $val; if ( strlen($val) && is_int($val) && $val) { $search_string .= " id=".$val." OR "; $follower_bottom[$val] = ""; } } if ( strlen($search_string) ) { $search_string = substr( $search_string, 0, strlen( $search_string ) - 4 ); $sql_query = "SELECT id, body FROM ".$db_table['webs']." WHERE (".$search_string.") AND group_id=".$input_settings['group_id']." ORDER BY header_title"; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { if ( isset($pages[$row['id']]) ) { $smali['followers'][$row['id']] = cleanMe ( $row['body'], "HTML" ); } else { $smali['followers'][$row['id']] = ""; } foreach ( $follower_top_exp as $key => $val ) { if ($val == $row['id'] && isset($pages[$row['id']]) ) { $smali['followers-top'] .= cleanMe ( $row['body'], "HTML" ); break; } } foreach ( $follower_left_exp as $key => $val ) { if ($val == $row['id'] && isset($pages[$row['id']]) ) { $smali['followers-left'] .= cleanMe ( $row['body'], "HTML" ); break; } } foreach ( $follower_right_exp as $key => $val ) { if ($val == $row['id'] && isset($pages[$row['id']]) ) { $smali['followers-right'] .= cleanMe ( $row['body'], "HTML" ); break; } } foreach ( $follower_bottom_exp as $key => $val ) { if ($val == $row['id'] && isset($pages[$row['id']]) ) { $smali['followers-bottom'] .= cleanMe ( $row['body'], "HTML" ); break; } } } mysqli_free_result ($result); } $date_settings['type'] = "stamp"; $date_settings['render'] = $input_settings['date_format']; $date_settings['day_name'] = $input_settings['date_day_name']; $date_settings['date'] = $smali['time_created']; if ( $webpage_settings_array['date-created'] ) { $smali['time_created'] = $input_settings['text_created_before'].date_menu ($date_settings).$input_settings['text_created_after']; } else { $smali['time_created'] = ""; } $date_settings['date'] = $smali['time_changed']; if ( $webpage_settings_array['date-updated'] ) { $smali['time_changed'] = $input_settings['text_last_updated_before'].date_menu ($date_settings).$input_settings['text_last_updated_after']; } else { $smali['time_changed'] = ""; } if ( strlen( $smali['trigger'] ) ) { $trigger_exp = explode("&", $smali['trigger']); unset($trigger); foreach ( $trigger_exp as $key => $val ) { $total_length = strlen($val); $split_pos = strpos($val, "="); $varible_name = substr($val, 0, $split_pos); $varible_value = substr($val, $split_pos + 1, $total_length - $split_pos); $trigger[$varible_name] = $varible_value; } } $sql_query = "UPDATE ".$db_table['counter']." SET counter=counter+1 WHERE sgroup_id=".$input_settings['group_id']." AND unit_id=".$_GET[$input_settings['var_id_name']]." LIMIT 1"; //echo $sql_query; $result = mysqli_query( $sql_connection, $sql_query ); $mysql_affected_rows = mysqli_affected_rows(); if ( !$mysql_affected_rows ) { $sql_query = "INSERT INTO ".$db_table['counter']." ( sgroup_id, unit_id, counter ) VALUES ( ".$input_settings['group_id'].", ".$_GET[$input_settings['var_id_name']].", 1 )"; //echo $sql_query; $result = mysqli_query( $sql_connection, $sql_query ); } if ( isset ( $webpage_settings_array['counter'] ) && $webpage_settings_array['counter'] ) { $counter = 0; $sql_query = "SELECT counter FROM ".$db_table['counter']." WHERE sgroup_id=".$input_settings['group_id']." AND unit_id=".$_GET[$input_settings['var_id_name']]." LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { $counter = $row['counter']; } mysqli_free_result ($result); $smali['counter'] = $input_settings['conter_before'].$counter.$input_settings['conter_after']; } if ($webpage_settings_array['navigation-path']) { $menu_quick = $input_settings['menu_quick'][0]; if (strlen($webpage_settings_array['navigation-path-name'])) { $menu_quick .= $input_settings['menu_quick'][1]; $menu_quick .= "".$webpage_settings_array['navigation-path-name'].""; $menu_quick .= $input_settings['menu_quick'][2]; } $smali['menu_quick'] = $menu_quick.$smali['menu_quick'].$input_settings['menu_quick'][5]; } else { $smali['menu_quick'] = ""; } $smali['css'] = ""; if ( !$webpage_settings_array['css'] ) { $smali['css'] = ""; if ( !$web_settings_array['default-css'] ) { $smali['css'] = ""; } } if (!isset($_POST['my_search_string'])) { $_POST['my_search_string'] = ""; } $smali['search_box'] = ""; if ( $webpage_settings_array['search-box'] ) { $smali['search_box'] = $input_settings['search']['search_box'][0]; $smali['search_box'] .= ""; $smali['search_box'] .= $input_settings['search']['search_box'][1]; $_POST['my_search_string'] = cleanMe ( $_POST['my_search_string'], "HTMLStrip" ); if ( !strlen ( $_POST['my_search_string'] ) ) { if ( isset ( $input_settings['search']['text_default'] ) ) { $_POST['my_search_string'] = ""; } } $smali['search_box'] .= ""; $smali['search_box'] .= $input_settings['search']['search_box'][2]; $smali['search_box'] .= $input_settings['search']['search_button']; $smali['search_box'] .= $input_settings['search']['search_box'][3]; $smali['search_box'] .= ""; $smali['search_box'] .= $input_settings['search']['search_box'][4]; } if ( strlen($_POST['my_search_string']) && $web_settings_array['search-page'] == $_GET[$input_settings['var_id_name']] && $_POST['my_search_string'] != $input_settings['search']['text_default']) { $search_settings = $input_settings['search']; $search_settings['search_string'] = $_POST['my_search_string']; $search_settings['group_id'] = $input_settings['group_id']; $search_settings['path_varible_name'] = $input_settings['var_id_name']; $search_settings['view_type'] = $web_settings_array['search-view']; $search_settings['texti_length'] = $web_settings_array['search-length']; $smali['body'] .= SMALIxL_Web_Search ($search_settings); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $smali['images'] = ""; $smali['images_selected'] = ""; $smali['files'] = ""; if ( isset( $webpage_settings_array['image-folder'] ) && strlen( $webpage_settings_array['image-folder'] ) ) { $image_overview_settings = $input_settings['files']; $image_overview_settings['folder_id'] = $webpage_settings_array['image-folder']; $image_overview_settings['image-folders'] = $webpage_settings_array['image-folders']; $image_overview_settings['image-apperance'] = $webpage_settings_array['image-apperance']; $image_overview_settings['images-open'] = $webpage_settings_array['images-open']; $image_overview_settings['ordering'] = $webpage_settings_array['image-order']; $image_overview_settings['ordering2'] = $webpage_settings_array['image-order2']; $image_overview_settings['image-size'] = $webpage_settings_array['image-size']; $images_files = files_overview( $image_overview_settings ); if ( $webpage_settings_array['images-open'] == 2 ) { $smali['images_javascript'] = $images_files['images_javascript']; } $smali['images'] = $images_files['images']; $smali['files'] = $images_files['files']; if ( isset( $images_files['images_selected'] ) ) { $smali['images_selected'] = $images_files['images_selected']; } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $smali['back_button'] = ""; if ( $webpage_settings_array['back-button'] ) { $smali['back_button'] = $input_settings['back_button']; } $smali['discussions'] = ""; $smali['discussions_new'] = ""; $smali['discussions_search'] = ""; $discussions_search_string = ""; $discussions_group_search_string = ""; if ( isset($webpage_settings_array['discussions-groups']) && $webpage_settings_array['discussions-groups'] ) { if ( isset( $_GET['date_to'] ) && isset( $_GET['date_from'] ) ) { $date_from = $_GET['date_from']; $date_to = $_GET['date_to']; } else if ( isset( $_POST['date_from_year'] ) ) { $_POST['date_from_year'] = cleanMe ( $_POST['date_from_year'], "database" ); $_POST['date_to_year'] = cleanMe ( $_POST['date_to_year'], "database" ); $date_from = $_POST['date_from_year'].$_POST['date_from_month'].$_POST['date_from_day']."0000"; $date_to = $_POST['date_to_year'].$_POST['date_to_month'].$_POST['date_to_day']."2400"; } else { $date_from = date("YmdHi", mktime(0, 0, 0, date("m"), date("d")-$input_settings['search_days_offset'], date("Y"))); $date_to = date("Ymd")."2400"; } $date_settings['date'] = $date_from; $discussions_search_string = " AND ".$date_from."<=".$db_table['discussions'].".date AND ".$db_table['discussions'].".date<=".$date_to." "; if ( !isset($_GET['number']) ) { $_GET['number'] = 0; } if (isset($_POST['amount'])) { $_POST['amount'] = cleanMe ( $_POST['amount'], "number" ); if ( $_POST['amount'] == 0 ) { $_POST['amount'] = 1; } setcookie("amount", $_POST['amount']); } else if (isset($_COOKIE['amount'])) { $_POST['amount'] = $_COOKIE['amount']; } else { $_POST['amount'] = $input_settings['search_amount']; setcookie("amount", $_POST['amount']); } $date_settings['var_name_year'] = "date_from_year"; $date_settings['var_name_month'] = "date_from_month"; $date_settings['var_name_day'] = "date_from_day"; $date_settings['render'] = "[:day:][:month:][:year:]"; $date_settings['year_type'] = 1; if (isset($_POST['search_string'])) { $_POST['search_string'] = cleanMe ($_POST['search_string'], "database" ); $_POST['search_string'] = str_replace ("%20", " ", $_POST['search_string']); $_POST['search_string'] = str_replace ("\%", "", $_POST['search_string']); setcookie("search_string", $_POST['search_string']); } else if (isset($_COOKIE['search_string'])) { $_POST['search_string'] = $_COOKIE['search_string']; } else { $_POST['search_string'] = ""; } if ( strlen($_POST['search_string']) ) { $discussions_search_string .= " AND ("; $discussions_search_string .= "".$db_table['discussions'].".headline LIKE '%". $_POST['search_string']."%' "; $discussions_search_string .= "OR ".$db_table['discussions'].".content LIKE '%". $_POST['search_string']."%' "; $discussions_search_string .= "OR ".$db_table['discussions'].".settings LIKE '%". $_POST['search_string']."%' ) "; } if ( !$webpage_settings_array['discussions-appearance'] ) { $discussions_search_string = ""; } $discussions_connection_group_type = 0; $discussions_connection_group_id = 0; $discussions_connection_id = 0; $discussions_connection_ext = ""; $show_list = true; $show_new = true; if ( $webpage_settings_array['discussions-connection'] ) { $show_list = false; $show_new = false; if ( $webpage_settings_array['discussions-connection'] == 4 && isset($_GET[$input_settings['files']['var_imgid_name']]) ) { $discussions_connection_group_type = 20; $discussions_connection_group_id = 20; $discussions_connection_id = $_GET[$input_settings['files']['var_imgid_name']]; $discussions_connection_ext = "&".$input_settings['files']['var_imgid_name']."=".$_GET[$input_settings['files']['var_imgid_name']]; $show_list = true; $show_new = true; } else if ( $webpage_settings_array['discussions-connection'] == 3 && isset($_GET[$input_settings['var_schedule_id_name']]) ) { $discussions_connection_group_type = 6; $discussions_connection_group_id = 6; $discussions_connection_id = $_GET[$input_settings['var_schedule_id_name']]; $discussions_connection_ext = "&".$input_settings['var_schedule_id_name']."=".$_GET[$input_settings['var_schedule_id_name']]; $show_list = true; $show_new = true; } else if ( $webpage_settings_array['discussions-connection'] == 2 && isset($_GET[$input_settings['var_cast_id_name']]) ) { $discussions_connection_group_type = 1; $discussions_connection_group_id = 1; $discussions_connection_id = $_GET[$input_settings['var_cast_id_name']]; $discussions_connection_ext = "&".$input_settings['var_cast_id_name']."=".$_GET[$input_settings['var_cast_id_name']]; $show_list = true; $show_new = true; } else if ( $webpage_settings_array['discussions-connection'] == 1 && isset($_GET[$input_settings['var_id_name']]) ) { $discussions_connection_group_type = 0; $discussions_connection_group_id = 0; $discussions_connection_group_id = $_GET[$input_settings['var_id_name']]; $show_list = true; $show_new = true; } } if ( substr_count ($webpage_settings_array['discussions-groups'], "-") ) { $discussions_search_string_temp = ""; $discussions_groups_expl = explode("-", $webpage_settings_array['discussions-groups']); foreach ( $discussions_groups_expl as $key => $val ) { $discussions_search_string_temp .= " ".$db_table['discussions'].".group_id=".$val." OR "; $discussions_group_search_string .= " id=".$val." OR "; } $discussions_search_string .= " AND ( ".substr ($discussions_search_string_temp, 0, strlen( $discussions_search_string_temp ) - 3 )." ) "; $discussions_group_search_string = " AND ( ".substr ($discussions_group_search_string, 0, strlen( $discussions_group_search_string ) - 3 )." ) "; } else { $discussions_search_string .= " AND ".$db_table['discussions'].".group_id=".$webpage_settings_array['discussions-groups']." "; $discussions_group_search_string = " AND id=".$webpage_settings_array['discussions-groups']." "; } if ( ( !isset( $_GET[$input_settings['var_discussion_new_name']] ) || $_GET[$input_settings['var_discussion_new_name']] == 2 ) && $show_new ) { $sql_query = "SELECT * FROM ".$db_table['system_groups']." WHERE stat=1 ".$discussions_group_search_string." ORDER BY group_name"; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { $discussions_group_settings = webpage_settings($row['group_info']); } if ( !$discussions_group_settings['discussion-permission'] || ( $discussions_group_settings['discussion-permission'] && $session_variables['user_id'] ) ) { // $smali['discussions_new'] = $input_settings['discussions']['button_new'][0]; $smali['discussions_new'] .= ""; $smali['discussions_new'] .= $webpage_settings_array['discussions-new-text']; $smali['discussions_new'] .= ""; $smali['discussions_new'] .= $input_settings['discussions']['button_new'][1]; } } if ( !isset( $_POST['smalixl_discussions_group_id'] ) ) { $_POST['smalixl_discussions_group_id'] = 0; } $post_smalixl_discussion_name = "smalixl_discussion_name".$_POST['smalixl_discussions_group_id']; if ( isset( $_POST[$post_smalixl_discussion_name] ) ) { $_POST['smalixl_discussion_name'] = $_POST[$post_smalixl_discussion_name]; $_POST['smalixl_discussions_user_id'] = 0; } else { if ( !isset( $_POST['smalixl_discussion_name'] ) ) { $_POST['smalixl_discussion_name'] = ""; } } $post_smalixl_discussions_email_var = "smalixl_discussion_email".$_POST['smalixl_discussions_group_id']; if ( isset( $_POST[$post_smalixl_discussions_email_var] ) ) { $_POST['smalixl_discussion_email'] = $_POST[$post_smalixl_discussions_email_var]; } else { if ( !isset( $_POST['smalixl_discussion_email'] ) ) { $_POST['smalixl_discussion_email'] = ""; } } $post_smalixl_discussion_group_type = "smalixl_discussions_group_type".$_POST['smalixl_discussions_group_id']; if ( isset( $_POST[$post_smalixl_discussion_group_type] ) ) { $_POST['smalixl_discussion_group_type'] = $_POST[$post_smalixl_discussion_group_type]; } else { $_POST['smalixl_discussion_group_type'] = 0; } if ( isset( $_POST['smalixl_discussion_notify'] ) && strlen($_POST['smalixl_discussion_notify']) ) { $_POST['smalixl_discussion_notify'] = "checked"; } else { $_POST['smalixl_discussion_notify'] = ""; } if ( !isset( $_POST['smalixl_discussion_headline'] ) ) { $_POST['smalixl_discussion_headline'] = ""; } if ( !isset( $_POST['smalixl_discussion_content'] ) ) { $_POST['smalixl_discussion_content'] = ""; } if ( !isset( $_POST['smalixl_discussions_icon'] ) ) { $_POST['smalixl_discussions_icon'] = 0; } if ( !isset( $_POST['smalixl_discussions_icon_id'] ) ) { $_POST['smalixl_discussions_icon_id'] = ""; } if ( !isset( $_POST['smalixl_discussions_user_id'] ) ) { $_POST['smalixl_discussions_user_id'] = $session_variables['user_id']; } if ( !isset( $_POST['smalixl_discussions_mother_id'] ) ) { $_POST['smalixl_discussions_mother_id'] = 0; } if ( !isset( $_POST['smalixl_discussions_family_id'] ) ) { $_POST['smalixl_discussions_family_id'] = 0; } if ( !isset( $_POST['smalixl_discussions_selected_id'] ) ) { $_POST['smalixl_discussions_selected_id'] = 0; } if ( !isset( $_POST['smalixl_discussion_notify_email'] ) ) { $_POST['smalixl_discussion_notify_email'] = ""; } $discussion_group_id_reply = 0; if ( isset( $_GET[$input_settings['var_discussion_new_name']] ) ) { if ( isset( $_GET[$input_settings['var_discussion_id_name']] ) ) { $sql_query = "SELECT group_id, mother_id, family_id, user_id, headline, settings FROM ".$db_table['discussions']." WHERE stat=1 AND id=".$_GET[$input_settings['var_discussion_id_name']]." LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { $discussion_group_id_reply = $row['group_id']; $discussions_thread_settings = webpage_settings($row['settings']); if ( $discussions_thread_settings['notify'] ) { if ( strlen( $discussions_thread_settings['email'] ) ) { $_POST['smalixl_discussion_notify_email'] = $discussions_thread_settings['email']; } else { $sql_query_email = "SELECT email FROM ".$db_table['users']." WHERE id=".$row['user_id']." LIMIT 1"; $result_email = mysqli_query( $sql_connection, $sql_query_email); while ( $row_email = mysqli_fetch_array ($result_email) ) { $_POST['smalixl_discussion_notify_email'] = $row_email['email']; } mysqli_free_result ($result_email); } } $_POST['smalixl_discussion_headline'] = $input_settings['discussions']['edit']['text_headline_reply'].$row['headline']; $_POST['smalixl_discussions_mother_id'] = $_GET[$input_settings['var_discussion_id_name']]; if ( $row['family_id'] ) { $_POST['smalixl_discussions_family_id'] = $row['family_id']; if ( !$webpage_settings_array['discussions-inline'] ) { $_POST['smalixl_discussions_mother_id'] = $row['mother_id']; } } else { $_POST['smalixl_discussions_mother_id'] = $_GET[$input_settings['var_discussion_id_name']]; $_POST['smalixl_discussions_family_id'] = $_GET[$input_settings['var_discussion_id_name']]; } } mysqli_free_result ($result); $_POST['smalixl_discussions_selected_id'] = $_GET[$input_settings['var_discussion_id_name']]; } $error_name = ""; $error_email = ""; $error_headline = ""; $error_content = ""; $settings_spamfilter['input_name_text'] = "smalixl_discussions_answer"; $settings_spamfilter['input_name_hidden'] = "smalixl_discussions_hidden"; $settings_spamfilter['input_extra'] = " style=\"".$input_settings['discussions']['edit']['input_normal_style']."\" "; if ( $_GET[$input_settings['var_discussion_new_name']] == 2 ) { ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// $spamfilter['error'] = false; $spamfilter = smalixl_spamfilter( $settings_spamfilter ); if ( !$spamfilter['error'] ) { ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// if ( $_POST['smalixl_discussion_notify'] == "checked" ) { $_POST['smalixl_discussion_notify'] = 1; } else { $_POST['smalixl_discussion_notify'] = 0; } $discussion_stat = 1; if ( $webpage_settings_array['discussions-censor'] ) { $discussion_stat = 0; } $discussion_settings = "[::name::]||".cleanMe ( $_POST['smalixl_discussion_name'], "database" )."||[::email::]||".$_POST['smalixl_discussion_email']."||[::ip::]||".$session_variables['ip']."||[::notify::]||".$_POST['smalixl_discussion_notify']."||[::icon::]||".$_POST['smalixl_discussions_icon_id']."||[::replies::]||0||[::replied::]||"; $smalixl_discussion_headline = cleanMe ( $_POST['smalixl_discussion_headline'], "database" ); $smalixl_discussion_content = cleanMe ( $_POST['smalixl_discussion_content'], "database" ); $discussion_settings = cleanMe ( $discussion_settings, "database" ); $sql_query = "INSERT INTO ".$db_table['discussions']." ( group_id, family_id, mother_id, system_id, unit_id, shared, stat, date, user_id, headline, content, settings ) VALUES ('".$_POST['smalixl_discussions_group_id']."', ".$_POST['smalixl_discussions_family_id'].", ".$_POST['smalixl_discussions_mother_id'].", ".$discussions_connection_group_id.", ".$discussions_connection_id.", 1, ".$discussion_stat.", '".date("YmdHi")."', '".$_POST['smalixl_discussions_user_id']."', '".$smalixl_discussion_headline."', '".$smalixl_discussion_content."', '".$discussion_settings."')"; if (mysqli_query( $sql_connection, $sql_query)) { $discussion_reply_id = mysql_insert_id(); if ( $_POST['smalixl_discussions_family_id'] ) { $sql_query = "SELECT settings FROM ".$db_table['discussions']." WHERE id=".$_POST['smalixl_discussions_family_id']." LIMIT 1"; $result = mysqli_query( $sql_connection, $sql_query); while ( $row = mysqli_fetch_array ($result) ) { $discussions_family_settings = webpage_settings($row['settings']); $discussion_settings = "[::name::]||".$discussions_family_settings['name']."||[::email::]||".$discussions_family_settings['email']."||[::ip::]||".$discussions_family_settings['ip']."||[::notify::]||".$discussions_family_settings['notify']."||[::icon::]||".$discussions_family_settings['icon']."||[::replies::]||".++$discussions_family_settings['replies']."||[::replied::]||".date("YmdHi"); } mysqli_free_result ($result); $sql_query = "UPDATE ".$db_table['discussions']." SET settings='".$discussion_settings."' WHERE id=".$_POST['smalixl_discussions_family_id']." LIMIT 1"; mysqli_query( $sql_connection, $sql_query); $_GET[$input_settings['var_discussion_id_name']] = $_POST['smalixl_discussions_family_id']; } else { $_GET[$input_settings['var_discussion_id_name']] = $discussion_reply_id; } $_GET[$input_settings['var_discussion_id_name']] = $_POST['smalixl_discussions_family_id']; if ( strlen( $_POST['smalixl_discussion_notify_email'] ) ) { $mail_to = ""; if ( substr_count ($_POST['smalixl_discussion_notify_email'], ";") ) { $email_expl = explode(";", $_POST['smalixl_discussion_notify_email']); foreach ( $email_expl as $key => $val ) { $val = str_replace ( " ", "", $val ); if ( strlen( $val ) && !errorCheck ($val, "email")) { $mail_to = $val; break; } } } else { $mail_to = $_POST['smalixl_discussion_notify_email']; } if ( !errorCheck ($mail_to, "email") ) { $subject = $input_settings['discussions']['edit']['email_subject']; $body = $input_settings['discussions']['edit']['email_body'][0].$_POST['smalixl_discussion_headline'].$input_settings['discussions']['edit']['email_body'][1]; $body .= "\t".$system_settings['default_website']."/index.php?".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]."&".$input_settings['var_discussion_id_name']."=".$_POST['smalixl_discussions_mother_id']; $body .= $input_settings['discussions']['edit']['email_body'][2]; $from = $input_settings['discussions']['edit']['email_from']; @mail ( $mail_to , $subject, $body, $from ); } } } } } else if ( $_GET[$input_settings['var_discussion_new_name']] == 1 ) { $error = 0; $user_id = 0; //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // H閞na kemur SPAM s韆n, ?e. samanbur餫rt閗k //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// if ( !$_POST['smalixl_discussion_group_type'] ) { if ( strlen( $_POST['smalixl_discussion_name'] ) < 2 ) { $error++; $error_name = $input_settings['discussions']['edit']['input_error_style']; } } else if ( $_POST['smalixl_discussion_group_type'] == 2 ) { $_POST['smalixl_discussion_name'] = cleanMe ( $_POST['smalixl_discussion_name'], "database" ); if ( strlen( $_POST['smalixl_discussion_name'] ) < 2 ) { $error++; $error_name = $input_settings['discussions']['edit']['input_error_style']; } else { $user_id = 0; $sql_query = "SELECT id FROM ".$db_table['users']." WHERE username='".$_POST['smalixl_discussion_name']."' AND stat=1 LIMIT 1"; $sql_result = mysqli_query( $sql_connection, $sql_query); while ($row = mysqli_fetch_array ($sql_result)) { $user_id = $row['id']; } mysqli_free_result ($sql_result); if ( !$user_id ) { $error++; $error_name = $input_settings['discussions']['edit']['input_error_style']; } else { $_POST['smalixl_discussions_user_id'] = $user_id; } } } if ( !$_POST['smalixl_discussion_group_type'] ) { $_POST['smalixl_discussion_email'] = cleanMe ( $_POST['smalixl_discussion_email'], "database" ); if ( strlen( $_POST['smalixl_discussion_email'] ) && errorCheck ($_POST['smalixl_discussion_email'], "email") ) { $error++; $error_email = $input_settings['discussions']['edit']['input_error_style']; } } $_POST['smalixl_discussion_headline'] = cleanMe ( $_POST['smalixl_discussion_headline'], "database" ); if ( !strlen( $_POST['smalixl_discussion_headline'] ) ) { $error++; $error_headline = $input_settings['discussions']['edit']['input_error_style']; } $_POST['smalixl_discussion_content'] = cleanMe ( $_POST['smalixl_discussion_content'], "database" ); if ( strlen( $_POST['smalixl_discussion_content'] ) < 5 ) { $error++; $error_content = $input_settings['discussions']['edit']['input_error_style']; } $_POST['smalixl_discussions_icon_id'] = cleanMe ( $_POST['smalixl_discussions_icon_id'], "database" ); ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// $spamfilter = smalixl_spamfilter( $settings_spamfilter ); if ( $spamfilter['error'] ) { $error++; $settings_spamfilter['input_extra'] = " style=\"".$input_settings['discussions']['edit']['input_error_style']."\" "; } ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// if ( $error ) { $_GET[$input_settings['var_discussion_new_name']] = 0; if ( $_POST['smalixl_discussions_selected_id'] ) { $_GET[$input_settings['var_discussion_id_name']] = $_POST['smalixl_discussions_selected_id']; } else { $show_list = false; } } } if ( $_GET[$input_settings['var_discussion_new_name']] == 2 ) { } else if ( $_GET[$input_settings['var_discussion_new_name']] == 1 ) { $smali['discussions'] .= ""; $smali['discussions'] .= ""; $smali['discussions'] .= "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; $smali['discussions'] .= ""; $smali['discussions'] .= "
"; $smali['discussions'] .= $input_settings['discussions']['edit']['text_read']; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "
"; $smali['discussions'] .= "
"; if ( strlen( $_POST['smalixl_discussions_icon_id'] ) ) { $smali['discussions'] .= " "; } if ( strlen( $_POST['smalixl_discussion_name'] ) ) { $smali['discussions'] .= cleanMe ( $_POST['smalixl_discussion_name'], "HTMLStrip" ) ; } if ( strlen( $_POST['smalixl_discussion_email'] ) && strlen( $_POST['smalixl_discussion_name'] ) ) { $smali['discussions'] .= " | "; } if ( strlen( $_POST['smalixl_discussion_email'] ) ) { $smali['discussions'] .= " ".$_POST['smalixl_discussion_email'].""; } if ( $_POST['smalixl_discussion_notify'] == "checked" ) { $smali['discussions'] .= "
(".$input_settings['discussions']['edit']['text_notify'].")"; } $smali['discussions'] .= "
".$_POST['smalixl_discussions_group_name']."
"; $smali['discussions'] .= "
"; $smali['discussions'] .= cleanMe ( $_POST['smalixl_discussion_headline'], "HTMLStrip" ) ; $smali['discussions'] .= "
"; $smali['discussions'] .= cleanMe ( $_POST['smalixl_discussion_content'], "HTMLStrip" ) ; $smali['discussions'] .= "
"; $smali['discussions'] .= "
"; $smali['discussions'] .= "
"; $smali['discussions'] .= "
"; if ( $_POST['smalixl_discussions_selected_id'] ) { $_GET[$input_settings['var_discussion_id_name']] = $_POST['smalixl_discussions_selected_id']; } else { $show_list = false; } $_GET[$input_settings['var_discussion_id_name']] = $_POST['smalixl_discussions_family_id']; } else { if ( $discussion_group_id_reply ) { $discussions_group_search_string = " AND id=".$discussion_group_id_reply." "; } $sql_query = "SELECT * FROM ".$db_table['system_groups']." WHERE stat=1 ".$discussions_group_search_string." ORDER BY group_name"; $result = mysqli_query( $sql_connection, $sql_query); $group_id_selected = 0; if ( isset( $_POST['smalixl_discussions_group_id'] ) ) { $group_id_selected = $_POST['smalixl_discussions_group_id']; } if ( isset( $_POST['smalixl_discussions_icon'] ) ) { $icon_id_selected = $_POST['smalixl_discussions_icon']; } $i = 0; $users_display = ""; $icons_display = ""; $icons_id = 0; $javascript_icons_array = "var icons = new Array();"; $javascript_groups_array = "var mygroups = new Array();"; while ( $row = mysqli_fetch_array ($result) ) { $discussions_group_settings = webpage_settings($row['group_info']); if ( !$discussions_group_settings['discussion-permission'] || $session_variables['access'] ) { $groups[$row['id']] = $row['group_name']; $javascript_groups_array .= "mygroups[".$row['id']."] = '".$row['group_name']."';\n"; $icons_display .= "\n\n"; $icons_display .= "\">\n"; if ( 4 < strlen ($discussions_group_settings['discussion-icons']) ) { $discussions_group_settings['discussion-icons'] = trim( $discussions_group_settings['discussion-icons'] ); $icons_list_expl = explode(" ", $discussions_group_settings['discussion-icons']); foreach ( $icons_list_expl as $key => $val ) { $invalid_strings = array("\n", " ", "\t", "\n", "\r", "\0", "\x0B"); $val = str_replace ( $invalid_strings, "", $val); if ( strlen( $val) ) { $icons_display .= "\n
"; $icons_display .= ""; $icons_display .= "\n"; $javascript_icons_array .= "icons[".$icons_id."] = '".$val."';\n"; $icons_id++; } } } $icons_display .= "
\n\n\n"; $users_display .= ""; if ( $discussions_group_settings['discussion-permission'] == 2 ) { $users_display .= ""; $users_display .= ""; $users_display .= ""; $users_display .= "
".$input_settings['discussions']['edit']['text_name']." 
 ".$input_settings['discussions']['edit']['text_notify']."
"; } else if ( $discussions_group_settings['discussion-permission'] == 1 ) { $users_display .= ""; $users_display .= ""; $users_display .= "
 ".$input_settings['discussions']['edit']['text_notify']."
"; } else { $users_display .= ""; $users_display .= ""; $users_display .= ""; $users_display .= "
".$input_settings['discussions']['edit']['text_name']." 
".$input_settings['discussions']['edit']['text_email']." ".$input_settings['discussions']['edit']['text_notify']."
"; } $users_display .= ""; $users_display .= ""; $i++; } } mysqli_free_result ($result); if ( !isset( $_GET[$input_settings['var_discussion_id_name']] ) ) { $show_list = false; } $smali['discussions'] .= ""; $smali['discussions'] .= ""; $smali['discussions'] .= "\n\n"; $smali['discussions'] .= $icons_display; $smali['discussions'] .= "\n\n\n"; $smali['discussions'] .= "\n\n\n\n\n\n\n"; $smali['discussions'] .= "\n\n\n\n"; ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// $smali['discussions'] .= "\n\n\n"; ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// $smali['discussions'] .= ""; $smali['discussions'] .= "
"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n\n\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n"; $smali['discussions'] .= "\n\n"; if ( 1 < count($groups) ) { $smali['discussions'] .= "\n"; } else { foreach ( $groups as $key => $val ) { $smali['discussions'] .= ""; } } $smali['discussions'] .= "
".$input_settings['discussions']['edit']['text_headline']."
"; $smali['discussions'] .= ""; $smali['discussions'] .= "
"; $smali['discussions'] .= "
".cleanMe ( $input_settings['discussions']['edit']['text_content'], "HTMLStrip" )."
"; $smali['discussions'] .= ""; $smali['discussions'] .= "
"; $smali['discussions'] .= $users_display; $smali['discussions'] .= "
"; $settings_spamfilter['math_question_begin'] = "Hva?er "; $settings_spamfilter['math_question'][0] = " pl鷖 "; $settings_spamfilter['math_question'][1] = " sinnum "; $settings_spamfilter['math_question_end'] = "?"; $settings_spamfilter['input_extra'] = " class=\"discussion_box_input\""; $spamfilter = smalixl_spamfilter( $settings_spamfilter ); $smali['discussions'] .= "
".$spamfilter['render']."
"; $smali['discussions'] .= "
"; $_GET[$input_settings['var_discussion_id_name']] = $_POST['smalixl_discussions_family_id']; } } if ( $show_list ) { if ( ( isset ( $_GET[$input_settings['var_discussion_id_name']] ) && $_GET[$input_settings['var_discussion_id_name']] ) || $webpage_settings_array['discussions-connection'] ) { if ( $webpage_settings_array['discussions-connection'] ) { $discussions_connection_search_string = " AND system_id=".$discussions_connection_group_id." AND unit_id=".$discussions_connection_id." "; } else { $discussions_connection_search_string = " AND ( ".$db_table['discussions'].".family_id=".$_GET[$input_settings['var_discussion_id_name']]." OR ".$db_table['discussions'].".id=".$_GET[$input_settings['var_discussion_id_name']]." ) "; } if ( $webpage_settings_array['discussions-inline'] ) { $sql_query = "SELECT ".$db_table['discussions'].".*, ".$db_table['system_groups'].".group_name, ".$db_table['system_groups'].".group_info FROM ".$db_table['discussions'].", ".$db_table['system_groups']." "; $sql_query .= " WHERE ".$db_table['system_groups'].".stat=1 AND ".$db_table['discussions'].".stat=1 ".$discussions_connection_search_string." AND ".$db_table['discussions'].".group_id=".$db_table['system_groups'].".id "; $sql_query .= "ORDER BY ".$db_table['discussions'].".date "; $total_rows = 0; } else { $sql_query = "SELECT COUNT(*) FROM ".$db_table['discussions'].", ".$db_table['system_groups']." "; $sql_query .= " WHERE ".$db_table['system_groups'].".stat=1 AND ".$db_table['discussions'].".stat=1 ".$discussions_connection_search_string." AND ".$db_table['discussions'].".group_id=".$db_table['system_groups'].".id "; $sql_query .= $discussions_search_string." "; $result = mysqli_query( $sql_connection, $sql_query); foreach ( $result as $key => $val ) { //echo $key." => ".$val."
"; foreach ( $val as $key2 => $val2 ) { //echo $key2." => ".$val2."
"; $total_rows = $val2; } } //$total_rows = mysql_result($result, 0); mysqli_free_result ($result); $sql_query = "SELECT ".$db_table['discussions'].".*, ".$db_table['system_groups'].".group_name, ".$db_table['system_groups'].".group_info FROM ".$db_table['discussions'].", ".$db_table['system_groups']." "; $sql_query .= " WHERE ".$db_table['system_groups'].".stat=1 AND ".$db_table['discussions'].".stat=1 ".$discussions_connection_search_string." AND ".$db_table['discussions'].".group_id=".$db_table['system_groups'].".id "; $sql_query .= "ORDER BY ".$db_table['discussions'].".date LIMIT ".$_GET['number'].", ".$_POST['amount']; } $result = mysqli_query( $sql_connection, $sql_query); $date_settings['type'] = $time_settings['type'] = "stamp"; $date_settings['day_name'] = $input_settings['discussions']['date_day_name']; $date_settings['render'] = $input_settings['discussions']['date']; $time_settings['render'] = $input_settings['discussions']['hour']; $s = 0; unset($temp); while ( $row = mysqli_fetch_array ($result) ) { $s++; $temp[$row['id']]['mother_id'] = $row['mother_id']; $temp[$row['id']]['content'] = ""; $temp_id[$row['id']] = $row['mother_id']; $discussions_group_settings = webpage_settings($row['group_info']); $discussions_settings = webpage_settings($row['settings']); if ( strlen( $discussions_settings['email'] && $webpage_settings_array['discussions-author-email'] ) ) { $this_user[0]['name'] = "".$discussions_settings['name'].""; } else if ( strlen( $discussions_settings['ip'] ) && $webpage_settings_array['discussions-author-ip'] ) { $this_user[0]['name'] = "".$discussions_settings['name'].""; } else { $this_user[0]['name'] = $discussions_settings['name']; } $this_user[0]['username'] = ""; $this_user[0]['location'] = ""; $this_user[0]['country'] = ""; $this_user[0]['image'] = ""; if ( strlen( $discussions_settings['email'] ) ) { $this_user[0]['email'] = "".$discussions_settings['email'].""; } $this_user[0]['website'] = ""; if ( strlen( $discussions_settings['ip'] ) ) { $this_user[0]['ip'] = "".$discussions_settings['ip'].""; } if ( $row['user_id'] && !isset( $this_user[$row['user_id']] ) ) { $sql_query_user = "SELECT * FROM ".$db_table['users']." "; $sql_query_user .= " WHERE stat=1 AND id=".$row['user_id']." LIMIT 1 "; $result_user = mysqli_query( $sql_connection, $sql_query_user); while ( $row_user = mysqli_fetch_array ($result_user) ) { if ( substr_count($input_settings['discussions']['normal']['order'], "[:image:]") ) { $sql_query_image = "SELECT * FROM ".$db_table['files']." "; $sql_query_image .= " WHERE id=".$row_user['photo_id']." LIMIT 1 "; $result_image = mysqli_query( $sql_connection, $sql_query_image); while ( $row_image = mysqli_fetch_array ($result_image) ) { $img_src = $system_settings['default_files_http'].$row_image['folder_id']."/thumblow/".$row_image['file']; $img_size = getimagesize( $img_src ); $this_user[$row['user_id']]['image'] = "\"".$row_image['title']."\""; } mysqli_free_result ($result_image); } if ( $webpage_settings_array['discussions-author-connect'] ) { $this_user[$row['user_id']]['username'] = "".$row_user['username'].""; } else if ( strlen( $row_user['email'] && $webpage_settings_array['discussions-author-email'] ) ) { $this_user[$row['user_id']]['username'] = "".$row_user['username'].""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-website'] ) { $this_user[$row['user_id']]['username'] = "".$row_user['username'].""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-ip'] ) { $this_user[$row['user_id']]['username'] = "".$row_user['username'].""; } else { $this_user[$row['user_id']]['username'] = $row_user['username']; } if ( $webpage_settings_array['discussions-author-connect'] ) { $this_user[$row['user_id']]['name'] = "".$row_user['name'].""; } else if ( strlen( $row_user['email'] && $webpage_settings_array['discussions-author-email'] ) ) { $this_user[$row['user_id']]['name'] = "".$row_user['name'].""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-website'] ) { $this_user[$row['user_id']]['name'] = "".$row_user['name'].""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-ip'] ) { $this_user[$row['user_id']]['name'] = "".$row_user['name'].""; } else { $this_user[$row['user_id']]['name'] = $row_user['name']; } $this_user[$row['user_id']]['location'] = $row_user['area']; $this_user[$row['user_id']]['country'] = show_country ("", "", "", $row_user['country'])."
"; if ( strlen( $row_user['email'] ) ) { if ( substr_count ($row_user['email'], ";") ) { $email_expl = explode(";", $row_user['email']); $e = 0; $this_user[$row['user_id']]['email'] = ""; foreach ( $email_expl as $key => $val ) { $e++; $val = str_replace ( " ", "", $val ); $this_user[$row['user_id']]['email'] .= "".$val.""; if ( $e < count( $email_expl ) ) { $this_user[$row['user_id']]['email'] .= $input_settings['discussions']['normal']['email_sep']; } } } else { $this_user[$row['user_id']]['email'] .= "".$row_user['email']." "; } } else { $this_user[$row['user_id']]['email'] = ""; } if ( strlen( $row_user['website'] ) ) { $this_user[$row['user_id']]['website'] = "".$row_user['website'].""; } else { $this_user[$row['user_id']]['website'] = ""; } $this_user[$row['user_id']]['ip'] = $this_user[0]['ip']; } mysqli_free_result ($result_user); } $discussions_temp_array = explode ("|", $input_settings['discussions']['selected']['order']); $temp[$row['id']]['content'] .= ""; ///////////////////////////////////// foreach ( $discussions_temp_array as $key => $val ) { if ( $val == "[:button_reply:]" ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['button_reply'][0]; if ( !$discussions_group_settings['discussion-permission'] || $session_variables['access'] ) { $temp[$row['id']]['content'] .= ""; $temp[$row['id']]['content'] .= $webpage_settings_array['discussions-reply-text']; $temp[$row['id']]['content'] .= ""; } $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['button_reply'][1]; } else if ( $val == "[:content:]" ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['content'][0]; $temp[$row['id']]['content'] .= cleanMe ( $row['content'], "HTMLStrip" ); $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['content'][1]; } else if ( $val == "[:headline:]" ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['headline'][0]; $temp[$row['id']]['content'] .= cleanMe ( $row['headline'], "HTMLStrip" ); $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['headline'][1]; } else if ( $val == "[:image:]" ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['image'][0]; if ( isset( $this_user[$row['user_id']]['image'] ) ) { $temp[$row['id']]['content'] .= $this_user[$row['user_id']]['image']; } else { $temp[$row['id']]['content'] .= " "; } $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['image'][1]; } else if ( $val == "[:icon:]") { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['icon'][0]; if ( strlen($discussions_settings['icon']) ) { $temp[$row['id']]['content'] .= ""; } $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['icon'][1]; } else if ( $val == "[:ip:]" && $webpage_settings_array['discussions-author-ip'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['ip'][0]; $temp[$row['id']]['content'] .= $this_user[$row['user_id']]['ip']; $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['ip'][1]; } else if ( $val == "[:website:]" && $webpage_settings_array['discussions-author-website'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['website'][0]; $temp[$row['id']]['content'] .= $this_user[$row['user_id']]['website']; $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['website'][1]; } else if ( $val == "[:email:]" && $webpage_settings_array['discussions-author-email'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['email'][0]; if ( isset( $this_user[$row['user_id']]['email'] ) ) { $temp[$row['id']]['content'] .= $this_user[$row['user_id']]['email']; } else { $temp[$row['id']]['content'] .= " "; } $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['email'][1]; } else if ( $val == "[:country:]" && $webpage_settings_array['discussions-author-land'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['country'][0]; $temp[$row['id']]['content'] .= $this_user[$row['user_id']]['country']; $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['country'][1]; } else if ( $val == "[:location:]" && $webpage_settings_array['discussions-author-location'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['location'][0]; $temp[$row['id']]['content'] .= $this_user[$row['user_id']]['location']; $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['location'][1]; } else if ( $val == "[:name:]" && $webpage_settings_array['discussions-author-name'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['name'][0]; $temp[$row['id']]['content'] .= cleanMe ( $this_user[$row['user_id']]['name'], "HTMLStrip" ); $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['name'][1]; } else if ( $val == "[:username:]" && $webpage_settings_array['discussions-author'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['username'][0]; $temp[$row['id']]['content'] .= cleanMe ( $this_user[$row['user_id']]['username'], "HTMLStrip" ); $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['username'][1]; } else if ( $val == "[:group:]" ) { if ( $webpage_settings_array['discussions-group'] ) { $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['group'][0]; if ( strlen( $discussions_group_settings['group-path'] ) ) { $temp[$row['id']]['content'] .= "".cleanMe ( $row['group_name'], "HTMLStrip" ).""; } else { $temp[$row['id']]['content'] .= cleanMe ( $row['group_name'], "HTMLStrip" ); } $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['group'][1]; } } else if ( $val == "[:date:]" ) { if ( $webpage_settings_array['discussions-date'] ) { $date_settings['date'] = $row['date']; $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['date'][0]; $temp[$row['id']]['content'] .= date_menu($date_settings); $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['date'][1]; } } else if ( $val == "[:hour:]" ) { if ( $webpage_settings_array['discussions-hour'] ) { $time_settings['date'] = $row['date']; $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['hour'][0]; $temp[$row['id']]['content'] .= date_menu($time_settings); $temp[$row['id']]['content'] .= $input_settings['discussions']['selected']['hour'][1]; } } } $temp[$row['id']]['content'] .= ""; ///////////////////////////////////// unset($this_user[0]); } mysqli_free_result ($result); if ( $s ) { if ( $webpage_settings_array['discussions-inline'] ) { $discussions_settings['mother_id'] = 0; $discussions_settings['level'] = 0; $discussions_settings['array'] = $temp; $discussions_settings['table'][0] = $input_settings['discussions']['selected']['outertable2'][0]; $discussions_settings['table'][1] = $input_settings['discussions']['selected']['outertable2'][1]; $discussions_settings['table'][2] = $input_settings['discussions']['selected']['outertable2'][2]; $discussions_settings['table'][3] = $input_settings['discussions']['selected']['outertable2'][3]; $discussions_settings['table'][4] = $input_settings['discussions']['selected']['outertable2'][4]; $discussions_settings['table'][5] = $input_settings['discussions']['selected']['outertable2'][5]; $discussions_settings['menu_spacer_width'] = $input_settings['discussions']['selected']['inline_width']; explode_discussion ( $discussions_settings ); } else { $pn_settings['total'] = $total_rows; $pn_settings['dose'] = $_POST['amount']; $pn_settings['current_dose'] = $_GET['number']; if ( !isset( $_GET[$input_settings['var_discussion_id_name']] ) ) { $_GET[$input_settings['var_discussion_id_name']] = 0; } $pn_settings['link_extension'] = "&".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]."&".$input_settings['var_discussion_id_name']."=".$_GET[$input_settings['var_discussion_id_name']]."&date_from=".$date_from."&date_to=".$date_to.$discussions_connection_ext; $pn_output = previous_next ($pn_settings); $smali['discussions'] .= $input_settings['discussions']['selected']['outertable'][0]; $smali['discussions'] .= $pn_output[0]; $smali['discussions'] .= $input_settings['discussions']['selected']['outertable'][1]; foreach ( $temp as $key => $val ) { $smali['discussions'] .= $val['content']; } $smali['discussions'] .= $input_settings['discussions']['selected']['outertable'][2]; $smali['discussions'] .= $pn_output[1]; $smali['discussions'] .= $input_settings['discussions']['selected']['outertable'][3]; } } else { $smali['discussions'] .= $webpage_settings_array['discussions-nothing-text']; } } else { $search_method = "AND ".$db_table['discussions'].".mother_id=0"; if ( $webpage_settings_array['discussions-appearance'] ) { $smali['discussions_searchbox'] = $input_settings['discussions']['searchbox'][0]; $smali['discussions_searchbox'] .= "
"; $smali['discussions_searchbox'] .= $input_settings['discussions']['searchbox'][1]; $date_settings['type'] = "dropmenu"; $date_settings['date'] = $input_settings['discussions']['searchbox_result']; $date_settings['var_name_year'] = "date_from_year"; $date_settings['var_name_month'] = "date_from_month"; $date_settings['var_name_day'] = "date_from_day"; $date_settings['render'] = "[:day:][:month:][:year:]"; $date_settings['year_type'] = 1; $date_settings['date'] = $date_from; $smali['discussions_searchbox'] .= date_menu ( $date_settings ); $smali['discussions_searchbox'] .= $input_settings['discussions']['searchbox'][2]; $date_settings['date'] = $date_to; $date_settings['var_name_year'] = "date_to_year"; $date_settings['var_name_month'] = "date_to_month"; $date_settings['var_name_day'] = "date_to_day"; $smali['discussions_searchbox'] .= date_menu ( $date_settings ); $smali['discussions_searchbox'] .= $input_settings['discussions']['searchbox'][3]; $smali['discussions_searchbox'] .= ""; $smali['discussions_searchbox'] .= $input_settings['discussions']['searchbox'][4]; $smali['discussions_searchbox'] .= ""; $smali['discussions_searchbox'] .= $input_settings['discussions']['searchbox'][5]; $smali['discussions_searchbox'] .= $input_settings['discussions']['search_button']; $smali['discussions_searchbox'] .= $input_settings['discussions']['searchbox'][6]; $search_method = " "; } $sql_query = "SELECT COUNT(*) FROM ".$db_table['discussions'].", ".$db_table['system_groups']." "; $sql_query .= " WHERE ".$db_table['system_groups'].".stat=1 AND ".$db_table['discussions'].".stat=1 ".$search_method." AND ".$db_table['discussions'].".group_id=".$db_table['system_groups'].".id "; $sql_query .= $discussions_search_string." "; $result = mysqli_query( $sql_connection, $sql_query); foreach ( $result as $key => $val ) { //echo $key." => ".$val."
"; foreach ( $val as $key2 => $val2 ) { //echo $key2." => ".$val2."
"; $total_rows = $val2; } } //$total_rows = mysql_result($result, 0); mysqli_free_result ($result); $sql_query = "SELECT ".$db_table['discussions'].".*, ".$db_table['system_groups'].".group_name, ".$db_table['system_groups'].".group_info FROM ".$db_table['discussions'].", ".$db_table['system_groups']." "; $sql_query .= " WHERE ".$db_table['system_groups'].".stat=1 AND ".$db_table['discussions'].".stat=1 ".$search_method." AND ".$db_table['discussions'].".group_id=".$db_table['system_groups'].".id "; $sql_query .= $discussions_search_string." "; $sql_query .= "ORDER BY ".$db_table['discussions'].".date DESC LIMIT ".$_GET['number'].", ".$_POST['amount']; $result = mysqli_query( $sql_connection, $sql_query); $temp = ""; $date_settings['type'] = $time_settings['type'] = "stamp"; $date_settings['day_name'] = $input_settings['discussions']['date_day_name']; $date_settings['render'] = $input_settings['discussions']['date']; $time_settings['render'] = $input_settings['discussions']['hour']; $s = 0; while ( $row = mysqli_fetch_array ($result) ) { $s++; $discussions_group_settings = webpage_settings($row['group_info']); $discussions_settings = webpage_settings($row['settings']); if ( strlen( $discussions_settings['email'] && $webpage_settings_array['discussions-author-email'] ) ) { $this_user[0]['name'] = "".$discussions_settings['name'].""; } else if ( strlen( $discussions_settings['ip'] ) && $webpage_settings_array['discussions-author-ip'] ) { $this_user[0]['name'] = "".$discussions_settings['name'].""; } else { $this_user[0]['name'] = $discussions_settings['name']; } $this_user[0]['username'] = ""; $this_user[0]['location'] = ""; $this_user[0]['country'] = ""; $this_user[0]['image'] = ""; if ( strlen( $discussions_settings['email'] ) ) { $this_user[0]['email'] = "".$discussions_settings['email'].""; } $this_user[0]['website'] = ""; if ( strlen( $discussions_settings['ip'] ) ) { $this_user[0]['ip'] = "".$discussions_settings['ip'].""; } if ( $row['user_id'] && !isset( $this_user[$row['user_id']] ) ) { $sql_query_user = "SELECT * FROM ".$db_table['users']." "; $sql_query_user .= " WHERE stat=1 AND id=".$row['user_id']." LIMIT 1 "; $result_user = mysqli_query( $sql_connection, $sql_query_user); while ( $row_user = mysqli_fetch_array ($result_user) ) { if ( substr_count($input_settings['discussions']['normal']['order'], "[:image:]") ) { $sql_query_image = "SELECT * FROM ".$db_table['files']." "; $sql_query_image .= " WHERE id=".$row_user['photo_id']." LIMIT 1 "; $result_image = mysqli_query( $sql_connection, $sql_query_image); while ( $row_image = mysqli_fetch_array ($result_image) ) { $img_src = $system_settings['default_files_http'].$row_image['folder_id']."/thumblow/".$row_image['file']; $img_size = @getimagesize( $img_src ); $this_user[$row['user_id']]['image'] = "\"".$row_image['title']."\""; } mysqli_free_result ($result_image); } if ( $webpage_settings_array['discussions-author-connect'] ) { $this_user[$row['user_id']]['username'] = "".cleanMe ( $row_user['username'], "HTMLStrip" ).""; } else if ( strlen( $row_user['email'] && $webpage_settings_array['discussions-author-email'] ) ) { $this_user[$row['user_id']]['username'] = "".cleanMe ( $row_user['username'], "HTMLStrip" ).""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-website'] ) { $this_user[$row['user_id']]['username'] = "".cleanMe ( $row_user['username'], "HTMLStrip" ).""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-ip'] ) { $this_user[$row['user_id']]['username'] = "".cleanMe ( $row_user['username'], "HTMLStrip" ).""; } else { $this_user[$row['user_id']]['username'] = cleanMe ( $row_user['username'], "HTMLStrip" ); } if ( $webpage_settings_array['discussions-author-connect'] ) { $this_user[$row['user_id']]['name'] = "".cleanMe ( $row_user['name'], "HTMLStrip" ).""; } else if ( strlen( $row_user['email'] && $webpage_settings_array['discussions-author-email'] ) ) { $this_user[$row['user_id']]['name'] = "".cleanMe ( $row_user['name'], "HTMLStrip" ).""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-website'] ) { $this_user[$row['user_id']]['name'] = "".cleanMe ( $row_user['name'], "HTMLStrip" ).""; } else if ( strlen( $row_user['website'] ) && $webpage_settings_array['discussions-author-ip'] ) { $this_user[$row['user_id']]['name'] = "".cleanMe ( $row_user['name'], "HTMLStrip" ).""; } else { $this_user[$row['user_id']]['name'] = cleanMe ( $row_user['name'], "HTMLStrip" ); } $this_user[$row['user_id']]['location'] = $row_user['area']; $this_user[$row['user_id']]['country'] = show_country ("", "", "", $row_user['country'])."
"; if ( strlen( $row_user['email'] ) ) { if ( substr_count ($row_user['email'], ";") ) { $email_expl = explode(";", $row_user['email']); $e = 0; $this_user[$row['user_id']]['email'] = ""; foreach ( $email_expl as $key => $val ) { $e++; $val = str_replace ( " ", "", $val ); $this_user[$row['user_id']]['email'] .= "".$val.""; if ( $e < count( $email_expl ) ) { $this_user[$row['user_id']]['email'] .= $input_settings['discussions']['normal']['email_sep']; } } } else { $this_user[$row['user_id']]['email'] .= "".$row_user['email']." "; } } else { $this_user[$row['user_id']]['email'] = ""; } if ( strlen( $row_user['website'] ) ) { $this_user[$row['user_id']]['website'] = "".$row_user['website'].""; } else { $this_user[$row['user_id']]['website'] = ""; } $this_user[$row['user_id']]['ip'] = $this_user[0]['ip']; } mysqli_free_result ($result_user); } $discussions_temp_array = explode ("|", $input_settings['discussions']['normal']['order']); $link_id = 0; if ( $row['family_id'] ) { $link_id = $row['family_id']; } else { $link_id = $row['id']; } foreach ( $discussions_temp_array as $key => $val ) { if ( $val == "[:replies:]" ) { $temp .= $input_settings['discussions']['normal']['replies'][0]; $temp .= $discussions_settings['replies']; $temp .= $input_settings['discussions']['normal']['replies'][1]; } else if ( $val == "[:last-replied-date:]" ) { if ( strlen( $discussions_settings['replied'] ) ) { $date_settings['date'] = $discussions_settings['replied']; } else { $date_settings['date'] = $row['date']; } $temp .= $input_settings['discussions']['normal']['last_replied_date'][0]; $temp .= date_menu($date_settings); $temp .= $input_settings['discussions']['normal']['last_replied_date'][1]; } else if ( $val == "[:last-replied-hour:]" ) { if ( strlen( $discussions_settings['replied'] ) ) { $time_settings['date'] = $discussions_settings['replied']; } else { $time_settings['date'] = $row['date']; } $temp .= $input_settings['discussions']['normal']['last_replied_hour'][0]; $temp .= date_menu($time_settings); $temp .= $input_settings['discussions']['normal']['last_replied_hour'][1]; } else if ( $val == "[:content:]" ) { $temp .= $input_settings['discussions']['normal']['content'][0]; $discussions_content = cleanMe ( $row['content'] , "databaseStrip" ); $discussions_content = makeShortText ( $discussions_content, $input_settings['discussions']['normal']['letter_amount'] ); $temp .= stripslashes( cleanMe( $discussions_content, "HTMLStrip" ) ); $temp .= $input_settings['discussions']['normal']['content'][1]; } else if ( $val == "[:more:]" ) { $temp .= $input_settings['discussions']['normal']['more'][0]; $temp .= ""; $temp .= $input_settings['discussions']['normal']['more_button']; $temp .= ""; $temp .= $input_settings['discussions']['normal']['more'][1]; } else if ( $val == "[:headline:]" ) { $temp .= $input_settings['discussions']['normal']['headline'][0]; $temp .= ""; $temp .= cleanMe ( $row['headline'], "HTMLStrip" ); $temp .= ""; $temp .= $input_settings['discussions']['normal']['headline'][1]; } else if ( $val == "[:image:]" ) { $temp .= $input_settings['discussions']['normal']['image'][0]; if ( isset( $this_user[$row['user_id']]['image'] ) ) { $temp .= $this_user[$row['user_id']]['image']; } else { $temp .= " "; } $temp .= $input_settings['discussions']['normal']['image'][1]; } else if ( $val == "[:icon:]") { $temp .= $input_settings['discussions']['normal']['icon'][0]; if ( strlen($discussions_settings['icon']) ) { $temp .= ""; } $temp .= $input_settings['discussions']['normal']['icon'][1]; } else if ( $val == "[:ip:]" && $webpage_settings_array['discussions-author-ip'] ) { $temp .= $input_settings['discussions']['normal']['ip'][0]; $temp .= $this_user[$row['user_id']]['ip']; $temp .= $input_settings['discussions']['normal']['ip'][1]; } else if ( $val == "[:website:]" && $webpage_settings_array['discussions-author-website'] ) { $temp .= $input_settings['discussions']['normal']['website'][0]; $temp .= $this_user[$row['user_id']]['website']; $temp .= $input_settings['discussions']['normal']['website'][1]; } else if ( $val == "[:email:]" && $webpage_settings_array['discussions-author-email'] ) { $temp .= $input_settings['discussions']['normal']['email'][0]; if ( isset( $this_user[$row['user_id']]['email'] ) ) { $temp .= $this_user[$row['user_id']]['email']; } else { $temp .= " "; } $temp .= $input_settings['discussions']['normal']['email'][1]; } else if ( $val == "[:country:]" && $webpage_settings_array['discussions-author-land'] ) { $temp .= $input_settings['discussions']['normal']['country'][0]; $temp .= $this_user[$row['user_id']]['country']; $temp .= $input_settings['discussions']['normal']['country'][1]; } else if ( $val == "[:location:]" && $webpage_settings_array['discussions-author-location'] ) { $temp .= $input_settings['discussions']['normal']['location'][0]; $temp .= $this_user[$row['user_id']]['location']; $temp .= $input_settings['discussions']['normal']['location'][1]; } else if ( $val == "[:name:]" && $webpage_settings_array['discussions-author-name'] ) { $temp .= $input_settings['discussions']['normal']['name'][0]; $temp .= cleanMe ( $this_user[$row['user_id']]['name'], "HTMLStrip" ); $temp .= $input_settings['discussions']['normal']['name'][1]; } else if ( $val == "[:username:]" && $webpage_settings_array['discussions-author'] ) { $temp .= $input_settings['discussions']['normal']['username'][0]; $temp .= cleanMe ( $this_user[$row['user_id']]['username'], "HTMLStrip" ); $temp .= $input_settings['discussions']['normal']['username'][1]; } else if ( $val == "[:group:]" ) { if ( $webpage_settings_array['discussions-group'] ) { $temp .= $input_settings['discussions']['normal']['group'][0]; if ( strlen( $discussions_group_settings['group-path'] ) ) { $temp .= "".$row['group_name'].""; } else { $temp .= $row['group_name']; } $temp .= $input_settings['discussions']['normal']['group'][1]; } } else if ( $val == "[:date:]" ) { if ( $webpage_settings_array['discussions-date'] ) { $date_settings['date'] = $row['date']; $temp .= $input_settings['discussions']['normal']['date'][0]; $temp .= date_menu($date_settings); $temp .= $input_settings['discussions']['normal']['date'][1]; } } else if ( $val == "[:hour:]" ) { if ( $webpage_settings_array['discussions-hour'] ) { $time_settings['date'] = $row['date']; $temp .= $input_settings['discussions']['normal']['hour'][0]; $temp .= date_menu($time_settings); $temp .= $input_settings['discussions']['normal']['hour'][1]; } } } unset($this_user[0]); } mysqli_free_result ($result); if ( $s ) { $pn_settings['total'] = $total_rows; $pn_settings['dose'] = $_POST['amount']; $pn_settings['current_dose'] = $_GET['number']; $pn_settings['link_extension'] = "&".$input_settings['var_id_name']."=".$_GET[$input_settings['var_id_name']]."&date_from=".$date_from."&date_to=".$date_to; $pn_output = previous_next ($pn_settings); $smali['discussions'] .= $input_settings['discussions']['normal']['outertable'][0]; $smali['discussions'] .= $pn_output[0]; $smali['discussions'] .= $input_settings['discussions']['normal']['outertable'][1]; $smali['discussions'] .= $temp; $smali['discussions'] .= $input_settings['discussions']['normal']['outertable'][2]; $smali['discussions'] .= $pn_output[1]; $smali['discussions'] .= $input_settings['discussions']['normal']['outertable'][3]; } else { $smali['discussions'] .= $webpage_settings_array['discussions-nothing-text']; } } } } $smali['user_id'] = $session_variables['user_id']; $smali['username'] = $session_variables['username']; $smali['username_long'] = $session_variables['username_long']; $smali['access'] = $session_variables['access']; $smali['session'] = $session_variables['session']; $smali['current_time'] = $session_variables['current_time']; $smali['rank'] = $session_variables['rank']; $smali['ip'] = $session_variables['ip']; ////////////////// /* GPS vi餬髏in */ $smali['gps_icbm_latitude'] = ""; $smali['gps_icbm_longitude'] = ""; $smali['gps_ddd.mm.mmm_latitude'] = ""; $smali['gps_ddd.mm.mmm_longitude'] = ""; $smali['gps_ddd.mm.sss_latitude'] = ""; $smali['gps_ddd.mm.sss_longitude'] = ""; $smali['google_map'] = ""; $smali['google_button'] = ""; $smali['google_css'] = ""; $smali['google_javascript'] = ""; $smali['geotag_meta'] = ""; $smali['geotag_text'] = ""; if ( isset( $webpage_settings_array['gps-latitude'] ) ) { $qps_input['language'] = "IS"; $qps_input['coordinate'] = $webpage_settings_array['gps-latitude']; $qps_input['tude'] = "latitud"; $gps_output_latitude = gps_converter( $qps_input ); $qps_input['coordinate'] = $webpage_settings_array['gps-longitude']; $qps_input['tude'] = "longitude"; $gps_output_longitude = gps_converter( $qps_input ); $smali['gps_icbm_latitude'] = $gps_output_latitude['raw']; $smali['gps_icbm_longitude'] = $gps_output_longitude['raw']; $smali['gps_ddd.mm.mmm_latitude'] = $gps_output_latitude['ddd.mm.mmm']; $smali['gps_ddd.mm.mmm_longitude'] = $gps_output_longitude['ddd.mm.mmm']; $smali['gps_ddd.mm.sss_latitude'] = $gps_output_latitude['ddd.mm.sss']; $smali['gps_ddd.mm.sss_longitude'] = $gps_output_longitude['ddd.mm.sss']; if ( $webpage_settings_array['google-maps-button'] ) { $google_maps_zoom_level = $webpage_settings_array['google-maps-z']; // 14-16 er f韓t fyrir b鎖, 7 fyrir landshluta, 5 fyrir allt landi? 3 fyrir nor饀r atlantshaf, 2 fyrir evr髉u og 1 fyrir heiminn $google_maps_latitude_marker = $google_maps_latitude = $smali['gps_icbm_latitude']; $google_maps_longitude_marker = $google_maps_longitude = $smali['gps_icbm_longitude']; $google_maps_type = "q"; if ( $webpage_settings_array['google-maps-type'] == 3 ) { $google_maps_type = "f"; } else if ( $webpage_settings_array['google-maps-type'] == 2 ) { $google_maps_type = "p"; } else if ( $webpage_settings_array['google-maps-type'] ) { $google_maps_type = "h"; } $google_maps_src = "http://maps.google.com/maps?ie=UTF8&t=".$google_maps_type."&ll=".$google_maps_latitude.",".$google_maps_longitude."&z=".$google_maps_zoom_level."&output=embed&q=".$google_maps_latitude_marker."+".$google_maps_longitude_marker; $google_maps_href = "http://maps.google.com/maps?ie=UTF8&t=".$google_maps_type."&ll=".$google_maps_latitude.",".$google_maps_longitude."&z=".$google_maps_zoom_level."&q=".$google_maps_latitude_marker.",".$google_maps_longitude_marker; $google_map = ""; // google_map() if ( $webpage_settings_array['google-maps-button'] == 3 ) { // 0 = Ekkert 1 = Hnapp 2 = Hnapp me?flj髏andi korti 3 = Bara kort $smali['google_map'] = $google_map; } else if ( $webpage_settings_array['google-maps-button'] == 2 ) { $google_map .= ""; $google_map .= "
".$smali['gps_ddd.mm.sss_latitude']." ".$smali['gps_ddd.mm.sss_longitude']."
"; $google_map .= ""; $google_div_width = $webpage_settings_array['google-maps-width']; $google_div_height = $webpage_settings_array['google-maps-height'] + 25; $smali['google_css'] = "#google_map_floating { \n\t position:fixed; \n\t left:2000px; \n\t top:100px; \n\t width:".$google_div_width."px; \n\t height:".$google_div_height."px; \n\t z-index:20; \n\t display: none; \n } \n"; $smali['google_map'] = "
".$google_map."
"; $smali['google_button'] = "".$input_settings['google_button_map'].""; $smali['google_javascript'] = " function smali_google_map() {\n"; $smali['google_javascript'] .= " if ( document.getElementById('google_map_floating') ) {\n"; $smali['google_javascript'] .= " var width = 1024;\n"; $smali['google_javascript'] .= " var height = 756;\n"; $smali['google_javascript'] .= " var map_left = ( width - ".$google_div_width." ) / 2;\n"; $smali['google_javascript'] .= " if ( document.getElementById('google_map_floating').style.display == 'inline' ) {\n"; $smali['google_javascript'] .= " document.getElementById('google_map_floating').style.display = 'none';\n"; $smali['google_javascript'] .= " } else {\n"; $smali['google_javascript'] .= " if ( window.document.body.clientWidth ) {\n"; $smali['google_javascript'] .= " width = window.document.body.clientWidth;\n"; $smali['google_javascript'] .= " height = window.document.body.clientHeight;\n"; $smali['google_javascript'] .= " map_left = ( width - ".$google_div_width." ) / 2;\n"; $smali['google_javascript'] .= " document.getElementById('google_map_floating').style.left = map_left+'px';\n"; $smali['google_javascript'] .= " }\n"; $smali['google_javascript'] .= " document.getElementById('google_map_floating').style.display = 'inline';\n"; $smali['google_javascript'] .= " }\n"; $smali['google_javascript'] .= " }\n"; $smali['google_javascript'] .= "}\n"; } else { $smali['google_button'] = "".$input_settings['google_button_map'].""; } } $smali['geotag_meta'] = "\n"; $smali['geotag_meta'] .= "\n"; $smali['geotag_meta'] .= "\n"; $smali['geotag_meta'] .= "\n"; $smali['geotag_text'] = $input_settings['geotag'][0].round( $gps_output_latitude['ddd.ddddddd'], 6 ).$input_settings['geotag'][1].round( $gps_output_longitude['ddd.ddddddd'], 6 ).$input_settings['geotag'][2]; if ( $webpage_settings_array['geotag-show'] && $webpage_settings_array['geotag-show'] < 2 ) { $smali['geotag_text'] = ""; } else if ( !$webpage_settings_array['geotag-show'] ) { $smali['geotag_meta'] = ""; $smali['geotag_text'] = ""; } } /* GPS vi餬髏in */ ////////////////// // Screen size for the counter setup $smali['counter_screen'] = ""; if ( $smali_first_visit_id && $smali_unixtime ) { // H閞na b鷘m vi?til ifraem sem s鎘ir script me?skj醩t鎟?sem er uppf鎟t me?javascript ?gegnum iframe $smali['counter_screen'] = " "; } unset($smali['menu_status']); unset($smali['ordering']); unset($smali['href']); unset($smali['window']); unset($smali['url']); unset($smali['valid_from']); unset($smali['valid_to']); unset($smali['settings']); unset($smali['template']); $smali['template'] = $system_settings['default_working_path'].$system_settings['default_files'].$webpage_settings_array['template']; if ( !$webpage_settings_array['template'] ) { $smali['template'] = $system_settings['default_working_path'].$system_settings['default_files'].$web_settings_array['default-template']; } if ( isset( $_GET['template'] ) ) { $_GET['template'] = strtolower ( $_GET['template'] ); if ( substr_count( $_GET['template'], "/" ) ) { $template_array = explode ( "/", $_GET['template'] ); $template_array_count = count ( $template_array ); if ( $template_array_count ) { $template_array_count--; $_GET['template'] = $template_array[$template_array_count]; } } } else { $_GET['template'] = ""; } if ( !strlen($_GET['template']) || !@include ($_GET['template']) ) { if ( !@include ($system_settings['default_working_path'].$system_settings['default_files'].$webpage_settings_array['template']) ) { if ( !@include ($system_settings['default_working_path'].$system_settings['default_files'].$web_settings_array['default-template']) ) { if ( !@include ("default.php") ) { if ( !@include ($system_settings['default_working_path']."default.php") ) { echo $smali['body']; } } } } } } else { if ( isset($web_settings_array['redirect']) && strlen( $web_settings_array['redirect'] ) ) { header("Location: ".$web_settings_array['redirect']); } else { header("HTTP/1.0 403-1 Forbidden"); } } } else { if ( isset($web_settings_array['redirect']) && strlen( $web_settings_array['redirect'] ) ) { header("Location: ".$web_settings_array['redirect']); } else { header("HTTP/1.0 403-1 Forbidden"); } } } ?>