vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - T-VBhoroscopes Addon -daily updated content (https://vborg.vbsupport.ru/showthread.php?t=127387)

lebanon 09-23-2006 10:00 PM

T-VBhoroscopes Addon -daily updated content
 
This is a quick vb-horoscopes feature to add to your forum.
I just made this and tested it on my forum, working fine as shown demo below

Requirements:
php fopen on
ADDED : IF fopen is not ON on your webserver , download the second zip file called gethoroscopes.php and replace the one in your cron folder with this one that uses Curl instead of fopen.
Installation :
-Upload the files to their respective locations
-Install the product using the VBulletin product manager
Your done !

You can test your script directly by going to your scheduled task
and using "RUN NOW" you should see the script output and then you
can go check your page at http://urforum/dailyhoroscopes.php


License :
- Your are allowed to query our website using the cronjob once everyday
Leave on default installation and you will not be breaking any rule, or only change the HOUR and MINUTE of runtime.
- You can freely modify the template the way you wish, all you need is
to leave the $result reference where you want it for the script to function
I will also appreciate if you share us with your modified template !

- You are required to keep the copyright text in your template, however if
you prefer to remove it, you can only do that after contacting me and recieving permission to do so ( free of charge ofcourse )

DEMO
http://www.tchatting.com/forum/dailyhoroscopes.php
or choose a sign
http://www.tchatting.com/forum/daily...php?sign=aries

If you use this and wish to recieve support please click INSTALL

Keyser S?ze 09-23-2006 11:22 PM

pretty neat, would it be possible for it to read your birthday and put ur horascope in ur profile?

lebanon 09-23-2006 11:23 PM

havent done that yet, as i said i only did it today , and i did lack ideas :D
So here is a first idea from u ( noted ) !
regards

DementedMindz 09-23-2006 11:38 PM

Nice mod but dont like the fact that it has to query your website. What happens if your site goes down? Then the mod is useless basiclly.

Keyser S?ze 09-23-2006 11:46 PM

i can understand why as it needs to be updated of course, but i do agree that can be a problem, also if u site is going slow it will make everyone elses go slow as well

lebanon 09-23-2006 11:48 PM

Although this is the whole idea which is the free daily content, plus i might add a mirror website in the next day for guaranteed uptime , as i do have 3 dedicated servers i can use...

however what u said is true, u dont have to do that ! simply disable the cron
And you have the choice to update your Horoscopes TXTs found in your
forum/dailyhoroscopes/sign.txt . regards

Gripemaster 09-23-2006 11:56 PM

*INSTALLED* Thank you! Very nice. :)

dodgeboard.com 09-24-2006 12:43 AM

How can I add this to vBa CMPS?

Zia 09-24-2006 03:46 AM

ah man Lebnanon..

atlast u changed ur mind ..:)
thanx to release it here...

Allan 09-24-2006 05:22 AM

Good idea :)

exist it for French version ?

Ajavas 09-24-2006 08:50 AM

:) Nice Addon! Installed.

Would be nice in dutch to....:rolleyes:

Barakat 09-24-2006 10:05 AM

nice one

project-Buckfas 09-24-2006 10:40 AM

Nice mod. Installed, thanks

Snake 09-24-2006 10:50 AM

Wow Thanks!

joffer 09-24-2006 01:45 PM

A little modified code of the cronjob that parses the horoscopes i made it so u can have a function gethoroscope(signname)
If u want u can replace your gethoroscopes.php with that and itll work fine.

PHP Code:

<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!
is_object($vbulletin->db))
{
    exit;
}
// ########################################################################
// ######################### START MAIN SCRIPT AND WRITE TO TXT ###########
// ########################################################################
$signs = array("aries","Taurus","gemini","cancer","leo","virgo","libra","scorpio","sagi","capricorn","aquarius","pisces");

function 
gethoroscope($sign) {
    
    
$url "http://www.tchatting.com/horoscopes/".$sign.".php";
@
$string implode(""file("$url"));
//$string = str_replace("\n","",$string);
$string trim($string);
$filename './dailyhoroscopes/'.$sign.'.txt';
// Let's make sure the file exists and is writable first.

if (is_writable($filename)) {
   if (!
$handle fopen($filename'w+')) {
         echo 
"Cannot open file ($filename)";
         exit;
   }

   
// Write $somecontent to our opened file.
   
if (fwrite($handle$string) === FALSE) {
       echo 
"Cannot write to file ($filename)";
       exit;
   }
   
   echo 
"Success, wrote ($string) to file ($filename)";
   
   
fclose($handle);

} else {
   echo 
"The file $filename is not writable";
}

}

