Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Edit_Case... New Plugin.

(Page 1 of 3)
> >
Quote Reply
Edit_Case... New Plugin.
I've just finished testing a plugin that I wrote for a client. He has given permission for me to make this a public plugin, so thanks :)

Price? FREE!

What does it do?

In short, it will enable you to format the inputted data of specific fields, i.e;

Quote:
tHis IS a TEST


... would become (if using :ALL);

Quote:
This Is A Test


... or (if using :FIRST)

Quote:
This is a test


Its a pretty simple plugin, and I don't envisage any more features (not so much I don't want too, but more the fact I don't have any more extra time).

Setting it up:

Its pretty simple.

1) Download the plugin from this thread, or our site.
2) Install it into your LinksSQL installation (Plugins > Plugin Download > Browse)
3) Now, you need to click on the "edit" button next to the plugin itself. This will take you to the plugins settings. Once you are in there, you need to edit the FieldsToLowercase value. More details on this are below;

What do I put in FieldsToLowercase ?

I've tried to make this plugin as simple to use. In short, the value for FieldsToLowercase, needs to be a list of the fields that you want to format (i.e Title,Description,Contact_Name, etc). An example would be;

Code:
Title,Description,Contact_Name


... or if you want to get fancy Laugh

Code:
Title:ALL,Description:FIRST,Contact_Name:ALL



The ":ALL" and ":FIRST" parts of the field names allow you to decide if you want to;

:ALL - format the whole phrase, such as "tHis IS a TEST" would become "This Is A Test"
:FIRST - format the first charachter only, such as "tHis IS a TEST" would become "This is a test"


Not much more else to say, except, enjoy Cool

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
Hi Andy,


I just downloaded the plugin from your ost. Uploaded it to the server and got this error when I clicked on install>

Unable to locate the Edit_Case.pm file in tar



Is this me, or is there a minor pb?
Quote Reply
Re: [nt6] Edit_Case... New Plugin. In reply to
I tried opening it, but couldn't, the file may be damaged.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
I managed to open the zip but spotted some problems in the code. If you turn on warnings (by adding -w to the shebang line) you'll get some constructive messages. I expect they will mainly relate to code such as:

Code:
$DEBUG ? print $IN->header() : '';

This says "If $DEBUG is true, print a header, otherwise define an empty string.". Perl will say something like "Useless use of string in void context" because defining an empty string is needless. It would be better written as:

Code:
print $IN->header() if $DEBUG;
Quote Reply
Re: [Jarrod] Edit_Case... New Plugin. In reply to
Sorry about that. Please try the attached version.

Quote:
This says "If $DEBUG is true, print a header, otherwise define an empty string.". Perl will say something like "Useless use of string in void context" because defining an empty string is needless. It would be better written as:

I guess it could be changed to that... but it doesn't do any harm :D

The reason it is there, is because I was doing some debugging during the development, and although I removed some of the output it was generating, I didn't bother changing the code structure for the debugging stuff Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [nt6] Edit_Case... New Plugin. In reply to
Hi. It should be fixed now.

I've also setup a page on our site, where you can download it;

http://www.ultranerds.com/...bin/details/100.html

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
Quote:
I guess it could be changed to that... but it doesn't do any harm :D

Its a bit annoying though if you run it under mod_perl and get warnings everytime you restart the mod_perl server :-p
Quote Reply
Re: [Jarrod] Edit_Case... New Plugin. In reply to
I guess Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
Andy what's mean this error ???

GT::Plugins (7636): Error running plugin PRE hook: Plugins::Edit_Case::add_link. Reason: Plugins::Edit_Case::add_link does not exist in Plugins/Edit_Case at /home/public_html/cgi-bin/admin/Links/Table/Links.pm line 88.

