Laatste reacties
Archief
Quote of the Day
Accident, n.:
A condition in which presence of mind is good, but absence of body is better.

   -- Foolish Dictionary

Quote of the Day module voor Joomla!

Yet Another Quote Module:-)

Shows a random quote. Was originally developed to reuse the quotes in my Postnuke site, but adapted to use an internal joomla! table, managed by the existing equotes component by Ron Liskey .

Defaults to the internal database, but this can be changed in the module parameters.

Download here

mod_qotd.php

<?phpinclude “mod_qotd.config.php”;

$connection=mysql_connect($host,$user,$pw);
mysql_select_db($db, $connection);

$count=mysql_query(“select count(*) from $tb”, $connection);

$countrow=mysql_fetch_row($count);
$total=$countrow[0];
$p = mt_rand(0,($total – 1));

$quotes=mysql_query(“select $fq,$fa from $tb”, $connection);
mysql_data_seek($quotes, $p);
$q=mysql_fetch_array($quotes);
echo rtrim($q[0]);
if (strlen($q[1])>0) {
echo “<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;– “;
echo rtrim($q[1]);
}
echo ”
“;
mysql_close($connection);
?>

mod_qotd.xml

<?xml version=”1.0″ ?>
<mosinstall type=”module”>
<name>Quote of the Day</name>
<creationDate>15 June 2006</creationDate>
<author>Peter Hasperhoven</author>
<copyright>This template is released under the GNU/GPL License</copyright>
<authorEmail>peter(at)hasperhoven.net</authorEmail>
<authorUrl>http://www.hasperhoven.org</authorUrl>
<version>1.0</version>
<description>Toont een random citaat (uit de Postnuke database:-)</description>
<files>
<filename module=”mod_qotd”>mod_qotd.php</filename>
<filename module=”mod_qotd”>mod_qotd.config.php</filename>
</files>
</mosinstall>

mod_qots.config.php

<?
$host=”localhost”;
$user=”user”;
$pw=”password”;
$db=”hasperh_postnuke”; // postnuke inheritance
$tb=”nuke_quotes”;      // table name
$fq=”pn_quote”;         // fieldname for content
$fa=”pn_author”;        // field name for author
?>

1 reactie to “Quote of the Day module voor Joomla!”

  1. Hasperhoven . NET » Blog Archive » Quote of the Day module voor Joomla! Says:

    [...] Als je de module wilt gebruiken,  download hem dan hier [...]

Leave a Reply