Recent Topics

[Solved] [2.4.0] Selecting multiple categories

Started by on Feb 23, 2008 – Contents updated: Feb 23, 2008

Feb 23, 2008 15:26    

If I select multiple categories using the checkboxes in the category list like I always did in other versions of b2evolution.....nothing happens ! Did any other users have the same problem (I didn't find anything about it when searching this forum) ? Or could it be that I did something wrong when upgrading ?

Feb 23, 2008 15:31

Got a link to your blog?

More importantly: is this happening with an unmodified 'custom' skin from the 1.10.3 package?

Feb 23, 2008 15:36

This is a known bug and I am not sure if it is fixed in the core. It is been a bug since 1.6. So if nobody fixed it, it is still a bug. To my knowledge you are only the third asking for it.
Never mind.
There is a hack in the forums. I made it. Last time I looked for it, I couldn't find it. So do keep searching. If need be I can redo the hack.

Good luck

Feb 23, 2008 16:46

It happens with all the unmotified 2.x. skins in b2evolution vers. 2.4.0.

For the fun of it I just downloaded your "cultb2" skin - I wanted too see what would happen with a non-2.x. skin. Result:

"An unexpected error has occured!
If this error persits, please report it to the administrator.

Go back to home page

Additional information about this error:
The skin [cultb2] set for blog [Blog All] does not exist. It must be properly set in the blog properties or properly overriden in a stub file."

Now, I could't get to the homepage/blogs at all. I could only go to the backoffice and here I tried to remove the problematic skin. However, it is not possible to remove any of the skins I downloaded myself (No red X) and therefore I removed the "cultb2" in my cpanel.

But that didn't change anything. I still can't go to the homepage/blogs and I still get the error message above.

Perhaps I'll now leave my computer for a while....When I come back I might reinstall my b2evolution and look in this forum for the hack you just mentioned.

Feb 23, 2008 17:02

Before you can remove a skin you have to make sure it is not selected as the skin for any blog. I'm pretty sure that's the way it works...

Feb 23, 2008 17:14

Amazing: A fool like me :> is automatically being prevented from making biiiiig mistakes in b2evolution !

Thank you for the message above that turned out to save my good mood for today

Feb 23, 2008 17:29

I guess I'll have to fire up the equipment to do some hacking.

*edit*
Wait a minute, do you mean backoffice or in the blog itself? The category selector in the backoffice (Dashboard) should function the same way you are used to and f you are having problems there, recheck if all the files are uploaded correctly (simply upload everything again).

The Bug in the blog itself is a feature that is rarely used. You can make the visitor select multiple categories to view and search. This gives the same effect as in the repositories: http://skins.b2evolution.net/ The bug is that the final "Get Selection" button simply is not there.

Feb 23, 2008 18:15

It is in the blogs themselves (and not in the backoffice) that I've met the problem. And you're right: There is no final "Get Selection" button why I've just been trying with "Enter"

In my b2evolution this category selector is a very important thing so I'd appreciate a good hack. Also, as I wrote in another topic, I'd appreciate a possibility of selecting both/and categories.

Feb 23, 2008 18:25

OK,

This is the post I was looking for: http://forums.b2evolution.net/viewtopic.php?t=9750 . Unfortunately this will be a bit of a puzzle to get going in 2.x, but I am working on it. Mind that I need to go shopping and have a proper dinner as well, so expect something in a few hours from now.

Feb 23, 2008 20:29

Hi dk, while searching I found your other post also, which makes you the second and not the third who ever asked for this feature. What's remarkable also, is that this bug is now confirmed to have lived all the way from 1.6.2 to 2.4.1 and nothing changed although the complete plugin / widget has been rewritten.
Luckily the hack worked in 2.4 as it did in 1.10. The bad part is that the plugin is now inside the core. So the easiest way is to present you the file you want to replace. Do have a look at it, I annotated the parts I changed.
This file replaces: /blog/inc/widgets/widgets/_coll_category_list.widget.php
download: [url=http://www.blog.hemminga.net/media/_coll_category_list.widget.zip]_coll_category_list.widget.zip[/url]
24 feb - 16:22 New version fixes bug

Good luck

Submitted as bug: [url=http://forums.b2evolution.net/viewtopic.php?t=14544][2.4] Category selector presented without submit button[/url]

Feb 23, 2008 22:10

Currently, in versions it works in, "ALL" means "all posts that match any of the selected categories". I believe the desire is for ALL to mean "all posts that match include the selected categories".

So like if I pick CAT1 and CAT5 then I would not get a post in CAT1 and CAT2 because it does not meet both the selections I asked for.

Sort of like currently we can have "ALL that match at least one" but the desire is for "ALL that match everything selected"

Feb 23, 2008 22:54

Hi Afwas

What I mean by the possibility of selecting BOTH AND categories instead of ANY (either/or), ANY BUT (either/or except) and ALL is explained very well in the text that goes with the hack called "Category behavior" in the list of b2evolution plugins, I think:

This hack changes the way items are returned when readers select multiple categories using the checkboxes in the category list. The default behavior is to return posts that are assigned to any of the checked categories. This hack allows you (or the reader) to [u]make the blog only return posts that match all of the selected categories[/u]. You can (no longer) see it in action here at the Plugins Repository. If you want to find all of the rendering hacks for version 0.9.0.x, you could (until recently) select those three categories, and the list would only return posts that matched all three

In regard to the widget file: I followed your instructions and found that the new file included the perfect solution of my problem - in my "Blog All" only. The new buttom "Get selection" also appeared in my other blogs but from here I was sent back to an empty "Blog All" everytime I tried to select multiple categories.

With these words I'll say that I'm already overwhelmed by the quality of this b2evolution support forum, so.....could I actually be wanting more ? ;)

Feb 23, 2008 22:57

Hi EdB

Exactly !

PS: I didn't see your last post before I submitted my own.....

Feb 23, 2008 23:12

Hi dk,

For the widget problem, try this. Go to Dashboard -> Blog settings -> <yourblog> -> URLs -> Blog URL and set Blog base URL to "Explicit param on index.php" or experiment with this setting until it (hopefully) works on other blogs than the All blog. Please report back to this topic.

I am looking into the both/and thing, but that looks far more complicated than a logical selector. That's because a database query needs to be formed. If you are interested, this is the code.
/inc/core/ui/_itemquery.class.php lines 172-193:

		compile_cat_array( $cat, $catsel, /* by ref */ $cat_array, /* by ref */ $cat_modifier, /* TODO $blog == 1 ? 0 : */ $blog );

		if( ! empty($cat_array) )
		{	// We want to restict to some cats:
			if( $cat_modifier == '-' )
			{
				$eq = 'NOT IN';
			}
			else
			{
				$eq = 'IN';
			}
			$whichcat = 'postcat_cat_ID '. $eq.' ('.implode(',', $cat_array). ') ';

			// echo $whichcat;
			$this->WHERE_and( $whichcat );

			if( $cat_modifier == '*' )
			{ // We want the categories combined! (i-e posts must be in ALL requested cats)
				$this->GROUP_BY( $this->dbIDname.' HAVING COUNT(postcat_cat_ID) = '.count($cat_array) );
			}
		}

Feb 24, 2008 12:48

:'(

In Dashboard I've now been trying to solve the widget problem - without any luck.

I don't feel too familiar with the lot of new possibilities here and the new "array language" in the 2.x files makes me feel like an analphabet, even though I used to be in quite good control of my old 0.9 version....

PS: Which file(s) should be changed, if one wishes the post links to be attached to the post titles like they used to be ? And erase the new line in the posts: "Link: ..."

Feb 24, 2008 16:24

Hi dk,

Do download the file again. The behaviour you reported turned out to be a bug. Thanks to ¥åßßå that is solved now.

Good luck

Feb 24, 2008 18:57

dk wrote:

PS: Which file(s) should be changed, if one wishes the post links to be attached to the post titles like they used to be ? And erase the new line in the posts: "Link: ..."

This would be material for a new post, that way your problem will get more exposure ( and your post count will go up so you'll be nearer a groovy user title change .... it's all good :D ), not everyone reads threads with more than ## posts ;)

¥

Mar 17, 2008 09:03

Afwas wrote:

I am looking into the both/and thing, but that looks far more complicated than a logical selector. That's because a database query needs to be formed. If you are interested, this is the code.
/inc/core/ui/_itemquery.class.php lines 172-193:

		compile_cat_array( $cat, $catsel, /* by ref */ $cat_array, /* by ref */ $cat_modifier, /* TODO $blog == 1 ? 0 : */ $blog );

		if( ! empty($cat_array) )
		{	// We want to restict to some cats:
			if( $cat_modifier == '-' )
			{
				$eq = 'NOT IN';
			}
			else
			{
				$eq = 'IN';
			}
			$whichcat = 'postcat_cat_ID '. $eq.' ('.implode(',', $cat_array). ') ';

			// echo $whichcat;
			$this->WHERE_and( $whichcat );

			if( $cat_modifier == '*' )
			{ // We want the categories combined! (i-e posts must be in ALL requested cats)
				$this->GROUP_BY( $this->dbIDname.' HAVING COUNT(postcat_cat_ID) = '.count($cat_array) );
			}
		}

I wanted to look at it, but in my "/inc/core/ui/..." I found no file called "_itemquery.class.php " :?:

Mar 17, 2008 11:54

/inc/items/model/ I was way off.


Form is loading...

Secure CMS – This forum is powered by b2evolution CMS, a complete engine for your website.