PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Susann
Moderator


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

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

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 Visit poster's website
jestrella
Moderator


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

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

I really not understand the first part... aboot the second one, it might require a little hardwork
View user's profile Send private message Visit poster's website
Susann
Moderator


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

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

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,
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 5997

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

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


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

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

Is posible to do what you stated Susann, but Kevin's approach will be better so you don't need to touch code itself
View user's profile Send private message Visit poster's website
Susann
Moderator


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

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

Thanks will try it.
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 5997

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

Just be aware that if the user has JS disabled, this won't stop them from submitting more than 500 characters.
View user's profile Send private message
Susann
Moderator


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

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

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.
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 5997

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

How will they do this? I don't know of any other ways.
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2404
Location: Pennsylvania

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

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


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

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

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
Moderator


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

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

Thanks gazj! Now I only need to figure out where is this part of code but it looks like this will do the trick.
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum