Remove some categories from show recent posts list?

Started by SpelingMistakes, June 01, 2008, 12:36:37 PM

Previous topic - Next topic

SpelingMistakes

Ok I didn't have luck with this http://www.simplemachines.org/community/index.php?topic=239990.0 – now I am thinking about some new way of solving problem

Can I remove some categories from show recent posts list? – I want to remove whole category from show recent list which is on bottom of my forum - if you read this topic mentioned above  – you will understood whole story

If it is possible – I will be very thankful

Spel
There is a huge difference between living and being alive!

SpelingMistakes

Possibility to add several different forum will be also be ok – In one category I have several forums and because of that I have ask for category removal and not forum removal – but ok – whatever – whatever I get and if it works – I will be satisfied

Spel
There is a huge difference between living and being alive!

ccbtimewiz

Let me understand this, you want posts from certain boards of your choosing to not appear on recent template?

These templates include the "Recent Posts", "Recent Replies", and "Unread Posts"?

SpelingMistakes

http://www.simplemachines.org/community/index.php?topic=239990.msg1547684#msg1547684

YES I want to remove all things from specific category or boards from recent posts

We are talking only about removing some specific categories of several forums in it from showing in that list - Recent Posts

Nothing else

If you read briefly that above mentioned topic, you will be much more learned how I get there.

In short – I have boot which catch rss news from several different places and post on forum – every rss source is different forum – there is lots of those rss topics which is good because all those are information's – but look http://img357.imageshack.us/img357/6315/adminpostsmt4.jpg

Very often all other people can't see nothing than administrator (boot) and its posts – which can be annoying

I want to remove them – I didn't succeed that – now I want to remove places where he posts – category or forums – whatever – I know numbers of forums and even of that will not be a problem – Using category I will kill it by one shot :)

I have make monster :) –    Some jokes are not bad – but I am in serious problem :(

Spel
There is a huge difference between living and being alive!

SpelingMistakes

I must be clear – I want to remove all those notifications but only in recent posts – I want that people when go to some specific board get "those" new posts notifications (little new beside name of topic)

I mean this "new" notification – for new posts etc

http://img514.imageshack.us/img514/9108/newnotificationbesidenage4.jpg


Those RSS boards are only for looking – noting to reply, discuss etc

Spel
There is a huge difference between living and being alive!

ccbtimewiz

Find:
Code (recent.php) Select
AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
AND $user_info[query_see_board]


Replace with:
AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
         AND b.ID_BOARD != #
AND $user_info[query_see_board]


You'll need to do this about 5 times in the recent.php file.

Replace "#" with the ID of the board, without the .0 tag. So for board 86, you'd put:

AND b.ID_BOARD != 86

To stop more boards, just keep adding more lines. So, for boards 86, 28, and 27:

AND b.ID_BOARD != 86
AND b.ID_BOARD != 28
AND b.ID_BOARD != 27


Make sure to do this on ALL instances you see $modSettings[recycle_board].

Hope this helps.

SpelingMistakes

I have only 3 of those $modSettings[recycle_board]
but only one of
AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "


After part which consist from both of those codes I have add

         AND b.ID_BOARD != 166
         AND b.ID_BOARD != 167
         AND b.ID_BOARD != 168
         AND b.ID_BOARD != 169
         AND b.ID_BOARD != 170
         AND b.ID_BOARD != 171
         AND b.ID_BOARD != 172
         AND b.ID_BOARD != 173
         AND b.ID_BOARD != 174
         AND b.ID_BOARD != 175
         AND b.ID_BOARD != 176
         AND b.ID_BOARD != 177
         AND b.ID_BOARD != 178
         AND b.ID_BOARD != 179
         AND b.ID_BOARD != 180
         AND b.ID_BOARD != 181
         AND b.ID_BOARD != 182
         AND b.ID_BOARD != 183
         AND b.ID_BOARD != 184
         AND b.ID_BOARD != 185
         AND b.ID_BOARD != 186
         AND b.ID_BOARD != 187
         AND b.ID_BOARD != 188
         AND b.ID_BOARD != 189
         AND b.ID_BOARD != 190

And everything works just like a charm - without any glitch - THANKS :)


Spel
There is a huge difference between living and being alive!