Stack Trace
======================================
Links (7636): Links::environment called at /home/public_html/cgi-bin/admin/Links.pm line 524 with no arguments.
Links (7636): Links::fatal called at GT::Base::error line 381 with arguments
(GT::Plugins (7636): Error running plugin PRE hook: Plugins::Edit_Case::add_link. Reason: Plugins::Edit_Case::add_link does not exist in Plugins/Edit_Case at /home/public_html/cgi-bin/admin/Links/Table/Links.pm line 88.
).
Links (7636): GT::Base::error called at GT::Plugins::_load_hook line 277 with arguments
(GT::Plugins=HASH(0x8498c24), PLUGINERR, FATAL, PRE, Plugins::Edit_Case::add_link, Plugins::Edit_Case::add_link does not exist in Plugins/Edit_Case).
Links (7636): GT::Plugins::_load_hook called at /home/public_html/cgi-bin/admin/GT/Plugins.pm line 98 with arguments
(GT::Plugins=HASH(0x8498c24), Plugins::Edit_Case::add_link, PRE).
Links (7636): GT::Plugins::dispatch called at /home/public_html/cgi-bin/admin/Links/Table/Links.pm line 88 with arguments
(GT::Plugins, /home/public_html/cgi-bin/admin/Plugins, add_link, CODE(0x848ba18), HASH(0x83b5ff8)).
Links (7636): Links::Table::Links::add called at GT::SQL::Admin::add_record line 456 with arguments
(Links::Table::Links=HASH(0x8411038), HASH(0x83b5ff8)).
Links (7636): GT::SQL::Admin::add_record called at /home/public_html/cgi-bin/admin/GT/SQL/Admin.pm line 121 with arguments
(Links::Admin=HASH(0x8407204)).
Links (7636): GT::SQL::Admin::process called at admin.cgi line 77 with arguments
(Links::Admin=HASH(0x8407204), db, GT::SQL=HASH(0x82dd48c), cgi, GT::CGI=HASH(0x82d3bb0)).
Links (7636): main::db_request called at admin.cgi line 55 with no arguments.
Links (7636): main::main called at admin.cgi line 23 with no arguments.


Thanks in Advance
Bye From Italy

Last edited by:

fabio: Jun 10, 2004, 6:35 AM
Quote Reply
Re: [fabio] Edit_Case... New Plugin. In reply to
Hi. Looks like you are using the old version. Please download the plugin from here: http://www.ultranerds.com/....cgi?query=Edit_Case. This is the latest copy Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
ok.... I'm installing right now


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Edit_Case... New Plugin. In reply to
It's the same :

A fatal error has occured:

GT::Plugins (9555): Error running plugin PRE hook: Plugins::Edit_Case::add_link. Reason: Plugins::Edit_Case::add_link does not exist in Plugins/Edit_Case at /home/public_html/cgi-bin/admin/Links/Table/Links.pm line 88.

Please enable debugging in setup for more details.

I'm using Links SQL Version: 2.2.0


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Edit_Case... New Plugin. In reply to
In Reply To:
ok.... I'm installing right now

Ok.

Your avatar scares me more and more, every time I see it Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [fabio] Edit_Case... New Plugin. In reply to
Could you send over LinksSQL admin panel details? I don't understand why it is doing that, as that routine should exist in the plugin (I just double checked).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
This bug should now be fixed in 1.1 (available from the Members Area on our site).

Sorry about the delay in getting it out :|

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
An idea to extend the plugin, which would make it more practical:
Usually the problem is with those users who write the Description is all (or almost all) uppercase. This should be fixed.
But in other cases the Description original case should not touched, since we don't want to affect unguilty users, right?

Therefore there should be an feature, to do the :FIRST feature action, if the Description has X percent or more uppercase letters.

It could work like this:
Description:FIRST:IFUPPERCASE:70%

It means, make all sentences starting uppercase letter, if the Description has more than 70% uppercase letters.


Not a difficult change, tough.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Sep 9, 2004, 5:02 AM
Quote Reply
Re: [webmaster33] Edit_Case... New Plugin. In reply to
Quote:
Not a difficult change, tough.

