<?php

/**
 * @name          : Joomla Social Pinboard
 * * @version	  : 2.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 Component about model
 * @Creation Date : March 2013
 * @Modified Date : March 2013
 * */
// No direct Access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.model');

class wishlogueModelpress extends WishlogueModel {

	function get_article() {

		$db = JFactory::getDBO();

		$title = JTEXT::_('COM_WISHLOGUE_PRESS');
		$nullDate = $db->quote($db->getNullDate());
		$date = JFactory::getDate();
		$nowDate = $db->quote($date->toSql());

		$query = 'SELECT `title`, `introtext`, `fulltext` 
					FROM #__content 
					WHERE `title` = "' . $title . '" AND `state` = 1 
					AND (`publish_up` = ' . $nullDate . ' OR `publish_up` <= ' . $nowDate . ') 
					AND (`publish_down` = ' . $nullDate . ' OR `publish_down` >= ' . $nowDate . ') ';
		$db->setQuery($query);
		$get_article = $db->loadObject();
		if (count($get_article) <= 0) {
			$get_article = new stdClass();
			$get_article->title = $title;
			$get_article->introtext = '';
			$get_article->fulltext = JTEXT::_('COM_WISHLOGUE_DEFAULT_CONTENT');
		}
		return $get_article;
	}

}

?>