vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   News Out - posts from forum(s) on any page (https://vborg.vbsupport.ru/showthread.php?t=65114)

Rafe 05-13-2004 10:00 PM

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

Boofo 05-14-2004 04:12 PM

Any screenshots? ;)

Rafe 05-14-2004 04:22 PM

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.

mOdEtWo 05-15-2004 12:24 AM

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?

Rafe 05-15-2004 10:30 AM

Quote:

Originally Posted by mOdEtWo
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?

I should do, but I'm not familiar enough with how to do it. If I ever move this on to a proper release that's one of the things I would do. I guess I should look at the code for some similar connections (suggestions anyone?)

GamerJunk.net 05-15-2004 12:46 PM

Is this like VBAdvanced?

wrongful 05-15-2004 07:33 PM

excuse me for the dumb question but what would be the best way to embed this content into a page.

mOdEtWo 05-15-2004 08:45 PM

Quote:

Originally Posted by Rafe
I should do, but I'm not familiar enough with how to do it. If I ever move this on to a proper release that's one of the things I would do. I guess I should look at the code for some similar connections (suggestions anyone?)

Well, as far as I know, you can use vB's way to connect to the mysql database, instead of having to use sql quesies yourself.

Code:

$sql_news = $DB_site->query("SELECT thread....... +++
You better look at one of the vB files or other hacks on how to use it tho. ;)

Rafe 05-15-2004 10:34 PM

Quote:

Originally Posted by RasMasta
Is this like VBAdvanced?

No. This isn't a portal system. You can use it to create a portal like affect. Its more flexible in that you have more choice in what you pull, but it take more time to set up.

Rafe 05-15-2004 10:36 PM

Quote:

Originally Posted by wrongful
excuse me for the dumb question but what would be the best way to embed this content into a page.

You could either copy this code into the relevant file or include this file in another page, or you could write out to a file and include that in the relevant file.

Obviously copy / include where you want the code to appear and edit appropriately.

nicholas 05-17-2004 10:33 AM

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.

gfxmods 05-17-2004 10:33 AM

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

Rafe 05-17-2004 08:13 PM

Quote:

Originally Posted by gfxmods
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

Remember this is a beta release. I'l try and do some tidying up and add a few features / make things a bit more elegant in the next release (need to find some time).

Geographic2 05-18-2004 12:03 AM

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.

Rafe 05-18-2004 09:52 AM

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:

Originally Posted by Geographic2
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.


iggy123 05-18-2004 04:14 PM

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?

Draco 05-20-2004 05:17 PM

Quote:

Originally Posted by iggy123
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?

I have the same problem?
any ideas what we can do?

pressoir 06-03-2004 01:07 PM

I got a blank screen after following the instructions

jugo 06-09-2004 01:16 PM

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

jugo 06-09-2004 01:42 PM

Fixed my own issue....I commented out these two lines from the code.
PHP Code:

//disconnect
mysql_free_result($sql_result);
mysql_close($connection); 


007 06-10-2004 04:54 AM

Very cool. I was actually planning to code this exact idea when I just now saw yours. I will definately check it out. :)

007 06-12-2004 08:16 PM

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..

FWF 06-21-2004 10:47 AM

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

Rampag33 06-21-2004 05:35 PM

I get a blank page.

specifiy news at the bottom
@writenews("50,53", "outputfile.txt","5");

-=Sniper=- 06-29-2004 04:34 PM

it worked once for me, and now trying again doesnt work at all? any updates to the script? or can you helpout? regards

-=Sniper=- 07-17-2004 03:28 PM

getting an error @ www.zone365.com at the bottom of the page?

-=Sniper=- 07-21-2004 05:38 PM

anyone?

archangelsk 07-31-2004 04:09 AM

woot, this is great. just what i needed, w/o all the excess fat of a portal system.

JunkAnime 08-24-2004 03:39 PM

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.

eLiTeGuRu 08-24-2004 06:35 PM

I followed the directions and it says Query Could not be Executed.

AlexSFBay 09-04-2004 06:36 PM

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!

AlexSFBay 09-04-2004 09:01 PM

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

Warning: mysql_error(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 357

Warning: mysql_errno(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 358

Any thoughts on how I can resolve this?

-=Sniper=- 09-05-2004 09:58 PM

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!

Viruseater 09-13-2004 06:58 PM

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.

AlexSFBay 09-15-2004 05:47 AM

I randomly get "Unable to add cookies, header already sent." Any ideas how can fix that?

AlexSFBay 09-15-2004 06:46 AM

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.

eLiTeGuRu 09-16-2004 01:18 AM

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:

$sql "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid IN ($cats) AND sticky = '0' ORDER BY threadid DESC LIMIT $newsitems"

Change to:

PHP Code:

$sql "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM YOURTABLEPREFIX_thread WHERE forumid IN ($cats) AND sticky = '0' ORDER BY threadid DESC LIMIT $newsitems"

Find Line 67
PHP Code:

$sql2 "SELECT postid, threadid, username, userid, title, dateline, pagetext, iconid FROM post WHERE threadid = \"$threadid\" ORDER BY postid ASC LIMIT 1"

Change to:

PHP Code:

$sql2 "SELECT postid, threadid, username, userid, title, dateline, pagetext, iconid FROM YOURTABLEPREFIX_post WHERE threadid = \"$threadid\" ORDER BY postid ASC LIMIT 1"

and

Find around line 104

PHP Code:

$sql3 "SELECT title FROM forum WHERE forumid = \"$forumid\" LIMIT 1"

Change to

PHP Code:

$sql3 "SELECT title FROM YOURTABLEPREFIX_forum WHERE forumid = \"$forumid\" LIMIT 1"


-=Sniper=- 09-21-2004 03:09 PM

Quote:

Originally Posted by AlexSFBay
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

Warning: mysql_error(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 357

Warning: mysql_errno(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 358

Any thoughts on how I can resolve this?


ok, I moved to a new server and its working fine! maybe its something to do with the server settings?

Dan 09-21-2004 07:25 PM

Hmm.... interesting mod. I could use this to work on a new custom portal. thanks for sharing it!

lcryan 09-25-2004 03:01 PM

<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
  • Page Generation 0.01328 seconds
  • Memory Usage 1,828KB
  • 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
  • (4)bbcode_code_printable
  • (7)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