Posté par : Omar G. - October 22, 2015, 12:08 pm - Forum : Tutorials

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.

Requirements


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

    Code :
    validate_email_format


    Add after:

    Code :
    ougc_getpreview


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:

HTML Code
1
2
3
4
5
6
7
<?=ougc_getpreview($post['message'])?>

<?=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.