Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
8 posts Page 1 of 1
Hello Couchies,

When auto-create Gallery during multiple uploading, the titles of pages are not beautiful. For example, if the image's name "men-At-work-cargo.jpg" the title will be "men_at_work_cargo".

This mechanizm can be easily changed in the file "uploader.php", for my needs it's like this:
insert after
Code: Select all
$f =  &$pg->fields[0]; // title

(line 230)

this code:
Code: Select all
$page_title = str_replace('_', ' ', $page_title);
$page_title = ucwords(strtolower($page_title));


So the name after aploading will be "Men At Work Cargo". Maybe it will be useful for somebody.

Attachments

hey Musman, after reading tried it and will start using it for when i need gallerys but actually this helped me to solve a problem where i needed to output in the template a value inputed by the client in the admin but needed to output it in lowercase and without spaces so after reading your post i workaround the solution: http://www.couchcms.com/forum/viewtopic.php?f=4&t=7998&p=13614#p13614
Thank you for this script. However there is a small problem, the new title picture is displayed correctly in the admin area, but on the frontend,
it is always the filename (with extension) that appears. Can you help me solve this? :(
The title in Admin panel (like 'Men At Work Cargo') is the title of page, so if you use
Code: Select all
<cms:show k_page_title />

in the Frontend, the title will be the same.
Hi,

I am French and I want to keep all the accents and comma on the title.

Is it possible?
Hi Paolo :)

Musman's solution takes the physical image's file-name (e.g. 'men-At-work-cargo.jpg') and then processes it to make it prettier.

The accents and commas you need will not be present in the file-name of the uploaded images (as the uploader would have already removed them as a security measure). So, I don't think Musman's solution will be able to figure out by itself where to introduce those elements anew in the stripped name.

I am sorry but you'll have to edit the created cloned pages manually if you want to use titles with accents etc.
Hi KK,

ok, that's what I though. No problem, I'll do it manually, it's for my website in Spanish, and, ho man, do they have accents...

Since I got you here, I will make a dating website, is there a chat plugin that is compatible with Couch, or is it possible to make one with it? I mean I need to validate 2 members to have a private chat room. I guess I'll figure it out, but since I haven't use the latest Couch functionalities... yet.

I will start and will need your help, so I'll bother you for a few months - for your regular fee, of course.

Cheers,
Paolo
Hi Paolo,

There seem to be plenty of chat plugins available out there that are platform agnostic i.e. don't care which CMS your site uses and can be integrated as an addon to existing sites.

Haven't had the opportunity to use any though so won't be able to recommend any (perhaps our members would like to chip in?)

Once you choose one, please feel free to let me know if you require my help.
8 posts Page 1 of 1