MySQL Forums
Forum List  »  Partitioning

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

function tagstriper($text) {
global $s_sess_lang;
if ($s_sess_lang=="english") {
$text = strip_tags($text);
$text = htmlentities($text);
$text = nl2br($text);
$text = preg_replace('/[^\sa-z0-9]/i','',$text);
}
return $text;
}
function strip_html_tags($text) {
$text = preg_replace(array('@<head[^>]*?>.*?</head>@siu','@<style[^>]*?>.*?</style>@siu','@<script[^>]*?.*?</script>@siu','@<object[^>]*?.*?</object>@siu','@<embed[^>]*?.*?</embed>@siu','@<applet[^>]*?.*?</applet>@siu','@<noframes[^>]*?.*?</noframes>@siu','@<noscript[^>]*?.*?</noscript>@siu','@<noembed[^>]*?.*?</noembed>@siu','@<((br)|(hr))@iu','@</?((address)|(blockquote)|(center)|(del))@iu','@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu','@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu','@</?((table)|(th)|(td)|(caption))@iu','@</?((form)|(button)|(fieldset)|(legend)|(input))@iu','@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu','@</?((frameset)|(frame)|(iframe))@iu',),array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',"\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0","\n\$0", "\n\$0",),$text);
return strip_tags($text);
}
function columnPicture($itemid,$option="") {
global $lang, $setts, $layout, $timeNowMysql;
$topPadder = 5;
$imagePadder = 10;
if ($option!='uncategorized') $item = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$itemid."'");
else $item = getSqlRow("SELECT * FROM nash_website_promoter_auctions WHERE matching_main_categoryname=0 AND id='".$itemid."'");
$out = "";
$out .= "<div style=\"background:url(".$setts['siteurl']."makethumb.php?src=images/_imgframe.png&w=".$setts['thumb_width']."&h=".$setts['thumb_width']."&f=png) no-repeat;width:".$setts['thumb_width']."px;height:".$setts['thumb_width']."px;padding-top:".$topPadder."px;\">";
if ($option!='uncategorized') {
$out .= ((adultItemCheck($item['id'])==0)?(($setts['is_soldicon']==1&&$item['active']==1&&$item['closed']==1&&$item['deleted']!=1&&$item['startdate']<$timeNowMysql&&($item['nrbids']!=0||getSqlField("SELECT bnpurchase FROM yspnash_winners WHERE auctionid='".$item['id']."'","bnpurchase")==1))?(($item['picpath']!='')?"<a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\"".(($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\"":"")."><img style=\"background:url(".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder).") no-repeat; width:".($setts['thumb_width']-$imagePadder)."px; height:".($setts['thumb_width']-$imagePadder)."px;\" src=\"".$setts['siteurl']."images/soldout_50x50.png\" border=\"0\"></a>":"<a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\"><img style=\"background:url(".$setts['siteurl']."makethumb.php?src=nopic.gif&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder).") no-repeat; width:".($setts['thumb_width']-$imagePadder)."px; height:".($setts['thumb_width']-$imagePadder)."px;\" src=\"".$setts['siteurl']."images/soldout_50x50.png\" border=\"0\"></a>"):(($item['picpath']!='')?"<a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\"".(($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\"":"")."><img src=\"".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder)."\" border=\"0\" title=\"".$item['itemname']."\"></a>":"<a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\"><img src=\"".$setts['siteurl']."makethumb.php?src=nopic.gif&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder)."\" border=\"0\" title=\"".$item['itemname']."\"></a>")).(($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?(($item['picpath']!=''&&$item['ebay_post_cache']==0)?"<div><span class=\"gpost\"><a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\">".$lang[nash647]." <img src=\"".$setts['siteurl']."images/zoom.gif\" border=\"0\"></a></span></div>":""):""):(($item['picpath']!='')?"<a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\"".(($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\"":"")."><img src=\"".$setts['siteurl']."makethumb.php?src=adultitem.gif&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder)."\" border=\"0\"></a>":"<a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\"><img src=\"".$setts['siteurl']."makethumb.php?src=nopic.gif&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder)."\" border=\"0\"></a>").(($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?(($item['picpath']!=''&&$item['ebay_post_cache']==0)?"<div><span class=\"gpost\"><a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=adultitem.gif&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\">".$lang[nash647]." <img src=\"".$setts['siteurl']."images/zoom.gif\" border=\"0\"></a></span></div>":""):""));
} else {
$out .= (($item['picpath']!='')?"<a href=\"".(($item['item_path']!="")?$item['item_path'].$item['item_id']:(($item['ebay_post_cache']==0)?"".$setts['siteurl']."auctiondetails.php?id=".$item['id']:$item['ebay_item_link']))."\"".(($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\"":"")." target=\"_blank\"><img src=\"".$setts['siteurl']."makethumb.php?src=".$item['picpath']."&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder)."\" border=\"0\"></a>":"<a href=\"".(($item['item_path']!="")?$item['item_path'].$item['item_id']:(($item['ebay_post_cache']==0)?"".$setts['siteurl']."auctiondetails.php?id=".$item['id']:$item['ebay_item_link']))."\" target=\"_blank\"><img src=\"".$setts['siteurl']."makethumb.php?src=nopic.gif&w=".($setts['thumb_width']-$imagePadder)."&h=".($setts['thumb_width']-$imagePadder)."\" border=\"0\"></a>");
$out .= (($setts['enlpic_item']==1&&$item['enlpicitem']=='Y')?(($item['picpath']!=''&&$item['ebay_post_cache']==0)?"<div><span class=\"gpost\"><a href=\"".(($auctionDetails['item_path']!="")?$auctionDetails['item_path'].$auctionDetails['item_id']:(($auctionDetails['ebay_post_cache']==0)?"".$setts['siteurl']."auctiondetails.php?id=".$auctionDetails['id']:$auctionDetails['ebay_item_link']))."\" onMouseover=\"ddrivetip('<center><img src=\'".$setts['siteurl']."makethumb.php?src=".$auctionDetails['picpath']."&w=400&h=400\' border=0></center>',400);\" onMouseout=\"hideddrivetip();\" target=\"_blank\">".$lang[nash647]." <img src=\"".$setts['siteurl']."images/zoom.gif\" border=\"0\" /></a></span></div>":""):"");
}
$out .= "</div>";
return $out;
}
function columnTitle($itemid,$option="") {
global $lang, $setts, $layout;
$item = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$itemid."'");
$user = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$item['ownerid']."'");
$out = "";
$out .= " ".setIconIt($item['id'])." ".newItemPics($item['id'])." ".(($setts['enable_idv3']=='Y'&&$option!='ended'&&$item['ebay_post_cache']==0)?" ".idvMarker($item['ownerid'])." ":"")." <a href=\"".(($item['ebay_post_cache']==0)?$setts['siteurl'].processLink('auctiondetails',array('itemname' => $item['itemname'],'id' => $item['id'])):$item['ebay_item_link'])."\">".$item['itemname']."</a> ".(($setts['is_coseller']==1&&$item['is_bidder_coseller']==1)?"<img src=\"".$setts['siteurl']."images/wait3.gif\" title=\"".$lang[nash4112]."\" border=\"0\" align=\"absmiddle\">":"").((trim($item['subitemname'])!='')?"<br /><li>".$item['subitemname']."</li>":"").(($setts['buyout_process']==1&&$item['bn']=='Y'&&$layout['act_buynow']==1)?"<br /><a href=\"".$setts['siteurl']."makeoffer.php?auctionid=".$item['id']."&noerror=1\"><img src=\"".$setts['siteurl']."themes/".$setts['default_theme']."/img/system/makeoffer25.gif\" title=\"".$lang[nash93]."\" border=\"0\" align=\"absmiddle\"></a> <em>".offerRange($item['offer_range_min'],$item['offer_range_max'],$item['currency'])."</em>":"").(($setts['buyout_process']==2&&$item['bn']=='Y'&&$layout['act_buynow']==1)?"<br />".(($item['offer_range_min']>0&&$item['offer_range_max']>0)?"<a href=\"".$setts['siteurl']."makeoffer.php?auctionid=".$item['id']."&noerror=1\"><img src=\"".$setts['siteurl']."themes/".$setts['default_theme']."/img/system/makeoffer25.gif\" alt=\"".$lang[nash93]."\" border=\"0\" align=\"absmiddle\"></a><br /><em>".offerRange($item['offer_range_min'],$item['offer_range_max'],$item['currency'])."</em>":""):"").(($user['is_fb_in_item_brrowser']==1)?"<br /><span class=\"gpost\" style=\"color:#666666;\">".$lang[nash4611]." ".getFeedback2($item['ownerid'])." ".calcFeedback($item['ownerid'])."</span>":"");
return $out;
}
function columnInstaPayment($acceptdirectpayment) {
global $lang, $setts;
$out = "";
$out .= (($acceptdirectpayment!='0')?"<img src=\"".$setts['siteurl']."images/icon_payPalLogo_15x15.gif\" title=\"".$lang[nash91]."\">":"<img src=\"".$setts['siteurl']."themes/".$setts['default_theme']."/img/pixel.gif\">");
return $out;
}
function columnBids($nrbids,$auctiontype,$itemid,$option="") {
global $lang, $setts, $layout;
$item = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$itemid."'");
$out = "";
if ($option!='ended') {
$out .= (($item['bn']=='Y'&&$item['bidstart']==$item['bnvalue'])?"":(($nrbids!='0')?$nrbids.(($nrbids==1)?" $lang[bid]":" $lang[nash86]"):(($auctiontype=="classified")?"<img src=\"".$setts['siteurl']."images/imgClassifiedAd.gif\" title=\"".$lang[nash101]."\">":"0 $lang[nash86]")));
$out .= ((($setts['buyout_process']==0||$setts['buyout_process']==2)&&$item['bn']=='Y'&&$layout['act_buynow']==1)?(($item['bn']=='Y'&&$item['bidstart']==$item['bnvalue'])?"":"<br />").(($item['bnvalue']>0&&$item['maxbid']==0&&$item['nrbids']==0&&(($item['closed']==1&&$item['is_start_on_first_bid']==1)||$item['closed']==0))?(($item['auctiontype']!='classified')?"<a href=\"".$setts['siteurl']."buynow.php?id=".$item['id']."\"><img src=\"".$setts['siteurl']."themes/".$setts['default_theme']."/img/system/buyitnow25.gif\" title=\"".$lang[nash92]."\" border=\"0\" align=\"absmiddle\"></a>":""):""):"");
} else {
$out .= (($nrbids!=0||getSqlField("SELECT bnpurchase FROM yspnash_winners WHERE auctionid='".$item['id']."'", "bnpurchase")==1)?"<img src=\"".$setts['siteurl']."images/blueCheck_cma.gif\" border=\"0\">":(($auctiontype=="classified")?"<img src=\"images/imgClassifiedAd.gif\" title=\"".$lang[nash101]."\">":"--"));
}
return $out;
}
function columnPrice($bidstart,$maxbid,$currency,$itemid,$option="") {
global $lang, $setts, $layout;
$item = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$itemid."'");
$out = "";
$out .= (($item['bn']=='Y'&&$item['bidstart']==$item['bnvalue'])?"<strong>".displayAmount($item['bnvalue'],$currency,'YES')."</strong>":"<strong>".(($item['maxbid']!=0)?displayAmount($item['maxbid'],$currency,'YES'):displayAmount($item['bidstart'],$currency,'YES'))."</strong>").((($setts['buyout_process']==0||$setts['buyout_process']==2)&&$item['bn']=='Y'&&$layout['act_buynow']==1)?(($item['bn']=='Y'&&$item['bidstart']==$item['bnvalue'])?"":"<br />").(($item['bnvalue']>0&&$item['maxbid']==0&&$item['nrbids']==0&&(($item['closed']==1&&$item['is_start_on_first_bid']==1)||$item['closed']==0)&&$item['active']==1&&$item['bidstart']!=$item['bnvalue'])?(($item['auctiontype']!='classified')?"".displayAmount($item['bnvalue'],$item['currency'],"YES"):""):""):"");
if ($option!='uncategorized'&&$item['ebay_post_cache']!=1) $out .= (($setts['is_freeshipicon']==1&&$setts['ispostagecosts']==1&&$item['postage_costs']==0&&$item['postage_costs_ww']==0&&$item['postage_costs_ww_specific']==0&&$item['postage_costs_ww_country']==""&&$item['calculated']=="")?"<div class=\"freeship\"><span class=\"freeship2\">".(($item['forpickuponly']==0)?$lang[nash4987]:$lang[nash6130])."</span></div>":(($setts['ispostagecosts']==1&&$item['postage_costs']>0&&$item['calculated']==""&&$item['country']==str_replace('+',' ',$_COOKIE['fastreferland'])&&$_COOKIE['fastreferzip']<>"")?"<div class=\"shippingto2\">+".displayAmount($item['postage_costs'],$currency,'YES')."</div>":""));
return $out;
}
class twitter {
private $user;
private $pass;
private $ch;
private $twitterHost = "http://twitter.com/";;
public function __construct($username,$passwd) {
$this->user = $username;
$this->pass = $passwd;
$this->ch = curl_init();
curl_setopt($this->ch,CURLOPT_VERBOSE,1);
curl_setopt($this->ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($this->ch,CURLOPT_USERPWD,"$this->user:$this->pass");
curl_setopt($this->ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
curl_setopt($this->ch,CURLOPT_POST,1);
}
public function __destruct() {
curl_close($this->ch);
}
public function setStatus($stat) {
if (strlen($stat)<1) return false;
$this->twitterHost .= "statuses/update.xml";
curl_setopt($this->ch,CURLOPT_POSTFIELDS,"status=".urlencode(stripslashes(urldecode($stat))));
curl_setopt($this->ch,CURLOPT_URL,$this->twitterHost);
$result = curl_exec($this->ch);
$resultArray = curl_getinfo($this->ch);
if ($resultArray['http_code']==200) return true;
else return false;
}}
function doPingOMatic($item_name,$item_link) {
global $lang, $setts, $timeNowMysql;
$xml_schema = "<?xml version=\"1.0\"?>\n";
$methodcall_schema = "<methodCall>\n";
$methodname_line = "<methodName>weblogUpdates.ping</methodName>\n";
$params_schema ="<params>\n";
$itemname_line ="<param><value>".$item_name."</value></param>\n";
$itemlink_line = "<param><value>".$item_link."</value></param>\n";
$params_end = "</params>\n";
$methodcall_end = "</methodCall>\n";
$ping_url = $setts['ping_url'];
$ping_post_content = $xml_schema.$methodcall_schema.$methodname_line;
$ping_post_content .= $params_schema.$itemname_line.$itemlink_line;
$ping_post_content .= $params_end.$methodcall_end;
$connect = curl_init();
curl_setopt($connect,CURLOPT_URL,$ping_url);
curl_setopt($connect,CURLOPT_RETURNTRANSFER,1);
curl_setopt($connect,CURLOPT_HTTPHEADER,array('Content-Type: text/xml'));
curl_setopt($connect,CURLOPT_POST,1);
curl_setopt($connect,CURLOPT_POSTFIELDS,$ping_post_content);
$result = curl_exec($connect);
$resultArray = curl_getinfo($connect);
curl_close($connect);
$isPingExist = getSqlNumber("SELECT id FROM nash_ping_services WHERE ping_url='".$ping_url."'");
if ($isPingExist>0) {
if ($resultArray['http_code']==200) $updLastPing = mysql_query("UPDATE nash_ping_services SET ping_time='".$timeNowMysql."', is_success='1' WHERE ping_url='".$ping_url."'");
else $updLastPing = mysql_query("UPDATE nash_ping_services SET ping_time='".$timeNowMysql."', is_success='0' WHERE ping_url='".$ping_url."'");
} else {
if ($resultArray['http_code']==200) $insertNewPing = mysql_query("INSERT INTO nash_ping_services (ping_url,ping_time,is_success) VALUES ('".$ping_url."','".$timeNowMysql."','1')");
else $insertNewPing = mysql_query("INSERT INTO nash_ping_services (ping_url,ping_time,is_success) VALUES ('".$ping_url."','".$timeNowMysql."','0')");
}
return $resultArray["http_code"];
}
function autoSiteMapBuilderSubmitter($go=false) {
global $setts;
if ($go==true) {
$urlArray = array(
"http://www.google.com/webmasters/tools/ping?sitemap=".urlencode($setts['siteurl']."sitemap.xml"),
"http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=SitemapWriter&url=".urlencode($setts['siteurl']."sitemap.xml"),
"http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=".urlencode($setts['siteurl']."sitemap.xml"),
"http://submissions.ask.com/ping?sitemap=".urlencode($setts['siteurl']."sitemap.xml"),
"http://webmaster.live.com/ping.aspx?siteMap=".urlencode($setts['siteurl']."sitemap.xml")
);
for ($i = 0; $i<count($urlArray); $i++) {
$connect = curl_init();
curl_setopt($connect,CURLOPT_URL,$urlArray[$i]);
curl_setopt($connect,CURLOPT_RETURNTRANSFER,1);
curl_setopt($connect,CURLOPT_POST,1);
$result = curl_exec($connect);
$resultArray = curl_getinfo($connect);
curl_close($connect);
}
return true;
} else {
return false;
}}
function webpageTitleDescriptionKeywords($id,$whichTag,$whichDBtable) {
global $lang, $c_lang, $setts;
$out = "";
if ($whichDBtable=="auctions") {
$itemMetaDetails = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$id."'");
$croot = $itemMetaDetails['category'];
$itemMetaDetailsCatNames = "";
$cntr = 0;
while ($croot>0) {
$sbcts = mysql_query("SELECT SQL_CACHE id,parent FROM yspnash_categories WHERE id='".$croot."'");
$crw = mysql_fetch_array($sbcts);
if ($cntr==0) {
$itemMetaDetailsCatNames = $c_lang[$crw['id']];
} else {
if ($parent!=$croot) $itemMetaDetailsCatNames = $c_lang[$crw['id']].", ".$itemMetaDetailsCatNames;
}
$cntr++;
$croot = $crw['parent'];
}
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['itemname']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['itemname']." ".$lang[nash1114]." ".$itemMetaDetailsCatNames." ".$lang[nash3795]." ".$setts['sitename']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['itemname'].", ".$itemMetaDetailsCatNames)));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="wanteds") {
$itemMetaDetails = getSqlRow("SELECT * FROM yspnash_wanted_ads WHERE id='".$id."'");
$croot = $itemMetaDetails['category'];
$itemMetaDetailsCatNames = "";
$cntr = 0;
while ($croot>0) {
$sbcts = mysql_query("SELECT SQL_CACHE id,parent FROM yspnash_categories WHERE id='".$croot."'");
$crw = mysql_fetch_array($sbcts);
if ($cntr==0) {
$itemMetaDetailsCatNames = $c_lang[$crw['id']];
} else {
if ($parent!=$croot) $itemMetaDetailsCatNames = $c_lang[$crw['id']].", ".$itemMetaDetailsCatNames;
}
$cntr++;
$croot = $crw['parent'];
}
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['itemname']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['itemname']." ".$lang[nash1114]." ".$itemMetaDetailsCatNames." ".$lang[nash3795]." ".$setts['sitename']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['itemname'].", ".$itemMetaDetailsCatNames)));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="classifieds") {
$itemMetaDetails = getSqlRow("SELECT * FROM nash_classified WHERE id='".$id."'");
$croot = $itemMetaDetails['category'];
$itemMetaDetailsCatNames = "";
$cntr = 0;
while ($croot>0) {
$sbcts = mysql_query("SELECT SQL_CACHE id,parent FROM nash_categories_classads WHERE id='".$croot."'");
$crw = mysql_fetch_array($sbcts);
if ($cntr==0) {
$itemMetaDetailsCatNames = $ca_lang[$crw['id']];
} else {
if ($parent!=$croot) $itemMetaDetailsCatNames = $ca_lang[$crw['id']].", ".$itemMetaDetailsCatNames;
}
$cntr++;
$croot = $crw['parent'];
}
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['itemname']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['itemname']." ".$lang[nash1114]." ".$itemMetaDetailsCatNames." ".$lang[nash3795]." ".$setts['sitename']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['itemname'].", ".$itemMetaDetailsCatNames)));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="auctions_categories") {
$cat_title = getSqlField("SELECT name FROM yspnash_categories WHERE id='".$id."'","name");
if ($whichTag=="Title"&&$cat_title!=""&&$cat_title!="n/a") {
$out = strip_html_tags(addSpecialChars($cat_title))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
} else if ($whichDBtable=="classifieds_categories") {
$cat_title = getSqlField("SELECT name FROM nash_categories_classads WHERE id='".$id."'","name");
if ($whichTag=="Title"&&$cat_title!=""&&$cat_title!="n/a") {
$out = strip_html_tags(addSpecialChars($cat_title))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
} else if ($whichDBtable=="pages_additional") {
$itemMetaDetails = getSqlRow("SELECT * FROM yspnash_pages_additional WHERE id='".$id."'");
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['pagename']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['pagename']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['pagename'])));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="nash_boards") {
$itemMetaDetails = getSqlRow("SELECT * FROM nash_boards WHERE id='".$id."'");
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['board_title']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['board_title']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['board_title'])));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="nash_messages") {
$itemMetaDetails = getSqlRow("SELECT * FROM nash_messages WHERE id='".$id."'");
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['post_subject']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['post_subject']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['post_subject'])));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="nash_blogs") {
$itemMetaDetails = getSqlRow("SELECT * FROM nash_blogs WHERE id='".$id."'");
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['description']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['description']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['description'])));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}
} else if ($whichDBtable=="nash_blogs_articles") {
$itemMetaDetails = getSqlRow("SELECT * FROM nash_blogs_articles WHERE id='".$id."'");
if ($whichTag=="Title") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['name']))." - ";
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
}
if ($whichTag=="Description") {
$out = strip_html_tags(addSpecialChars($itemMetaDetails['name']));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count1);
} while ($count1);
}
if ($whichTag=="Keywords") {
$out = strtolower(strip_html_tags(addSpecialChars($itemMetaDetails['name'])));
$out = str_replace(".","",$out);
$out = str_replace("'","",$out);
$out = str_replace('"',"",$out);
$out = str_replace(",","",$out);
$out = str_replace("!","",$out);
$out = str_replace("-","",$out);
$out = str_replace(":","",$out);
do {
$out = str_replace(" "," ",$out,$count2);
} while ($count2);
$out = str_replace(" ",",",$out);
}}
return $out;
}
function crazyWeekdayName($in) {
global $lang, $setts;
if ($in==1) $out = $lang[nash3071];
else if ($in==2) $out = $lang[nash3072];
else if ($in==3) $out = $lang[nash3073];
else if ($in==4) $out = $lang[nash3074];
else if ($in==5) $out = $lang[nash3075];
else if ($in==6) $out = $lang[nash3076];
else if ($in==7) $out = $lang[nash3070];
return $out;
}
function tinyurl_builder($link_type,$link_id,$keywords) {
global $setts;
$target = "";
if ($link_type=="a") $target .= $setts['siteurl']."auctiondetails.php?id=".$link_id;
else if ($link_type=="c") $target .= $setts['siteurl']."classified.details.php?id=".$link_id;
else if ($link_type=="w") $target .= $setts['siteurl']."wanted.details.php?id=".$link_id;
else if ($link_type=="b") $target .= $setts['siteurl']."blogshome.php?blog=".$link_id;
else if ($link_type=="g") $target .= $setts['siteurl']."group.php?id=".$link_id;
$keywords = strtolower($keywords);
$keywords = str_replace("*"," ",$keywords);
$keywords = str_replace("/"," ",$keywords);
$keywords = str_replace("-"," ",$keywords);
$keywords = str_replace("_"," ",$keywords);
$keywords = str_replace("'","",$keywords);
$keywords = str_replace('"','',$keywords);
$keywords = str_replace(" ","",$keywords);
$keywords_array = explode(" ",$keywords);
if (getSqlNumber("SELECT id FROM nash_tinyurls WHERE link_type='".$link_type."' AND link_id='".$link_id."' AND key1='".trim($keywords_array[0])."' AND key2='".trim($keywords_array[1])."' AND key3='".trim($keywords_array[2])."' AND key4='".trim($keywords_array[3])."' AND key5='".trim($keywords_array[4])."' AND key6='".trim($keywords_array[5])."' AND key7='".trim($keywords_array[6])."' AND key8='".trim($keywords_array[7])."' AND key9='".trim($keywords_array[8])."' AND key10='".trim($keywords_array[9])."'")==0) {
$insertKeywordTinyURL = mysql_query("INSERT INTO nash_tinyurls (day,month,year,target,link_type,link_id,key1,key2,key3,key4,key5,key6,key7,key8,key9,key10) VALUES ('".date('j')."','".date('n')."','".date('Y')."','".$target."','".$link_type."','".$link_id."','".trim($keywords_array[0])."','".trim($keywords_array[1])."','".trim($keywords_array[2])."','".trim($keywords_array[3])."','".trim($keywords_array[4])."','".trim($keywords_array[5])."','".trim($keywords_array[6])."','".trim($keywords_array[7])."','".trim($keywords_array[8])."','".trim($keywords_array[9])."')");
$integer = rand(10000,99999);
while (getSqlNumber("SELECT id FROM nash_tinyurls WHERE key1='".$integer."'")>0) $integer = rand(10000,99999);
$insertRandomTinyURL = mysql_query("INSERT INTO nash_tinyurls (day,month,year,target,link_type,link_id,key1) VALUES ('".date('j')."','".date('n')."','".date('Y')."','".$target."','".$link_type."','".$link_id."','".$integer."')");
}}
function nashRandomAlphaNumeric($length=5,$source=1) {
$src = ($source==1)?"2346789ABCDEFGHJKLMNPQRTUVWXYZ":"abcdefghjklmnpqrtuvwxyz12346789ABCDEFGHJKLMNPQRTUVWXYZ";
$len = strlen($src)-1;
$out = "";
for($i=0;$i<$length;$i++) {
$x = rand(0,$len);
$out .= $src{$x};
}
return $out;
}
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"]=="on") $pageURL .= "s";
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"]!="80") $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
else $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
return $pageURL;
}
function filter_unused($all,$used,$prefix_all="",$prefix_used="") {
$unused = array();
sort($all);
sort($used);
$a = 0;
$u = 0;
$maxa = sizeof($all)-1;
$maxu = sizeof($used)-1;
while (true) {
if ($a>$maxa) break;
if ($u>$maxu) {
for(;$a<=$maxa;$a++) $unused[] = $all[$a];
break;
}
if ($prefix_all.$all[$a]>$prefix_used.$used[$u]) {
$u++;
continue;
}
if ($prefix_all.$all[$a]==$prefix_used.$used[$u]) {
$a++;
$u++;
continue;
}
$unused[] = $all[$a];
$a++;
}
return $unused;
}
$fixQuantity = mysql_query("UPDATE yspnash_winners SET quant_req='1', quant_offered='1' WHERE quant_req='0' AND quant_offered='0' AND auctiontype!='dutch'");
$nbFixBids = getSqlNumber("SELECT id FROM yspnash_bids WHERE bidderid='0'");
if ($nbFixBids>0) {
$getFixBids = mysql_query("SELECT SQL_CACHE auctionid FROM yspnash_bids WHERE bidderid='0'");
while ($fixBids = mysql_fetch_array($getFixBids)) $fixNbBids = mysql_query("UPDATE yspnash_auctions SET nbbids=nbbids-1 WHERE id='".$fixBids['auctionid']."'");
$delFixBids = mysql_query("DELETE FROM yspnash_bids WHERE bidderid='0'");
$delFixBidsHistory = mysql_query("DELETE FROM yspnash_bids_history WHERE bidderid='' OR bidderid='0'");
}
$fixListin = mysql_query("UPDATE yspnash_auctions SET listin='auction' WHERE listin=''");?>

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Do I have to re write querries when Partitioning?
3889
September 05, 2010 07:52PM
1746
September 06, 2010 11:38PM
2389
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.