for(
$i=0;$i<12;$i++) {
    
gethoroscope($signs[$i]);
}
?>


warnmar10 09-24-2006 03:21 PM

I had to CHMOD all the text files in forums/dailyhoroscopes before it would work... which means I hit your server three times in one day before I figured it out.

COBRAws 09-24-2006 04:29 PM

Spanish version?

lebanon 09-24-2006 06:50 PM

Quote:

Originally Posted by warnmar10
I had to CHMOD all the text files in forums/dailyhoroscopes before it would work... which means I hit your server three times in one day before I figured it out.

Sorry i have not mentioned any chmoding , because by default webservers would accept php read/write commands owned by user to his own user directories unless further restrictions applied from your host such as in your case !
Ill add a note for that ! thank you for your note

As for translations , well , the feeds i recieve are in english, ill try to setup a translator using some service like google or bablefish maybe all i can think of now , because i dont imagine daily translation would be easy unless automatic,.

COBRAws 09-26-2006 10:06 PM

Quote:

Originally Posted by lebanon
As for translations , well , the feeds i recieve are in english, ill try to setup a translator using some service like google or bablefish maybe all i can think of now , because i dont imagine daily translation would be easy unless automatic,.

So we would be fetching a feed from another feed? Is there a way so we can program this to fetch any FEED we want?

Thank you.

kofoid 09-26-2006 10:12 PM

And the most famous question.... will this run on 3.5.4?

bada_bing 09-27-2006 01:46 AM

Do you happen to know how to make this work on vbadvance?

TheBlackPoet 09-27-2006 02:17 AM

you took me to another level with this buddy... i installed it.. ran the cron..and whoa!! so big ups to ya!!

ang2el 09-27-2006 03:00 AM

Do we have to update about daily horoscopes?

zooki 09-27-2006 11:18 AM

cool.

oberheimhaven 09-27-2006 11:38 AM

Fopen? Not sure about this install nothing happened any suggestions I know rookie<<
thxs
MarkAnthony

bada_bing 09-27-2006 02:30 PM

Ive installed this but I dont see the cron job entry in my Scheduled Task manager.

Also is there a vbadvance module for this?

oberheimhaven 09-27-2006 06:56 PM

Stupid<< right here great hack I got it Im sorry gang brain fart

Ok I click my sign however nothing is there to read next> any suggestions??? plz back to the drawing board
Mark

lebanon 09-27-2006 07:28 PM

Quote:

Originally Posted by COBRAws
So we would be fetching a feed from another feed? Is there a way so we can program this to fetch any FEED we want?

Thank you.

Well , yes ur fetching a feed from my feeds , now depending on the nature of the feeds and that its only 1 time per day its not a problem for me or my server . Yet , if you want to fetch ur own feed, ill be glad to explain it and set the feed directly on your feed when u prvt msg me with the feed u want to adjust the horoscopes to , it wont take more than 10-20 minutes to set it for a different source .

- ang2el : no the cron will auto update the horoscopes for you daily, thats what is it for .

- kofoid : it should run without a problem, the template and custom page coding are almost the same since there are no advanced requests so i havent tested it but am positive it should work fine.

- bada_bing : The cron is called cron_horoscopes it runs daily 1 time.

as for vbadvanced i havent implemented this to it , but i suppose it would be fine to do so with minimal work , we have the source and we have the signs each in a seperate txt , so what are you suggesting exactly ? Random Sign ? or links to signs or ...?
oberheimhaven : you have to link it anywhere you link to , the file to link to is www.yourforum.tld/dailyhoroscopes.php

hope i didnt miss any question ... regards

oberheimhaven 09-27-2006 07:46 PM

Quote:

Originally Posted by lebanon
Well , yes ur fetching a feed from my feeds , now depending on the nature of the feeds and that its only 1 time per day its not a problem for me or my server . Yet , if you want to fetch ur own feed, ill be glad to explain it and set the feed directly on your feed when u prvt msg me with the feed u want to adjust the horoscopes to , it wont take more than 10-20 minutes to set it for a different source .

