Welcome to Geeklog Sunday, October 17 2021 @ 03:48 pm EDT

Geeklog Forums

Glossary


Status: offline

remy

Forum User
Full Member
Registered: 09/06/03
Posts: 161
Location:Rotterdam & Bonn
I am re-developing the Glossary plugin. This plugin has some configuration, and a few items are suitable to have them personalised. I'm thinking of adding an additional tab in the myAccount page for these configuration values, as opposed to create a dedicated configuration script.

Is this possible, and, when yes, how could that be done?

it means also to have some storage in the user tables. Does this fit in the Geeklog core?
( I am aware of plugins that create custom user pages. )
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1438
Yup that is possible you can add a tab or to a section on the My Account page. The Forum plugin does this. You can check it out to see what API it uses to insert the required fields into the My Account page along with displaying the information on the User Profile page.

Look for functions like:
plugin_profileextrassave_forum
plugin_profilevariablesedit_forum
plugin_profilevariablesdisplay_forum

You can't store data directly into the Geeklog users table. What you would have to do is create your own table with a user id and then the columns you need for your data. From there you would have to use the Geeklog API so your plugin will be notified when a user is added, updated or deleted (so if need be you can update your table. The forum plugin has this functionality as well. It is stored in its functions.php file.

Look for functions like:
plugin_user_create_forum
plugin_user_delete_forum

There are probably more API functions that help with this type of stuff (I can't remember off the top of my head). Look in the /system/lib-plugins.php file for similar type of API functions.

Sorry about not having a well written doc on how to use the API.
One of the Geeklog Core Developers.
 Quote

Status: offline

remy

Forum User
Full Member
Registered: 09/06/03
Posts: 161
Location:Rotterdam & Bonn
Thank you so much for the clear hints.

Found the api's, and tested them here; the extra data fields works in the profile page, but not in the myAccount page.
Though the forum clearly uses the api. But the forum has its own scripts too for maintaining the user prefs.

In here, the forum preferences display weird options by its own scripts. So I do suspect that the templates are not updated. F.i. the profile template in layout/theme/preferences contains none option to add a tab. Neither it contains variables to show the api-added content
And the profile template in layout/theme/users does contain variables to show (but not edit) the api-added content.

But the idea works and is nice.
 Quote

All times are EDT. The time is now 03:48 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content