Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 09-27-2005, 12:35 AM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Horoscope: Why won't it work?

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03701 seconds
  • Memory Usage 2,279KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete