MySQL Forums
Forum List  »  Partitioning

Re: Do I have to re write querries when Partitioning?
Posted by: john hango
Date: September 05, 2010 07:43PM

Thank you for the help. I really appreciate it. I believe these are all my querries. This is the querry right now that gives me the most problems. Fatal error: Maximum execution time of 300 seconds exceeded in /home1/esazzlec/public_html/config/functions.php on line 74

I'm going to give you the whole list of querries I hope this helps.


<? if (!defined('INCLUDED')) die("Access Denied");
$fileRoot = (file_exists("config/config.php"))?"":((file_exists("../config/config.php"))?"../":((file_exists("../../config/config.php"))?"../../":"../../../"));
$timeNowMysql = date("Y-m-d H:i:s",time());
$imgarrow = "<img src='themes/".$setts['default_theme']."/img/arrow.gif' width='9' height='9' hspace='4'>";
$imgarrow2 = "<img src='themes/".$setts['default_theme']."/img/arrowb.gif' width='8' height='8' hspace='4'>";
$imgarrowit = "<img src='themes/".$setts['default_theme']."/img/arr_it.gif' width='11' height='11' hspace='4' align='absmiddle'>";
$imgwarning = "<img src='themes/".$setts['default_theme']."/img/warning.gif' width='11' height='11' hspace='4'>";
$imgarrwhite = "<img src='themes/".$setts['default_theme']."/img/arrow1.gif' width='9' height='9' hspace='2' align='absmiddle'>";
$imgarritem = "<img src='themes/".$setts['default_theme']."/img/ar1.gif' width='10' height='10' hspace='4' vspace='2' align='absmiddle'>";
//start of translating sessions
if ($_SESSION[$setts['pk']."_sessionera"]!="") {
$sessionera = nash_cc_decrypt(base64_decode($_SESSION[$setts['pk']."_sessionera"]),$setts['myprivatekey']);
list($s_adminarea,$s_adminid,$s_adminusername,$s_adminlevel,$s_adminlastaccess,$s_usertype) = explode("[XAX]",$sessionera);
}
if ($_SESSION[$setts['pk']."_sessioner"]!="") {
$sessioner = nash_cc_decrypt(base64_decode($_SESSION[$setts['pk']."_sessioner"]),$setts['myprivatekey']);
list($s_membersarea,$s_memberlastaccess,$s_memberid,$s_membername,$s_memberusern,$s_password,$s_sms_phone_number,$s_sms_message,$s_syidescription,$s_nb_items_per_page,$s_is_myfolders,$s_option,$s_charity_id,$s_scatid,$s_sstep,$s_llistin,$s_ageOkToBid,$s_memberzip,$s_memberland,$s_accsusp,$s_is_guest,$s_is_seller,$s_auctionid_refresh,$s_buynow_refresh,$s_buynow_timeout,$s_sess_lang,$s_table_to_modify,$s_slandid,$s_landname,$s_landflag,$s_mygateza_merch_id,$s_mygateza_app_id,$s_mygateza_currency,$s_setcom_email,$s_setcom_username,$s_setcom_pw,$s_setcom_currency,$s_label_comment1,$s_label_comment2,$s_label_comment3,$s_label_comment4,$s_label_comment5,$s_comment1,$s_comment2,$s_comment3,$s_comment4,$s_comment5,$s_quantity,$s_pagseguro_token,$s_show_msg,$s_showcountry,$s_nrs2) = explode("[XAX]",$sessioner);
}
//end of translating sessions
if (isset($s_nrs2)&&!empty($s_nrs2)) $_GET['nrs2'] = $s_nrs2;
if (isset($_GET['nrs2'])&&!empty($_GET['nrs2'])) {
$s_nrs2 = $_GET['nrs2'];
setcookie("fastrefer", $_GET['nrs2'], time()+86400);
$_COOKIE['fastrefer'] = $_GET['nrs2'];
//start of updating sessions
$_SESSION[$setts['pk']."_sessioner"] = base64_encode(nash_cc_encrypt($s_membersarea."[XAX]".$s_memberlastaccess."[XAX]".$s_memberid."[XAX]".$s_membername."[XAX]".$s_memberusern."[XAX]".$s_password."[XAX]".$s_sms_phone_number."[XAX]".$s_sms_message."[XAX]".$s_syidescription."[XAX]".$s_nb_items_per_page."[XAX]".$s_is_myfolders."[XAX]".$s_option."[XAX]".$s_charity_id."[XAX]".$s_scatid."[XAX]".$s_sstep."[XAX]".$s_llistin."[XAX]".$s_ageOkToBid."[XAX]".$s_memberzip."[XAX]".$s_memberland."[XAX]".$s_accsusp."[XAX]".$s_is_guest."[XAX]".$s_is_seller."[XAX]".$s_auctionid_refresh."[XAX]".$s_buynow_refresh."[XAX]".$s_buynow_timeout."[XAX]".$s_sess_lang."[XAX]".$s_table_to_modify."[XAX]".$s_slandid."[XAX]".$s_landname."[XAX]".$s_landflag."[XAX]".$s_mygateza_merch_id."[XAX]".$s_mygateza_app_id."[XAX]".$s_mygateza_currency."[XAX]".$s_setcom_email."[XAX]".$s_setcom_username."[XAX]".$s_setcom_pw."[XAX]".$s_setcom_currency."[XAX]".$s_label_comment1."[XAX]".$s_label_comment2."[XAX]".$s_label_comment3."[XAX]".$s_label_comment4."[XAX]".$s_label_comment5."[XAX]".$s_comment1."[XAX]".$s_comment2."[XAX]".$s_comment3."[XAX]".$s_comment4."[XAX]".$s_comment5."[XAX]".$s_quantity."[XAX]".$s_pagseguro_token."[XAX]".$s_show_msg."[XAX]".$s_showcountry."[XAX]".$s_nrs2,$setts['myprivatekey']));
//end of updating sessions
}
function generatePin($value) {
return substr(md5($value),15,8);
}
function checkPin($value,$pin) {
$valid = (substr(md5($value),15,8)==$pin)?TRUE:FALSE;
return $valid;
}
if ($_SESSION[$setts['pk']."_pin_value"]!="") {
//@unlink($fileRoot."uplimg/tmp_pin_".$_SESSION[$setts['pk']."_pin_value"].".jpg");
$_SESSION[$setts['pk']."_pin_value"] = "";
}
if ($_SESSION[$setts['pk']."_admin_pin_value"]!="") {
//@unlink($fileRoot."uplimg/tmp_pin_".$_SESSION[$setts['pk']."_admin_pin_value"].".jpg");
$_SESSION[$setts['pk']."_admin_pin_value"] = "";
}
if (!$s_sess_lang||$s_sess_lang=="n/a"||$s_sess_lang=="") {
$s_sess_lang = $setts['default_lang'];
//start of updating sessions
$_SESSION[$setts['pk']."_sessioner"] = base64_encode(nash_cc_encrypt($s_membersarea."[XAX]".$s_memberlastaccess."[XAX]".$s_memberid."[XAX]".$s_membername."[XAX]".$s_memberusern."[XAX]".$s_password."[XAX]".$s_sms_phone_number."[XAX]".$s_sms_message."[XAX]".$s_syidescription."[XAX]".$s_nb_items_per_page."[XAX]".$s_is_myfolders."[XAX]".$s_option."[XAX]".$s_charity_id."[XAX]".$s_scatid."[XAX]".$s_sstep."[XAX]".$s_llistin."[XAX]".$s_ageOkToBid."[XAX]".$s_memberzip."[XAX]".$s_memberland."[XAX]".$s_accsusp."[XAX]".$s_is_guest."[XAX]".$s_is_seller."[XAX]".$s_auctionid_refresh."[XAX]".$s_buynow_refresh."[XAX]".$s_buynow_timeout."[XAX]".$s_sess_lang."[XAX]".$s_table_to_modify."[XAX]".$s_slandid."[XAX]".$s_landname."[XAX]".$s_landflag."[XAX]".$s_mygateza_merch_id."[XAX]".$s_mygateza_app_id."[XAX]".$s_mygateza_currency."[XAX]".$s_setcom_email."[XAX]".$s_setcom_username."[XAX]".$s_setcom_pw."[XAX]".$s_setcom_currency."[XAX]".$s_label_comment1."[XAX]".$s_label_comment2."[XAX]".$s_label_comment3."[XAX]".$s_label_comment4."[XAX]".$s_label_comment5."[XAX]".$s_comment1."[XAX]".$s_comment2."[XAX]".$s_comment3."[XAX]".$s_comment4."[XAX]".$s_comment5."[XAX]".$s_quantity."[XAX]".$s_pagseguro_token."[XAX]".$s_show_msg."[XAX]".$s_showcountry."[XAX]".$s_nrs2,$setts['myprivatekey']));
//end of updating sessions
}
@include_once($fileRoot."config/lang/".$s_sess_lang."/site.lang");
@include_once($fileRoot."config/lang/".$s_sess_lang."/category.lang");
@include_once($fileRoot."config/lang/".$s_sess_lang."/catsarray.php");
@include_once($fileRoot."config/lang/".$s_sess_lang."/classads.lang");
@include_once($fileRoot."config/lang/".$s_sess_lang."/classadsarray.php");
@include_once($fileRoot."config/lang/".$s_sess_lang."/regions.lang");
@include_once($fileRoot."config/lang/".$s_sess_lang."/regionsarray.php");
include_once($fileRoot."config/settings.php");
include_once($fileRoot."gco/library/googlecart.php");
include_once($fileRoot."gco/library/googleitem.php");
include_once($fileRoot."config/class.sms.php");
include_once($fileRoot."config/hmac.php");
function strToForm($str) {
return htmlspecialchars(stripslashes($str));
}
function InStrCount($String,$Find,$CaseSensitive = false) {
$i=0;
$x=0;
while (strlen($String)>=$i) {
unset($substring);
if ($CaseSensitive) {
$Find = strtolower($Find);
$String = strtolower($String);
}
$substring = substr($String,$i,strlen($Find));
if ($substring==$Find) $x++;
$i++;
}
return $x;
}
function getSqlRow($query) {
global $lang, $setts;
if ($setts['ismysqlcache']==1) {
list($a,$b) = explode("SELECT",$query);
$query = "SELECT SQL_CACHE".$b;
}
$result = mysql_query($query) or die("<INVALID_QUERY_1>");
$row = mysql_fetch_array($result);
mysql_free_result($result);
return $row;
}
function getSqlNumber($sqlQuery) {
global $setts;
if ($setts['ismysqlcache']==1) {
list($a,$b) = explode("SELECT",$sqlQuery);
$sqlQuery = "SELECT SQL_CACHE".$b;
}
if (InStrCount($sqlQuery,"DISTINCT")>0) {
$query_result = @mysql_query($sqlQuery) or die("<INVALID_QUERY_2>");
$result = @mysql_num_rows($query_result);
} else {
list($c,$d) = explode("FROM",$sqlQuery);
if (InStrCount($d,"WHERE")>0) {
list($e,$f) = explode("WHERE",$d);
if (trim($e)!="") $table_name = trim($e);
if (trim($f)!="") $condition = "WHERE ".trim($f);
} else {
$table_name = trim($d);
$condition = "";
}
$query_result = @mysql_query("SELECT COUNT(*) AS count_rows FROM ".$table_name." ".$condition);
//$query_result = @mysql_query("SELECT COUNT(*) AS count_rows FROM ".$table_name." ".$condition) or die("<INVALID_QUERY_3>");
$result = @mysql_result($query_result,0,"count_rows");
}
@mysql_free_result($query_result);
return $result;
}
function getSqlField($sqlQuery,$field) {
global $lang, $setts;
$isQuery = getSqlNumber($sqlQuery);
if ($setts['ismysqlcache']==1) {
list($a,$b) = explode("SELECT",$sqlQuery);
$sqlQuery = "SELECT SQL_CACHE".$b;
}
$query = @mysql_query($sqlQuery) or die("<INVALID_QUERY_4>");
if ($isQuery>0) $result = @mysql_result($query,0,$field);
else $result = "n/a";
@mysql_free_result($query);
return trim($result);
}
function deleteFile($filepath,$filename) {
global $path, $lang, $setts;
$success = FALSE;
if (file_exists($filepath.$filename)&&$filename!=""&&$filename!="n/a") {
@unlink($filepath.$filename);
$success = TRUE;
}
return $success;
}
function uploadFile($file,$fileName,$destDir,$overwrite=FALSE,$adminPath="",$showMsg=TRUE) {
$success = FALSE;
if ($file!=""&&$file!="none"&&$file!=$destDir.$fileName) {
if (file_exists($destDir.$fileName)) {
$filename1 = eregi_replace("\/","",$fileName);
$filename2 = eregi_replace("\.","",$filename1);
$cached_filename = eregi_replace("\:","",$filename2);
$rep=@opendir($adminPath.'cache/');
while ($cacheFile = @readdir($rep)) {
if (eregi($cached_filename, $cacheFile)) @unlink($adminPath.'cache/'.$cacheFile);
}
if ($overwrite) @unlink($destDir.$fileName);
@closedir($rep);
@clearstatcache();
}
$success = TRUE;
$copyPath = $destDir.$fileName;
if (!@copy($file, $copyPath)) {
if ($showMsg) echo "Error: Failed to copy ".$file."...<br />";
$success = FALSE;
}
} else if ($file==$destDir.$fileName) {
$success = TRUE;
}
return $success;
}
function ftp_file($sourcefile,$destinationfile) {
global $lang, $setts;
set_time_limit(0);
$success = TRUE;
$destinationfileChecker = $destinationfile;
$destinationfile = $setts['remote_pic_ftpdirectory'].$destinationfile;
$remote_pic_ftpaddy = $setts['remote_pic_ftpaddy'];
$remote_pic_username = $setts['remote_pic_username'];
$remote_pic_password = $setts['remote_pic_password'];
$conn_id = ftp_connect($remote_pic_ftpaddy);
if ($conn_id==false) {
echo "Error: openning FTP connection has failed to ".$remote_pic_ftpaddy."...<BR>";
$success = FALSE;
}
$login_result = ftp_login($conn_id,$remote_pic_username,$remote_pic_password);
if (!$conn_id||!$login_result) {
echo "Error: attempted to connect to ".$remote_pic_ftpaddy." with user ".$remote_pic_username." has failed...<BR>";
$success = FALSE;
}
ftp_pasv($conn_id, true);
$upload = ftp_put($conn_id,$destinationfile,$sourcefile,FTP_BINARY);
if (!$upload) {
echo "Error: upload to ".$remote_pic_ftpaddy." has failed...<BR>";
$success = FALSE;
} else {
$ch=ftp_site($conn_id,"chmod 777 ".$destinationfile);
}
ftp_close($conn_id);
return $success;
}
function remSpecialChars($string) {
$string = stripslashes($string);
$string = eregi_replace("'","&#039;",$string);
$string = eregi_replace('"','&quot;',$string);
return $string;
}
if ($setts['ishtmlfilteron']==1) {
function addSpecialChars($string,$noQuotes=FALSE) {
$pattern = "/(?i)<img.+\.php/";
$string = eregi_replace("&amp;","&",$string);
if (!$noQuotes) $string = eregi_replace("&#039;","'",$string);
$string = eregi_replace('&quot;','"',$string);
$string = eregi_replace("&lt;","<",$string);
$string = eregi_replace("&gt;",">",$string);
$string = eregi_replace("&nbsp;"," ",$string);
$string = str_replace("&rsquo;","'",$string);
$string = (preg_match($pattern, $string))?strip_tags($string,"<br />"):$string;
return $string;
}} else {
function addSpecialChars($string,$noQuotes=FALSE) {
$pattern = "/(?i)<img.+\.php/";
$string = eregi_replace("&amp;","&",$string);
if (!$noQuotes) $string = eregi_replace("&#039;","'",$string);
$string = eregi_replace('&quot;','"',$string);
$string = eregi_replace("&lt;","<",$string);
$string = eregi_replace("&gt;",">",$string);
$string = eregi_replace("&nbsp;"," ",$string);
$string = str_replace("&rsquo;","'",$string);
return $string;
}}
function unhtmlentities($string) {
if (InStrCount($string,"&amp;#")>0) {
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string);
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
} else {
return htmlentities($string);
}}
function titleResize($titleText) {
$maxLength = 15;
$newText = "";
$titleText = addSpecialChars($titleText);
$titleWords = explode(" ",$titleText);
for ($i=0; $i<count($titleWords); $i++) {
if (strlen($titleWords[$i])>$maxLength) $newText .= substr($titleWords[$i],0,$maxLength-3)."... ";
else $newText .= $titleWords[$i]." ";
}
return $newText;
}
function paginate($start,$limit,$total,$filePath,$otherParams,$uninum="",$currentpagethis="") {
global $lang,$setts,$s_membersarea,$s_memberlastaccess,$s_memberid,$s_membername,$s_memberusern,$s_password,$s_sms_phone_number,$s_sms_message,$s_syidescription,$s_nb_items_per_page,$s_is_myfolders,$s_option,$s_charity_id,$s_scatid,$s_sstep,$s_llistin,$s_ageOkToBid,$s_memberzip,$s_memberland,$s_accsusp,$s_is_guest,$s_is_seller,$s_auctionid_refresh,$s_buynow_refresh,$s_buynow_timeout,$s_sess_lang,$s_table_to_modify,$s_slandid,$s_landname,$s_landflag,$s_mygateza_merch_id,$s_mygateza_app_id,$s_mygateza_currency,$s_setcom_email,$s_setcom_username,$s_setcom_pw,$s_setcom_currency,$s_label_comment1,$s_label_comment2,$s_label_comment3,$s_label_comment4,$s_label_comment5,$s_comment1,$s_comment2,$s_comment3,$s_comment4,$s_comment5,$s_quantity,$s_pagseguro_token,$s_show_msg,$s_showcountry,$s_nrs2;
$userNbPerPage = (!$s_nb_items_per_page)?25:$s_nb_items_per_page;
if ($limit==0||!$limit) $limit = 1;
$allPages = ceil($total/$limit);
if ($currentpagethis!="") {
$start = ($currentpagethis-1)*$limit;
$currentPage = $currentpagethis;
} else {
$currentPage = floor($start/$limit)+1;
}
$pagination = "";
if ($allPages>10) {
$maxPages = ($allPages>9)?9:$allPages;
if ($allPages>9) {
if ($currentPage>=1&&$currentPage<=$allPages) {
$pagination .= ($currentPage>4)?" ... ":" ";
$minPages = ($currentPage>4)?$currentPage:5;
$maxPages = ($currentPage<$allPages-4)?$currentPage:$allPages-4;
for ($i=$minPages-4; $i<$maxPages+5; $i++) {
$pagination .= ($i==$currentPage)?"<strong><span style=\"font-size: 17px;\">".$i."</strong></strong> ":" <a href=\"".$filePath."?limit=".$limit."&start=".(($i-1)*$limit).$otherParams."&curPageNumber=".$i."\"><span style=\"font-size: 15px;\">".$i."</strong></a> ";
}
$pagination .= ($currentPage<$allPages-4)?" ... ":" ";
} else {
$pagination .= " ... ";
}}} else {
for ($i=1; $i<$allPages+1; $i++) {
$pagination .= ($i==$currentPage)?"<strong><span style=\"font-size: 17px;\">".$i."</span></strong> ":" <a href=\"".$filePath."?limit=".$limit."&start=".(($i-1)*$limit).$otherParams."&curPageNumber=".$i."\"><span style=\"font-size: 15px;\">".$i."</span></a> ";
}}
if ($currentPage>1) $pagination = "<a href=\"".$filePath."?limit=".$limit."&start=0".$otherParams."&curPageNumber=1\"><img src=\"".$setts['siteurl']."images/iconLtArrow_20x20.gif\" title=\"$lang[nash4013]\" border=\"0\" align=\"absmiddle\"></a> <a href=\"".$filePath."?limit=".$limit."&start=".(($currentPage-2)*$limit).$otherParams."&curPageNumber=".($currentPage-1)."\"><img src=\"".$setts['siteurl']."images/iconLtArrowG_20x20.gif\" title=\"$lang[nash4014]\" border=\"0\" align=\"absmiddle\"></a> ".$pagination;
if ($currentPage<$allPages) $pagination .= " <a href=\"".$filePath."?limit=".$limit."&start=".($currentPage*$limit).$otherParams."&curPageNumber=".($currentPage+1)."\"><img src=\"".$setts['siteurl']."images/iconRtArrowG_20x20.gif\" title=\"$lang[nash4015]\" border=\"0\" align=\"absmiddle\"></a> <a href=\"".$filePath."?limit=".$limit."&start=".(($allPages-1)*$limit).$otherParams."&curPageNumber=".$allPages."\"><img src=\"".$setts['siteurl']."images/iconRtArrow_20x20.gif\" title=\"$lang[nash4016]\" border=\"0\" align=\"absmiddle\"></a>";
$pagination = "<script language=\"javascript\" type=\"text/javascript\">function fgtpfixer".$uninum."(content) { content.value=content.value.replace(/['&_,.%`\"@~#-+$^*=<>|]/gi,''); content.value=content.value.replace(/[a-zA-Z]/gi,''); if (content.value>".$allPages.") content.value=".$allPages.";}</script><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><form name=\"rowsperpageform".$uninum."\" id=\"rowsperpageform".$uninum."\"><tr class=\"boldgrey\"><td width=\"100%\">".$lang[nash4743]." ".$currentPage." ".$lang[nash4745]." ".$allPages."</td><td nowrap></td><td nowrap align=\"right\">".$lang[nash4744]."</td></tr><tr><td>".$pagination."</td><td nowrap><select name=\"rowsperpagemenu".$uninum."\" id=\"rowsperpagemenu".$uninum."\" onChange=\"location.href=rowsperpageform".$uninum.".rowsperpagemenu".$uninum.".options[selectedIndex].value;\"><option value=\"".$filePath."?limit=5".$otherParams."\"".(($userNbPerPage==5||$limit==5)?" selected":"").">5 $lang[nash4017]</option><option value=\"".$filePath."?limit=10".$otherParams."\"".(($userNbPerPage==10||$limit==10)?" selected":"").">10 $lang[nash4017]</option><option value=\"".$filePath."?limit=25".$otherParams."\"".(($userNbPerPage==25||$limit==25)?" selected":"").">25 $lang[nash4017]</option><option value=\"".$filePath."?limit=50".$otherParams."\"".(($userNbPerPage==50||$limit==50)?" selected":"").">50 $lang[nash4017]</option><option value=\"".$filePath."?limit=100".$otherParams."\"".(($userNbPerPage==100||$limit==100)?" selected":"").">100 $lang[nash4017]</option></select></td><td nowrap><input size=\"3\" name=\"curpage".$uninum."\" id=\"curpage".$uninum."\" onKeyUp=\"fgtpfixer".$uninum."(this);\" onKeyPress=\"return handleEnter(this, event)\">&nbsp;<input name=\"curpageok".$uninum."\" id=\"curpageok".$uninum."\" type=\"submit\" value=\"".$lang[go]."\" onclick=\"location.href='".$filePath."?limit=".$limit."&start=".$start."".$otherParams."&curPageNumber='+document.getElementById('curpage".$uninum."').value;return false\"></td></tr></form></table>";
echo $pagination;
}
function paginate5($start,$limit,$total,$filePath,$otherParams,$uninum="",$currentpagethis="") {
global $lang,$setts,$s_membersarea,$s_memberlastaccess,$s_memberid,$s_membername,$s_memberusern,$s_password,$s_sms_phone_number,$s_sms_message,$s_syidescription,$s_nb_items_per_page,$s_is_myfolders,$s_option,$s_charity_id,$s_scatid,$s_sstep,$s_llistin,$s_ageOkToBid,$s_memberzip,$s_memberland,$s_accsusp,$s_is_guest,$s_is_seller,$s_auctionid_refresh,$s_buynow_refresh,$s_buynow_timeout,$s_sess_lang,$s_table_to_modify,$s_slandid,$s_landname,$s_landflag,$s_mygateza_merch_id,$s_mygateza_app_id,$s_mygateza_currency,$s_setcom_email,$s_setcom_username,$s_setcom_pw,$s_setcom_currency,$s_label_comment1,$s_label_comment2,$s_label_comment3,$s_label_comment4,$s_label_comment5,$s_comment1,$s_comment2,$s_comment3,$s_comment4,$s_comment5,$s_quantity,$s_pagseguro_token,$s_show_msg,$s_showcountry,$s_nrs2;
$userNbPerPage = (!$s_nb_items_per_page)?25:$s_nb_items_per_page;
$allPages = ceil($total/$limit);
if ($currentpagethis!="") {
$start = ($currentpagethis-1)*$limit;
$currentPage = $currentpagethis;
} else {
$currentPage = floor($start/$limit)+1;
}
$pagination = "";
if ($allPages>10) {
$maxPages = ($allPages>9)?9:$allPages;
if ($allPages>9) {
if ($currentPage>=1&&$currentPage<=$allPages) {
$pagination .= ($currentPage>4)?" ... ":" ";
$minPages = ($currentPage>4)?$currentPage:5;
$maxPages = ($currentPage<$allPages-4)?$currentPage:$allPages-4;
for ($i=$minPages-4; $i<$maxPages+5; $i++) {
$pagination .= ($i==$currentPage)?"<strong><span style=\"font-size: 17px;\">".$i."</strong></strong> ":" <a href=\"".$filePath."?limit=".$limit."&start=".(($i-1)*$limit).$otherParams."&curPageNumber=".$i."\"><span style=\"font-size: 15px;\">".$i."</strong></a> ";
}
$pagination .= ($currentPage<$allPages-4)?" ... ":" ";
} else {
$pagination .= " ... ";
}}} else {
for ($i=1; $i<$allPages+1; $i++) {
$pagination .= ($i==$currentPage)?"<strong><span style=\"font-size: 17px;\">".$i."</span></strong> ":" <a href=\"".$filePath."?limit=".$limit."&start=".(($i-1)*$limit).$otherParams."&curPageNumber=".$i."\"><span style=\"font-size: 15px;\">".$i."</span></a> ";
}}
if ($currentPage>1) $pagination = "<a href=\"".$filePath."?limit=".$limit."&start=0".$otherParams."&curPageNumber=1\"><img src=\"".$setts['siteurl']."images/iconLtArrow_20x20.gif\" title=\"$lang[nash4013]\" border=\"0\" align=\"absmiddle\"></a> <a href=\"".$filePath."?limit=".$limit."&start=".(($currentPage-2)*$limit).$otherParams."&curPageNumber=".($currentPage-1)."\"><img src=\"".$setts['siteurl']."images/iconLtArrowG_20x20.gif\" title=\"$lang[nash4014]\" border=\"0\" align=\"absmiddle\"></a> ".$pagination;
if ($currentPage<$allPages) $pagination .= " <a href=\"".$filePath."?limit=".$limit."&start=".($currentPage*$limit).$otherParams."&curPageNumber=".($currentPage+1)."\"><img src=\"".$setts['siteurl']."images/iconRtArrowG_20x20.gif\" title=\"$lang[nash4015]\" border=\"0\" align=\"absmiddle\"></a> <a href=\"".$filePath."?limit=".$limit."&start=".(($allPages-1)*$limit).$otherParams."&curPageNumber=".$allPages."\"><img src=\"".$setts['siteurl']."images/iconRtArrow_20x20.gif\" title=\"$lang[nash4016]\" border=\"0\" align=\"absmiddle\"></a>";
$pagination = "<script language=\"javascript\" type=\"text/javascript\">function fgtpfixer".$uninum."(content) { content.value=content.value.replace(/['&_,.%`\"@~#-+$^*=<>|]/gi,''); content.value=content.value.replace(/[a-zA-Z]/gi,''); if (content.value>".$allPages.") content.value=".$allPages.";}</script><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><form name=\"rowsperpageform".$uninum."\" id=\"rowsperpageform".$uninum."\"><tr class=\"boldgrey\"><td width=\"100%\">".$lang[nash4743]." ".$currentPage." ".$lang[nash4745]." ".$allPages."</td><td nowrap></td><td nowrap align=\"right\">".$lang[nash4744]."</td></tr><tr><td>".$pagination."</td><td nowrap><select name=\"rowsperpagemenu".$uninum."\" id=\"rowsperpagemenu".$uninum."\" onChange=\"location.href=rowsperpageform".$uninum.".rowsperpagemenu".$uninum.".options[selectedIndex].value;\"><option value=\"".$filePath."?limit=22".$otherParams."\"".(($userNbPerPage==22||$limit==22)?" selected":"").">22 $lang[nash4017]</option><option value=\"".$filePath."?limit=44".$otherParams."\"".(($userNbPerPage==44||$limit==44)?" selected":"").">44 $lang[nash4017]</option><option value=\"".$filePath."?limit=66".$otherParams."\"".(($userNbPerPage==66||$limit==66)?" selected":"").">66 $lang[nash4017]</option><option value=\"".$filePath."?limit=88".$otherParams."\"".(($userNbPerPage==88||$limit==88)?" selected":"").">88 $lang[nash4017]</option></select></td><td nowrap><input size=\"3\" name=\"curpage".$uninum."\" id=\"curpage".$uninum."\" onKeyUp=\"fgtpfixer".$uninum."(this);\">&nbsp;<input name=\"curpageok".$uninum."\" id=\"curpageok".$uninum."\" type=\"submit\" value=\"".$lang[go]."\" onclick=\"location.href='".$filePath."?limit=".$limit."&start=".$start."".$otherParams."&curPageNumber='+document.getElementById('curpage".$uninum."').value;return false\"></td></tr></form></table>";
echo $pagination;
}
function deleteAuction($auctionid,$deletionType=FALSE,$countAuctions=TRUE,$remoteDelete=FALSE) {
global $timeNowMysql,$s_membersarea,$s_memberlastaccess,$s_memberid,$s_membername,$s_memberusern,$s_password,$s_sms_phone_number,$s_sms_message,$s_syidescription,$s_nb_items_per_page,$s_is_myfolders,$s_option,$s_charity_id,$s_scatid,$s_sstep,$s_llistin,$s_ageOkToBid,$s_memberzip,$s_memberland,$s_accsusp,$s_is_guest,$s_is_seller,$s_auctionid_refresh,$s_buynow_refresh,$s_buynow_timeout,$s_sess_lang,$s_table_to_modify,$s_slandid,$s_landname,$s_landflag,$s_mygateza_merch_id,$s_mygateza_app_id,$s_mygateza_currency,$s_setcom_email,$s_setcom_username,$s_setcom_pw,$s_setcom_currency,$s_label_comment1,$s_label_comment2,$s_label_comment3,$s_label_comment4,$s_label_comment5,$s_comment1,$s_comment2,$s_comment3,$s_comment4,$s_comment5,$s_quantity,$s_pagseguro_token,$s_show_msg,$s_showcountry,$s_nrs2;
$item = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$auctionid."'");
$ownerId = ($remoteDelete)?$item['ownerid']:$s_memberid;
if (!$deletionType) {
$markDeleted = mysql_query("UPDATE yspnash_auctions SET deleted=1 WHERE id='".$auctionid."' AND ownerid='".$ownerId."'");
if ($item['active']==1&&(($item['closed']==1&&$item['is_start_on_first_bid']==1)||$item['closed']==0)&&$item['listin']!="store"&&$item['ownerid']==$ownerId) {
$closeAuction = mysql_query("UPDATE yspnash_auctions SET closed=1, enddate='".$timeNowMysql."' WHERE id='".$item['id']."' AND ownerid='".$ownerId."'");
delcatcount($item['category'],$auctionid);
delcatcount($item['addlcategory'],$auctionid);
$delStarRatings = mysql_query("DELETE FROM nash_starratings WHERE id='auc".$auctionid."'");
}
} else if ($deletionType&&$s_adminarea=="Active") {
$getAuction = mysql_query("SELECT SQL_CACHE id FROM yspnash_auctions WHERE id='".$auctionid."'");
$counter = 0;
while ($auctionsArray=mysql_fetch_array($getAuction)) {
$imageName = getSqlField("SELECT picpath FROM yspnash_auctions WHERE id='".$auctionsArray['id']."'","picpath");
deleteFile("../",$imageName);
$getAdditionalImages = mysql_query("SELECT SQL_CACHE * FROM yspnash_auction_images WHERE auctionid='".$auctionsArray['id']."'");
while($adImage = mysql_fetch_array($getAdditionalImages)) {
deleteFile("../",$adImage['name']);
}
$digdelName = getSqlField("SELECT digdel_path FROM yspnash_auctions WHERE id='".$auctionsArray['id']."'","digdel_path");
deleteFile("../",$digdelName);
}
if ((($item['closed']==1&&$item['is_start_on_first_bid']==1)||$item['closed']==0)&&$item['active']==1&&$item['deleted']!=1&&$countAuctions) {
delcatcount($item['category']);
delcatcount($item['addlcategory']);
}
$delAuction = mysql_query("DELETE FROM yspnash_auctions WHERE id='".$auctionid."'");
$delAuctionImages = mysql_query("DELETE FROM yspnash_auction_images WHERE auctionid='".$auctionid."'");
$delProxy = mysql_query("DELETE FROM yspnash_proxybid WHERE auctionid='".$auctionid."'");
$delBids = mysql_query("DELETE FROM yspnash_bids WHERE auctionid='".$auctionid."'");
$delBidsHistory = mysql_query("DELETE FROM yspnash_bids_history WHERE auctionid='".$auctionid."'");
$delCustomFieldsData = mysql_query("DELETE FROM yspnash_fields_data WHERE auctionid='".$auctionid."'");
$delStarRatings = mysql_query("DELETE FROM nash_starratings WHERE id='auc".$auctionid."'");
}}
function setStyle($auctionId) {
$auction = getSqlRow("SELECT bolditem,hlitem FROM yspnash_auctions WHERE id='".$auctionId."'");
if ($auction['bolditem']=="Y"&&$auction['hlitem']=="Y") $style="hlbolditem";
else if ($auction['bolditem']=="Y"&&$auction['hlitem']!="Y") $style="bolditem";
else if ($auction['bolditem']!="Y"&&$auction['hlitem']=="Y") $style="hlitem";
else if ($auction['bolditem']!="Y"&&$auction['hlitem']!="Y") $style="item";
return $style;
}
function setIconIt($auctionId) {
global $lang, $setts;
$auction = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$auctionId."'");
if ($auction['iconit']=="000") $out.="";
else if ($auction['iconit']=="001") $out.="<img align=\"absmiddle\" src=\"listing_icons/001.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="002") $out.="<img align=\"absmiddle\" src=\"listing_icons/002.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="003") $out.="<img align=\"absmiddle\" src=\"listing_icons/003.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="004") $out.="<img align=\"absmiddle\" src=\"listing_icons/004.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="005") $out.="<img align=\"absmiddle\" src=\"listing_icons/005.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="006") $out.="<img align=\"absmiddle\" src=\"listing_icons/006.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="007") $out.="<img align=\"absmiddle\" src=\"listing_icons/007.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="008") $out.="<img align=\"absmiddle\" src=\"listing_icons/008.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="009") $out.="<img align=\"absmiddle\" src=\"listing_icons/009.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="010") $out.="<img align=\"absmiddle\" src=\"listing_icons/010.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="011") $out.="<img align=\"absmiddle\" src=\"listing_icons/011.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="012") $out.="<img align=\"absmiddle\" src=\"listing_icons/012.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="013") $out.="<img align=\"absmiddle\" src=\"listing_icons/013.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="014") $out.="<img align=\"absmiddle\" src=\"listing_icons/014.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="015") $out.="<img align=\"absmiddle\" src=\"listing_icons/015.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="016") $out.="<img align=\"absmiddle\" src=\"listing_icons/016.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="017") $out.="<img align=\"absmiddle\" src=\"listing_icons/017.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="018") $out.="<img align=\"absmiddle\" src=\"listing_icons/018.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="020") $out.="<img align=\"absmiddle\" src=\"listing_icons/020.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="021") $out.="<img align=\"absmiddle\" src=\"listing_icons/021.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="022") $out.="<img align=\"absmiddle\" src=\"listing_icons/022.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="023") $out.="<img align=\"absmiddle\" src=\"listing_icons/023.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="024") $out.="<img align=\"absmiddle\" src=\"listing_icons/024.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="025") $out.="<img align=\"absmiddle\" src=\"listing_icons/025.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="026") $out.="<img align=\"absmiddle\" src=\"listing_icons/026.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="027") $out.="<img align=\"absmiddle\" src=\"listing_icons/027.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="028") $out.="<img align=\"absmiddle\" src=\"listing_icons/028.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="029") $out.="<img align=\"absmiddle\" src=\"listing_icons/029.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="030") $out.="<img align=\"absmiddle\" src=\"listing_icons/030.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="031") $out.="<img align=\"absmiddle\" src=\"listing_icons/031.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="032") $out.="<img align=\"absmiddle\" src=\"listing_icons/032.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="033") $out.="<img align=\"absmiddle\" src=\"listing_icons/033.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="034") $out.="<img align=\"absmiddle\" src=\"listing_icons/034.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="035") $out.="<img align=\"absmiddle\" src=\"listing_icons/035.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="036") $out.="<img align=\"absmiddle\" src=\"listing_icons/036.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="037") $out.="<img align=\"absmiddle\" src=\"listing_icons/037.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="038") $out.="<img align=\"absmiddle\" src=\"listing_icons/038.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="039") $out.="<img align=\"absmiddle\" src=\"listing_icons/039.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="040") $out.="<img align=\"absmiddle\" src=\"listing_icons/040.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="041") $out.="<img align=\"absmiddle\" src=\"listing_icons/041.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="042") $out.="<img align=\"absmiddle\" src=\"listing_icons/042.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($auction['iconit']=="043") $out.="<img align=\"absmiddle\" src=\"listing_icons/043.gif\" border=\"0\" width=\"16\" height=\"16\">";
return $out;
}
function setIconItClassAds($classifiedId) {
global $lang, $setts;
$classfiedAd = getSqlRow("SELECT * FROM nash_classified WHERE id='".$classifiedId."'");
if ($classfiedAd['iconit']=="000") $out.="";
else if ($classfiedAd['iconit']=="001") $out.="<img align=\"absmiddle\" src=\"listing_icons/001.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="002") $out.="<img align=\"absmiddle\" src=\"listing_icons/002.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="003") $out.="<img align=\"absmiddle\" src=\"listing_icons/003.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="004") $out.="<img align=\"absmiddle\" src=\"listing_icons/004.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="005") $out.="<img align=\"absmiddle\" src=\"listing_icons/005.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="006") $out.="<img align=\"absmiddle\" src=\"listing_icons/006.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="007") $out.="<img align=\"absmiddle\" src=\"listing_icons/007.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="008") $out.="<img align=\"absmiddle\" src=\"listing_icons/008.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="009") $out.="<img align=\"absmiddle\" src=\"listing_icons/009.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="010") $out.="<img align=\"absmiddle\" src=\"listing_icons/010.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="011") $out.="<img align=\"absmiddle\" src=\"listing_icons/011.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="012") $out.="<img align=\"absmiddle\" src=\"listing_icons/012.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="013") $out.="<img align=\"absmiddle\" src=\"listing_icons/013.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="014") $out.="<img align=\"absmiddle\" src=\"listing_icons/014.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="015") $out.="<img align=\"absmiddle\" src=\"listing_icons/015.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="016") $out.="<img align=\"absmiddle\" src=\"listing_icons/016.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="017") $out.="<img align=\"absmiddle\" src=\"listing_icons/017.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="018") $out.="<img align=\"absmiddle\" src=\"listing_icons/018.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="020") $out.="<img align=\"absmiddle\" src=\"listing_icons/020.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="021") $out.="<img align=\"absmiddle\" src=\"listing_icons/021.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="022") $out.="<img align=\"absmiddle\" src=\"listing_icons/022.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="023") $out.="<img align=\"absmiddle\" src=\"listing_icons/023.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="024") $out.="<img align=\"absmiddle\" src=\"listing_icons/024.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="025") $out.="<img align=\"absmiddle\" src=\"listing_icons/025.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="026") $out.="<img align=\"absmiddle\" src=\"listing_icons/026.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="027") $out.="<img align=\"absmiddle\" src=\"listing_icons/027.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="028") $out.="<img align=\"absmiddle\" src=\"listing_icons/028.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="029") $out.="<img align=\"absmiddle\" src=\"listing_icons/029.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="030") $out.="<img align=\"absmiddle\" src=\"listing_icons/030.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="031") $out.="<img align=\"absmiddle\" src=\"listing_icons/031.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="032") $out.="<img align=\"absmiddle\" src=\"listing_icons/032.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="033") $out.="<img align=\"absmiddle\" src=\"listing_icons/033.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="034") $out.="<img align=\"absmiddle\" src=\"listing_icons/034.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="035") $out.="<img align=\"absmiddle\" src=\"listing_icons/035.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="036") $out.="<img align=\"absmiddle\" src=\"listing_icons/036.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="037") $out.="<img align=\"absmiddle\" src=\"listing_icons/037.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="038") $out.="<img align=\"absmiddle\" src=\"listing_icons/038.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="039") $out.="<img align=\"absmiddle\" src=\"listing_icons/039.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="040") $out.="<img align=\"absmiddle\" src=\"listing_icons/040.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="041") $out.="<img align=\"absmiddle\" src=\"listing_icons/041.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="042") $out.="<img align=\"absmiddle\" src=\"listing_icons/042.gif\" border=\"0\" width=\"16\" height=\"16\">";
else if ($classfiedAd['iconit']=="043") $out.="<img align=\"absmiddle\" src=\"listing_icons/043.gif\" border=\"0\" width=\"16\" height=\"16\">";
return $out;
}
function showBuyNow($isRp,$reservePrice,$maxBid,$nrBids,$bnPrice) {
global $lang, $setts;
$showBn = FALSE;
if ($setts['alwaysshowbuynow']) {
if ($maxBid>$bnPrice) $showBn = FALSE;
else $showBn = TRUE;
} else {
if ($nrBids<=0) {
$showBn = TRUE;
} else {
if ($isRp=="Y") {
if ($maxBid<$reservePrice) $showBn = TRUE;
else $showBn = FALSE;
} else {
$showBn = FALSE;
}}}
return $showBn;
}
function newUserPics($auctionId) {
global $lang, $setts;
$auction = getSqlRow("SELECT ownerid FROM yspnash_auctions WHERE id='".$auctionId."'");
$newuser = getSqlRow("SELECT regdate FROM yspnash_users WHERE id='".$auction['ownerid']."'");
$regdate = $newuser['regdate'];
$currentTime = time();
$timestamp_days = (60*60*24*30);//30 days
$howLongFromRegDate = ($currentTime-$regdate);
if ($howLongFromRegDate<$timestamp_days) $result = "<img src=\"".$setts['siteurl']."images/iconNewId_16x16.gif\" border=\"0\" align=absmiddle title=\"$lang[nash291]\">";
else $result = "";
return $result;
}
function newUserPics2($userid) {
global $lang, $setts;
$newuser = getSqlRow("SELECT regdate FROM yspnash_users WHERE id='".$userid."'");
$regdate = $newuser['regdate'];
$currentTime = time();
$timestamp_days = (60*60*24*30);//30 days
$howLongFromRegDate = ($currentTime-$regdate);
if ($howLongFromRegDate<$timestamp_days) $result = "<img src=\"".$setts['siteurl']."images/iconNewId_16x16.gif\" border=\"0\" align=absmiddle title=\"$lang[nash291]\">";
else $result = "";
return $result;
}
function newItemPics($auctionId) {
global $lang, $setts;
$auction = getSqlRow("SELECT startdate FROM yspnash_auctions WHERE id='".$auctionId."'");
$startdate = $auction['startdate'];
$timestamp_startdate = @strtotime($startdate);
$rightnow = date("Y-m-d H:i:s", time());
$timestamp_rightnow = strtotime($rightnow);
$timestamp_hours = (60*60*24);//24 hours
$howLongFromStartDate = ($timestamp_rightnow-$timestamp_startdate);
if ($howLongFromStartDate<$timestamp_hours) $result = "<img src=\"".$setts['siteurl']."images/new.gif\" border=\"0\" title=\"".$lang[nash292]."\" align=\"absmiddle\">";
else $result = "";
return $result;
}
function changedUsername($userId) {
global $lang, $setts;
$user = getSqlRow("SELECT is_username_changed FROM yspnash_users WHERE id='".$userId."'");
if ($user['is_username_changed']==1) $result = "<img src=\"".$setts['siteurl']."images/cma_changed_uname.gif\" border=\"0\" align=\"absmiddle\" title=\"".$lang[nash4703]."\">";
else $result = "";
return $result;
}
function naru($userId) {
global $lang, $setts;
$user = getSqlRow("SELECT active,admin_flag_for_any_reason FROM yspnash_users WHERE id='".$userId."'");
if ($user['active']==0&&$user['admin_flag_for_any_reason']==1) $result = "&nbsp;<img src=\"".$setts['siteurl']."images/naru.gif\" border=\"0\" title=\"".$lang[nash5317]."\" align=\"absmiddle\">";
else $result = "";
return $result;
}
function displayAmount($amount,$currency=NULL,$invoicelook=NULL) {
global $setts, $lang;
if ($invoicelook==NULL&&$amount<0) return $lang[item_swapped];
if ($currency==NULL) $currency = $setts['currency'];
if ($setts['iscurrencysymbols']==1) {
$tru_symbol = trim(getSqlField("SELECT tru_symbol FROM yspnash_currencies WHERE symbol='".$currency."'", "tru_symbol"));
if ($tru_symbol!="n/a"&&$tru_symbol!="") $currency = unhtmlentities($tru_symbol);
}
if ($amount==9999999999999999999999) return "Above";
if ($setts['m_format'] == 1) $formattedAmount = number_format($amount,$setts['digits'],'.',',');
else $formattedAmount = number_format($amount,$setts['digits'],',','.');
if ($setts['position']==1) $result = $currency." ".$formattedAmount;
else $result = $formattedAmount." ".$currency;
if ($invoicelook==NULL&&$amount==0)$result="--";
return $result;
}
function getFeedback($userid,$admin=FALSE,$lightVersion=FALSE) {
global $setts, $lang, $currentVersionYsp;
$subdir = ($admin==TRUE)?"../":"";
if (getSqlField("SELECT enable_fbprivate FROM yspnash_users WHERE id='".$userid."'", "enable_fbprivate")==0) {
$query = mysql_query("SELECT SQL_CACHE * FROM yspnash_feedbacks WHERE userid='".$userid."' AND submitted='1'");
$rating = 0;
while ($row = mysql_fetch_array($query)) {
if ($row['rate']>=3) $rating++;
else if ($row['rate']<3) $rating--;
}
mysql_free_result($query);
if ($rating<1) {
$result = " ($rating) ";
} else {
$inger = 0;
$query2 = mysql_query("SELECT SQL_CACHE * FROM nash_feedback_ratings_settings WHERE fb_hidden='0' ORDER BY fb_order");
while ($row2 = mysql_fetch_array($query2)) {
if ($rating>=$row2['fb_rating_from']&&$rating<=$row2['fb_rating_to']&&$row2['fb_rating_to']!='Above') $result=" ($rating) <img align=\"absmiddle\" src=\"".$setts['siteurl'].$row2['fb_img_url']."\" border=\"0\" title=\"$lang[nash4005] ".$row2['fb_rating_from']." $lang[to] ".$row2['fb_rating_to']."\">";
else if ($rating>=$row2['fb_rating_from']&&$row2['fb_rating_to']=='Above') $result=" ($rating) <img align=\"absmiddle\" src=\"".$setts['siteurl'].$row2['fb_img_url']."\" border=\"0\" title=\"$lang[nash4006] ".$row2['fb_rating_from']."\">";
else if ($rating<$row2['fb_rating_from']&&$inger==0) $result=" ($rating) ";
if ($lightVersion==FALSE) {
if ($rating==$row2['fb_congrats_level']&&getSqlField("SELECT fb_congrats_sent FROM yspnash_users WHERE id='".$userid."'","fb_congrats_sent")<$row2['fb_congrats_level']) {
$fbSentUpdated = mysql_query("UPDATE yspnash_users SET fb_congrats_sent='".$rating."' WHERE id='".$userid."'");
echo "<html><body>";
$to = getSqlField("SELECT name FROM yspnash_users WHERE id='".$userid."'","name")." <".getSqlField("SELECT email FROM yspnash_users WHERE id='".$userid."'","email").">";
$subject="$lang[nash299] ".$setts['sitename']."!";
$message="<a href=\"".$setts['siteurl']."\"><img src=\"".$setts['siteurl'].$row2['fb_congrats_img_url']."\" title=\"$lang[nash300]\" border=\"0\"></a>";
if ($setts['unsubscribelink']==1) $message .= "<br />".
"<br />".
"".$setts['sitename']." $lang[nash5034]<br />".
"$lang[nash5035]<br />".
"".$setts['sitename']." $lang[nash5036]<br />".
"$lang[nash5037] ".getSqlField("SELECT email FROM yspnash_users WHERE id='".$userid."'","email").", $lang[nash5038] ".$setts['sitename'].".<br />".
"<br />".
"$lang[nash5039] \"".$setts['sitename']."\" $lang[nash5040] \"$lang[Cap_members]\" $lang[nash5041]<br />".
"$lang[nash5042] ".$setts['sitename']." $lang[nash5043]<br />".
"$lang[nash5044]<br />".
"<br />".
"$lang[nash5045]<br />".
"<br />".
"$lang[nash5046] (c) ".date('Y')." ".$setts['sitename'].". ".$lang[nash5047]."<br />".
"$lang[nash5048]<br />".
"".$setts['sitename']." ".$lang[nash2867]." ".$setts['sitename']." ".$lang[nash5049]." ".$setts['sitename'].".<br />".
"".$setts['sitename']." ".$lang[nash5050]." ".$setts['idv_mailing_address']."";
$headers="Return-Path: ".$setts['adminemail']."\n";
$headers.="From: ".$setts['sitename']." <".$setts['adminemail'].">\n";
$headers.="Reply-to: ".$setts['adminemail']."\n";
$headers.="X-Priority: 3\n";
$headers.="X-Mailer: ".$setts['sitename']." [version ".$currentVersionYsp."]\n";
$headers.="Cc: ".$setts['adminemail']."\n";
$headers.="Bcc: ".$setts['adminemail']."\n";
$headers.="MIME-Version: 1.0\n";
$headers.="Content-Transfer-Encoding: 7bit\n";
$headers.="Content-type: text/html; charset=utf-8";
mail ($to, $subject, $message, $headers);
echo "</body></html>";
}}
$inger++;
}
mysql_free_result($query2);
}} else {
$result = " ($lang[nash4805]) ";
}
if ($lightVersion==FALSE) {
if ($setts['enable_powsel']) {
if (getSqlField("SELECT powerseller_level FROM yspnash_users WHERE id='".$userid."'","powerseller_level")=='bronze') $result.=" <img src=\"".$setts['siteurl']."images/iconPS_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4195]\">";
if (getSqlField("SELECT powerseller_level FROM yspnash_users WHERE id='".$userid."'","powerseller_level")=='silver') $result.=" <img src=\"".$setts['siteurl']."images/iconPS_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4196]\">";
if (getSqlField("SELECT powerseller_level FROM yspnash_users WHERE id='".$userid."'","powerseller_level")=='gold') $result.=" <img src=\"".$setts['siteurl']."images/iconPS_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4197]\">";
if (getSqlField("SELECT powerseller_level FROM yspnash_users WHERE id='".$userid."'","powerseller_level")=='platinum') $result.=" <img src=\"".$setts['siteurl']."images/iconPS_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4198]\">";
if (getSqlField("SELECT powerseller_level FROM yspnash_users WHERE id='".$userid."'","powerseller_level")=='titanium') $result.=" <img src=\"".$setts['siteurl']."images/iconPS_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4199]\">";
}
if ($setts['enable_powbuy']) {
if (getSqlField("SELECT powerbuyer_level FROM yspnash_users WHERE id='".$userid."'","powerbuyer_level")=='bronze') $result.=" <img src=\"".$setts['siteurl']."images/iconPB_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4200]\">";
if (getSqlField("SELECT powerbuyer_level FROM yspnash_users WHERE id='".$userid."'","powerbuyer_level")=='silver') $result.=" <img src=\"".$setts['siteurl']."images/iconPB_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4201]\">";
if (getSqlField("SELECT powerbuyer_level FROM yspnash_users WHERE id='".$userid."'","powerbuyer_level")=='gold') $result.=" <img src=\"".$setts['siteurl']."images/iconPB_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4202]\">";
if (getSqlField("SELECT powerbuyer_level FROM yspnash_users WHERE id='".$userid."'","powerbuyer_level")=='platinum') $result.=" <img src=\"".$setts['siteurl']."images/iconPB_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4203]\">";
if (getSqlField("SELECT powerbuyer_level FROM yspnash_users WHERE id='".$userid."'","powerbuyer_level")=='titanium') $result.=" <img src=\"".$setts['siteurl']."images/iconPB_50x25.gif\" border=\"0\" align=absmiddle title=\"$lang[nash4204]\">";
}
if (getSqlField("SELECT isaboutme FROM yspnash_users WHERE id='".$userid."'","isaboutme")=="Y") {
if (!eregi("popup_allbidders.php",$_SERVER['PHP_SELF'])) $result.=" <a style=\"text-decoration:none\" href=\"".$setts['siteurl']."aboutme.php?userid=".$userid."&ame=1\"><img src=\"".$setts['siteurl']."themes/".$setts[default_theme]."/img/system/about_me.gif\" border=\"0\" align=\"absmiddle\" title=\"".$lang[nash145]."\"></a> ";
else $result.=" <img src=\"".$setts['siteurl']."themes/".$setts[default_theme]."/img/system/about_me.gif\" border=\"0\" align=\"absmiddle\">";
}
if (getSqlField("SELECT aboutpage_type FROM yspnash_users WHERE id='".$userid."'","aboutpage_type")==2) {
$store_name = getSqlField("SELECT t.store_name FROM yspnash_fees_tiers AS t, yspnash_users AS u WHERE t.fee_type='store' AND u.store_account_type=t.id AND u.id='".$userid."' ORDER BY t.fee_amount DESC", "t.store_name");
$store_img_url = getSqlField("SELECT t.store_img_url FROM yspnash_fees_tiers AS t, yspnash_users AS u WHERE t.fee_type='store' AND u.store_account_type=t.id AND u.id='".$userid."' ORDER BY t.theorder ASC, t.fee_amount DESC", "t.store_img_url");
if ($store_name==""||$store_name=="n/a") $store_name = $lang[nash64];
if ($store_img_url==""||$store_img_url=="n/a") $store_img_url = "themes/".$setts[default_theme]."/img/system/iconStoresNW_20x20.gif";
if (!eregi("popup_allbidders.php",$_SERVER['PHP_SELF'])) $result.=" <a style=\"text-decoration:none\" href=\"".$setts['siteurl']."shop.php?userid=".$userid."\"><img src=\"".$setts['siteurl'].$store_img_url."\" border=\"0\" align=\"absmiddle\" title=\"".$store_name."\"></a> ";
else $result.=" <img src=\"".$setts['siteurl'].$store_img_url."\" border=\"0\" align=\"absmiddle\" title=\"".$store_name."\">";
}
$preferred_seller = getSqlField("SELECT preferred_seller FROM yspnash_users WHERE id='".$userid."'","preferred_seller");
if ($preferred_seller=="N"||$preferred_seller=="n/a") $result .= " <img src=\"".$setts['siteurl']."themes/".$setts['default_theme']."/img/system/transparent.gif\" border=\"0\" align=\"absmiddle\">";
else $result .= " <img src=\"".$setts['siteurl']."themes/".$setts['default_theme']."/img/system/star".$preferred_seller.".gif\" border=\"0\" align=\"absmiddle\" title=\"$lang[nash313]\">";
}
return $result;
}
function getFeedback2($userid) {
global $setts, $lang;
if (getSqlField("SELECT enable_fbprivate FROM yspnash_users WHERE id='".$userid."'", "enable_fbprivate")==0) {
$query = mysql_query("SELECT SQL_CACHE * FROM yspnash_feedbacks WHERE userid='".$userid."' AND submitted='1'");
$rating = 0;
while ($row = mysql_fetch_array($query)) {
if ($row['rate']>=3) $rating++;
else if ($row['rate']<3) $rating--;
}
mysql_free_result($query);
if ($rating<1) {
$result=" ($rating) ";
} else {
$query2 = mysql_query("SELECT SQL_CACHE * FROM nash_feedback_ratings_settings WHERE fb_hidden='0' ORDER BY fb_order");
while ($row2 = mysql_fetch_array($query2)) {
if ($rating>=$row2['fb_rating_from']&&$rating<=$row2['fb_rating_to']&&$row2['fb_rating_to']!='Above') $result=" ($rating)";
else if ($rating>=$row2['fb_rating_from']&&$row2['fb_rating_to']=='Above') $result=" ($rating)";
else if ($rating<$row2['fb_rating_from']&&$inger==0) $result=" ($rating)";
}
mysql_free_result($query2);
}} else {
$result = " ($lang[nash4805]) ";
}
return $result;
}
function getOnlineStatus($userid) {
global $path, $setts, $lang;
$nbRows = getSqlNumber("SELECT * FROM nash_whoishere WHERE session_user_id='".$userid."'");
if ($nbRows>0) $result = "<img src=\"".$path."images/icon_user_online_ysp_on_A.gif\" border=\"0\" align=\"absmiddle\" title=\"".$lang[nash4705]."\">";
else $result = "";
return $result;
}

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Do I have to re write querries when Partitioning?
5612
September 05, 2010 07:43PM
1765
September 06, 2010 11:38PM
2405
September 06, 2010 11:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.