PDA

View Full Version : News only pulled from a specific user


TechDawgFan
03-06-2007, 10:46 AM
I'm brand new to vBadvanced. Just downloaded today and am trying to do some customization before taking it live.

I'm currently using the RSS News feed EXTENSIVELY in my forums. I've set up a user (News_Bot) that the articles get posted by and they go into an "Admin Holding Pen" before we move them to the specific topic forum they go with. We've done this because some of our feeds produce multiple threads.

I would like to be able to use News_Bot's threads as the content for my homepage news module, but the option to select at that level isn't available. Is there a way to hack the news.php module to do this? I found this thread (http://www.vbadvanced.com/forum/showthread.php?t=5100) that does it by usergroup, but the code in the news.php module has apparently changed since that time.

Any help would be MUCH appreciated!

Chris

Brian
03-06-2007, 12:02 PM
Hi Chris, welcome to vBadvanced. :)

Should be an easy change to restrict the news to one user. Just look in your modules/news.php file for this code:
WHERE visible = 1

Replace with this:
WHERE visible = 1 AND thread.userid = X
Replace X at the end there with the userid and that should do the trick.

Our Sponsors
 

TechDawgFan
03-06-2007, 12:07 PM
Thanks! Got the following error when I did it

Database error in vBulletin 3.6.0:

Invalid SQL:

SELECT IF(votenum >= 1, votenum, 0) AS numbvote, IF(votenum >= 1 AND votenum != 0, votetotal / votenum, 0) AS voteavg, threadid, firstpostid FROM vb3_thread AS thread
WHERE visible = 1 AND thread.userid = 3501 AND open != 10 AND thread.forumid IN(27,29,26,25,28)

ORDER BY sticky DESC,dateline DESC
LIMIT 10;

MySQL Error : Unknown column 'thread.userid' in 'where clause'
Error Number : 1054
Date : Tuesday, March 6th 2007 @ 11:04:26 AM
Script : http://www.latechbbb.com/cmps_index.php

TechDawgFan
03-06-2007, 12:27 PM
Ignore.

Found the fix.

It's supposed to be "thread.postuserid = X" instead of "thread.userid = X"

Working fine now!

Our Sponsors
 

Brian
03-06-2007, 01:25 PM
Ahhh, sorry. I wasn't thinking. Glad you were able to figure it out though.

SteveRobWhateve
06-10-2007, 04:12 AM
can this work for multiple members?

Brian
06-10-2007, 10:13 AM
Just use this code instead:

WHERE visible = 1 AND thread.postuserid IN(X, Y, Z)