PDA

View Full Version : [REQ] latestthreads by iconid instead of forumid


ragintajin
11-09-2005, 03:05 PM
Hey Brian,

I'm trying to make the lattestthreads display posts based on their iconid (posticon) instead of the forumid, similar to the Mark Thread as News (http://www.vbadvanced.com/forum/showthread.php?t=5193) hack. The coding in the latestthreads.php is obviously different than the news.php so I was hoping you could point me in the right direction.

Thanks in advance.

Brian
11-10-2005, 12:08 PM
WHERE visible = 1 AND open != 10 AND thread.forumid IN(" . implode(',', $mods['inforums']) . ") $notdeleted

Change that line to something like this:
WHERE visible = 1 AND open != 10 AND iconid = X

Replace X there with the iconid. Also, be sure that you have a forum selected to display posts from so that query will still be executed.

Our Sponsors
 

ragintajin
11-10-2005, 10:41 PM
WHERE visible = 1 AND open != 10 AND thread.forumid IN(" . implode(',', $mods['inforums']) . ") $notdeleted

Change that line to something like this:
WHERE visible = 1 AND open != 10 AND iconid = X

Replace X there with the iconid. Also, be sure that you have a forum selected to display posts from so that query will still be executed.
Forgot the thread. in front of iconid, but other than that it works great. Thanks, Brian!

Brian
11-12-2005, 01:05 PM
Ohh yea, guess that would help, huh? :p
Glad you were able to figure it out though.

Our Sponsors
 

Slave
11-14-2005, 02:20 AM
Brian .. anyway of making this a choice in the AdminCP? as one of the whole points of picking a news item via icon is so that you can have posts from more than one forum show within the correct news area/page .. your solution means you still have to post in the one forum ..

I've had a look and, after having a play with phpmyadmin, I can add the selection box to the admincp menu but I'm not sure of the needed code in the news.php file ..

So .. you'd still have the choice of picking threads from the admincp .. and forums if you want. But you also have a 3rd choice of leaving the forum blank and entering an iconid into the next selection box.

Any chance you could take a look?

Slave
11-14-2005, 02:29 AM
Just to give you an example ..

At the moment, using the old hack, I have 10 different news areas all using different icons. I can post anywhere on my (many) forums and if I pick an icon I know it will show on the correct news page (I have about 7 news pages depending on the type of news) .. all this using the one news.php file as I am able to pick the iconid via that news pages admincp edit page.

With your solution above I'm going to have to have 10 different news.php files/modules setup .. and even then I will only be able to post my news stories in the one forum per news area which will severely limit the flexibility of how my site works.

I think this is the only thing that I'm now waiting for before moving my site/forum over to 3.5/2.0.0 .. so if it could be made as default within cmps I would be eternally grateful :)

bloodydecks
12-06-2005, 02:08 AM
Works great Brian. Whew I've needed this for a long time. Is there a way to set permissions so only moderators/admin can use a certain icon?

x[sliver]
12-06-2005, 02:12 PM
Thanks a lot Brian!!! :D

Brian
12-06-2005, 02:43 PM
your solution means you still have to post in the one forum ..
No, the code I posted removes the forum check and displays all threads with that specific iconid.

ragintajin
12-09-2005, 05:19 AM
Hey Brian,

Would having like 5 different blocks (each pulling from different iconid's), have a profound affect on server load or page generation? Apparently the page generation numbers are ranging anywhere from .7 seconds to 3.3 seconds...

I should also note that a couple of these blocks have their own custom_bits templates.

Brian
12-09-2005, 03:31 PM
It probably could depending on the size of your forums.

Joey805
02-12-2006, 11:59 PM
Brian, could you tell me what code I need to change in news.php in order to mark items as news? I cant seem to find that line in the latest version of cmps 2.1 with vb 3.53

Joey805
02-25-2006, 11:55 AM
Is there a way to display items marked as news on a non vb page?

bloodydecks
08-09-2006, 11:28 PM
No you can't.

Slave
09-19-2006, 10:56 AM
WHERE visible = 1 AND open != 10 AND thread.forumid IN(" . implode(',', $mods['inforums']) . ") $notdeleted

Change that line to something like this:
WHERE visible = 1 AND open != 10 AND iconid = X

Replace X there with the iconid. Also, be sure that you have a forum selected to display posts from so that query will still be executed.
Can anyone confirm if this works on 3.6.1 ?

Slave
09-19-2006, 11:08 AM
Yes it does :)