Keyword

Disable "featured" for registered users when adding items

  • Enrico Ardito
  • Enrico Ardito's Avatar Topic Author
  • Offline
  • New Member
More
14 years 9 months ago #75839 by Enrico Ardito
It would be useful to add 'can make an item featured' permission in K2 backend in 'user groups' tab to prevent registered users (bloggers?) to not be able to make an item featured.

Thanks.

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

More
14 years 9 months ago #75840 by rexkramer
Sounds useful! I agree with you.

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

More
14 years 9 months ago #75841 by Josh
good idea, hopefully in the next release. I would find this really helpful too.

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

More
14 years 2 months ago #75842 by Jiliko.net
Hi guys,

You can do this by copying 'components/com_k2/views/item/tmpl/form.php' to 'templates/YOUR_JOOMLA_TEMPLATE/html/com_k2/item/form.php'.

Joomla & K2 will auto load this file instead of the original K2 file when a user will add an article in frontend. Just edit this file and delete featured code.

Olivier

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

More
14 years 1 month ago #75843 by Jiliko.net
You can do that with this piece of code :

$user = &JFactory::getUser();

if ($user->gid >23) { //user is admin
//Featured code
}

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

More
14 years 1 month ago #75844 by Jiliko.net
The copy step is just to avoid modify k2 component original files.

By copying the file and modifying the one in your Joomla template, you won't be worried by K2 updates...

Olivier

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

More
14 years 1 week ago #75845 by Scott Osteen
I'm a bit of a newb, but i think i can do this. Do I first copy 'components/com_k2/views/item/tmpl/form.php' to 'templates/YOUR_JOOMLA_TEMPLATE/html/com_k2/item/form.php'.
and then add the code listed below?

And where do insert this code?


Olivier Nolbert said:You can do that with this piece of code :
$user = &JFactory::getUser();

if ($user->gid >23) { //user is admin
//Featured code
}

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

More
14 years 6 days ago #75846 by Jiliko.net
Hi Scott,

That"s exactly what you have to do...

In 2.3, the code is @lines 293-294

Just have to put these 2 lines between your test...

Olivier

Scott Osteen said:I'm a bit of a newb, but i think i can do this. Do I first copy 'components/com_k2/views/item/tmpl/form.php' to 'templates/YOUR_JOOMLA_TEMPLATE/html/com_k2/item/form.php'. and then add the code listed below?

And where do insert this code?


Olivier Nolbert said:You can do that with this piece of code : $user = &JFactory::getUser();

if ($user->gid >23) { //user is admin
//Featured code
}

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

More
14 years 6 days ago #75847 by Scott Osteen
I'm fairly sure I just screwed it up. Any chance i could get you to fix it for me?

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

More
14 years 6 days ago #75848 by Jiliko.net
Scott,

Here's the modified form.php

Olivier

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


Powered by Kunena Forum