Website horoscope script stopped working

Trouble With A Script Not On The List. Post Your Bugs And Fixes Here And Discussion.

Website horoscope script stopped working

Postby paul on Thu Jun 19, 2008 9:37 pm

The website daily horoscope script has stopped working because of a change in the url of yahoo horoscopes.

if you have the daily horoscopes on your site contact me for the fix.

Paul
User avatar
paul
Site Admin
 
Posts: 236
Joined: Sat Jan 26, 2008 7:30 pm
Location: Newington,Ct,USA

Here is the horoscope code for people who want to install

Postby paul on Sat Jun 21, 2008 5:22 pm

Here is the file I named

engine/pages/horoscope.php

Code: Select all
<?
$sign = $_GET['sign'];
$date = $_GET['date'];
?>



<!--<center><a href="index.php"><img src="images/imagesheader1.gif" width="350" height="42" border="0" alt=""></a></center>-->
<br><br>
<?

if(!$date  && !$sign){

?>
<div class='headline' style='text-align: center;'>Daily horoscope. Choose your sign.<br><br></div>
<table align="center" border="0" width="200" id="table1" cellspacing="0" cellpadding="0">
   <tr>
   <td width="100">
<a href="index.php?page=horoscope&sign=aquarius">
<IMG SRC="images/icon_zodiac_aquarius.gif" BORDER="0" ALT="Aquarius">
Aquarius</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=libra">
<IMG SRC="images/icon_zodiac_libra.gif" BORDER="0" ALT="Libra">
Libra</A></td>
   </tr>
   <tr>
   <td width="100">
<a href="index.php?page=horoscope&sign=aries">
<IMG SRC="images/icon_zodiac_aries.gif" BORDER="0" ALT="Aries">
Aries</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=pisces">
<IMG SRC="images/icon_zodiac_pisces.gif" BORDER="0" ALT="Pisces">
Pisces</A></td>
   </tr>
   <tr>
   <td width="100">
<a href="index.php?page=horoscope&sign=cancer">
<IMG SRC="images/icon_zodiac_cancer.gif" BORDER="0" ALT="Cancer">
Cancer</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=sagittarius">
<IMG SRC="images/icon_zodiac_sagittarius.gif" BORDER="0" ALT="Sagittarius">
Sagittarius</A></td>
   </tr>
   <tr>
   <td width="100">
<a href="index.php?page=horoscope&sign=capricorn">
<IMG SRC="images/icon_zodiac_capricorn.gif" BORDER="0" ALT="Capricorn">
Capricorn</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=scorpio">
<IMG SRC="images/icon_zodiac_scorpio.gif" BORDER="0" ALT="Scorpio">
Scorpio</A></td>
   </tr>
   <tr>
   <td width="100">
<a href="index.php?page=horoscope&sign=gemini">
<IMG SRC="images/icon_zodiac_gemini.gif" BORDER="0" ALT="Gemini">
Gemini</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=taurus">
<IMG SRC="images/icon_zodiac_taurus.gif" BORDER="0" ALT="Taurus">
Taurus</A></td>
   </tr>
   <tr>
   <td width="100">
<a href="index.php?page=horoscope&sign=leo">
<IMG SRC="images/icon_zodiac_leo.gif" BORDER="0" ALT="Leo">
Leo</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=virgo">
<IMG SRC="images/icon_zodiac_virgo.gif" BORDER="0" ALT="Virgo">
Virgo</A></td>
   </tr>
    </table><div class='headline' style='text-align: center;'><br />
Copy Paste Link Below To Send Free Horoscope To Friends:<br />
                       <input type="text"  size="70" value="<?php print $root_host."index.php?page=horoscope";?>" onMouseOver="this.focus();this.select()"onClick="this.focus();this.select()">
                       <br><br />
 
                                              </p>
                  <p align="center">Copy Paste Below To Add Free Horoscope To Your Myspace:<br />
    <input type="text"  size="70" value="<?php print "<a href='".$root_host."index.php?page=horoscope'>".$site_title." Free Daily Horoscope Click Here</a>";?>" onMouseOver="this.focus();this.select()"onClick="this.focus();this.select()">
  <br><br /></div>
<?

}

