Keyword

Features Added :: Mod Tools (UNOFFICIAL)

More
13 years 3 months ago - 13 years 3 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
13 years 3 months ago - 13 years 3 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
13 years 2 months ago - 13 years 2 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
13 years 2 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
13 years 2 months ago - 13 years 2 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
13 years 2 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
13 years 2 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
13 years 2 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
13 years 2 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
13 years 18 hours ago - 13 years 18 hours 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.

More
12 years 11 months ago #63611 by Manoj Goel
Replied by Manoj Goel on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Hey Generic, you have done a good job, but it is useless to try. Because it don't display related items from same category on item pages, which is the most important. On item pages it just display blank module.

This module will become most useful when it display related items from same category on the item pages and show nothing on other pages, just like K2 Split Content module. Only drawback of k2 Split content is that it display Related items by Tags instead of category.

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

More
12 years 11 months ago #63612 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Hi Manoj Goel

Thanks for the feedback, I too see the advantages of the module working on items.
The code at present looks to the category for items when you are in an item you are no longer in the category.

Another function would need to be added to look for other items in the same category as the item being viewed, if you are a coder please have a go I don't have the time at present to look for a solution.

I got round this (though not ideal) by adding the breadcrumbs module to items.

If you or your clients can keep on top of tagging then the split content module is ideal, in my case I had over a 1,000 untagged items to import and without Mod Tools (UNOFFICIAL) there would have been no easy way to create navigation to these items.

Generic

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

More
12 years 11 months ago #63613 by Manoj Goel
Replied by Manoj Goel on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Hi Generic,
On Joomla extension directory I found a module K2 Related content. It is a nice module as it can show the list of related articles from same category on item/article page, and shows nothing on other pages. Its perfect for me.

About Your Modified Module : - Your modified module shows the item/articles list in ascending or descending list on category pages. Presently it is not useful, but it can be very useful if it can show "MOST POPULAR ARTICLES" of the same category on category pages, and show nothing on other pages.

I am not a coder but I can do a lot if you can give me hint on how to add feature to show articles by popularity.

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

More
12 years 11 months ago #63614 by Generic
Replied by Generic on topic Re: Features Added :: Mod Tools (UNOFFICIAL)
Manoj

I did look at the K2 Related content module but could not get this to work on Joomla 2.5, please let me know if you get it working (the module may have since been updated).

The 'Mod Tools (UNOFFICIAL)' has the same 'order by' options as the original K2 Mod Tools

Default (by ID - ascending)
Reverse default (by ID - descending)
Name alphabetical
Name reverse alphabetical
Ordering

Adding an option for popularity should be quite straightforward.

Generic

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


Powered by Kunena Forum