Its a freebie ;) I'm open to hacks... but at the moment, I simply don't have time to add new features to the free plugins :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
Just released a fix for this plugin. You can download the fixed version here;

http://www.ultranerds.com/...bin/details/100.html

There was a problem with the :FIRST paramater being always called, which it shouldn't have been. Should all be fixed up now though :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
BTW: you could show up actual version number of plugin on downlad pages like this:
http://www.ultranerds.com/cgi-bin/details/100.html

Users doesn't know which version is downloadable, and if they need to update the plugin.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
Quote:
Its a freebie ;) I'm open to hacks...

I have a few free hours, so I could improve the script, but in that case I ask to place also my credit info & URL into the script & detailed info page.
It would be not a hack, but an improvement to v1.5.
Just waiting for your approval...

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Edit_Case... New Plugin. In reply to
In Reply To:
Quote:
Its a freebie ;) I'm open to hacks...

I have a few free hours, so I could improve the script, but in that case I ask to place also my credit info & URL into the script & detailed info page.
It would be not a hack, but an improvement to v1.5.
Just waiting for your approval...

Sure... anything that improves it :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit_Case... New Plugin. In reply to
Andy,

I posted the Edit_Case v1.5 release to you through PM for approval.
Tomorrow I travel away for 1 day, so I'm waiting your approval to release it now before I go to sleep.

Waiting your reply.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [fabio] Edit_Case... New Plugin. In reply to
I finished Edit_Case plugin v1.5 beta1 the day before tomorrow, but since tomorrow I was away, releasing today Smile

Features of Edit_Case plugin v1.5 beta1:
  • Plugin can change the case of specific fields. You can specify which fields
    to check, to uppercase ALL or just First case of whole paragraph.
  • Specific field texts can be changed even conditionally, for example you can lowercase a Description if there are more than 80% UPPERCASE letters.
  • Flexible, through simple admin config interface.
  • Seamless integration with LinksSQL
  • Debugging available

Changes in Edit_Case plugin v1.5 beta1:
  • Bugfix: fixed 'change_case' subroutine name back to 'add_link', to make v1.2 working
  • Improvement: code completely rewritten
  • Improvement: added feature to do conditional case format changes, based on percent of UPPERCASE letters
  • Improvement: more complete debugging
  • Change: option FieldsToLowercase renamed to FieldsToChangeCase

Commands listed in the FieldsToChangeCase option can be used like this:
Normal usage:
Title:ALL, Description:FIRST, Accomodation_Name:ALL, Resort:FIRST,Country
Conditional usage:
Title:ALL:IFUPPERCASE:70%, Description:FIRST:IFUPPERCASE:70%, etc...

1. part: Field can be like:
Title, Description, Accomodation_Name, Resort, Country, etc...
2. part: you can use :ALL or :FIRST to decide how the value is formatted.
3. part: (optional) - you can use :IFUPPERCASE to create conditional action
4. part: (optional, but required if 3. part is used) - this is a number (70) or percent number (70%)

Known bug: working only for Add page. Modify page isn't supported yet.


Enjoy this fine release.


Coming soon Edit_Case plugin v1.8...

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Sep 12, 2004, 6:30 AM
Quote Reply
Re: [webmaster33] Edit_Case... New Plugin. In reply to
Quick update: Edit Case v1.5 beta2

Updated to Edit Case v1.5 beta2, since the debug option was left turned on by default.
Now is turned off.

Comments, bug reports, ideas are welcome.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Edit_Case... New Plugin. In reply to
Works great Sly

Thanks for putting this together guys, its one of those things I have often thought of looking at.

There is one thing that I am seeing though, and that is that for some reason it seems to be returning the link title preceeded by a space.

I am using the Plugin in the normal configuration... ie:
Title:ALL, Description:FIRST

The Description seems to be fine, but the on the tests I did, the Title was returned preceeded by a single space each time.

Thanks again
Mark
> >