Revision 2083
Added by darkviper almost 12 years ago
- modules/news/upgrade manipulation of {SYSVAR:}-Tags fixed
- modules/wysiwyg/upgrade manipulation of {SYSVAR:}-Tags fixed
- modules/news/add default template fixed
| upgrade.php | ||
|---|---|---|
| 194 | 194 |         if (($oEntrySet = $oDb->doQuery($sql))) {
 | 
| 195 | 195 | $iRecords = 0; | 
| 196 | 196 | $iReplaced = 0; | 
| 197 |             $aSearch = array( '/\{SYSVAR\:MEDIA_REL\}[\/\\\\]?/sU',
 | |
| 198 |                               '/\{SYSVAR\:WB_URL\}[\/\\\\]?/sU',
 | |
| 199 |                               '/(\{SYSVAR\:AppUrl\.MediaDir\})[\/\\\\]?/sU',
 | |
| 200 |                               '/(\{SYSVAR\:AppUrl\})[\/\\\\]?/sU'
 | |
| 197 |             $aSearch = array( '/\{SYSVAR\:MEDIA_REL\}\/*/s',
 | |
| 198 |                               '/\{SYSVAR\:WB_URL\}\/*/s',
 | |
| 199 |                               '/'.preg_quote('"'.$oReg->AppUrl.$oReg->MediaDir, '/').'*/s',
 | |
| 200 |                               '/'.preg_quote('"'.$oReg->AppUrl, '/').'*/s',
 | |
| 201 |                               '/(\{SYSVAR\:AppUrl\.MediaDir\})\/+/s',
 | |
| 202 |                               '/(\{SYSVAR\:AppUrl\})\/+/s'
 | |
| 201 | 203 | ); | 
| 202 |             $aReplace = array( '{SYSVAR:AppUrl.MediaDir}', '{SYSVAR:AppUrl}', '\1', '\1' );
 | |
| 204 |             $aReplace = array( '{SYSVAR:AppUrl.MediaDir}', '{SYSVAR:AppUrl}', '{SYSVAR:AppUrl.MediaDir}', '{SYSVAR:AppUrl}', '\1', '\1');
 | |
| 203 | 205 |             while (($aEntry = $oEntrySet->fetchRow(MYSQL_ASSOC))) {
 | 
| 204 | 206 | $iCount = 0; | 
| 205 | 207 | $aSubject = array($aEntry['content_long'], $aEntry['content_short']); | 
| ... | ... | |
| 214 | 216 | $iRecords++; | 
| 215 | 217 | } | 
| 216 | 218 | } | 
| 217 | $msg[] = '['.$iRecords.'] records with ['.$iReplaced.'] SYSVAR placeholder(s) repaired'." $OK"; | |
| 219 |             $msg[] = '['.$iRecords.'] records with ['.$iReplaced.'] SYSVAR placeholder(s) repaired/inserted'." $OK";
 | |
| 218 | 220 | } | 
| 219 |         try {
 | |
| 220 | $sql = 'UPDATE `'.$oDb->TablePrefix.'mod_news_posts` '; | |
| 221 |             $sql .= 'SET `content` = REPLACE(`content`, \'"'.$oReg->AppPath.$oReg->MediaDir.'\', \'"{SYSVAR:AppPath.MediaDir}\')';
 | |
| 222 | $oDb->doQuery($sql); | |
| 223 | $msg[] = 'Change internal absolute Media links into SYSVAR placeholders'." $OK"; | |
| 224 |         } catch(WbDatabaseException $e) {
 | |
| 225 | $msg[] = ''.$oDb->get_error(); | |
| 226 | } | |
| 227 |         try {
 | |
| 228 | $sql = 'UPDATE `'.$oDb->TablePrefix.'mod_news_posts` '; | |
| 229 |             $sql .= 'SET `content` = REPLACE(`content`, \'"'.$oReg->AppPath.'\', \'"{SYSVAR:AppPath}\')';
 | |
| 230 | $oDb->doQuery($sql); | |
| 231 | $msg[] = 'Change internal absolute links into SYSVAR placeholders'." $OK"; | |
| 232 |         } catch(WbDatabaseException $e) {
 | |
| 233 | $msg[] = ''.$oDb->get_error(); | |
| 234 | } | |
| 235 | 221 | /* --- rebuild all access files ------------------------------------------------------- */ | 
| 236 | 222 | 		$aReport = array('FilesDeleted'=>0,'FilesCreated'=>0,);
 | 
| 237 | 223 | $oReorg = new m_news_Reorg(ModuleReorgAbstract::LOG_EXTENDED); | 
Also available in: Unified diff