- ang2el : no the cron will auto update the horoscopes for you daily, thats what is it for .

- kofoid : it should run without a problem, the template and custom page coding are almost the same since there are no advanced requests so i havent tested it but am positive it should work fine.

- bada_bing : The cron is called cron_horoscopes it runs daily 1 time.

as for vbadvanced i havent implemented this to it , but i suppose it would be fine to do so with minimal work , we have the source and we have the signs each in a seperate txt , so what are you suggesting exactly ? Random Sign ? or links to signs or ...?
oberheimhaven : you have to link it anywhere you link to , the file to link to is www.yourforum.tld/dailyhoroscopes.php

hope i didnt miss any question ... regards


I done install note for note I click to read nothing to read?? Any Plz suggestions???

lebanon 09-27-2006 08:10 PM

if the cron have not been ran yet, you might want to run it manually the first time, go to scheduled tasts and on cron_horoscope click run now.
also if there is an error it will show when u run the cron.
After that you wont need to do it.

oberheimhaven 09-27-2006 08:35 PM

I did still nothing to read???? I click on the scope nothing comes up to read??? next> thxs

cron_horoscopes

Success, wrote () to file (./dailyhoroscopes/aries.txt)Success, wrote () to file (./dailyhoroscopes/taurus.txt)Success, wrote () to file (./dailyhoroscopes/gemini.txt)Success, wrote () to file (./dailyhoroscopes/cancer.txt)Success, wrote () to file (./dailyhoroscopes/leo.txt)Success, wrote () to file (./dailyhoroscopes/virgo.txt)Success, wrote () to file (./dailyhoroscopes/libra.txt)Success, wrote () to file (./dailyhoroscopes/scorpio.txt)Success, wrote () to file (./dailyhoroscopes/sagittarius.txt)Success, wrote () to file (./dailyhoroscopes/capricorn.txt)Success, wrote () to file (./dailyhoroscopes/aquarius.txt)Success, wrote () to file (./dailyhoroscopes/pisces.txt)
Done

Zowners 09-27-2006 11:51 PM

I had the same problem with having to chmod several files before it would work...so I hope I didn't hit your site more than once. And also the cron didn't work today. Will I have to do this manually once a day? And finally...what does this mean: php fopen on? How would I go about this? Maybe if I do or fix this the cron will work? Otherwise I love astrology/this mod. :=)

lebanon 09-28-2006 12:16 AM