ccbtimewiz


DrizzetPheonix

Could this be written into a package?

Something that allows the admin to select what boards not to show in recent posts from the admin menus.
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

DrizzetPheonix

How about limiting specific topics? I don't want to take the whole board out just on section of it. Thanks for any help.
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

SpelingMistakes

Topic?

How you will limit topic? By name or?

If you put some topics in some board - that is a solution, but if you want to limit by some topic – I think it is impossible – You need some script which will read topic and check to see is it right or no - that is impossible - I mean too much problems.

That idea can be implemented for "censuring" – for instance – talk about sex, or terrorism but – it is long story and I don't know did you mean on something like that. If you can limit by topic that mean you can even move those topics to some board or delete them – it is same – only action on the end is different.

For you problem -

It will be much better that some topics with specific area of interest goes into some specific board and this solution is already implemented and working great.


If you want to limit some member from showing on that list you can use solution from other topic – you have link in my first post –

Spel
There is a huge difference between living and being alive!

DrizzetPheonix

Which area of the code do i place the boards if i simply don't want it to show in the Ten recent posts but want it to show everywhere else. I have multiple areas that have the above code. I know some of them are for the replies etc. I only want to take them from the Top ten recent posts.
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

ccbtimewiz

Quote from: DrizzetPheonix on June 05, 2008, 01:19:02 PM
How about limiting specific topics? I don't want to take the whole board out just on section of it. Thanks for any help.

Find:
Code (recent.php) Select
AND t.ID_TOPIC = m.ID_TOPIC

Add After:
AND t.ID_TOPIC != #

And replace "#" with the ID of the topic without the trailing .0

DrizzetPheonix

Quote from: DrizzetPheonix on June 05, 2008, 02:42:57 PM
Which area of the code do i place the boards if i simply don't want it to show in the Ten recent posts but want it to show everywhere else. I have multiple areas that have the above code. I know some of them are for the replies etc. I only want to take them from the Top ten recent posts.

Is there a specific section just for the ten recent post display? I have more than one area with the code being the same....like i stated above I want it to only be taken away in that one area.
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

DrizzetPheonix




// Find the ten most recent posts.
function RecentPosts()
{
global $txt, $scripturl, $db_prefix, $user_info, $context, $ID_MEMBER, $modSettings, $sourcedir, $board;


That is what i find for the top ten recent. Is there a way to make certain boards not show in this?
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

ccbtimewiz

#15
Of course.

Find:
Code (recent.php) Select
// Find the 10 most recent messages they can *view*.
// !!!SLOW This query is really slow still, probably?
$request = db_query("
SELECT m.ID_MSG
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
WHERE b.ID_BOARD = m.ID_BOARD
AND $query_this_board
ORDER BY m.ID_MSG DESC
LIMIT $_REQUEST[start], 10", __FILE__, __LINE__);
$messages = array();
while ($row = mysql_fetch_assoc($request))
$messages[] = $row['ID_MSG'];
mysql_free_result($request);


Replace with:
// Find the 10 most recent messages they can *view*.
// !!!SLOW This query is really slow still, probably?
$request = db_query("
SELECT m.ID_MSG
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
WHERE b.ID_BOARD = m.ID_BOARD
                        AND m.ID_MSG != x
                        AND b.ID_BOARD != y
AND $query_this_board
ORDER BY m.ID_MSG DESC
LIMIT $_REQUEST[start], 10", __FILE__, __LINE__);
$messages = array();
while ($row = mysql_fetch_assoc($request))
$messages[] = $row['ID_MSG'];
mysql_free_result($request);


Replace "x" with the ID of a topic you don't want showing, and replace "y" with the ID of a board you don't want showing.

DrizzetPheonix

<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

ccbtimewiz


DrizzetPheonix

I did it just for boards, do i have to put the topic ones in also....? I have triple checked the code...
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

DrizzetPheonix

http://www.dravensportal.com/drvpforum/index.php

that is my site.... at the bottom in the info center for recent  10 posts, that is the only area i don't want them to be seen. Would i have to edit boardindex for this? I don't know much about php, so I'm not sure why the above suggestion didn't work.
<a href="http://www.dravensportal.com><font="red">DravensPortal
</font></a>

Advertisement: