Changeset 1063
- Timestamp:
- Mar 3, 2006, 5:32:21 AM (18 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/calendar_monthly.class.php
r1062 r1063 453 453 $ratio_h = $tn_height/$cell_height; 454 454 455 455 456 $pos_top=$pos_left=0; 456 457 $img_width=$img_height=''; … … 462 463 $img_height = 'height="'.$cell_height.'"'; 463 464 $browser_img_width = $cell_height*$tn_width/$tn_height; 464 $pos_left = ($ tn_width-$browser_img_width)/2;465 $pos_left = ($browser_img_width-$cell_width)/2; 465 466 } 466 467 else … … 468 469 $img_width = 'width="'.$cell_width.'"'; 469 470 $browser_img_height = $cell_width*$tn_height/$tn_width; 470 $pos_top = ($ tn_height-$browser_img_height)/2;471 $pos_top = ($browser_img_height-$cell_height)/2; 471 472 } 472 473 } -
trunk/include/functions_session.inc.php
r1034 r1063 55 55 } 56 56 57 if (isset($conf['session_save_handler']) 57 if (isset($conf['session_save_handler']) 58 58 and ($conf['session_save_handler'] == 'db') 59 and defined('PHPWG_INSTALLED')) 59 and defined('PHPWG_INSTALLED')) 60 60 { 61 session_set_save_handler('pwg_session_open', 61 session_set_save_handler('pwg_session_open', 62 62 'pwg_session_close', 63 63 'pwg_session_read', … … 80 80 { 81 81 if ( isset($_SERVER['REDIRECT_URL']) ) 82 { // mod_rewrite is activated for upper level directories. we must set the 82 { // mod_rewrite is activated for upper level directories. we must set the 83 83 // cookie to the path shown in the browser otherwise it will be discarded. 84 84 $scr = $_SERVER['REDIRECT_URL']; … … 96 96 * @params not use but useful for php engine 97 97 */ 98 function pwg_session_open($path, $name) 98 function pwg_session_open($path, $name) 99 99 { 100 100 return true; … … 105 105 * 106 106 */ 107 function pwg_session_close() 107 function pwg_session_close() 108 108 { 109 109 return true; … … 112 112 /** 113 113 * this function returns 114 * a string corresponding to the value of the variable save in the session 114 * a string corresponding to the value of the variable save in the session 115 115 * or an empty string when the variable doesn't exist 116 * 116 * 117 117 * @param string session id 118 118 */ 119 function pwg_session_read($session_id) 119 function pwg_session_read($session_id) 120 120 { 121 121 $query = ' 122 SELECT data 122 SELECT data 123 123 FROM '.SESSIONS_TABLE.' 124 124 WHERE id = \''.$session_id.'\' 125 125 ;'; 126 126 $result = pwg_query($query); 127 if ($result) 127 if ($result) 128 128 { 129 129 $row = mysql_fetch_assoc($result); 130 130 return $row['data']; 131 } 132 else 131 } 132 else 133 133 { 134 134 return ''; … … 137 137 138 138 /** 139 * returns true; writes set a variable in the active session 140 * 139 * returns true; writes set a variable in the active session 140 * 141 141 * @param string session id 142 142 * @data string value of date to be saved 143 143 */ 144 function pwg_session_write($session_id, $data) 144 function pwg_session_write($session_id, $data) 145 145 { 146 146 $query = ' 147 SELECT id 148 FROM '.SESSIONS_TABLE.' 149 WHERE id = \''.$session_id.'\' 150 ;'; 151 $result = pwg_query($query); 152 if (mysql_num_rows($result)) 153 { 154 $query = ' 155 UPDATE '.SESSIONS_TABLE.' 147 UPDATE '.SESSIONS_TABLE.' 156 148 SET expiration = now(), 157 149 data = \''.$data.'\' 158 150 WHERE id = \''.$session_id.'\' 159 ;'; 160 pwg_query($query); 161 } 162 else 151 ;'; 152 pwg_query($query); 153 if ( mysql_affected_rows()==0 ) 163 154 { 164 155 $query = ' 165 INSERT INTO '.SESSIONS_TABLE.' 156 INSERT INTO '.SESSIONS_TABLE.' 166 157 (id,data,expiration) 167 158 VALUES(\''.$session_id.'\',\''.$data.'\',now()) 168 159 ;'; 169 pwg_query($query); 160 pwg_query($query); 170 161 } 171 162 return true; … … 173 164 174 165 /** 175 * returns true; delete the active session 176 * 166 * returns true; delete the active session 167 * 177 168 * @param string session id 178 169 */ 179 function pwg_session_destroy($session_id) 170 function pwg_session_destroy($session_id) 180 171 { 181 172 $query = ' 182 DELETE 173 DELETE 183 174 FROM '.SESSIONS_TABLE.' 184 175 WHERE id = \''.$session_id.'\' … … 192 183 * called each time a session is closed. 193 184 */ 194 function pwg_session_gc() 185 function pwg_session_gc() 195 186 { 196 187 global $conf; 197 188 198 189 $query = ' 199 DELETE 190 DELETE 200 191 FROM '.SESSIONS_TABLE.' 201 192 WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(expiration) > '
Note: See TracChangeset
for help on using the changeset viewer.