ultimix
rating_markup.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
38  var $RatingAlgorithms = false;
39 
54  function __construct()
55  {
56  try
57  {
58  $this->RatingAlgorithms = get_package( 'rating::rating_algorithms' , 'last' , __FILE__ );
59  }
60  catch( Exception $e )
61  {
62  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
63  }
64  }
65 
88  function compile_rating( &$Settings )
89  {
90  try
91  {
92  $MasterId = $Settings->get_setting( 'master_id' );
93  $MasterType = $Settings->get_setting( 'master_type' , 'user' );
94 
95  $Rating = $this->RatingAlgorithms->get_rating( $MasterId , $MasterType );
96 
97  $ShowPrefix = intval( $Settings->get_setting( 'show_prefix' , 0 ) );
98 
99  return( $ShowPrefix == 1 ? "{lang:rating}: $Rating" : $Rating );
100  }
101  catch( Exception $e )
102  {
103  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
104  }
105  }
106  }
107 ?>