![]() |
News Out - posts from forum(s) on any page
This script will let you pull the first posts from threads in a forum and display them on a non-vb page anywhere on your site.
For example you can use this to pull posts from a forum and display them as news. (Each post in the forum is a news item). Currently it will pull them on the basis of thread start date. This is very rough and ready. But maybe someone will find it useful. If you read the code and comments you can do things like strip out tags, snip the post off after the first para etc etc. You can choose to write out to a file or to write to screen. You can pull stuff from one or many forums. I'll try and answer any questions that come up, but this is a beta so.... Rafe |
Any screenshots? ;)
|
I didn't think there was much point. It pulls the text and images (and any stuff from the post). The intention is you integrate into other pages.
I use it to power various things at my site - http://www.allaboutsymbian.com Thew news there is done like this. |
Thank you Rafe, I'll try it out.
One thing tho, why don't you use the vb function to connect to mysql database, instead of putting it into this script? |
Quote:
|
Is this like VBAdvanced?
|
excuse me for the dumb question but what would be the best way to embed this content into a page.
|
Quote:
Code:
$sql_news = $DB_site->query("SELECT thread....... +++ |
Quote:
|
Quote:
Obviously copy / include where you want the code to appear and edit appropriately. |
Thank you, Rafe. This is just right and I'll use it. I've been looking for something like this as an alternative to the portal-with-everything hacks.
|
this may be the solution to my site, i have been using a portal and im thinking of creating a new layout and using somthig along these lines for a news page, that way my site is more unique then another vb portal page
|
Quote:
|
This would be better as an addition to external.php rather than a seperate file.
External.php provides the functionality for XML,RSS, and the like for exactly this purpose. The difference between what you are doing and that is you show the content of the posts whereas they show only thread titles. Still it'd be more in line if it were an addition to external.php than a seperate file. |
Perhaps so. However this is still a beta. In theory there's a lot of extra functionality I may add (depends on time etc.)
There's advantage to combing with external.php but there are also advantages in install terms of just uploading one new file. Maybe the best approach would be to call in external2.php to make it clear what it does? Still thanks for your feedback. Rafe Quote:
|
when i try and call this using the <?include ('newsout.php');?> I get the following error message:
Unable to add cookies, header already sent. any ideas? |
Quote:
any ideas what we can do? |
I got a blank screen after following the instructions
|
I get enws...only thing is that I also get this at the end....
Code:
Warning: mysql_query(): 1 is not a valid MySQL-Link resource in /home/s3/public_html/portal/includes/db_mysql.php |
Fixed my own issue....I commented out these two lines from the code.
PHP Code:
|
Very cool. I was actually planning to code this exact idea when I just now saw yours. I will definately check it out. :)
|
This doesn't seem to work. I put it in my forums directory and left the change directory lines commented out. There also didn't seem to be any place to select which forum(s) to pull posts from.
I tried opening the file at forums/newsout.php directly and all I got was a white page.. |
you should do a full release of this...it would be useful however its to "iffy" for me to test out on my site as a BETA release...but it looks promising
|
I get a blank page.
specifiy news at the bottom @writenews("50,53", "outputfile.txt","5"); |
it worked once for me, and now trying again doesnt work at all? any updates to the script? or can you helpout? regards
|
getting an error @ www.zone365.com at the bottom of the page?
|
anyone?
|
woot, this is great. just what i needed, w/o all the excess fat of a portal system.
|
When I try to use this I get a blank page... Does anybody have a clue what I might be doing wrong?
Edit By the way I followed the directions of the script. |
I followed the directions and it says Query Could not be Executed.
|
Wow, you've read my mind. I've been piecing together a bunch of hacks to come up with something like this. I've downloaded it and I'll give you my thoughts on how the process went for me. In any case, excellent work, and it's very much appreciated!
|
The script works, but I'm getting errors at the end
Code:
Warning: mysql_query(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 212 |
I get the same error! if someone can do me a similar hack! which allows me to use smilies, etc etc
then please contact me! |
Wouldn't it be easier if you used
require_once("./includes/config.php"); that way you wouldn't need to use all the hard codes. |
I randomly get "Unable to add cookies, header already sent." Any ideas how can fix that?
|
I figured it out! After a couple hours of tweaking my script, I finally figured out that
chdir('forums/'); require_once('./global.php'); needs to be located right at the very top (before any other additional PHP code -- ie header.php) in order to avoid the cookie error message. |
After messing around with this code, I realized that if you have a table prefix, it will not work. Therefore do this:
Find around line 45 PHP Code:
PHP Code:
PHP Code:
PHP Code:
Find around line 104 PHP Code:
PHP Code:
|
Quote:
ok, I moved to a new server and its working fine! maybe its something to do with the server settings? |
Hmm.... interesting mod. I could use this to work on a new custom portal. thanks for sharing it!
|
<a href="http://www.liquid-core.net/forums/news.php" target="_blank">http://www.liquid-core.net/forums/news.php</a>
I'm getting 'Could not execute query.' |
All times are GMT. The time now is 04:49 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|