Character limit for...
 
Notifications
Clear all

Character limit for summary?

5 Posts
3 Users
0 Reactions
1,920 Views
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

Is it possible to have a hard character limit for the summary?

I admit to sucking at queries and PHP, so I'm not sure how to go about it or if it would take a huge modification to do.


Skins made by Kali are no longer supported!

 
Posted : 04/05/2010 10:19 pm
(@tammy)
Posts: 2577
Member Moderator
 

You could change the summary field in the database from a text field to varchar(255).  That would be a very short summary.  Anything else would be a pretty involved mod.


 
Posted : 05/05/2010 12:30 am
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

Thanks for the info.

I have a feeling that our users would riot if we had such a short summary limit. However, if some PHP genius feels like taking the task on, we're willing to fork over some $$$ for the effort.


Skins made by Kali are no longer supported!

 
Posted : 05/05/2010 8:38 pm
(@hobert)
Posts: 61
Trusted Member
 

I'm not sure just changing the SQL database table would be satisfactory (no matter what length you decide).  Wouldn't that just throw up a SQL error if the the summary was too small and fail the story add?

After a little bit of Googlefu, I found two different javascripts that might be useful, if you can rewrite either of them and add them to the includes/storyform.php.

http://www.reconn.us/content/view/34/46/  (This looks promising as it is short.)

http://www.hscripts.com/scripts/JavaScript/character-count.php

And, no, not angling for the job (grin).


efiction - 3.5.3
MySql - 5.5.32
php - 5.5.22
Linex - Apache 2.2.17
Hosted by: Fatcow!
http://www.hobert.net/fic/

 
Posted : 06/05/2010 12:05 pm
(@tammy)
Posts: 2577
Member Moderator
 

No, it won't throw an error.  It'll just cut the text off at the limit.  That's why I suggested that as the only easy way to do it.  You'd have to use a combination of javascript and checks within the php (to catch people using FF and other extensions).


 
Posted : 06/05/2010 12:49 pm
Share: