Welcome to Geeklog, Anonymous Friday, April 26 2024 @ 10:39 pm EDT

Geeklog Forums

Enabling Comments in plugin


Status: offline

rgelbman

Forum User
Newbie
Registered: 01/08/04
Posts: 7
I read in the documentation that I need to call MAKESID() to generate a key field for the entry in my plugin's table to use comments. I assume this generated ID is an INT field based on looking at the function but I'm not sure of what length I need to assign it in my table. Also do I need to call this function and assign it to a variable for my insert statement or can I call it directly from inside the insert statement? Any answer/advice is much appreciated.

Thanks
Rob
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
I think you really just need to ensure you have a unique ID.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
You definitely do not need to use MakeSID. As Blaine pointed out, you just need a unique ID. And it does not need to be unique throughout all of GL, just unique for your plugin. You can therefore also use an auto-increment field if you like. I do it both ways in various plugins : auto-increment in some, MakeSID in others.

Actually, in eariler releases of GL the field did have to be unique throughout all of GL due to a programming bug in core GL (which I reported and has long since been fixed)

In the comments table there are 2 fields which identify your plugin's comments : "sid" which is your unique id, and "type" which is the name of your plugin. The past bug was that they were not taking 'type' into consideration in the queries around comments.

There are some other errors in the plugin guide. Nothing against the authors of course as the guide was a pretty huge help in getting me going, for one. I'm sure many others as well.

In the next release of my UPAGE plugin (hopefully due in a week, maybe 2 at most) I will have the plugin functions documented with code comments. That should be a big help. I already have them mostly commented actually, just not released yet. The current version of my plugin is extremely well commented though, if you want to use it as something of a programming guide. Unfortunately the plugin stuff in it is not commented at all in the current version, but the rest of it is.

BTW, the next upage release will have a 'gallery lite' feature for photo upload. I'll then split the code and make it into 2 plugins : upage and upic (a fairly full-featured gallery replacement). Upage will be able to use it's native photo capability for light-weight stuff, or you will also be able to turn off the native stuff and use upic if you prefer.
 Quote

Status: offline

rgelbman

Forum User
Newbie
Registered: 01/08/04
Posts: 7
Thanks for answering my question. I have a unique ID on my table so I guess I won't have any problem.
 Quote

All times are EDT. The time is now 10:39 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