How to set Test Board so that posts there don't show up in Show Unread Posts?

Started by Deprecated, July 28, 2008, 10:08:52 AM

Previous topic - Next topic

Deprecated

Is there a way to have a Test Board set so that posts there do not show up in "Show unread posts since last visit" ?

It would also be okay if it doesn't show up in "Show new replies to your posts" also.

I've already set it so that posts don't add to a member's post total. I want the Test Board to be totally isolated from the rest of the forum so that nothing done there ever affects anything else unless a member voluntarily goes to that forum area.

Thanks!

ccbtimewiz

There is currently no way to disclude boards from the recent category by default.

But you can use the edits I made. Please refer to this post.

Deprecated

Thanks ccbtimewiz! We're nearly there...

The problem is that your mods are for SMF 1.x and I'm running 2.0b3.1 which has somewhat different syntax. There are three instances that need to be edited, and I doped out the first two, but my PHP isn't that advanced and the structure of the third instance is confusing me. This is Recent.php and I've cut out the three instances shown below. I edited the first two but I can't see exactly how to edit the third. I hope you can help:

WHERE {query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : '') . '
AND b.id_board != 24                //// ADDED CODE
AND ml.approved = {int:is_approved}


$query_this_board = '{query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : ''). '
AND b.id_board != 24                //// ADDED CODE
AND m.id_msg >= {int:max_id_msg}';


WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : ''),
array(
'recycle_board' => (int) $modSettings['recycle_board'],
)

ccbtimewiz

WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : ''),
AND b.id_board != 24
array(
'recycle_board' => (int) $modSettings['recycle_board'],
)


Try using that in the third instance.

Deprecated

No, that doesn't fly. The third instance gets a syntax error.

That comma at the end of the line above seems to put an AND on the next line out of syntax.

I moved the AND b.id_board != 24 up between the previously existing WHERE and AND, and the syntax is okay but the mod doesn't work then.

ccbtimewiz

Maybe this then?

WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : ''),
array(
'recycle_board' => (int) $modSettings['recycle_board'],
)
AND b.id_board != 24


Deprecated

(bump)

The last suggestion above failed with a PHP syntax error.

I'm hoping somebody will know how to mod SMF 2.0 to remove a specific board from being shown in new posts.

TIA! :)

ccbtimewiz

WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : ''),
AND b.id_board != 24,
array(
'recycle_board' => (int) $modSettings['recycle_board'],
)


Maybe this..?


Deprecated

Still looking for help. The last suggestion fails PHP syntax.

I can't be the only one who doesn't want test posts to show up in new unread posts...

NickC

I have a test forum, not a test board. It's an entirely separate forum in a subdomain with its own database. I use it to test code mods, style updates and changes to admin settings before I deploy them on my live site. I can trash it to my heart's content and restore it when it breaks, without any risk to my live environment.

If your host only lets you have 1 database, you could have your test and live tables in the same one, with a different prefix.

I leave mine in maintenenance mode so people don't accidentally post in the wrong one if they find it, but you could allow member access to it if you wanted.

Seems a lot easier and more useful than trying to isolate an area of your live site.

Deprecated

I'm LMAO now! How can I be so misunderstood? :D

I too have a separate test forum, for testing my SMF code changes. I ride it hard and put it away wet! ;) If it breaks I'll shoot it and reinstall...

I've got a production forum dedicated to a handicraft hobby. It's been live only 10 days and it's growing like gangbusters.

My production forum has a Test section for members to experiment with BB code, test signatures, etc. It's just a crap forum for testing stuff.

I don't want the members' test posts to show up when you hit Unread Posts. I'm sure other forums must have had the same idea...

Rumbaar

Try:
WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != 24
AND b.id_board != {int:recycle_board}' : ''),
array(
'recycle_board' => (int) $modSettings['recycle_board'],
)
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Bulakbol

You can try mine. Sources/Recent.php
Code (find) Select
// Don't bother to show deleted posts!
$request = $smcFunc['db_query']('', '
SELECT b.id_board
FROM {db_prefix}boards AS b
WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : ''),
array(
'recycle_board' => (int) $modSettings['recycle_board'],
)
);


Code (replace) Select
// Don't bother to show deleted posts!
$request = $smcFunc['db_query']('', '
SELECT b.id_board
FROM {db_prefix}boards AS b
WHERE ' . $user_info[$see_board] . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : '') . '
AND b.id_board != {int:test_board}',
array(
'recycle_board' => (int) $modSettings['recycle_board'],
'test_board' => 24,
)
);
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Deprecated

Hey Johnny that's a slick fix! I'm glad this change has been pushed fairly low on my TODO list because your change looks better. :)

Thanks!

Deprecated

Johny, thank you so very much!!! That patch worked slicker than snot on a door knob!!! :D :D :D

Perfect, man, perfect!!!

Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Deprecated

This is such a good idea that I'm tempted to code up an interface in the admin panel so you can select which board to ignore. The only thing that prevents this from being submitted to the mod site is that you have to manually enter the board number. The interface would fix that.

I've written a few PHP interfaces to SQL but SQL is definitely not my thing. I really appreciate your helpful suggestion.

Thanks again! Great fix! :)

Advertisement: