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.

2
  • 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, 2014 at 13:45
  • Thanks @johanpw for correcting my question now it looks fine.. Dec 15, 2014 at 2:37

1 Answer 1

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

1
  • Thanks for your answer your it is very use-full for my work since now there is no error. Dec 15, 2014 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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