Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Susann
Moderator



Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Thu Sep 24, 2009 9:23 am Reply with quote

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 ?
 
View user's profile Send private message
jestrella
Moderator



Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic

PostPosted: Thu Sep 24, 2009 10:21 pm Reply with quote

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 [ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message Visit poster's website
Susann







PostPosted: Fri Sep 25, 2009 5:03 am Reply with quote

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: 6432

PostPosted: Fri Sep 25, 2009 6:49 am Reply with quote

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...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
jestrella







PostPosted: Fri Sep 25, 2009 6:52 am Reply with quote

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







PostPosted: Fri Sep 25, 2009 7:08 am Reply with quote

Thanks will try it.
 
kguske







PostPosted: Fri Sep 25, 2009 7:13 am Reply with quote

Just be aware that if the user has JS disabled, this won't stop them from submitting more than 500 characters.
 
Susann







PostPosted: Fri Sep 25, 2009 7:46 am Reply with quote

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







PostPosted: Fri Sep 25, 2009 8:08 am Reply with quote

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

PostPosted: Fri Sep 25, 2009 9:08 am Reply with quote

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. 
View user's profile Send private message
gazj
Worker
Worker



Joined: Apr 28, 2006
Posts: 152
Location: doncaster england

PostPosted: Fri Sep 25, 2009 10:01 am Reply with quote

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
 
View user's profile Send private message Visit poster's website
Susann







PostPosted: Sun Sep 27, 2009 10:51 am Reply with quote

Thanks gazj! Now I only need to figure out where is this part of code but it looks like this will do the trick.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©