PDA

View Full Version : Mark / Unmark thread as news.


KieuTuan
10-15-2005, 04:23 AM
This hack allow you to post mark a thread is show or not in the news module:
In the new module find:

$deljoin
WHERE thread.threadid IN(" . implode(',', $newstids) . ")
$mods[exforums]


and replace with:

$deljoin " .
. ") " .
"WHERE (thread.sticky = 1) AND (thread.forumid = xxxx) " .
"$mods[exforums]


Add on 17-Oct-05.
I just forgotten:
Find:
$getnewsids = $DB_site->query("
SELECT threadid, firstpostid FROM " . TABLE_PREFIX . "thread AS thread
$deljoin
WHERE visible = 1 AND open != 10 AND thread.iconid IN(" . implode(',', $mods['inforums']) . ") $notdeleted

Repalce with

$getnewsids = $DB_site->query("
SELECT threadid, firstpostid FROM " . TABLE_PREFIX . "thread AS thread
$deljoin " .
"WHERE (thread.sticky = 1) AND (thread.forumid = xxxx) " .




Where xxxx is the id of the forum you intent to keep news article.
Now everytime you post a thread in the news forum and check sticky checkbox your thread will be displace in news module. To turn off just uncheck the sticky.
Hope it will be usefull for all.

Crazy Serb
10-15-2005, 01:23 PM
ok, so if I wanted to integrate THIS HACK (http://www.vbadvanced.com/forum/showthread.php?t=5193) into your solution, what would I have to change that news.php into - I am getting parse errors with what I'm using:


$deljoin
WHERE thread.iconid IN($mod_options['portal_news_forumid'])
$mods[exforums]


that's probably wrong, but I've tried a few variations with and without brackets, dots, this, that...

help!

Our Sponsors
 

KieuTuan
10-17-2005, 01:06 AM
It's running smothly on my site. In the last post I have forgotten something. Using my revised as above.

Dorfdad
10-17-2005, 11:06 AM
Will this allow me I have about 200 subforums (games) and when I post a news story in any subforum will this allow me to mark the thread as a news item and it appear on the front page!? I dont want a specific folder for news only. I need it to be from ANY thread on the forum I can post a news article..

Thanks in advance..

Our Sponsors
 

KieuTuan
10-18-2005, 12:02 AM
Somewhere in the to of news modul add:
$theforumstorenews = array(x,y,z,...);
replace (in my hack, you have to repace at 2 position):

"WHERE (thread.sticky = 1) AND (thread.forumid = xxxx) " .

with

"WHERE (thread.sticky = 1) AND thread.forumid IN (" . implode(',', $theforumstorenews) . ") " .

You can put new into any forum list in the $theforumstorenews array.
if you want to show all article mark up sticky except some store in specific forums:

Somewhere in the to of news modul add:
$theforumnotshows = array(x,y,z,...);
replace (in my hack, you have to repace at 2 position):

"WHERE (thread.sticky = 1) AND (thread.forumid = xxxx) " .

with

"WHERE (thread.sticky = 1) AND thread.forumid NOT IN (" . implode(',', $theforumnotshows) . ") " .

Dorfdad
10-19-2005, 05:10 PM
sorry but what file or template do I edit for this!?

KieuTuan
10-22-2005, 04:21 AM
You just edit news.php in module folder.

mousi
02-13-2007, 10:59 PM
Hello. Nice hack! I have some questions:

1) I do not want to use the "sticky" threads, can I have an extra checkbox to do this?
2) If the above is possible, will the news module also pull threads from my news forums?

Thx in advance!

PS: I know that this is a very old thread, but I couldn't find anything similar

Crazy Serb
03-11-2007, 04:06 PM
speaking of which, did anyone figure out a way to get this working with the latest VBaCMPS and VB 3.6.5?

or this hack (preferrably):
http://www.vbadvanced.com/forum/showthread.php?t=5193

Crazy Serb
03-11-2007, 04:29 PM
or, even better, Brian, could you consider this as a feature for the next version?

something that will allow easy tagging of threads on the frontend by admin and moderators (given the appropriate permissions), almost as easy as sticking/unsticking threads...

that would be awesome!