3

We are developing a Joomla site where different types of articles will be posted and the users will bookmark the article to their user account and display it in their user profile.

If there is a recommended way to create this function or coding we are ready to do that, if not is there any module supporting this feature?

The table format for this bookmark feature is

arti_id | date_added | user_id | time_added | status 

the
arti_id -> Aritcal ID
status -> Public / Private

Others are common.

  • There's no such feature like this built into Joomla - the JED has several at extensions.joomla.org/extensions/content-sharing/…, but the rated ones all appear to be paid extensions. I'd be interested in what answers come in for the question though :) – GDP Dec 11 '14 at 13:45
  • Thanks @johanpw for correcting my question now it looks fine.. – Santhosh Kumar Dec 15 '14 at 2:37
2

Personally, I would suggest you create a plugin for this.

I'm not going to write it out for you, but will show you the concept.

  1. Create your base plugin and to help, follow the documentation here
  2. Create your database table with the columns you specified in your question.
  3. Your first function will need to add a bookmark button to all articles and should be done using the onContentPrepare event.
  4. The second function should capture the button click and run a database query to add the bookmark. You can caption the user object and ID easily using the code below:

    $user = JFactory::getUser();
    $user_id = $user->id;
    

I assume you will also want to display a user's bookmarks somewhere. For this, I would suggest creating a simply modules that runs a database query, getting all results which match the $user->id; with the ID in user_id column in your database.

Hope this points you in the right direction

  • Thanks for your answer your it is very use-full for my work since now there is no error. – Santhosh Kumar Dec 15 '14 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.