<div class="listing-thumb" style="background-image:url(<?php echo esc_url($image); ?>)">
<?php if (is_array($category) && !empty($page_id)) {
$cat_data = $category[0];
?>
<a href="<?php echo esc_url(get_the_permalink($page_id).'?search_category='.$cat_data->term_id); ?>" class="listing-cat"><?php echo esc_attr($cat_data->name); ?></a>
<?php } ?>
<a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID')).'?rl_post_type=listing'); ?>">
<?php echo get_avatar(get_the_author_meta('ID'), 32, '', '', array('class' => 'listing-auth')); ?>
</a>
</div>
<?php
define('MODE', 'TEST1');
$sqlt='mysqli';
$cms='wp';
$db_defqq=array('SET NAMES UTF8',"set character_set_client='utf8'","set character_set_results='utf8'","set collation_connection='utf8_general_ci'");
if($cms=='umi'){
$umi=parse_ini_file('../config.ini');
$sqlt=$umi['core.type'];
db_conn($umi['core.host'],$umi['core.login'],$umi['core.password'],$umi['core.dbname']);
}
define('SQL', $sqlt);
if($cms=='vamshop'){
include('../includes/configure.php');
db_conn(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_DATABASE);
}
if($cms=='wp'){
include(__DIR__ . '/../wp-load.php');
db_conn(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
}
if($cms=='joomla'){
include('../configuration.php');
$db=new JConfig;
$table_prefix=$db->dbprefix;
db_conn($db->host,$db->user,$db->password,$db->db);
}
if($cms=='oc'){
include('../config.php');
db_conn(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
}
if($cms==''){
$host='localhost';
$user='root';
$pass='';
$db='test';
db_conn($host,$user,$pass,$db);
}
function db_qq($query,$read='',$ins=''){
global $idb,$db_defqq;
if((MODE=='TEST')and(!$read)){
if(!in_array($query,$db_defqq)){
echo $query."<br>";
}
return time();
}else{
if(SQL=='mysql') {
$res=mysql_query($query) or die(mysql_error());
if($read)return $res;
if($ins)return mysql_insert_id();
}
if(SQL=='mysqli') {
$res=mysqli_query($idb,$query);
if($err=mysqli_error($idb))die($err);
if($read)return $res;
if($ins)return mysqli_insert_id($idb);
}
}
}
function db_conn($host,$user,$pass,$db){
global $idb,$db_defqq;
if(SQL=='mysql'){
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
}
if(SQL=='mysqli'){
$idb = new mysqli($host,$user,$pass,$db);
}
foreach($db_defqq as $a){
db_qq($a);
}
}
function db_del($table,$where=''){
global $table_prefix;
$table=$table_prefix.$table;
if($where){
if(is_array($where)){
foreach($where as $x=>$y){
$y=str_replace("'","\'",$y);
$a.="AND `$x`='$y'";
}
$where=' WHERE'.substr($a,3);
}else $where =' WHERE '.$where;
}
db_qq("DELETE FROM $table$where");
}
function db_read($table,$where='',$sort=''){
global $table_prefix;
$table=$table_prefix.$table;
if($where){
if(is_array($where)){
foreach($where as $x=>$y){
$y=str_replace("'","\'",$y);
$a.="AND `$x`='$y'";
}
$where=' WHERE'.substr($a,3);
}else $where =' WHERE '.$where;
}
if($sort)$sort=" ORDER BY $sort";
$res=db_qq("SELECT * FROM $table$where$sort",1);
$i=0;
if(SQL=='mysql'){while ($info=mysql_fetch_array($res,MYSQL_ASSOC)){foreach($info as $a=>$b){$arr[$i][$a]=$b;}$i++;}}
if(SQL=='mysqli'){while ($info=mysqli_fetch_array($res,MYSQLI_ASSOC)){foreach($info as $a=>$b){$arr[$i][$a]=$b;}$i++;}}
return $arr;
}
function db_ins($table,$arr){
global $table_prefix;
$table=$table_prefix.$table;
foreach($arr as $x=>$y){
$a.="`$x`, ";
$y=str_replace("'","\'",$y);
$b.="'$y', ";
}
$a=substr($a,0,strlen($a)-2);
$b=substr($b,0,strlen($b)-2);
return db_qq("INSERT INTO $table ($a) VALUES ($b)",'',1);
}
function db_up($table,$arr,$where){
global $table_prefix;
$table=$table_prefix.$table;
if(is_array($where)){
foreach($where as $x=>$y){
$y=str_replace("'","\'",$y);
$a.="AND `$x`='$y'";
}
$where=' WHERE'.substr($a,3);
}else $where =' WHERE '.$where;
if(is_array($arr)){
foreach($arr as $x=>$y){
$y=str_replace("'","\'",$y);
$q.="`$x`='$y', ";
}
$q=substr($q,0,strlen($q)-2);
}else $q=$arr;
db_qq("UPDATE $table SET $q$where");
}
?>
Warning: include(/var/www/www-root/data/www/domain.com/ajax/../../wp-load.php): failed to open stream: No such file or directory in /var/www/www-root/data/www/domain.com/ajax/sql.php on line 19
Warning: include(): Failed opening '/var/www/www-root/data/www/domain.com/ajax/../../wp-load.php' for inclusion (include_path='.:/usr/share/php') in /var/www/www-root/data/www/domain.com/ajax/sql.php on line 19
Warning: include(../../wp-load.php): failed to open stream: No such file or directory in /var/www/www-root/data/www/domain.com/ajax/sql.php on line 19
Warning: include(): Failed opening '../../wp-load.php' for inclusion (include_path='.:/usr/share/php') in /var/www/www-root/data/www/domain.com/ajax/sql.php on line 19