Keyword

Show registered item summary to public

  • Prashanth
  • Prashanth's Avatar Topic Author
  • Offline
  • New Member
More
14 years 10 months ago #86410 by Prashanth
Show registered item summary to public was created by Prashanth
Hi,
I would like to be able to show items marked for registered users only in the category listing even for public users. That was the public users get to see a summary of the article and on clicking read more they are asked to register. Kindly let me know which file i need to edit to be able to do this.

Thanks
Prashanth

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

More
14 years 10 months ago #86411 by Jiliko.net
Replied by Jiliko.net on topic Show registered item summary to public
Hi Prashanth,

You can do that :

- Override K2 template to avoid k2 core files modification and K2 update problem : doc here
- Modify item.php and category.php of your K2 template to test if a registered user is connected and display what you want (full text or summary+registration link).

Olivier

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

  • Prashanth
  • Prashanth's Avatar Topic Author
  • Offline
  • New Member
More
14 years 10 months ago #86412 by Prashanth
Replied by Prashanth on topic Show registered item summary to public
Hi Olivier,

What i wanna do is display items marked for registered users only in the category listing. In category.php, i donot see any code where there is a check for the access right of the item. No matter what the access rights of the item be, i wanna show it in the category listing. Can you tell me as to where are the access rights for a particular item checked?

Thanks
Prashanth

Olivier Nolbert said:Hi Prashanth,
You can do that :

- Override K2 template to avoid k2 core files modification and K2 update problem : doc here
- Modify item.php and category.php of your K2 template to test if a registered user is connected and display what you want (full text or summary+registration link).

Olivier

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

  • Prashanth
  • Prashanth's Avatar Topic Author
  • Offline
  • New Member
More
14 years 10 months ago #86413 by Prashanth
Replied by Prashanth on topic Show registered item summary to public
I just modified the getData() function under models/itemlist.php to not check for access id and that did the trick for me as i would like any user to see the item list but access to the full article must be restricted.

Prashanth said:Hi Olivier,

What i wanna do is display items marked for registered users only in the category listing. In category.php, i donot see any code where there is a check for the access right of the item. No matter what the access rights of the item be, i wanna show it in the category listing. Can you tell me as to where are the access rights for a particular item checked?

Thanks
Prashanth

Olivier Nolbert said:Hi Prashanth, You can do that :

- Override K2 template to avoid k2 core files modification and K2 update problem : doc here
- Modify item.php and category.php of your K2 template to test if a registered user is connected and display what you want (full text or summary+registration link).

Olivier

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

More
14 years 10 months ago #86414 by Jiliko.net
Replied by Jiliko.net on topic Show registered item summary to public
Prashanth,

Sure, your solution works but now, you have to care about K2 updates which could/will override your modifications.

In category.php, which processes display of the category listing, you have to add the access right code. By doing this in your own K2 template, you don't have to care about future K2 updates.

Olivier

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

  • Prashanth
  • Prashanth's Avatar Topic Author
  • Offline
  • New Member
More
14 years 10 months ago #86415 by Prashanth
Replied by Prashanth on topic Show registered item summary to public
Hi Olivier,

I dont understand how i can modify category.php.
The list of items category.php would receive will not have the items marked for registered users and the getData function would perform an SQL query for only items marked for public users. So in category.php, i will not be able to do anything as i donot have the items in the first place.

Am i missing something here.

Thanks
Prashanth

Olivier Nolbert said:Prashanth,
Sure, your solution works but now, you have to care about K2 updates which could/will override your modifications.

In category.php, which processes display of the category listing, you have to add the access right code. By doing this in your own K2 template, you don't have to care about future K2 updates.

Olivier

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

More
14 years 10 months ago #86416 by Jiliko.net
Replied by Jiliko.net on topic Show registered item summary to public
Hi Prashanth,

What do you mean by 'marked item', how do you do that ?

In the category.php, you can add code to test if a user is connected, and if so, displaying the item full text.

Maybe i am missing something too.

Olivier

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

  • Prashanth
  • Prashanth's Avatar Topic Author
  • Offline
  • New Member
More
14 years 10 months ago #86417 by Prashanth
Replied by Prashanth on topic Show registered item summary to public
I want the guest users to be able to see all the items in the category listing (including items whose access rights are set to registered). But when the guest user clicks on read more, he should not be able to see the complete article but should be asked to go register / login

In K2 if an item has access rights of registered, the category listing would not show the item to guest users. This is because under model/itemlist.php the SQL query gets only the items whose access id is <= the users access id.

This is why i had to modify the SQL query itself as I would be unable to do anything in category.php.

Can you think of any other way that i could have done this?

Olivier Nolbert said:Hi Prashanth,
What do you mean by 'marked item', how do you do that ?

In the category.php, you can add code to test if a user is connected, and if so, displaying the item full text.

Maybe i am missing something too.

Olivier

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

More
14 years 10 months ago #86418 by Jiliko.net
Replied by Jiliko.net on topic Show registered item summary to public
Prashanth,

Sure, i've missed a thing, a BIG thing :-)

Your solution is the only one, unfortunately...

Olivier

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

More
14 years 5 months ago #86419 by ehsan rezazadeh
Replied by ehsan rezazadeh on topic Show registered item summary to public
hi

im not very professional in programming .i have the same problem too.

can u help me to solve it step by step?

how can i show the registered item title to global users?

 

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

More
14 years 5 months ago #86420 by Olivier Karfis
Replied by Olivier Karfis on topic Show registered item summary to public
Hi.

 

Without having to modify any code, I found that Dioscouri's "Hider" plugin works pretty well do this kind of thing (and actually allows more flexibility like allowing you to display customized "call-to-action" to guest users accessing a registered only item. 

 

NOTE: this does not work if you enable full content in the RSS feed so be careful (but if you only display your intro in the RSS feed you should be OK).

 

extensions.joomla.org/extensions/access-a-security/content-restriction/6004

 

--Olivier ehsan rezazadeh said:

hi

im not very professional in programming .i have the same problem too.

can u help me to solve it step by step?

how can i show the registered item title to global users?

 

Owner of www.FrenchToday.com - K2 fan and freelancer, runs the Joomla/K2 tip site: www.yanaku.com

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

More
14 years 5 months ago #86421 by ehsan rezazadeh
Replied by ehsan rezazadeh on topic Show registered item summary to public
 thank u its work.

 

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

More
13 years 8 months ago #86422 by Mantas Phunk
Replied by Mantas Phunk on topic Show registered item summary to public
Prashanth,

Maybe You can share your modifications? It's very urgent 

 

Thank You in Advice.

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

More
13 years 8 months ago #86423 by Mantas Phunk
Replied by Mantas Phunk on topic Show registered item summary to public
I think for people with big knowledge of php it would not be hard task. i found that then i rout my module to category it shows all articles and default k2 blog listing, checks is user loged in.. Please somebody look for a solution how to bypass that check, so I will get all articles listed. Thank You !

 

K2 is great!

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

More
11 years 6 months ago #86424 by Gerald Moore
Replied by Gerald Moore on topic Re: Show registered item summary to public
How do I do this?

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

More
8 years 4 months ago #159992 by Mars Cureg
Replied by Mars Cureg on topic Show registered item summary to public
Anyone can just reply with the correct codes and modification here?

I need this to be fix on our website

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #160005 by Krikor Boghossian

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


Powered by Kunena Forum