[geeklog-devtalk] geeklog-devel digest, Vol 1 #496 - 9 msgs
geeklog-devel-request at lists.geeklog.net
geeklog-devel-request at lists.geeklog.net
Sat Jan 29 13:00:02 EST 2005
Send geeklog-devel mailing list submissions to
geeklog-devel at lists.geeklog.net
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.geeklog.net/listinfo/geeklog-devel
or, via email, send a message with subject or body 'help' to
geeklog-devel-request at lists.geeklog.net
You can reach the person managing the list at
geeklog-devel-admin at lists.geeklog.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of geeklog-devel digest..."
Today's Topics:
1. Re: Deleting comments (Vincent Furia)
2. Re: Deleting comments (Dirk Haun)
3. Re: Deleting comments (Vincent Furia)
4. Re: Deleting comments (Dirk Haun)
5. [Fwd: Re: [geeklog-devel] GL2 DataAccess Class] (Tony Bibbs)
6. Re: Deleting comments (Vincent Furia)
7. Re: Deleting comments (Dirk Haun)
8. Re: GL2 link? (Vincent Furia)
9. Re: GL2 link? (Dirk Haun)
--__--__--
Message: 1
Date: Fri, 28 Jan 2005 14:22:24 -0500
From: Vincent Furia <vfuria at gmail.com>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] Deleting comments
Reply-To: geeklog-devel at lists.geeklog.net
------=_Part_150_20533675.1106940144162
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Well,
I think I'm done. Attached is the new documentation for Plugin
Comment Engine. Note the missing code examples. I was hoping to work
with Blaine, Tom, or one of the other plugin developers that use
comments to get the examples done (and to make sure that the new API
is reasonable).
Note that comment.php passes on requests to delete and save comments
to the plugin which then must call CMT_deleteComment or
CMT_saveComment respectively. That way plugins can do any
pre-save/delete checks and post-save/delete processing that they want.
Besides the major changes to the comment API, I have also refactored
the code in comment.php and consolidated comment related code in
system/lib-comment.php. A code review would be welcome, but at the
least some strenuous testing is required. Here is a list of files
that I ended up touching:
public_html/comment.php
public_html/article.php
public_html/layout/professional/comment/commentbar.thtml
public_html/layout/professional/comment/thread.thtml
public_html/lib-common.php
system/lib-comment.php
system/lib-plugins.php
I'll repeat. Please test this out a bit. I've done a lot of testing,
but the changes are pretty significant.
Thanks,
Vinny
On Sat, 22 Jan 2005 21:22:49 -0500, Vincent Furia <vfuria at gmail.com> wrote:
> With Dirk's blessing to break the comment plugin API. Here is my idea thus far:
>
> CMT_deleteComment and CMT_saveComment will be limited to exactly that
> functionality. They will act no different for articles or polls as
> they would for any other variable. They will return 0 for success or
> >0 for failure (and log the failure to the errorLog). I plan on doing
> something similar for CMT_commentForm.
>
> So there will now be plugin functions for saving and deleting comments
> which should simply call these functions when they are ready (and
> determine that the correct permissions hold, etc).
>
> I'll continue with this approach if it sounds good to everyone. I'd
> especially like some feedback from anyone currently using the plugin
> comment functionality.
>
> -Vinny
>
------=_Part_150_20533675.1106940144162
Content-Type: text/html; name="comment.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="comment.html"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
=09<title>Plugin Comment Engine</title>
=09<LINK REL =3D'stylesheet' TYPE=3D'text/css' HREF=3D'http://gplugs.source=
forge.net/pluginman/stylesheet.css' TITLE=3D'Style'>
</head>
<body>
<h1>Plugin Comment Engine</h1>
<p>This section will describe and documents how to enable your plugin to us=
e the Geeklog comment engine. This is a key feature or plugin functionality=
for many developers and not very difficult to integrate into your project=
. The GL developers have made this very straight forward and enabled the AP=
I calls into comment related core programs.</p>
<p><b>NOTE: </b>You will need to be using Geeklog version 1.3.12 to success=
fully use the current Comment API's. The plugin comment API has been compl=
etely reworked for this release of Geeklog. Comment systems on plugins tha=
t predate 1.3.12 will no longer work.</p>
<p>There are two (2) plugin functions that are required to support comments=
in a plugin. The example functions that are used for explanation in this s=
ection and included in this kit are very complete. You should only need to =
edit them for your plugin name and table names. The following table summari=
zes the functions:</p>
<div align=3D"center">
<table cellPadding=3D"2" width=3D"100%" border=3D"1" style=3D"border-coll=
apse: collapse" bordercolor=3D"#111111" cellspacing=3D"0">
<tr>
<th vAlign=3D"top" width=3D"4%"> </th>
<th vAlign=3D"top" width=3D"31%">Function</th>
<th vAlign=3D"top" width=3D"95%">Description of Function</th>
</tr>
<tr>
=09 <td class=3D"codeheader" vAlign=3D"top" width=3D"5%" align=3D"center">=
<font size=3D"2">1</font></td>
=09 <td class=3D"codeheader" vAlign=3D"top" width=3D"10%"><font size=3D"2"=
>plugin_deletecomment_<plugin name></font></td>
=09 <td class=3D"code" vAlign=3D"top" width=3D"85%"><font size=3D"2">This =
function expects two parameters: comment id and plugin item identifier. Th=
is function is called when a request to delete a comment is received by com=
ment.php. It is up to the plugin to make sure that the requesting user has=
sufficient permissions to perform the deletion. It should return a HTML st=
ring (COM_refresh) redirecting to the plugin page containing the item to wh=
ich the deleted comment belonged.</font></td>
</tr>
<tr>
=09 <td class=3D"codeheader" vAlign=3D"top" width=3D"5%" align=3D"center">=
<font size=3D"2">2</font></td>
=09 <td class=3D"codeheader" vAlign=3D"top" width=3D"10%"><font size=3D"2"=
>plugin_savecomment_<plugin name></font></td>
=09 <td class=3D"code" vAlign=3D"top" width=3D"85%"><font size=3D"2">This =
function expects five (5) parameters: comment title, comment text, id of as=
sociated story, parent comment id, and post mode (either 'text' or 'html').=
This function is called when a request to save a comment is received by co=
mment.php. It is up to the plugin to make sure that the requesting user ha=
s sufficient permissions to save the comment. It should return a HTML strin=
g (COM_refresh) redirecting to the plugin page containing the item to which=
the saved comment belongs.</font></td>
</tr>
<tr>
=09 <td class=3D"codeheader" vAlign=3D"top" width=3D"5%" align=3D"center">=
<font size=3D"2">3</font></td>
=09 <td class=3D"codeheader" vAlign=3D"top"><font size=3D"2">plugin_displa=
ycomment_<plugin name></font></td>
=09 <td class=3D"code" vAlign=3D"top" width=3D"95%"><font size=3D"2">This =
function expects seven (7) parameters: item id, comment id, title, display =
order, display format, page number and view type. This function is called =
when a request to display a comment is received. It is up to the plugin to=
make sure that the requesting user has sufficient permission to view the c=
omments and then to call COM_userComments to format the comments for displa=
y. It should return false if there was some error, otherwise it should ret=
urn a HTML string that contains comments to display (excluding COM_header a=
nd COM_footer).</font></td>
</tr>
</table>
</div>
<h3>How to Call the Comment Engine</h3>
<p>Use the following URL to link to the comment form for your plugin: <font=
COLOR=3D"#0000f0">http://<site_url>/comment.php?type=3D<plugin_na=
me>&sid=3D<unique_plugin_id></font></p>
<p>The comment bar has been programmed to conveniently link back to the rec=
ord of the plugin it is displaying. You should include in your plugin's pu=
blic_html folder an index.php which supports links in the form of <font COL=
OR=3D"#0000f0">http://<site_url>/<plugin_name>/index.php?id=3D&=
lt;unique_plugin_id></font>. This will allow comments displayed on the =
comment.php page to link back to your plugin.</p>
<p><b>Additional details on the comment table:</b> The commend table has a =
unique primary key called <b>cid</b> that is an auto_increment date type. T=
he field <b>type</b> will contain the name of our plugin. The field <b>sid<=
/b> (story-id) is the unique identifier for plugin record with which the co=
mment is associated. The field <b>pid</b> is used to indicate the parent co=
mment id and is 0 for 'top-level' comments (replys directly to the plugin r=
ecord) or, in the case of a threaded comment, it is set to the <b>cid</b> (=
the record id in the comment table) for the comment of which it is a child.=
For information on the 'leftIndex' and 'rightIndex' fields of the comment=
table see <a href=3D"http://vinny.furiafamily.com/article.php?story=3D2005=
0123154732396">this article on hierarchical structures in databases</a></p>
<h3>Plugin Database Changes</h3>
<p>Optionally, you may want to add a field in your plugin to keep track of =
the number of comments for each item. You can update this count in the plug=
in_handlecomment() function to keep it accurate and later use the field to =
quickly check how many comments have been left for the item.</p>
<h3>Function Details and Examples</h3>
<div style=3D"clear: right">
<div style=3D"float: right; border: solid; border-color: black; border-widt=
h: 1; background-color: #DDDDDD; padding: 6px 6px 6px 6px; font-size: xx-sm=
all">
CODE EXAMPLE 1
</div>
<p>1) The <b>deletecomment</b> function is called by comment.php when a com=
ment delete occurs on a comment for your plugin. You need to make sure tha=
t the current user has adequate permissions to delete the comment. You sho=
uld then call the comment function CMT_deleteComment() to delete the commen=
t.</p>
</div>
<div style=3D"clear: right">
<div style=3D"float: right; border: solid; border-color: black; border-widt=
h: 1; background-color: #DDDDDD; padding: 6px 6px 6px 6px; font-size: xx-sm=
all">
CODE EXAMPLE 2
</div>
<p>1) The <b>savecomment</b> function is called by comment.php when a comme=
nt save occurs on a comment for your plugin. You need to make sure that th=
e current user has adequate permissions to save the comment. You should th=
en call the comment function CMT_saveComment() to save the comment.</p>
</div>
<div style=3D"clear: right">
<div style=3D"float: right; border: solid; border-color: black; border-widt=
h: 1; background-color: #DDDDDD; padding: 6px 6px 6px 6px; font-size: xx-sm=
all">
CODE EXAMPLE 3
</div>
<p>2) The <b>displaycomment</b> function is called by comment.php when a re=
quest is made to display a comment for your plugin. You need to make sure =
that the current user has sufficient access to view the comment(s). You sh=
ould then call the comment display function (CMT_userComments()) and return=
the results.</p>
</div>
</body>
</html>
------=_Part_150_20533675.1106940144162--
--__--__--
Message: 2
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Subject: Re: [geeklog-devel] Deleting comments
Date: Fri, 28 Jan 2005 20:46:07 +0100
Organization: Terra Software Systems
Reply-To: geeklog-devel at lists.geeklog.net
Vinny,
I'd like to suggest an additional change that shouldn't interfere with
what you did. I think in PLG_commentPreSave (and the plugin's
implementation of that function), $comment should be passed by reference.
That way, plugins could alter the text of the comment, e.g. to replace
smilies or whatever comes to mind.
Thoughts?
>A code review would be welcome, but at the
>least some strenuous testing is required.
geeklog.info is running on the latest CVS code. The site isn't too busy,
but that will provide some testing. I'll also have a look at the code.
bye, Dirk
--
http://www.haun-online.de/
http://www.tinyweb.de/
--__--__--
Message: 3
Date: Fri, 28 Jan 2005 15:03:22 -0500
From: Vincent Furia <vfuria at gmail.com>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] Deleting comments
Reply-To: geeklog-devel at lists.geeklog.net
I like the idea. And it seems like it wouldn't be too difficult to
implement. I think only title, comment, and postmode should be passed
by reference though.
-Vinny
On Fri, 28 Jan 2005 20:46:07 +0100, Dirk Haun <dirk at haun-online.de> wrote:
> Vinny,
>
> I'd like to suggest an additional change that shouldn't interfere with
> what you did. I think in PLG_commentPreSave (and the plugin's
> implementation of that function), $comment should be passed by reference.
>
> That way, plugins could alter the text of the comment, e.g. to replace
> smilies or whatever comes to mind.
>
> Thoughts?
>
>
> >A code review would be welcome, but at the
> >least some strenuous testing is required.
>
> geeklog.info is running on the latest CVS code. The site isn't too busy,
> but that will provide some testing. I'll also have a look at the code.
>
> bye, Dirk
>
> --
> http://www.haun-online.de/
> http://www.tinyweb.de/
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>
--__--__--
Message: 4
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Subject: Re: [geeklog-devel] Deleting comments
Date: Fri, 28 Jan 2005 21:48:35 +0100
Organization: Terra Software Systems
Reply-To: geeklog-devel at lists.geeklog.net
Vincent Furia wrote:
>I think only title, comment, and postmode should be passed
>by reference though.
Makes perfect sense (to me at least ;-)
bye, Dirk
--
http://www.haun-online.de/
http://www.macosx-faq.de/
--__--__--
Message: 5
Date: Fri, 28 Jan 2005 16:04:37 -0600
From: Tony Bibbs <tony at tonybibbs.com>
To: geeklog-devel at lists.geeklog.net
Subject: [Fwd: Re: [geeklog-devel] GL2 DataAccess Class]
Reply-To: geeklog-devel at lists.geeklog.net
Forgot to include the list.
--Tony
-------- Original Message --------
Subject: Re: [geeklog-devel] GL2 DataAccess Class
Date: Fri, 28 Jan 2005 15:46:53 -0600
From: Tony Bibbs <tony at tonybibbs.com>
To: vmf at abtech.org
References: <8319e2d60501162044335efb64 at mail.gmail.com>
<41EBCC95.7080203 at tonybibbs.com>
<8319e2d605011706391e0c02d7 at mail.gmail.com>
<8319e2d6050117070717a15298 at mail.gmail.com>
<41EBF8C1.8070503 at tonybibbs.com>
<8319e2d605011710386432525e at mail.gmail.com>
<41F9AB13.3030605 at tonybibbs.com>
<8319e2d605012808432fb2eaeb at mail.gmail.com>
Vincent Furia wrote:
>Tony,
>
>I'm just sending this to you because I'm not sure if this debate
>belongs on the list. Feel free to move it there if you'd like.
>
>
I'll leave it there. I think it is a good debate so that we have a log
of consciously deciding these things.
>It is still undefined what return value should be expected when an
>UPDATE or INSERT is done. Normally the DAO returns an array of
>classes, that doesn't make sense for UPDATEs or INSERTs.
>
>
Updates deletes and inserts would all throw SQLExceptions. So you would
to do a TRY clause around them, and all database calls for that matter.
In otherwords, no return means all went well.
>I'm starting to get more and more concerned with speed issues for GL2.
> Between Creole being generally slow compared to other DBAPIs (by
>itself, not that big of a deal) and Propel loading/includes being very
>time intensive I'm worried adding additional layers are going to slow
>things down.
>
>All these things combine to make me want to reconsider using the DAO.
>We also need to get to the point where we can decide if the Propel
>speed issues are going to be a problem.
>
>
Stripping the DAO doesn't save you anything. The Creole/Propel issues
would still exist. I'm not skirting the issues with the performance. I
fully expect that I/we will have to do true profiling at some point with
this. The real question I think you are asking is just how much
overhead is the DAO and how does that compare to the benefits.
>Also, noting that the February deadline you imposed on yourself is
>looming, I'm curious if you feel work has progressed enough to keep to
>going (I feel that we're making good progress).
>
>
Yeah, I was just thinking about this the other day. I definitely think
things have progressed and that we have a ton of code to show for it.
My only worry is things stagnating again. I'm doing to do my best to
prevent this but getting continuing help from you and Kevin will be just
as important of a factor.
>As I said before, I'm don't feel strongly enough about the DAO to
>force the issue. But I think it warrants reconsideration.
>
>
Maybe we should take the link plugin, implement it fully and do some
serious performance analysis on it before deciding on the DAO. That way
we have only implemented time into one fairly minor plugin and I think
it has enough complexity to give us an idea on performance?
I'm leary of ditching the DAO as it has proven useful in all my apps
here at work. Here we recently went from using raw JDBC to using
Hibernate by simply implementing the new DAO layer and it saved us a
bunch of time. Granted that was Java but without going the DAO layer,
going to Hibernate wouldn't have even have been possible.
--Tony
--__--__--
Message: 6
Date: Fri, 28 Jan 2005 18:15:16 -0500
From: Vincent Furia <vfuria at gmail.com>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] Deleting comments
Reply-To: geeklog-devel at lists.geeklog.net
Hows that for a feature improvement, only had to add 3 characters.
(Discussed fix checked in).
-Vinny
On Fri, 28 Jan 2005 21:48:35 +0100, Dirk Haun <dirk at haun-online.de> wrote:
> Vincent Furia wrote:
>
> >I think only title, comment, and postmode should be passed
> >by reference though.
>
> Makes perfect sense (to me at least ;-)
>
> bye, Dirk
>
> --
> http://www.haun-online.de/
> http://www.macosx-faq.de/
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>
--__--__--
Message: 7
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Subject: Re: [geeklog-devel] Deleting comments
Date: Sat, 29 Jan 2005 00:27:26 +0100
Organization: Terra Software Systems
Reply-To: geeklog-devel at lists.geeklog.net
Vincent Furia wrote:
>Hows that for a feature improvement, only had to add 3 characters.
>(Discussed fix checked in).
Not bad. Quite a bit of overhead for those 3 characters, though ;-)
bye, Dirk
--
http://www.haun-online.de/
http://www.macosx-faq.de/
--__--__--
Message: 8
Date: Sat, 29 Jan 2005 11:03:23 -0500
From: Vincent Furia <vfuria at gmail.com>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] GL2 link?
Reply-To: geeklog-devel at lists.geeklog.net
How about linking to
http://wiki.geeklog.net/wiki/index.php/Geeklog_2x_Documentation. I
think that has the most information about GL2 short of the mailing
lists.
-Vinny
On Tue, 25 Jan 2005 21:11:52 +0100, Dirk Haun <dirk at haun-online.de> wrote:
> What's a good link to point people to information about GL2? I've
> restructured the Resources block on geeklog.net a bit and noticed that
> the "Geeklog 2" link there points to the project page, which doesn't have
> a lot to say about GL2.
>
> Maybe someone wants to write a static page that can serve as a portal
> page to the various GL2 resources?
>
> Speaking of which: At one point, we had a GL2 vision document (linked to
> from <http://www.geeklog.net/article.php/20020726125436153>) but it's
> long gone. Search engines and human readers are still looking for it,
> though, so I've configured the server to send a "410 Gone". Does someone
> still have that document?
>
> bye, Dirk
>
> --
> http://www.haun-online.de/
> http://www.macosx-faq.de/
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>
--__--__--
Message: 9
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Subject: Re: [geeklog-devel] GL2 link?
Date: Sat, 29 Jan 2005 17:18:32 +0100
Organization: Terra Software Systems
Reply-To: geeklog-devel at lists.geeklog.net
Vincent Furia wrote:
>How about linking to
>http://wiki.geeklog.net/wiki/index.php/Geeklog_2x_Documentation
Good idea - completely forgot about the Wiki.
bye, Dirk
--
http://www.haun-online.de/
http://geeklog.info/
--__--__--
_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
http://lists.geeklog.net/listinfo/geeklog-devel
End of geeklog-devel Digest
More information about the geeklog-devtalk
mailing list