<?php
/**
 * @name          : Joomla Social Pinboard
 * @version	  : 1.5.0
 * @package       : apptha
 * @since         : Joomla 1.5
 * @author        : Apptha - http://www.apptha.com
 * @copyright     : Copyright (C) 2011 Powered by Apptha
 * @license       : http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 * @abstract      : Social Pinboard Module header
 * @Creation Date : August 2013
 * @Modified Date : August 2013
 * */

defined('_JEXEC') or die;

class ModAdspaceHelper
{
	public static function getAds() {
		$db = JFactory::getDBO();
		$query = "SELECT id, url, imagename, createddate FROM `#__pin_wishlogueadspace` WHERE status=1";
		$db->setQuery( $query );
		$rows = $db->loadObjectList();
		return $rows;
	}

	public static function getGooglead() {
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__pin_googlead WHERE pin_ad_position='wishlogue_ad_space' AND status=1 ORDER BY RAND() LIMIT 1";
		$db->setQuery($query);
        $result = $db->loadObject();
        return $result;
    }
}