Remove blocks from categories

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

yes i did purge the cache oterwise the single will not work also and that is working.
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Remove blocks from categories

Post by warmweer »

thecoalman wrote: Tue Nov 17, 2020 6:35 pm
To specify a group of topic ID's try:

Code: Select all

<!-- IF topicrow.TOPIC_ID != 123 or topicrow.TOPIC_ID != 456 or topicrow.TOPIC_ID != 789 -->
Perhaps the problem is the boolean clause

The code will be executed if the condition (as it is formulated) returns TRUE
topic_id = can only be one number, so at least 2 of those (sub)statements return TRUE, and the code will always be executed

<!-- IF topicrow.TOPIC_ID = 123 or topicrow.TOPIC_ID = 456 or topicrow.TOPIC_ID = 789 -->

In this case only 3 possible topic_ids will return TRUE

Perhaps it would be easier to use a clause like

If topic_id IN (123, 456, 789) then "do something abnormal"
I'll leave the exact formulation up to the coders
Last edited by warmweer on Tue Nov 17, 2020 8:20 pm, edited 1 time in total.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

I Think you are right. Because <!-- IF topicrow.TOPIC_ID != 456 --> is working but <!-- IF topicrow.TOPIC_ID != 123 or topicrow.TOPIC_ID != 456 --> Not
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Remove blocks from categories

Post by thecoalman »

Yes, that was poor example from me but he needs to exclude those ID's. Using this would require using else?

Code: Select all

<!-- IF topicrow.TOPIC_ID = 123 or topicrow.TOPIC_ID = 456 or topicrow.TOPIC_ID = 789 -->
e.g.

Code: Select all

<!-- IF topicrow.TOPIC_ID = 123 or topicrow.TOPIC_ID = 456 or topicrow.TOPIC_ID = 789 -->
<!-- ELSE -->
Not sure how else you would do that within the template limitations.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Remove blocks from categories

Post by Brf »

MrAnonymous wrote: Tue Nov 17, 2020 8:17 pm t <!-- IF topicrow.TOPIC_ID != 123 or topicrow.TOPIC_ID != 456 -->
That should be "and" not "or".
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

Hey Guys good news.

<!-- IF topicrow.TOPIC_ID != 465 and topicrow.TOPIC_ID != 464 --> This is working without Else.

That is working !! Yippie.

Now i want to know how to hide this in a categorie because <!-- IF topicrow.FORUM_ID != 14 --> is not working at the moment.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Remove blocks from categories

Post by Brf »

If forum 14 is a category, then it has no posts.
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

How do you call it then.

/viewforum.php?f=14 This is showing also blocks i want to hide. Now i can only hide the topics with <!-- IF topicrow.TOPIC_ID != 465 and topicrow.TOPIC_ID != 464 --> and finally that is working, i feel we are so close. Thanks all for the help so far.
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

If topic_id IN (123, 456, 789) this is interesting, And mayby if we put in here If forum_id IN (12, 45, 78) can also work i guess. But the question is how to put this in an working code line ?
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Remove blocks from categories

Post by warmweer »

MrAnonymous wrote: Tue Nov 17, 2020 9:28 pm If topic_id IN (123, 456, 789) this is interesting, And mayby if we put in here If forum_id IN (12, 45, 78) can also work i guess. But the question is how to put this in an working code line ?
php and true SQL aren't my strong point and I always have to search for the correct syntax and then the sweating starts and the cursing at the screen so I'll refrain frorm trying to give precise instructions (which would probably be incorrect anyway) but:

you could create an array, fill in the data, and then use in_array

$myAry = [forum_id1, forum_id2, etc...];

and

in_array( aforum_id, $myAry);

use echo in_array( aforum_id, $myAry); to test if the result is the expected result
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

I am not a coder so i cannot help or test it out, maybe somebody read this and can give a working code to try out.
MrAnonymous
Registered User
Posts: 25
Joined: Tue Oct 13, 2020 3:01 pm

Re: Remove blocks from categories

Post by MrAnonymous »

Hi Guyz i want to release my forum soon, so my question is there somebody who is willing to help us out with this question ?
Post Reply

Return to “[3.2.x] Styles Support & Discussion”