else{

if(!$date){

$date = date("Ymd");

}

?>


<table align="center" border="0" width="400"cellspacing="0" cellpadding="5">
<tr>
<td>
<table align="center" border="0" width="100%"cellspacing="0" cellpadding="5">
<tr>
<td width="100">

<a href="index.php?page=horoscope&sign=aquarius&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_aquarius.gif" BORDER="0" ALT="Aquarius">
</A></td>
<td width="100">
<a href="index.php?page=horoscope&sign=aries&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_aries.gif" BORDER="0" ALT="Aries">
</A></td>
<td width="100">
<a href="index.php?page=horoscope&sign=cancer&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_cancer.gif" BORDER="0" ALT="Cancer">
</A></td>
<td width="100">
<a href="index.php?page=horoscope&sign=capricorn&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_capricorn.gif" BORDER="0" ALT="Capricorn">
</A></td>
<td width="100">
<a href="index.php?page=horoscope&sign=gemini&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_gemini.gif" BORDER="0" ALT="Gemini">
</A></td>
<td width="100">
<a href="index.php?page=horoscope&sign=leo&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_leo.gif" BORDER="0" ALT="Leo">
</A></td>
   <td width="100">
<a href="index.php?page=horoscope&sign=libra&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_libra.gif" BORDER="0" ALT="Libra">
</A></td>
   
   <td width="100">
<a href="index.php?page=horoscope&sign=pisces&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_pisces.gif" BORDER="0" ALT="Pisces">
</A></td>
   
   <td width="100">
<a href="index.php?page=horoscope&sign=sagittarius&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_sagittarius.gif" BORDER="0" ALT="Sagittarius">
</A></td>
<td width="100">
<a href="index.php?page=horoscope&sign=taurus&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_taurus.gif" BORDER="0" ALT="Taurus">
</A></td>
   
   <td width="100">
<a href="index.php?page=horoscope&sign=scorpio&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_scorpio.gif" BORDER="0" ALT="Scorpio">
</A></td>
   
   
   
   <td width="100">
<a href="index.php?page=horoscope&sign=virgo&date=<? echo $date ?>">
<IMG SRC="images/icon_zodiac_virgo.gif" BORDER="0" ALT="Virgo">
</A></td>
   </tr>
</table>
<br><center><b><font face="arial"><? echo ucwords($sign) ?></font></b><br><br>

<a href="index.php">Reset</a> &nbsp; &nbsp;

<?
if($date > (date("Ymd")-1)){
?>
<a href="index.php?page=horoscope&sign=<? echo $sign ?>&date=<? echo (date("Ymd")-1) ?>">Yesterday</a> &nbsp; &nbsp;
<?
}
else{
echo '<b><font size="2">Yesterday</font></b> &nbsp; &nbsp;';
}

if($date != (date("Ymd"))){
?>
<a href="index.php?page=horoscope&sign=<? echo $sign ?>">Today</a> &nbsp; &nbsp;
<?
}
else{
echo '<b><font size="2">Today</font></b> &nbsp; &nbsp;';
}

if($date < (date("Ymd")+1)){
?>
<a href="index.php?page=horoscope&sign=<? echo $sign ?>&date=<? echo (date("Ymd")+1) ?>">Tomorrow</a> &nbsp; &nbsp;
<?
}
else{
echo '<b><font size="2">Tomorrow</font></b> &nbsp; &nbsp;';
}
?>

<!--<a href="http://astrology.yahoo.com/astrology/general/dailyextended/<? echo $sign ?>/<? echo $date ?>" target="_blank">Source</a>--></center>
<table width="100%" align="center">
<tr>
   <td>
<?

//$url="http://astrology.yahoo.com/astrology/general/dailyextended/$sign/$date";
$url="http://shine.yahoo.com/astrology/$sign/daily-overview/$date";

preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "$url", $matches);
$domain = "http://" . $matches[2];
$page = $matches[3];

$code = file_get_contents($domain.$page);

//$start= strpos($code, "<table width=\"90%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
//$finish= strpos($code, "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\">");
$start= strpos($code, "<h3>Overview</h3>");
$start=$start+17;
$finish= strpos($code, "<div class=\"ft\">");
$length= $finish-$start;
$code=substr($code, $start, $length);

$newcode = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);

echo "<br>".$newcode;




?>

</td></tr>
</table>
</td>
</tr>
</table>
<div class='headline' style='text-align: center;'><br />
Copy Paste Link Below To Send Free Horoscope To Friends:<br />
                       <input type="text"  size="70" value="<?php print $root_host."index.php?page=horoscope";?>" onMouseOver="this.focus();this.select()"onClick="this.focus();this.select()">
                       <br><br />
 
                                              </p>
                  <p align="center">Copy Paste Below To Add Free Horoscope To Your Myspace:<br />
    <input type="text"  size="70" value="<?php print "<a href='".$root_host."index.php?page=horoscope'>".$site_title." Free Daily Horoscope Click Here</a>";?>" onMouseOver="this.focus();this.select()"onClick="this.focus();this.select()">
  <br><br /></div>
    <div align="center"><a href="http://www.webscribble-webdate-support.com">Source</a></div>
<?
}
?>


create a file names engine/pages/horoscope.php

you can link to this file in the engine/templates/quicksearch.html under who's online

after the </tr> add this code:

Code: Select all
<tr>
               <td><img src="images/bullet.gif" width="13" height="13" border="0"></td>
               <td><a href="index.php?page=horoscope" class="w">Daily Horoscope</a></td>
            
            </tr>


you can link to the horoscope in your file templates/members_menu.html

by adding this code:

Code: Select all
<a href="index.php?page=horoscope" class="m">My Horoscope</a> |



you must upload the images to the images folder

if you need further assistance let me know.

Paul
Attachments
horoscope.php
horoscope.php download and copy this file into your servers engine/pages directory.
(8.1 KB) Downloaded 35 times
images.rar
Images rar file unrar and upload images to images directory on your server
(24.98 KB) Downloaded 29 times
User avatar
paul
Site Admin
 
Posts: 236
Joined: Sat Jan 26, 2008 7:30 pm
Location: Newington,Ct,USA

Re: Website horoscope script stopped working

Postby axus on Wed Aug 06, 2008 5:43 am

Hi Paul
I would appreciate the horoscope fix with details how to install it please
Regards
Keith
axus
 
Posts: 11
Joined: Tue Feb 05, 2008 2:47 pm

Re: Website horoscope script stopped working

Postby paul on Wed Aug 06, 2008 2:01 pm

download the horoscope.php file attached to the previous post

upload this file to your server in the following directory

engine/pages

download images.rar from the previous post

unrar(unzip) the file

upload the images into your

image (directory)

your done.

Paul
User avatar
paul
Site Admin
 
Posts: 236
Joined: Sat Jan 26, 2008 7:30 pm
Location: Newington,Ct,USA


Return to PHP Script Support Forum

Who is online

Users browsing this forum: No registered users and 0 guests