ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

subscription_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
26 class subscription_markup_1_0_0{
27
38 var $String = false;
39 var $SubscriptionAlgorithms = false;
40
55 function __construct()
56 {
57 try
58 {
59 $this->String = get_package_object( 'string' , 'last' , __FILE__ );
60 $this->SubscriptionAlgorithms = get_package(
61 'subscription::subscription_algorithms' , 'last' , __FILE__
62 );
63 }
64 catch( Exception $e )
65 {
66 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
67 }
68 }
69
92 function compile_unsubscribe_url( &$Settings )
93 {
94 try
95 {
96 $UserId = $Settings->get_setting( 'user_id' );
97 $SubscriptionId = $Settings->get_setting( 'subscription_id' );
98
99 $Hash = $this->SubscriptionAlgorithms->calculate_hash( $UserId , $SubscriptionId );
100
101 return( "{http_host}/unsubscribe.html?user_id[eq]$UserId&hash[eq]$Hash" );
102 }
103 catch( Exception $e )
104 {
105 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
106 }
107 }
108 }
109 ?>