Author |
Message |
Susann
Moderator

Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support
|
Posted:
Thu Sep 24, 2009 9:23 am |
|
I´m developing a new site and need to reduce the size of page text and header text too.
Is there a way to change it only in the db ?
How do I change it in the code ?
How can I use an alternative editor only for this module ? I need to limit the options of the editor and I believe its easier to use an alternative.
Any ideas ? |
|
|
|
 |
jestrella
Moderator

Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic
|
Posted:
Thu Sep 24, 2009 10:21 pm |
|
I really not understand the first part... aboot the second one, it might require a little hardwork |
_________________ "For those whom have not reach the sky... Every mountain seems high"
Best Regards
Jonathan Estrella
http://about.me/jestrella04 |
|
|
 |
Susann

|
Posted:
Fri Sep 25, 2009 5:03 am |
|
The second part is already done.I removed the editor from this module and used rnconfig for this.
The other thing is more important. I would like to limit the number of rows or characters you can insert into the page text and header text.
Is it possible to limit it via database to 500 characters only ?
`page_header` text NOT NULL,
`text` text NOT NULL, |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Fri Sep 25, 2009 6:49 am |
|
If I can jump in on this...search for "jquery maximum characters textarea" and you'll see some examples of how you can do this. You can then add a file to either the modules/addons or includes/addons (depending on how frequently you want to load the JS), without modifying content plus. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
jestrella

|
Posted:
Fri Sep 25, 2009 6:52 am |
|
Is posible to do what you stated Susann, but Kevin's approach will be better so you don't need to touch code itself |
|
|
|
 |
Susann

|
Posted:
Fri Sep 25, 2009 7:08 am |
|
|
|
 |
kguske

|
Posted:
Fri Sep 25, 2009 7:13 am |
|
Just be aware that if the user has JS disabled, this won't stop them from submitting more than 500 characters. |
|
|
|
 |
Susann

|
Posted:
Fri Sep 25, 2009 7:46 am |
|
Yes, I know this and therefore I think I will look for someone who is able to change this module so that I can use it for my site without problems. |
|
|
|
 |
kguske

|
Posted:
Fri Sep 25, 2009 8:08 am |
|
How will they do this? I don't know of any other ways. |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Fri Sep 25, 2009 9:08 am |
|
You could trim the input when saving to db to 500 characters.
The only problem with this is that a user can enter more than 500. The only way to correct this is to us JS as Kevin has suggested. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
gazj
Worker


Joined: Apr 28, 2006
Posts: 152
Location: doncaster england
|
Posted:
Fri Sep 25, 2009 10:01 am |
|
Code:$text = ( strlen($text) > 500 ) ? substr($text, 0, (500 - 4)) . ' ...' : $text;
|
add this to the part where it saves to the db and change the $text to what ever the $ is for the content this will (if the content is longer than 500 chars) limit it to 496 and add ... to the end could be altered to show a div with styling to make a notification box under the text to show a message like content length exceeded |
|
|
|
 |
Susann

|
Posted:
Sun Sep 27, 2009 10:51 am |
|
Thanks gazj! Now I only need to figure out where is this part of code but it looks like this will do the trick. |
|
|
|
 |
|