HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/ffeilden.com/public_html/modules/mod_ip_recentsold/helper.php
<?php
/**
 * @version 2.0.3 2013-04-08
 * @package Joomla
 * @subpackage Iproperty
 * @copyright (C) 2013 the Thinkery
 * @license see LICENSE.php
 */

defined('_JEXEC') or die('Restricted access');
require_once(JPATH_SITE.DS.'components'.DS.'com_iproperty'.DS.'helpers'.DS.'html.helper.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_iproperty'.DS.'helpers'.DS.'property.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_iproperty'.DS.'helpers'.DS.'route.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_iproperty'.DS.'helpers'.DS.'query.php');
require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_iproperty'.DS.'classes'.DS.'admin.class.php');

jimport('joomla.utilities.date');

class modIPRecentsoldHelper
{
	function prepareContent( $text, $length=300 ) 
    {
		// strips tags won't remove the actual jscript
		$text = preg_replace( "'<script[^>]*>.*?</script>'si", "", $text );
		$text = preg_replace( '/{.+?}/', '', $text);
		// replace line breaking tags with whitespace
		$text = preg_replace( "'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text );
		$text = strip_tags( $text );
		if (strlen($text) > $length) $text = substr($text, 0, $length) . "...";
		return $text;
	}

    function getPropertiesList( $where, $limitstart=0, $limit=9999, $sort = 'p.modified', $order = 'DESC' )
	{
		$db = JFactory::getDBO();
        $property = new ipropertyHelperproperty($db);
        $property->setType('properties');
        $property->setWhere( $where );
        $property->setOrderBy( $sort, $order );
        $properties = $property->getProperty($limitstart,$limit);
        return $properties;
	}

	function getList(&$params)
	{
        $thumb_width            = $params->get('thumb_width', 200) . 'px';
		$thumb_height           = $params->get('thumb_height', 120) . 'px';
		$count                  = (int) $params->get('count', 5);
        $usethumb               = ($params->get('usethumb', 1) == 1) ? true : false;
		$text_length            = intval($params->get( 'preview_count', 75) );
        $stype                  = $params->get('stype', 5);
        $category               = $params->get('category', false);
        
        if($params->get('random', 1)){
            $sort                   = 'RAND()';
            $order                  = '';
        }else{
            $sort                   = 'p.modified';
            $order                  = 'DESC';
        }

        $where  = array();
        $where[] = 'p.stype IN ('.$stype.')';
        if($category){
            $where[] = 'pm.cat_id IN ('.implode(',', $category).')';
        }

        $rows = modIPRecentsoldHelper::getPropertiesList($where,0,$count, $sort, $order);

        $i		= 0;
        $lists	= array();
        if( $rows ){
            foreach ( $rows as $row )
            {
                $available_cats = ipropertyHTML::getAvailableCats($row->id);
                $first_cat      = $available_cats[0];

                $lists[$i]->link            = ipropertyHelperRoute::getPropertyRoute($row->id.':'.$row->prop_alias, $first_cat, true);
                $lists[$i]->mainimage       = ipropertyHTML::getThumbnail($row->id, $lists[$i]->link, $row->street_address, $thumb_width, ' class="ip_recent_img"', '', $usethumb);
                $lists[$i]->street_address  = htmlspecialchars( $row->street_address );
                $lists[$i]->city            = htmlspecialchars( $row->city );
                $lists[$i]->state           = htmlspecialchars( ipropertyHTML::getStateName($row->locstate));
                $lists[$i]->province        = htmlspecialchars( $row->province );
                $lists[$i]->created         = $row->created;
                $lists[$i]->modified        = $row->modified;
                $lists[$i]->stype           = $row->stype;

                $prepared_text = $row->short_description ? modIPRecentsoldHelper::prepareContent($row->short_description, $params->get('preview_count', 250)) : modIPRecentsoldHelper::prepareContent($row->description, $params->get('preview_count', 250));

                if($params->get('clean_desc', 0)){
                    $lists[$i]->introtext = ipropertyHTML::sentence_case($prepared_text);
                }else{
                    $lists[$i]->introtext = $prepared_text;
                }

                $lists[$i]->introtext .= ' <a href="' . $lists[$i]->link . '">' . JTEXT::_('MOD_IP_RECENT_SOLD_READ_MORE') . '</a>';
                $lists[$i]->formattedprice = $row->formattedprice;
                $i++;

                $prepared_text = '';
            }
        }

		return $lists;
	}
}