oberheimhaven , try chmodding the files in dailyhoroscope/*.txt to 755 or 777 , depending on ur host configuration, i have em 755 but are writable by user so it works fine .
fopen , to check for it , either put a php file with this is it :
<? phpinfo(); ?>
and open it in browser , go to allow_url_fopen and see if its On or Off .
Or if u dont want to create the file , in ur admincp , and in the last tab u will find a php info page ready for you, check there.

Zowners : am not counting hits not, it doesnt really bother me for now, but if this had too many subscribers it will start to , because the files are updated one time aday so its useless to grab them more than once a day ! , while for testing porpuses its accepted and it will show on my logs that they are not repeated daily ( cron times will appear as same times repeatedly )

oberheimhaven 09-28-2006 12:55 AM

Quote:

Originally Posted by lebanon
oberheimhaven , try chmodding the files in dailyhoroscope/*.txt to 755 or 777 , depending on ur host configuration, i have em 755 but are writable by user so it works fine .
fopen , to check for it , either put a php file with this is it :
<? phpinfo(); ?>
and open it in browser , go to allow_url_fopen and see if its On or Off .
Or if u dont want to create the file , in ur admincp , and in the last tab u will find a php info page ready for you, check there.

Zowners : am not counting hits not, it doesnt really bother me for now, but if this had too many subscribers it will start to , because the files are updated one time aday so its useless to grab them more than once a day ! , while for testing porpuses its accepted and it will show on my logs that they are not repeated daily ( cron times will appear as same times repeatedly )


Or if u dont want to create the file , in ur admincp , and in the last tab u will find a php info page ready for you, check there.


Im so sorry What am I checking for?? I chmod still nothing They are there but nothing opens Im running 3.6.0 this will work correct?? I will keep working on her thanks for the reply

Is there no control for this in admin cp???? I have done everything i know to do and nothing it comes up however when clicked on for horoscope ziltch??

http://www.musiciansquarters.com/for...sign=capricorn Nothing???

bada_bing 09-28-2006 01:16 AM

Quote:

Originally Posted by lebanon
if the cron have not been ran yet, you might want to run it manually the first time, go to scheduled tasts and on cron_horoscope click run now.
also if there is an error it will show when u run the cron.
After that you wont need to do it.

I looked several times and there is not con job called cron_horoscope I tried to add a cron manually but when I do that I get an error

bada_bing 09-28-2006 01:19 AM

Quote:

Originally Posted by lebanon
Well , yes ur fetching a feed from my feeds , now depending on the nature of the feeds and that its only 1 time per day its not a problem for me or my server . Yet , if you want to fetch ur own feed, ill be glad to explain it and set the feed directly on your feed when u prvt msg me with the feed u want to adjust the horoscopes to , it wont take more than 10-20 minutes to set it for a different source .

- ang2el : no the cron will auto update the horoscopes for you daily, thats what is it for .

- kofoid : it should run without a problem, the template and custom page coding are almost the same since there are no advanced requests so i havent tested it but am positive it should work fine.

- bada_bing : The cron is called cron_horoscopes it runs daily 1 time.

as for vbadvanced i havent implemented this to it , but i suppose it would be fine to do so with minimal work , we have the source and we have the signs each in a seperate txt , so what are you suggesting exactly ? Random Sign ? or links to signs or ...?
oberheimhaven : you have to link it anywhere you link to , the file to link to is www.yourforum.tld/dailyhoroscopes.php

hope i didnt miss any question ... regards

As to vbadvance I would like a miniture version of all the signs contained withing a block so I can display this hack on my portal

Zowners 09-28-2006 01:37 AM

Quote:

Originally Posted by lebanon
Zowners : am not counting hits not, it doesnt really bother me for now, but if this had too many subscribers it will start to , because the files are updated one time aday so its useless to grab them more than once a day ! , while for testing porpuses its accepted and it will show on my logs that they are not repeated daily ( cron times will appear as same times repeatedly )

Well I don't think it went through until I had all the dir chmod...so that's good. :) But I added it yesterday & checked on it all day...it never updated itself. I did so manually not long ago. Will I have to do this manually once per day? It's ok if I do I just need to know so I don't do it manually then it suddenly work/do it twice on you. I'm trying very hard to respect your wishes. ;)

And I never knew what php fopen on meant. I did everything else & this thing seems to be working fine other than the cron. Did the fact I didn't do anything about this php fopen on cause the automatic cron to fail?

Sarver 09-28-2006 07:15 AM

Yea, i'm havin the same problem.. no horoscope is showing up. I'm just wondering.. do i have to manually type in the horoscopes myself? .. i hope not lol.

Anyways, hope someone can help out lol.

Dave.

oberheimhaven 09-28-2006 05:31 PM

same deal huh??? Hey it loaded fine No horoscopes I croned I have done everything I possible know how to do?? Still no horoscopes any ideal let me know If i find out will do the same I have installed 3.6.0 but nothing ;-(

From my host
The PHP option allow_url_fopen would normally allow a programmer to open, include or otherwise use a remote file using a URL rather than a local file path. For security reasons, DreamHost has disabled this feature; however, a feature-rich alternative exists in the form of the bundled cURL library, and you can always get around the problem by compiling your own version of PHP.

lebanon 09-28-2006 06:42 PM

oberheimhaven,
please check the link
http://www.yousite/urforum/admincp/index.php?do=phpinfo
in PHP CORE section
find value of
allow_url_fopen (should be) On On

as for the rest of questions, ofcourse you should not update anything daily, if the first time u run the cron manually it succeeds , then surely next time it will succeed with no doubt and nothing ever u should do from ur side after that ! ....
There is no reason at all for the cron to run manually successfully and not run in background successfully too !
Yes also the horoscopes should run on vb 3.6.0 too ,

bada-king if u dont see the cron , are u sure u did import the xml product file ? it should create the cron for u automatically ...


All times are GMT. The time now is 04:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01372 seconds
  • Memory Usage 1,851KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete