MyBB
  Get preview of messages.
I like to trim long messages to show only a portion of it to the front end ...

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:
    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
There are currently no posts to display. Be the first one to leave a reply.

Current time: 18 Apr, 2024, 8:53 am