[geeklog-devtalk] geeklog-devel digest, Vol 1 #327 - 3 msgs
geeklog-devel-request at lists.geeklog.net
geeklog-devel-request at lists.geeklog.net
Sat Jun 5 13:00:02 EDT 2004
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. Ability to set user defined template variables (Blaine Lang)
2. PDF stuff in CVS (Tony Bibbs)
3. Replacing/Extending Core Functions. (Tom Willett)
--__--__--
Message: 1
From: "Blaine Lang" <geeklog at langfamily.ca>
To: <geeklog-devel at lists.geeklog.net>
Date: Fri, 4 Jun 2004 17:33:12 -0400
Subject: [geeklog-devel] Ability to set user defined template variables
Reply-To: geeklog-devel at lists.geeklog.net
This is a multi-part message in MIME format.
------=_NextPart_000_065B_01C44A5A.02EF5D50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
There are times that you want to extend a template and have access to a =
{variable} in the .thtml file.
I was thinking that it may be nice to have a PLG function that if =
existed would be called and it would be up to that function to set the =
template variable.
I can use PHP in header.thtml but still I'd rather just use a =
{variable}.
I can also replace the complete COM_siteHeader but thats a bit of =
overkill to just add a variable.
What if I just wanted to add a logout link or add a something to the =
topicsblock.
If the block functions checked for plg_setvar_blockname() then I could =
add a function like this:
plg_setvar_siteheader (&$template) {
global $_USER;
if ($_USER['uid'] > 1 ) {
$template ->set_var( logout_link', '<a =
href=3D"...">logout</a>');
}
);
I expect this may add some overhead and maybe we don't add to =
COM_showBlock but maybe add it to a few of the main block functions.
Feedback ??
Blaine
------=_NextPart_000_065B_01C44A5A.02EF5D50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>There are times that you want to extend =
a template=20
and have access to a {variable} in the .thtml file.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I was thinking that it may be nice to =
have a PLG=20
function that if existed would be called and it would be up to that =
function to=20
set the template variable.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I can use PHP in header.thtml but still =
I'd rather=20
just use a {variable}.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I can also replace the =
complete=20
COM_siteHeader but thats a bit of overkill to just add a =
variable.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>What if I just wanted to add a =
logout link or=20
add a something to the topicsblock.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If the block functions checked for=20
plg_setvar_blockname() then I could add a function like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>plg_setvar_siteheader (&$template)=20
{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> global =
$_USER;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> if ($_USER['uid'] =
> 1 )=20
{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
=20
$template ->set_var( logout_link', '<a=20
href=3D"...">logout</a>');</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I expect this may add some overhead and =
maybe we=20
don't add to COM_showBlock but maybe add it to a few of the main block=20
functions.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Feedback ??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Blaine</FONT></DIV></BODY></HTML>
------=_NextPart_000_065B_01C44A5A.02EF5D50--
--__--__--
Message: 2
Date: Fri, 04 Jun 2004 16:59:01 -0500
From: Tony Bibbs <tony at tonybibbs.com>
To: geeklog-devel at lists.geeklog.net
Subject: [geeklog-devel] PDF stuff in CVS
Reply-To: geeklog-devel at lists.geeklog.net
I've just checked in beta code of the PDF stuff into CVS. This feature
is disabled by default and hasn't been integrated into the article/story
system yet (I'm working on that this weekend). However, what is in CVS
does work and if you want you can test it by installing from CVS,
installing HTMLDoc (See config.php comments) and then by doing to a URL
like this:
http://www.myglsite.com/pdfgenerator.php?pageType=2&pageData=<page>
Note that <page> will need to be URL encoded to work.
The code is in better shape now, I still need to hook it up with a
template, add some language stuff, etc which I will get done this
weekend. If anybody gets a chance to give it a whirl that would be
great, I'm out of town this weekend and won't be back on until Monday.
--Tony
--__--__--
Message: 3
From: "Tom Willett" <tomw at pigstye.net>
To: geeklog-devel at lists.geeklog.net
Date: Sat, 5 Jun 2004 16:43:52 +0000
Subject: [geeklog-devel] Replacing/Extending Core Functions.
Reply-To: geeklog-devel at lists.geeklog.net
While working on the Comment Spam plugin, I encountered an issue that I have
encountered several times. I was wondering if there is an easier way, I do
not have a good suggestion.
The Comment Spam plugin intercepts the SaveComment function call to examine
the comment and take appropriate action. I did this by renaming the core
savecomment function to savecomment1 and creating a new savecomment function
in the functions.inc of the plugin. This allows me to process the comment
and pass it on to the savecomment function if needed. Inelegant because it
requires patching comment.php.
I have encountered this issue several times and have resorted to disabling
the core function and writing my own or extending the core function.
GL2 being OO should allow for easy extension or replacement of core
functions -- its easy to write a class that extends another. But in GL2 how
could this modified class be installed as the core class and what about
multiple dueling extensions to a class? Like I said I do not have an easy
suggestion, but better to think of it now than latter.
Thinking about it I do have a partial suggestion, but I am not sure how it
would effect performance -- have each class in its own seperate file. Then
all you have to do is replace the file -- this just magnifies the multiple
dueling extensions problem though.
If anyone is interested, I built the spam plugin with extensibility in mind
so that to add another filter or action or admin section all you have to do
is place the class file with the extension in the plugin directory. The
plugin automatically uses it. If you want I will post it here.
--
Tom Willett
tomw at pigstye.net
--__--__--
_______________________________________________
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