Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Friday, May 24 2013 @ 05:19 AM EDT


 Forum Index > Extensions > Plugins New Topic Post Reply
 Enabling Comments in plugin
   
rgelbman
 01/18/04 10:02AM (Read 1161 times)  
+----
Newbie

Status: offline


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

 
Profile Email
 Quote
Blaine
 01/18/04 05:12PM  
+++++
Full Member

Status: offline


Registered: 07/16/02
Posts: 1233
I think you really just need to ensure you have a unique ID.

Geeklog components by PortalParts -- www.portalparts.com
 
Profile Email Website
 Quote
amckay
 01/18/04 05:35PM  
+++++
Full Member

Status: offline


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.

 
Profile Email Website
 Quote
rgelbman
 01/18/04 06:38PM  
+----
Newbie

Status: offline


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.

 
Profile Email
 Quote
Content generated in: 0.27 seconds
New Topic Post Reply

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