Other [PAID] XenPorta Block for use with XenQuotation

Sheldon

Well-known member
Original Add-on: http://xenforo.com/community/resources/xenquotation.180/

It comes with a XenPorta block, but when you attempt to install, you get the "Not a valid XML File" note.

Here is the code to the original:

XML FILE
Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>XenQuotation</module_name>
  <module_cache>now</module_cache>
  <module_settings/>
  <module_template><![CDATA[<xen:include template="xenquote_sidebar_random_quote"><xen:map from="$XenQuotation" to="$quote" /><xen:set var="$title">{xen:phrase xenquote_random_quotation}</xen:set></xen:include>]]></module_template>
</module>

PHP FILE
PHP:
/**
* EWRporta random quotation block module.
*/
class EWRporta_Block_XenQuotation extends XenForo_Model
{   
    public function getModule()
    {       
        if (!$addon = $this->getModelFromCache('XenForo_Model_AddOn')->getAddOnById('XenQuotation') || empty($addon['active']))
        {
            return "killModule";
        }
       
        $quoteModel = $this->getModelFromCache('XenQuotation_Model_Quote');
       
        $fetchOptions = $quoteModel->getPermissionBasedQuoteFetchOptions();
        $quote = $quoteModel->getRandomQuotation($fetchOptions);
       
        if ($quote)
        {
            // add the random quote to the sidebar
            $quoteModel->prepareQuotation($quote);
            $quoteModel->quotationViewed($quote);
        }
        else
        {
            // no quotations to display, hide the module (makes it a pain
            // to debug though if you're expecting it to be there)
            return "killModule";
        }
 
        return $quote;
    }
}
 
?>

I know someone here is much better at this than me, but I'd be willing to pay someone for a few minutes work.... I don't think it would take long, I just don't have a clue where to start. If anyone is interested, please feel free to PM me what you'd charge to do this.
 
I think I've fixed the XML file, but I haven't tested it.

Works perfectly.

Nid1Kx.png


You are awesome. What do I owe ya?
 
Top Bottom