- Posts: 10
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Disable "featured" for registered users when adding items
Disable "featured" for registered users when adding items
- Enrico Ardito
- Topic Author
- Offline
- New Member
Less
More
14 years 9 months ago #75839
by Enrico Ardito
Disable "featured" for registered users when adding items was created 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.
Thanks.
Please Log in or Create an account to join the conversation.
- rexkramer
- Offline
- Senior Member
Less
More
- Posts: 71
14 years 9 months ago #75840
by rexkramer
Replied by rexkramer on topic Disable "featured" for registered users when adding items
Sounds useful! I agree with you.
Please Log in or Create an account to join the conversation.
- Josh
- Offline
- Senior Member
Less
More
- Posts: 63
14 years 9 months ago #75841
by Josh
Replied by Josh on topic Disable "featured" for registered users when adding items
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.
- Jiliko.net
- Offline
- Platinum Member
Less
More
- Posts: 567
14 years 2 months ago #75842
by Jiliko.net
Replied by Jiliko.net on topic Disable "featured" for registered users when adding items
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
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.
- Jiliko.net
- Offline
- Platinum Member
Less
More
- Posts: 567
14 years 1 month ago #75843
by Jiliko.net
Replied by Jiliko.net on topic Disable "featured" for registered users when adding items
You can do that with this piece of code :
$user = &JFactory::getUser();
if ($user->gid >23) { //user is admin
//Featured code
}
$user = &JFactory::getUser();
if ($user->gid >23) { //user is admin
//Featured code
}
Please Log in or Create an account to join the conversation.
- Jiliko.net
- Offline
- Platinum Member
Less
More
- Posts: 567
14 years 1 month ago #75844
by Jiliko.net
Replied by Jiliko.net on topic Disable "featured" for registered users when adding items
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
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.
- Scott Osteen
- Offline
- New Member
Less
More
- Posts: 15
14 years 1 week ago #75845
by Scott Osteen
Replied by Scott Osteen on topic Disable "featured" for registered users when adding items
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
}
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.
- Jiliko.net
- Offline
- Platinum Member
Less
More
- Posts: 567
14 years 6 days ago #75846
by Jiliko.net
Replied by Jiliko.net on topic Disable "featured" for registered users when adding items
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
}
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.
- Scott Osteen
- Offline
- New Member
Less
More
- Posts: 15
14 years 6 days ago #75847
by Scott Osteen
Replied by Scott Osteen on topic Disable "featured" for registered users when adding items
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.
- Jiliko.net
- Offline
- Platinum Member
Less
More
- Posts: 567
14 years 6 days ago #75848
by Jiliko.net
Replied by Jiliko.net on topic Disable "featured" for registered users when adding items
Scott,
Here's the modified form.php
Olivier
Here's the modified form.php
Olivier
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Disable "featured" for registered users when adding items