[geeklog-devel] New function for lib-common
Blaine Lang
geeklog at langfamily.ca
Fri May 16 19:46:25 EDT 2003
I agree that for most business applications the base smilie setup will be
fine. Technical, Theme and Personal sites will have a need to edit the
smilies. And although my interest is to find more business oriented
applications, I saw a need to optimize the routines I was using in my
projects.
But thinking outside the box a bit more .. this could be used for any
images. What if a client could upload images into a library and then
reference those in stories, comments, forum disucssions or other plugins.
Example: Our company :mylogo: yada yada yada ...
If I often wanted to reference a image of our products etc ... create
custom tags to images.
At least this way just the tag is inserted in the table for the content.
Cheers,
Blaine
----- Original Message -----
From: "Tony Bibbs" <tony at tonybibbs.com>
To: <geeklog-devel at lists.geeklog.net>
Sent: Thursday, May 15, 2003 3:36 PM
Subject: Re: [geeklog-devel] New function for lib-common
> Well, obviously, use your best judgement. I don't see my wanting to ever
> edit emoticons at that fine of a level. Either I use them or I don't. I
> don't think I'll ever be in adding new ones or anything like that. My
> hunch is that is how most others will use them...obviously I don't have
> anything to back that up but that is my hunch.
>
> Just a thought,
>
> --Tony
>
> On Thu, 15 May 2003,
> Blaine Lang wrote:
>
> > Tony Bibbs" <tony at tonybibbs.com> wrote:
> >
> > > Is a DB table really needed? I think a section in a config file would
be
> > best suited for this.
> > It's just a lot easier to update and manage a table then a config file.
As
> > with good normalized database design, there may be a number of extra
small
> > tables. We have some now with just 2 records. Thats ok - Don't have to
> > access to bother with them.
> >
> > I imagine it could be a XML formated config file using a XML class to
read
> > and update - but is that not more overhead then a simple SQL call?
> >
> > Blaine
> > ----- Original Message -----
> > From: "Tony Bibbs" <tony at tonybibbs.com>
> > To: <geeklog-devel at lists.geeklog.net>
> > Sent: Thursday, May 15, 2003 2:34 PM
> > Subject: Re: [geeklog-devel] New function for lib-common
> >
> >
> > > Is a DB table really needed? I think a section in a config file would
be
> > > best suited for this. I'm just saying this from the ever growing DB
bloat
> > > we have. I"m fine either way but if you can figure out an easy way to
> > > support this via a config file that would be great.
> > >
> > > --Tony
> > >
> > > On Tue, 13 May 2003,
> > > Blaine Lang wrote:
> > >
> > > > I've used emoticons in a few of my projects and I'm working on a new
> > plugin that also supports them. I've reworked the function that I'm now
> > pretty happy with. We also have had requests to add support for
emoticons
> > and smilies in the core GL story and comment engine. Not really a key
> > requirement for business use but the basic ones are handy.
> > > >
> > > > Anyway, my new function uses a table for the mappings of emoticons
to
> > images and will be easy to extend - just need to now create a admin
module.
> > You can have multiple emoticons map to the same image as in :) and :-)
to
> > the smile image.
> > > >
> > > > Any concerns in adding this function to CVS?
> > > > - need to update lib-databases
> > > > - add a new config parm $_CONF['SMILE_PATH']
> > > > - update the 1.3.8 updgrade SQL script
> > > >
> > > > Blaine
> > > >
> > > > The function is shown below
> > > > ---------------
> > > > /**
> > > > * Replace emoticons in string with formated HTML of smilies.
> > > > * Emoticon mapping to images are defined in a the table.
> > > > * This function will replace all the emoticons in the past string.
> > > > * @param string $text The text
> > > > * @return string The text, possibly with emoticons replaced with
the
> > HTML img tags for the smilie image.
> > > > */
> > > > function COM_replaceEmoticons( $text ) {
> > > > global $_CONF, $_TABLES;
> > > >
> > > > $arr_smilies = array();
> > > > $sql = DB_query("SELECT code,smile_url from
{$_TABLES['smilies']}");
> > > > while ( list($key,$icon) = DB_fetchARRAY($sql)) {
> > > > $arr_smilies[$key] = $icon;
> > > > }
> > > >
> > > > foreach ($arr_smilies as $key => $icon) {
> > > > $text = str_replace($key,'<img src='.$_CONF['SMILE_PATH'].
$icon
> > . ' BORDER="0">',$text);
> > > > }
> > > >
> > > > return $text;
> > > >
> > > > }
> > > >
> > > >
> > > >
> > >
> > > --
> > > Tony Bibbs "I guess you have to remember that those who don't
> > > tony at tonybibbs.com hunt or fish often see those of us who do as
> > > harmlessly strange and sort of amusing. When you
> > > think about it, that might be a fair assessment."
> > > --Unknown
> > >
> > >
> > > _______________________________________________
> > > geeklog-devel mailing list
> > > geeklog-devel at lists.geeklog.net
> > > http://lists.geeklog.net/listinfo/geeklog-devel
> >
> > _______________________________________________
> > geeklog-devel mailing list
> > geeklog-devel at lists.geeklog.net
> > http://lists.geeklog.net/listinfo/geeklog-devel
> >
>
> --
> Tony Bibbs "I guess you have to remember that those who don't
> tony at tonybibbs.com hunt or fish often see those of us who do as
> harmlessly strange and sort of amusing. When you
> think about it, that might be a fair assessment."
> --Unknown
>
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
More information about the geeklog-devel
mailing list