1 | <?php |
---|
2 | |
---|
3 | $visible=(isset($visible))?$visible:false; |
---|
4 | global $cl_version,$cl_plugin; |
---|
5 | |
---|
6 | $cl_version=isset($cl_version)?$cl_version:""; |
---|
7 | $cl_plugin=isset($cl_plugin)?$cl_plugin:""; |
---|
8 | |
---|
9 | $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : |
---|
10 | (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true'); |
---|
11 | //=========================================================================== |
---|
12 | $cookies="' x '"; |
---|
13 | global $imgSizeWH ; |
---|
14 | global $events ,$windowHeight , $windowWidth; |
---|
15 | global $size ; |
---|
16 | global $DEBUG_autosize; |
---|
17 | global $autosize_parametres,$user_status; |
---|
18 | global $has_pamoorama,$pictureSelType,$pictureDeriv; |
---|
19 | //=========================================================================== |
---|
20 | $size= array( |
---|
21 | 'src_img_h' => ($imgSizeWH[1]==0)?$_COOKIE['theMainImageHeight']:$imgSizeWH[1], |
---|
22 | 'src_img_w' => ($imgSizeWH[0]==0)?$_COOKIE['theMainImageWidth']:$imgSizeWH[0], |
---|
23 | 'window_height' =>($windowHeight==0)?$_COOKIE['windowHeight']:$windowHeight, |
---|
24 | 'window_width' => ($windowWidth==0)?$_COOKIE['windowWidth']:$windowWidth |
---|
25 | ); |
---|
26 | $ratio=$size['src_img_w']/$size['src_img_h']; |
---|
27 | $my_path = AUTOSIZE_PATH_ABS; |
---|
28 | $theme=$user['theme']; |
---|
29 | $user_status = $user['status'] ; |
---|
30 | $template->assign( array( |
---|
31 | 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS, |
---|
32 | 'ROOT_URL' => ROOT_URL, |
---|
33 | 'AUTOSIZE_PATH' => AUTOSIZE_PATH |
---|
34 | ) |
---|
35 | ); |
---|
36 | if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; |
---|
37 | //====================================================== |
---|
38 | |
---|
39 | //=== type possible === |
---|
40 | $defined_types = array_keys(ImageStdParams::get_defined_type_map()); |
---|
41 | if(isset($defined_types)) |
---|
42 | foreach ($defined_types as $type_size){ |
---|
43 | $value = $type_size; |
---|
44 | if($type_size != "square" && $type_size != "thumb" ) |
---|
45 | $options[$value] = $type_size; |
---|
46 | } |
---|
47 | $autosize_parametres = cl_autosize_Get_Options(); |
---|
48 | $user_type= get_user_status($user_status)."_type"; |
---|
49 | $user_type= $autosize_parametres->$user_type ; |
---|
50 | $select_type=ImageStdParams::get_by_type($user_type); |
---|
51 | $ideal_size = $select_type->sizing->ideal_size ; |
---|
52 | if($user_type=="Autosize" || $user_type=="SelMaxi"){ |
---|
53 | $ideal_size[0]=$imgSizeWH[0]; |
---|
54 | $ideal_size[1]=$imgSizeWH[1]; |
---|
55 | } |
---|
56 | |
---|
57 | //=========================================== |
---|
58 | $COOKIE_PATH = cookie_path() ; |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | $slide_show = isset($page['slideshow'])?$page['slideshow']:false; |
---|
63 | |
---|
64 | $template->assign( |
---|
65 | array( |
---|
66 | 'ideal_size_width' => $ideal_size[0] , |
---|
67 | 'ideal_size_height' => $ideal_size[1] , |
---|
68 | 'has_pamoorama' => $has_pamoorama, |
---|
69 | 'pictureMap' => $pictureDeriv , |
---|
70 | 'pictureDeriv' => $pictureDeriv , |
---|
71 | 'pictureSelType' => $pictureSelType, |
---|
72 | |
---|
73 | 'SRC_IMG' => $SRC_IMG, |
---|
74 | 'liste_type' => $liste_type , |
---|
75 | 'COOKIE_PATH' => $COOKIE_PATH , |
---|
76 | 'slide_show' => $slide_show, |
---|
77 | |
---|
78 | 'ratio' =>$ratio , |
---|
79 | |
---|
80 | 'webmaster_type' => array( |
---|
81 | 'OPTIONS' => $options, |
---|
82 | 'SELECTED' => $autosize_parametres->webmaster_type |
---|
83 | ), |
---|
84 | 'admin_type' => array( |
---|
85 | 'OPTIONS' => $options, |
---|
86 | 'SELECTED' => $autosize_parametres->admin_type |
---|
87 | ), |
---|
88 | 'generic_type' => array( |
---|
89 | 'OPTIONS' => $options, |
---|
90 | 'SELECTED' => $autosize_parametres->generic_type |
---|
91 | ), |
---|
92 | 'guest_type' => array( |
---|
93 | 'OPTIONS' => $options, |
---|
94 | 'SELECTED' => $autosize_parametres->guest_type |
---|
95 | ), |
---|
96 | 'normal_type' => array( |
---|
97 | 'OPTIONS' => $options, |
---|
98 | 'SELECTED' => $autosize_parametres->normal_type |
---|
99 | ), |
---|
100 | |
---|
101 | 'DEBUG_autosize' => $DEBUG_autosize , |
---|
102 | 'cl_visible' => $cl_visible, |
---|
103 | 'cl_version' => $cl_version , |
---|
104 | 'Version_pwg' => PHPWG_VERSION , |
---|
105 | 'cl_plugin' => $cl_plugin, |
---|
106 | |
---|
107 | 'fade_in' => $autosize_parametres->fade_in, |
---|
108 | 'thumbnail' => $conf['prefix_thumbnail'], |
---|
109 | 'visible' => $visible, |
---|
110 | |
---|
111 | 'theme' => $theme, |
---|
112 | |
---|
113 | 'windowHeight' => $windowHeight, |
---|
114 | 'windowWidth' => $windowWidth, |
---|
115 | |
---|
116 | 'SCALED_WIDTH' => $imgSizeWH[0], |
---|
117 | 'SCALED_HEIGHT' => $imgSizeWH[1], |
---|
118 | |
---|
119 | 'theImageWidth' => isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']: $imgSizeWH[0], |
---|
120 | 'theImageHeight' => isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$imgSizeWH[1], |
---|
121 | |
---|
122 | 'MINI_HEIGHT' => $autosize_parametres->mini_height, |
---|
123 | 'MINI_WIDTH' => $autosize_parametres->mini_width, |
---|
124 | |
---|
125 | 'MINI_HEIGHT2' => $autosize_parametres->mini_height2, |
---|
126 | 'MINI_WIDTH2' => $autosize_parametres->mini_width2, |
---|
127 | |
---|
128 | 'MARGE_BASSE' => $autosize_parametres->marge_basse, |
---|
129 | 'ECHELLE_MAX' => $autosize_parametres->echelle_max, |
---|
130 | |
---|
131 | |
---|
132 | 'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"' : '' , |
---|
133 | 'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"' : '' , |
---|
134 | 'defaut_type' => ($autosize_parametres->defaut_type == 'on') ? 'checked="defaut_type"' : '' , |
---|
135 | |
---|
136 | 'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"' : '' , |
---|
137 | 'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"' : '' , |
---|
138 | 'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"' : '' , |
---|
139 | 'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"' : '' , |
---|
140 | 'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"' : '' , |
---|
141 | |
---|
142 | 'user_status' => get_user_status($user_status) , |
---|
143 | |
---|
144 | 'Size' => $size |
---|
145 | |
---|
146 | ) |
---|
147 | ); |
---|
148 | |
---|
149 | if(preg_match("|fin_affiche|", $DEBUG_autosize, $val)){ |
---|
150 | echo "<pre>"; |
---|
151 | echo $DEBUG_autosize."<br>"; |
---|
152 | echo "autosize_parametres; ";print_r($autosize_parametres); |
---|
153 | echo "infos_message; ";print_r(explode(",","$infos_message")); |
---|
154 | echo "events; ";print_r($events); |
---|
155 | echo $pictureDeriv . " " . $pictureDeriv . " " . $pictureSelType; |
---|
156 | echo "WH: " . $windowHeight . "x " .$windowWidth; |
---|
157 | echo "Size : ".print_r($size); |
---|
158 | echo "COOKIE:".print_r($_COOKIE); |
---|
159 | |
---|
160 | |
---|
161 | die(); |
---|
162 | } |
---|
163 | |
---|
164 | |
---|
165 | //unset($_POST); |
---|
166 | ?> |
---|