Keyword

K2 tool Latest Item : Code hack required PLEASE

  • Kalbir B Bir
  • Kalbir B Bir's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90781 by Kalbir B Bir
Hello, I have enabled the K2 tool Latest Item option on my footer at www.kalveer.com.   I get by default only the Latest Item posted by the Authors. But i want it to show The Latest 4 posts by the author instead of just 1. I looked into the code at modules\mod_k2_tools\helper.php line 75 which calls a sql query for the latest Item. $query = "SELECT COUNT(*) FROM #__k2_items  WHERE {$where} published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 AND access<={$aid} AND created_by_alias='' AND created_by={$row->created_by} AND EXISTS (SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access<={$aid} )";can someone give me a sql query which calls the latest 4 items please? and is this the only code i should edit to work this? 

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

More
13 years 10 months ago #90782 by william white
Replied by william white on topic K2 tool Latest Item : Code hack required PLEASE
I havent tried that but you could use mod_k2 content to do the same thing easily

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

  • Kalbir B Bir
  • Kalbir B Bir's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90783 by Kalbir B Bir
Replied by Kalbir B Bir on topic K2 tool Latest Item : Code hack required PLEASE
Thanks William. Thats just what i wanted. I feel stupid for going all the way inside the code to get this done when it was right in front of me.

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


Powered by Kunena Forum