We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Shortening the text in Mailbox preview | Forum

Alican
Alican Feb 22 '14
Hello, 


I would like to shorten the number characters in texts in Mailbox preview.





Should I edit Database or Plugins files? And Where exactly responsible for this settings.


Thanks a lot

Alican
Alican Mar 1 '14
no idea?
tammy harris
tammy harris Mar 1 '14
it would be in the plugin 
look in views controllers and components

but any change you make if the plugin gets updated will be lost 
Arash
Arash Mar 2 '14
It is in the .._plugins\mailbox\controllers\mailbox.php you will find your answer. The usual way of shortening a text is substr() function for to do what you want. Since you (and the app does it is done with mb_substr(). Knowing that it's going to be easy as a pie for you to find where to change it: 


Line 206: 

                    $short = mb_strlen($value['text']) > 100 ? mb_substr($value['text'], 0, 100) . '...' : $value['text']; //TODO:
Guess what value you have to change;)
I don't know if this will change it on both places, but I'm guessing not. Try changing, and get back to us if it doesn't.
Since I want to be a good teacher I'm also goning to point you to the php.net page: http://se2.php.net/mb_substr
Mark the thread as solved if you got it all worked out:D

Alican
Alican Mar 2 '14
Arash, Thanks a lot!


This completely solved domain.com/mailbox/inbox page. But your guess is correct, it didn't effect the text in the console mailbox new mail notification area. 
Do you have any idea which page is responsible for console?.. :) I think I figured out 'substr()' with your help and can deal with it, if I can find the related file. Thanks again.

Alican
Alican Mar 2 '14
Ok the file to be edited for the console is -> _plugins/mailbox/classes/request_event_handler.php

Thank you again! :) I can't find how to mark the thread as solved though, but it's solved.:)

Arash
Arash Mar 2 '14
Awsome to be helping you out Alican. Ang well done with getting back, now it's gonna be easer for the next person! Feel free to help someone else as a thank you:D