Results 1 to 6 of 6

Thread: Limit Characters in "Description"

  1. #1
    Donor
    Join Date
    Aug 2010
    Location
    Huntington Beach, CA USA
    Posts
    36
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default Limit Characters in "Description"

    I want to limit the number of characters someone can add in the Description field. I know that in the Submit admin we have the choice of:

    Description Minimum characters:
    Summary Maximum characters:

    Is it possible to implement a "Description - Maximum characters" ? Either in Admin panel or in the code?

    I just had someone enter an entire (long) article in the description... and after moderation approval... the entire thing posted... It was a legitimate poster... but we have to keep that from happening since the point is ultimately to send them to the posts URL.

    Thanks...

    Jeff

  2. #2
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,914
    Blog Entries
    88
    Thanks
    519
    Thanked 845 Times in 550 Posts

    Default

    You would need a plugin (see Extra Post Fields in Submit) to run a length check during post submission and show an error if the post has exceeded the limit.

    Alternatively, edit the bookmarking_post.php template to truncate the post when it is displayed:

    PHP Code:
    <div class="show_post_content">
                <?php echo nl2br(truncate($h->post->content400); ?>
                <?php $h->pluginHook('show_post_content_post'); ?>
            </div>
    That might upset someone who has written 2,000 characters, though.

  3. #3
    Designer mabujo's Avatar
    Join Date
    Mar 2010
    Location
    France
    Posts
    296
    Thanks
    45
    Thanked 157 Times in 101 Posts

    Default

    You could also implement a counter on the submit form in JavaScript without too much difficulty...
    mabujo
    Themes : Yonda - Isis - My Hotaru sites : Arsenal News - Coming soon : More Hotaru sites and Hotaru Themes

  4. #4
    Senior Member
    Join Date
    Aug 2010
    Posts
    199
    Thanks
    41
    Thanked 8 Times in 8 Posts

    Default

    Hi,

    Thanks for the suggestion. Yes, that is one thing I can do though I am not too comfortable messing around with PHP. Also, any mods that I do to the scripts I will have to redo when there is a new version of the product and it is not clear what the impact may be. For this reason, I try to minimize the amount of code changes that I make to any CMS script. Thanks again for all of your help.

    Rich

  5. #5
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,914
    Blog Entries
    88
    Thanks
    519
    Thanked 845 Times in 550 Posts

    Default

    Quote Originally Posted by richrf View Post
    Also, any mods that I do to the scripts I will have to redo when there is a new version of the product
    Not really. Hotaru is designed so that you don't lose your modifications when you upgrade the core or plugins. More info here. The only challenge is that when new features are added to templates, you might need to copy them into your modified templates.

  6. #6
    Senior Member
    Join Date
    Aug 2010
    Posts
    199
    Thanks
    41
    Thanked 8 Times in 8 Posts

    Default

    I agree. But it depends upon where the code is placed as well as whether new custom code will continue to work with upgrades. My own disposition is to perform as little customization as necessary in order to ensure a relatively smooth upgrade path. This also assumes that the core code will evolve with backward compatibility. Wordpress, for example, does migrate well. Joomla and Drupal provide very little backward compatibility from version to version and are a headache because of this. From what I can tell so far there are mixed experiences with Hotaru - some plugins seem to migrate better than others from version to version. Is this the case or is it better than what I have observed.

    Thanks for the link and additional info.

    Rich

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. "Error establishing mySQL database connection." i'm STUCK ON 'Step 2/4'
    By justmailnaveen in forum Installation and Upgrading
    Replies: 27
    Last Post: 11-03-2011, 11:05 AM
  2. Replies: 3
    Last Post: 05-25-2010, 11:37 PM
  3. Replies: 4
    Last Post: 05-21-2010, 05:53 PM
  4. Post "comment/tag/edit" icons not showing up after clean 1.2 install
    By louis in forum Installation and Upgrading
    Replies: 2
    Last Post: 05-08-2010, 12:12 PM
  5. "Posted on DD/MMM/YYYY" instead of "Posted XYZ Days Ago"?
    By nothingman in forum How-To and Troubleshooting
    Replies: 9
    Last Post: 11-25-2009, 03:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •