Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 02:35 pm EST

Geeklog Forums

Creating a data input form and integrating into Geeklog


Status: offline

elvis

Forum User
Newbie
Registered: 06/14/07
Posts: 2
Hi everybody!

I would like to create a data input form and integrate it into Geeklog.

Because I would like certain data to appear automatically (like user full name from gl_users table and data from one more field from table, let's call it XY, which I manually added in database), I thought the process would look like this:

1. check user session
2. get user id from session
3. get user data from id
4. show this data in form (full name from table gl_users, user id from manually added table XY)

I noticed that there are a certain functions in lib-sessions.php (function SESS_sessionCheck, function SESS_getUserIdFromSession, function SESS_getUserData, function SESS_getUserDataFromId) which I think would do the job.

But because of my lack of php knowledge I can't put together a working script. I tried to do something but with no success.

The form would like this:

form field 1: username (automatically shown from field fullname in table gl_users)
form field 2: user id (automatically shown from manually added table XY, not from gl_users)
form field 3: data XY (form to input data into table XY)
form field 4: datetime (form to input data into table XY)

I managed to test how to add data into tables, but I don't know how to more "complicated" stuff, like the script that would check and return certain data with a help of existing Geeklog php functions.

I know it's more like php question rather than Geeklog issue, but I would really like to improve my Geeklog site, but I don't have a php knowledge to do that.

Thanks in advance for helping me out.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Actually, all the data you need is in the global $_USER array (to which you have access when you include lib-common.php). $_USER['username'], $_USER['uid'], etc.

There's a nice Beginner's Guide to Geeklog Programming in the wiki that you may want to read for details.

bye, Dirk
 Quote

All times are EST. The time is now 02:35 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