I'm trying to port over the horoscope hack (for my own personal use, not releasing it as I don't have permission), and everything is fine except I can't figure out why it's not reading from the database correctly.
I've got the cron working correctly and the data is sitting there in the database, but zodiac.php just isn't reading it correctly. Here's zodiac.php:
PHP Code:
<?php
/*******************************************\
* Zodiac v1.0.3 [zodiac.php] *
*********************************************
* Created by Steve For use with VB3 *
*********************************************
* Zodiac and Horoscope Addon for VBulletin *
\*******************************************/
/* Define Stuff */
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'zodiac');
$phrasegroups = array();
$specialtemplates = array();
$actiontemplates = array();
$globaltemplates = array('zodiac_main');
require_once('./global.php');
require_once('./includes/functions_user.php');
$hackname="Zodiac Horoscope";
$horoscopetype="Weekly Horoscope";
/* Set Navigation */
if (isset($_GET['do'])) {
$do = $_GET['do'];
}
/* Stuff */
if ($do=="aries") {
// Aries
$title="Aries";
$horoscope=$vbulletin->db->query("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="taurus") {
// Taurus
$title="Taurus";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="gemini") {
// Gemini
$title="Gemini";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="cancer") {
// Cancer
$title="Cancer";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="leo") {
// Leo
$title="Leo";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="virgo") {
// Virgo
$title="Virgo";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="libra") {
// Libra
$title="Libra";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="scorpio") {
// Scorpio
$title="Scorpio";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="sagittarius") {
// Sagittarius
$title="Sagittarius";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="capricorn") {
// Capricorn
$title="Capricorn";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="aquarius") {
// Aquarius
$title="Aquarius";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} elseif ($do=="pisces") {
// Pisces
$title="Pisces";
$horoscope=$vbulletin->db->query_read("SELECT weekly FROM " . TABLE_PREFIX . "zodiac WHERE sign='".$do."'");
} else {
// None
$title="Zodiac Horoscope";
$horoscope[weekly]="To view a weekly horoscope please select a zodiac from the following list:<br><li><a href=\"?do=aries\">Aries</a></li> <li><a href=\"?do=taurus\">Taurus</a></li> <li><a href=\"?do=gemini\">Gemini</a></li> <li><a href=\"?do=cancer\">Cancer</a></li> <li><a href=\"?do=leo\">Leo</a></li> <li><a href=\"?do=virgo\">Virgo</a></li> <li><a href=\"?do=libra\">Libra</a></li> <li><a href=\"?do=scorpio\">Scorpio</a></li> <li><a href=\"?do=sagittarius\">Sagittarius</a></li> <li><a href=\"?do=capricorn\">Capricorn</a></li> <li><a href=\"?do=aquarius\">Aquarius</a></li> <li><a href=\"?do=pisces\">Pisces</a></li><br>Thanks.";
}
// Please Do Not alter, remove or make invisible the footer as it is part of the free horoscope feed arrangement
$hackfooter="Powered by: <a href=\"http://hop.clickbank.net/?juseste/branch90\" target=\"_blank\">Astrology Source</a>";
/* Display */
$horoscope=("$horoscope[weekly]");
if ($horoscope=="") { $horoscope="There appears to be a problem with the Database.<br>The $do weekly horoscope can't be retrieved at this time.<br>Please check back later.<br><b>Thankyou</b>."; }
eval('print_output("' . fetch_template('zodiac_main') . '");');
?>
Thanks for your help