Keyword

Features Added :: Mod Tools (UNOFFICIAL)

More
12 years 6 months ago - 12 years 6 months ago #63601 by Jason
Made a few additions to K2's mod_tools to include the following:

Modified Category List Menu Mode:
+ Added Auto/Manual Category Detection to Category List Menu Mode: Will automatically detect the current category or set it manually.
+ Optional list ID option for the Category List Menu Mode.
Added new Mode: Article List Menu with identical features to the Category List Menu Mode
+Auto/Manual Category Detection
+Optional ul#id css selector

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago - 12 years 6 months ago #63602 by Jason
Replied by Jason on topic Re: Features Added :: Mod Tools
If its of interest, I will produce a diff report of everything I've added/changed/removed for review. If not, I attached the module here.


Rather than try to install the module - copy the contents over to your devbed and overwrite the originals.
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago - 12 years 6 months ago #63603 by Jason
Replied by Jason on topic Re: Features Added :: Mod Tools
Bump...

getk2.org interface for adding extensions is broken.

PS> K2 team... Any interest in adding these modifications to the official mod tools?

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #63604 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Hi Jason

Lovely work, I was just about to add the same features.

I have merged the changes into K2 2.5.5 and added K2_ARTICLES_LIST_MENU="Articles List (Menu)" to the language file.

Generic
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago - 12 years 6 months ago #63605 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Hi Jason

Seems to be randomly adding in another category/article list, I have had a good look at my categories and articles but can't seem to find any relationships to cause this, any ideas.

In my attached screen shot the level1 articles are in a separate category yet the list is pulling them in and setting the level to 0 makes no difference. This is also happening for the categories list in some parts of my site.

Generic

### UPDATE & WARNING ###

I have found the bug, what appears to be happening is that the random bits are actually items from a category set to registered access but where the items themselves are still set to public.

Joomla access levels work so that the items automatically inherit access levels from the category but this mod is not abiding to this and allowing access restricted content to be publicly viewable.
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #63606 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Okay so I am desperately trying to work this out, basically we need to add a way of checking the items category for access level in the helper.php any ideas of what I could add to this function for this?
function hasItems($id) {

		$mainframe = &JFactory::getApplication();
		$user = &JFactory::getUser();
		$aid = (int) $user->get('aid');
		$id = (int) $id;
		$db = &JFactory::getDBO();
		$query = "SELECT * FROM #__k2_items  WHERE catid={$id} AND published=1 AND trash=0 ";
		if(K2_JVERSION=='16'){
			$query .= " AND access IN(".implode(',', $user->authorisedLevels()).") ";
			if($mainframe->getLanguageFilter()) {
				$languageTag = JFactory::getLanguage()->getTag();
				$query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
			}

		}
		else {
			$query .= " AND access <= {$aid}";
		}

		$db->setQuery($query);
		$rows = $db->loadObjectList();
		if ($db->getErrorNum()) {
			echo $db->stderr();
			return false;
		}

		if (count($rows)) {
			return true;
		} else {
			return false;
		}
	}

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #63607 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Updates and Fixes including the above bugs I reported previously.

See README file in the zip for changelog, this is now working really well hope it gets added to a future K2 release.

I would like to add a limit (like item count in mod_k2_content) setting to the Category and Article lists. I will try and find some time for this but if anyone wants to help that would be great.

I check this forum every few days so post if you find any bugs, please K2 admin add a PM option to this forum

Generic
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #63608 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Now added list limit options for Category and Article lists.

Example: set limit to 5 and show the most recent 5 articles related to the category being viewed. Nice!

Generic
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #63609 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Fixed Articles List ordering not working when using a level other than 0
See README.txt in Zip
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago - 12 years 3 months ago #63610 by Jason
My apologies, I was oblivious to any responses on this topic... Catching up here...


Awesome Work GENARIC !!!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum