add_shortcode( ‘FEATUREDPOST’, ‘visitor_check_shortcode’ );
function visitor_check_shortcode($atts) {
echo ‘<h3 class=”widget-title”>Premium Biz</h3><div class=”featured-classified-ads”><ul>’;
$cartlimit = get_option(‘my-setting1’);
$limit = $cartlimit . “00”;
$sql = mysql_query(“select * from bbs_awpcp_ads where ad_item_price > ‘$limit’ and disabled = ‘0’ order by ad_id DESC LIMIT 8”);
while($ad = mysql_fetch_array($sql)){
$id = $ad[‘ad_id’];
$ss = mysql_query(“select * from bbs_awpcp_adphotos where ad_id = $id”);
$ks = mysql_fetch_array($ss);
$featuredimage = $ks[‘image_name’];
$src = ‘http://businessforbuysale.com/wp-content/uploads/awpcp/’.$featuredimage;
$noimg = “no_image.jpg”;
if (@getimagesize($src)) {
$featuredimage = $featuredimage;
}
else
{
$featuredimage = $noimg;
}
echo ‘<a href=”http://businessforbuysale.com/business/show-listing/’. $ad[‘ad_id’] .’/’. $ad[‘ad_title’].'”><li><img src=”http://businessforbuysale.com/wp-content/uploads/awpcp/’ . $featuredimage .'” /><br /><p>’;
echo custom_echo($ad[‘ad_title’]);
echo “</p></li></a>”;
}
echo “</ul></div>”;
}
SHORTCODE : [FEATUREDPOST] to use
Reblogged this on SutoCom Solutions.
LikeLike
Reblogged this on Vairam Blog.
LikeLike