HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/informatica/modules/mod_randomquotes/helper.php
<?php
/**
* @copyright	Copyright (C) 2014 OpenSource Technologies Pvt. Ltd. All rights reserved
* * @license		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

class modRandomQuotesHelper
{
    public static function renderItem(&$item, &$params)
    {
        $mainframe = JFactory::getApplication();

        $results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
        //$item->afterDisplayTitle = trim(implode("\n", $results));

        $results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
        //$item->beforeDisplayContent = trim(implode("\n", $results));

        require JModuleHelper::getLayoutPath('mod_randomquotes', '_item');
    }

    public static function getList(&$params, &$access)
    {
        $randomquotesPath = 'modules/mod_randomquotes/quotes/';
    // Name of the randomquotes text file
    $randomquotesFile = 'randomquotes.txt';

        $GLOBAL['randomquotesPath'] = $randomquotesPath;
        $lineSep = "\n";
        $quoteFile = fopen(implode('/', array($randomquotesPath, $randomquotesFile)), 'r') or die("Unable to find $randomquotesFile in $randomquotesPath");
        while (!feof($quoteFile)) {
            $tquote = trim(fgets($quoteFile, 1024));
            if (strlen($tquote) > 0) {
                $quotes[] = $tquote;
            }
        }

        return $quotes;
    }
}