Omar G. - October 22, 2015, 12:08 pm - Blog

I like to trim long messages to show only a portion of it to the front end user. I do this directly in my forum or as a feature while coding multiple plugins. Here I will explain to you how to do it directly within your theme.


After installing both plugins.
  1. Go to your FTP, inside your plugins directory, find and open the "phptpl_allowed_funcs.txt" file.

    Add after:

Now you should be able to use any of the following within your templates to strip any message down:
Now you can use something like:

<?=ougc_getpreview($post['message'], 100)?>

<?=ougc_getpreview($post['message'], 50, false)?>

<?=ougc_getpreview($post['message'], 0, true, false)?>

I hope it is of some use for you.