![]() |
Synopsis
This hack allows webmaster to provide syndicated VB content to other webmasters such as Latest topics, Latest Polls or calendar entries to other webmasters for inclusion on their websites. The webmasters using the feeds do NOT need PHP, PERL, MYSQL, ASP just a javascript enabled browser. Requirements * Crontab * The ability to run PHP via the command line Example http://cpfc.org/news/newsfeed.html Please note the documentation is sketchy and if your aren't savvy with hacking code yourself then maybe you should wait until the documentation is up to speed. |
don't use the txt file
use this |
This looks really interesting Dave. I'm looking forward to trying this out. Good job! :)
|
I'm doing something wrong. I get these errors when trying to run activefeed.php from the command line:
Code:
./activefeed.php: ?: No such file or directory |
Steve when executing your php file from the command line (telnet/SSH) you must specify the location of php binary
Ie for me /usr/local/php/bin/php -q /path/to/php/file |
if you can't get that to work you can do the following
/usr/bin/lynx -dump http://url.com/to/script.php |
Dave this is very cool. Looking forward to play with it.
|
Schleet :)
|
Invoking it with the path to php gives me this error now:
Code:
bash:~/www/forums$ /usr/bin/php -q activefeed.php mysql_select_db($dbname); |
you might need to add
#!/usr/local/bin/php at the top of your file. If you are running php as cgi mode. |
Nope, I'm not running PHP in cgi-mode. Any other ideas? I really want to get this one working.
|
Quote:
your on linux? try locate php|more search through until you find a binary rather than a directory |
Dave,
/usr/bin/php is the binary. Quote:
|
Steve:
1) Can you run any php scripts via the command line? 2) Is your path to config.php correct? |
1. Apparently not. I tried with a couple of other scripts and got the same error. How do I get around this?
2. Yes, otherwise my forums would cease to function. Thanks! |
Quote:
|
I'm running RedHat 7.1. I'm not going to take a chance on rebuilding PHP. If something went wrong my forums would stop operating and I can't run that risk. :eek:
Also I just tested a couple of other PHP scripts from the command line and they executed just fine. It's only scripts that access a database that give me this problem. |
use lynx its a browser that comes with nearly every linux distrib and you can just execute the script as if you just typed it in to your browser.
Just use the following thats what i've done to get it to work as i was getting same error. |
Thanks PPN! That now works to create the latest_topics.txt file. However I now have another problem when I try to use the resulting script. You can see for yourself at:
http://www.optiboard.com/activefeed.html |
I rewrote nearly all of the code within this to do the following things, select latest topics from all forums that are open to users with groupid 1. It also writes to a .js file and the code should have been
Code:
<script language="JavaScript" src="http://yourdomain/forums/latest_topics.js"></script> also the ? needs escaped for both php and javascript so you need \\? i done this in my version and also made it work with ./global.php instead of connected within the file. New attachment two posts below. |
This works great except for one problem - it only pulls threads from my first forum (with forumid 24.) How do I get it to pull the last 10 threads from all my open forums?
http://www.optiboard.com/newsfeed.html |
em bah i made a mistake with the forum permissions, it only worked if you had access masks on. Reworked it and it now takes it from all forums. See attachment below.
Updated to connect to the database a different way. |
Hmmm.....I am getting a blank page except one time when it did work.
When I /usr/bin/lynx -dump http://url.com/to/activefeed.php it had NO error code and the .js script was touch with a new date but the page came up empty. This is after it worked the first time. I am using your latest version of the script as well. Any idea's? Thanks, Michael www.clublexus.com |
Thanks PPN! Works perfectly now.
One question though. Is there anyway to disable the cookie-setting when newsfeed.php is run? Running it even shows up in Who's Online. |
Looks quite interesting.
But is this possible without the cron facility ? Without the facility to run php from command line ? Any clues ? Thanks |
if you can't use lynx use this
change newsfeed.php to newsfeed.cgi and at the top add #!/usr/bin/php this is my presuming the path to your PHP then add the following cronjob /usr/bin/php -q /path/to/htdocs/newsfeed.cgi an alternative to cronjob would involve editing the vb php files, It shouldn't be to hard to do, all you would need to do it include the newsfeed.php where you want it to execute. |
PPN, do you know how to disable the cookie-setting?
|
instead of
PHP Code:
PHP Code:
|
Thanks, I'll give it a try!
|
It didn't work. It seems to have broken the newsfeed.php script altogether.
http://www.optiboard.com/newsfeed.html |
PHP Code:
|
Thanks but I'm still having the same problem. The latest_topics.js file is messed up. After running this, the first line always begins with:
ument.write ...instead of: document.write I'm going to check the code again. [Edit: I checked but can't find any reason for this to happen. Again it's the first line only. All subsequent lines print out fine.] |
I tried to use: /usr/bin/php -q /path/to/htdocs/newsfeed.cgi
It seems to execute the file now, but I get a parse error... --------- <br> <b>Parse error</b>: parse error in <b>/home/********/********/******/newsfeed.cgi</b> on line <b>73</b><br> --------- Line 72, 73, 74: } else { $replytext = "replies \\?; ---------- Thanks for your help. |
Why did you change this from newsfeed.php to newsfeed.cgi? Does your PHP parse CGI files?
|
I changed it because of what PPN said..
Quote:
Quote:
*shrug* <- feeling sad, finally get cron to do something.. now this error(hehe) Thanks for your fast reply.. ;) |
Ah, ok. I didn't see that. Doesn't your server have lynx installed?
|
Yes it does, but when I use it.. (lynx - dump or lynx)
I get this error: Your terminal lacks the ability to clear the screen or position the cursor. :( |
Quote:
PPN - Good work :) |
I have tried:
-------------------------------------------------------------------------------- root /home/********/*******l/******/newsfeed.php error: /bin/sh: root: command not found ------------------------------------------------------------------------------- I have no clue why but I tried: GET http://forums.yourhostsucks.com/newsfeed.php Error: <br> <b>Parse error</b>: parse error in <b>/home/yourhost/public_html/forums/newsfeed.php</b> on line <b>72</b><br> ------------------------------------------------------------------------------- /usr/bin/php -q /home/******/*********/*******/newsfeed.cgi Error: <br> <b>Parse error</b>: parse error in <b>/home/********/********/******/newsfeed.cgi</b> on line <b>73</b><br> Note: it is line 73 because I added #!/usr/bin/php at the top. --------------------------------------------------------------------------------- I tried a couple others with no luck as well.. :) EX: GET http://forums.yourhostsucks.com/newsfeed.php > /dev/null Tried to use nice, etc.. Any Ideas? :) Thanks! |
[QUOTE]Originally posted by YourHostSucks
I have tried: -------------------------------------------------------------------------------- root /home/********/*******l/******/newsfeed.php error: /bin/sh: root: command not found |
All times are GMT. The time now is 03:13 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|