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.
You should now be able to use any of the following within your templates to strip any message down.
You can use something like:
I hope it is of some use for you.
Requirements
- Upload Template Conditionals plugin by Yumi and activate it (v1.7.7 as of this).
- Upload the following plugin file to your plugin directory and activate it.
Steps
After installing both plugins.
- Go to your FTP, inside your plugins directory, find and open the "phptpl_allowed_funcs.txt" file.
Find:
validate_email_format
Add after:
ougc_getpreview
You should now be able to use any of the following within your templates to strip any message down.
You can use something like:
<?=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.
This post was last modified: 1 Mar, 2020, 9:06 pm by Omar G.. Edit Reason: Fix code tags