Joomla help

apps

#1

Hi all,

I’m redesigning my church website on DH, using joomla.

I grabbed the bible verse-of-the-day from the joomla site, but it requires url_fopen capabilities, which apparently aren’t allowed here. Does anyone know or have anything similiar that will work on DH? Either a bible verse or proverb of he day…

TIA…


#2

You need to replace the use of url_fopen with a curl call. Here is the working script using curl. You just need to replace the hard-coded variables with the dynamic assignments from Joomla’s xml config file, which is the commented out part, to use this in Joomla.

[code]<?php
/*
defined( ‘_VALID_MOS’ ) or die( ‘Direct Access to this location is not allowed.’ );
$verse = “”;
$Version = $params->get(‘Version’);
$CharLimit = $params->get(‘CharLimit’);
$DisplayAudio = $params->get(‘DisplayAudio’);
*/

$verse = “”;
$Version = 9;
$CharLimit = 1000;
$DisplayAudio = “No”;

$cTargetPage = “http://www.biblegateway.com/usage/votd/votd2html.php?version=".$Version."&jscript=0”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $cTargetPage);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);

$verse = curl_exec($ch);
curl_close($ch);

$verse = str_replace(“—”,"-",$verse);
$verse = str_replace("<a href","<a target="_blank" href",$verse);
$verse = stripslashes(utf8_decode($verse));

if ($DisplayAudio == “No”) {
$verse = str_replace(strstr($verse,’ <’),’’,$verse);
$verse .= “”;
}
if ($CharLimit !== “None”) {
if (strlen($verse) <= $CharLimit) {
echo $verse;
} else {
$verse = substr($verse, 0, $CharLimit - 10);
$verse .= “… <a href=http://www.biblegateway.com/usage/votd/votd2html.php?version=”.$Version."&jscript=0 target=_blank>[More]";
echo $verse;
}
} else {
echo $verse;
}
?>
[/code]


#3

Thanks. Sorry if I’m being stupid here, but what file is this?
And does this need to be modified?


#4

That’s a rewrite of the qotd php script included in the zip archive you got when you downloaded the qotd extension. I got it, unzipped it, and rewrote the method.

Just find the modules/mod_qotd folder in your Joomla site and ftp up the corrected code.


#5

It works. Awesome. Thanks.