Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 28th May 2013, 10:00
remy74 remy74 is offline
Junior Member
Join Date: May 2013
Posts: 16
Thanks: 9
Thanked 6 Times in 4 Posts

Originally Posted by till View Post
There is no api function availbale for that. The places were we use such conversions (e.g. web statistics) it is hard coded. Its a good idea to add it as a filter in the next version.
For testing, I'm trying to add this :
function filterField($field_name, $field_value, $filters, $filter_event) {

                        global $app;
                        $returnval = $field_value;

                        //* Loop trough all filters
                        foreach($filters as $filter) {
                                if($filter['event'] == $filter_event) {
                                        switch ($filter['type']) {
                                                case 'TOLOWER':
                                                        $returnval = strtolower($returnval);
                                                case 'TOUPPER':
                                                        $returnval = strtoupper($returnval);
                                                case 'IDNTOASCII':
                                                        $returnval = $app->functions->idn_encode($returnval);
                                                case 'IDNTOUTF8':
                                                        $returnval = $app->functions->idn_decode($returnval);
                                                case 'FORMATED_BYTES':
                                                        $unit = array('Bytes', 'KB', 'MB', 'GB', 'TB');
                                                        $returnval= @round($value/pow(1024, ($i = floor(log($returnval, 1024)))), 2).' '.$unit[$i];
                                                //   In the next try, will implement this on the functions class ..   
                                               // $returnval = $app->functions->convertSize($returnval);
                                                        $this->errorMessage .= "Unknown Filter: ".$filter['type'];

            return $returnval;
on the tform.inc files ..
And on the tfrom file module :
'filters'   => array( 0 => array( 'event' => 'SHOW',
                                              'type' => 'FORMATED_BYTES')
but no lucky, not working.. Is we forget something else ?

Last edited by remy74; 28th May 2013 at 11:03.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeradius and Mysql uvstudios HOWTO-Related Questions 4 19th February 2014 13:11
Proftpd + MySQL virtual users, can't connect geekman HOWTO-Related Questions 28 27th September 2010 19:03
FreeRadius + MySQL working, but I don't know how to customise SQL queries awe Installation/Configuration 4 5th April 2010 00:28
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 18:26
Webmin docs missing namit Server Operation 11 5th January 2006 10:51

All times are GMT +2. The time now is 12:34.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.