Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
И содержимое когда смотришь через phpmyadmin нормальное?В базе таблицы в utf8_general_ci', все файлы сохранены в UTF-8
<?php require 'modules/module-initialize.php'; ?>
<?php
mysql_query ("set character_set_results='utf8'");
$result = mysql_query("SELECT * FROM $dblist $where ORDER BY $_GET[srt] LIMIT $_GET[p]");
while($row = mysql_fetch_array($result))
echo "$row[make]";
?>
<?php require 'modules/module-initialize.php'; ?>
<?php
mysql_query ("set character_set_results='utf8'");
echo "$row[make]";
?>
Этот файл уже в UTF-8Задавай кодировку в том файле который подключается к базе
<?php
require_once 'admin/cp-includes/inc-confdata.php';
require_once 'admin/cp-includes/inc-general.php';
require_once 'admin/cp-includes/inc-functions.php';
// check installation status
if(!$dbhost) header('location:setup.php');
$link = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $link);
// make data query-safe
$_GET = safe_data($_GET, 'query');
// create variable string
$pass_vars = '';
foreach($_GET as $name => $value) $pass_vars .= $name.'='.$value.'&';
$pass_vars = ltrim($pass_vars, '&');
// get configuration info
$result = mysql_query("SELECT * FROM $dbconf", $link);
$conf = mysql_fetch_array($result);
$conf = safe_data($conf, 'display');
// current page
$this_page = pathinfo($_SERVER[PHP_SELF], PATHINFO_BASENAME);
// initialization steps for the main listings page
if($this_page == 'index.php' || $this_page == 'listings.php') {
require 'modules/module-query.php';
// get last updated date from inventory
$result = mysql_query("SELECT updated FROM $dblist ORDER BY updated DESC LIMIT 1", $link);
$updated = mysql_fetch_array($result);
// get total number of listings for display
$result = mysql_query("SELECT COUNT(*) FROM $dblist WHERE hide!='1' AND (expire>'".time()."' OR expire='' OR expire='0') AND (user_expire>'".time()."' OR user_expire='' OR user_expire='0')", $link);
$display_total = mysql_fetch_array($result);
// set default pagenation values
if(!$_GET[p]) $_GET[p] = $conf[perpage]; // default number of entries per page
if(!$_GET[page]) $_GET[page] = 1; // current page
if(!$_GET[srt]) $_GET[srt] = $conf[srt]; // default sort order
$start = ($_GET[page] - 1) * $_GET[p]; // start row for query
// get total number of entries for pagenation
$result = mysql_query("SELECT COUNT(*) FROM $dblist $where", $link);
$total = mysql_fetch_array($result); $total = $total[0]; // total number of listings
$pages = ceil($total / $_GET[p]); // number of pages
}
// initialization steps for listing details page, print page, and send to a friend page
elseif($this_page == 'show.php' || $this_page == 'print.php' || $this_page == 'friend.php' || $this_page == 'slideshow.php') {
if($_POST[submit]) $_GET[id] = $_POST[id];
if($_POST[submit]) $picnum = $_POST[picnum]; else $picnum = $_GET[picnum];
// get listing information
$result = mysql_query("SELECT * FROM $dblist WHERE id='$_GET[id]' LIMIT 1", $link);
$row = mysql_fetch_array($result);
$row = safe_data($row, 'display');
// do not display zeros for integer fields
if(!$row[model_year]) $row[model_year] = '';
// log visit in stats table and increment number of views
if($this_page == 'show.php') {
mysql_query("UPDATE $dblist SET viewed=viewed+1 WHERE id='$row[id]' LIMIT 1", $link);
$tstamp = time() + (3600 * $conf[toffset]);
mysql_query("INSERT INTO $dbstat VALUES('0',
'$row[id]',
'$row[userid]',
'$row[user_type]',
'$tstamp',
'".date('j', $tstamp)."',
'".date('n', $tstamp)."',
'".date('Y', $tstamp)."',
'".date('G', $tstamp)."',
'$_SERVER[REMOTE_ADDR]')", $link) or die(mysql_error());
}
// get QuickSelect features
$result = mysql_query("SELECT * FROM $dbfeat WHERE id='$_GET[id]' LIMIT 1", $link);
if(mysql_num_rows($result)) {
$features = mysql_fetch_array($result);
foreach($features as $id => $value) {
if(substr($id, 0, 2) == 'cp' && $value == 1) {
// get caption
$result = mysql_query("SELECT caption FROM $dbcapt WHERE id='".substr($id, 2)."' LIMIT 1", $link);
$caption = mysql_fetch_array($result);
$caption = safe_data($caption, 'display');
$row[features] .= "\n".$caption[caption];
}
}
}
// get user information
$result = mysql_query("SELECT *,CONCAT(first_name,' ',last_name) AS name FROM $dbacct WHERE id='$row[userid]' LIMIT 1", $link);
$user = mysql_fetch_array($result);
$user = safe_data($user, 'display');
// get location information
$result = mysql_query("SELECT * FROM $dbloca WHERE id='$row[location]' LIMIT 1", $link);
$location = mysql_fetch_array($result);
$location = safe_data($location, 'display');
// get images
if($row[images]) {
$image_set = array();
$result = mysql_query("SELECT fname FROM $dbimgs WHERE listid='$_GET[id]' ORDER BY id ASC", $link);
while($images = mysql_fetch_array($result)) {
array_push($image_set, $images[fname]);
}
}
// subject line for send to a friend page
if(!$_POST[subject]) {
if($row[cond]) $_POST[subject] = $row[cond]." ";
$_POST[subject] .= "$row[make]";
if($row[stock]) $_POST[subject] .= " (Stock Number: $row[stock])";
}
}
// initialization steps for advanced search page
elseif($this_page == 'search.php') {
// set default pagenation values
if(!$_GET[p]) $_GET[p] = $conf[perpage]; // default number of entries per page
if(!$_GET[srt]) $_GET[srt] = $conf[srt]; // default sort order
}
// initialization steps for contact us page
elseif($this_page == 'contact.php') {
if($_POST[submit]) $_GET = $_POST;
// get listing information
$result = mysql_query("SELECT * FROM $dblist WHERE id='$_GET[id]' LIMIT 1", $link);
$row = mysql_fetch_array($result);
$row = safe_data($row, 'display');
// do not display zeros for integer fields
if(!$row[model_year]) $row[model_year] = '';
if(!$_POST[subject]) {
if ($row[cond]) $_POST[subject] = $row[cond]." ";
$_POST[subject] .= "$row[make]";
if($row[stock]) $_POST[subject] .= " (Stock Number: $row[stock])";
}
if(!$_POST[message]) {
$_POST[message] = "I would like to receive additional information about the ";
if($row[model_year]) $_POST[message] .= "$row[model_year] ";
$_POST[message] .= "$row[make] displayed on your website.";
if($row[stock]) $_POST[message] .= "\n\nStock Number: $row[stock]";
}
// determine where to send message
if($_GET[mode] == 'sales') {
// get user information
$result = mysql_query("SELECT email,contact FROM $dbacct WHERE id='$row[userid]' LIMIT 1", $link);
$result = mysql_fetch_array($result);
$result = safe_data($result, 'display');
$sendto = $result[email];
} else {
// get user information
$result = mysql_query("SELECT email FROM $dbloca WHERE id='$row[location]' LIMIT 1", $link);
$result = mysql_fetch_array($result);
$result = safe_data($result, 'display');
$sendto = $result[email];
}
}
?>