Project

General

Profile

« Previous | Next » 

Revision 1054

Added by Matthias over 15 years ago

Added changed news settings to upgrade-script

View differences:

trunk/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.8.0 -------------------------------------
14
11-July-2009 Matthias Gallas
15
+	Added changed news settings to upgrade-script
14 16
09-July-2009 Ruud Eisinga
15 17
!	Added a better option to hide the READ_MORE link in the news module. (ticket #739)
16 18
09-July-2009 Matthias Gallas
trunk/wb/upgrade-script.php
234 234

  
235 235

  
236 236
/**********************************************************
237
 *  - Update settings of News Modul
238
 */
239

  
240
// These are the default setting
241
$post_loop = '<tr class=\"post_top\">
242
<td class=\"post_title\"><a href=\"[LINK]\">[TITLE]</a></td>
243
<td class=\"post_date\">[PUBLISHED_TIME], [PUBLISHED_DATE]</td>
244
</tr>
245
<tr>
246
<td class=\"post_short\" colspan=\"2\">
247
[SHORT] 
248
<span style=\"visibility:[SHOW_READ_MORE];\"><a href=\"[LINK]\">[TEXT_READ_MORE]</a></span>
249
</td>
250
</tr>';
251
$post_header = addslashes('<table cellpadding="0" cellspacing="0" border="0" width="98%">
252
<tr>
253
<td height="30"><h1>[TITLE]</h1></td>
254
<td rowspan="3" style="display: [DISPLAY_IMAGE]"><img src="[GROUP_IMAGE]" alt="[GROUP_TITLE]" /></td>
255
</tr>
256
<tr>
257
<td valign="top"><b>[TEXT_POSTED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [PUBLISHED_DATE]</b></td>
258
</tr>
259
<tr style="display: [DISPLAY_GROUP]">
260
<td valign="top"><a href="[BACK]">[PAGE_TITLE]</a> >> <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>
261
</tr>
262
</table>');
263
$post_footer = '<p>[TEXT_LAST_CHANGED]: [MODI_DATE] [TEXT_AT] [MODI_TIME]</p>
264
<a href=\"[BACK]\">[TEXT_BACK]</a>';
265
$comments_header = addslashes('<br /><br />
266
<h2>[TEXT_COMMENTS]</h2>
267
<table cellpadding="2" cellspacing="0" border="0" width="98%">');
268
$comments_loop = addslashes('<tr>
269
<td class="comment_title">[TITLE]</td>
270
<td class="comment_info">[TEXT_BY] [DISPLAY_NAME] [TEXT_ON] [DATE] [TEXT_AT] [TIME]</td>
271
</tr>
272
<tr>
273
<td colspan="2" class="comment_text">[COMMENT]</td>
274
</tr>');
275
$comments_footer = '</table>
276
<br /><a href=\"[ADD_COMMENT_URL]\">[TEXT_ADD_COMMENT]</a>';
277
$comments_page = '<h1>[TEXT_COMMENT]</h1>
278
<h2>[POST_TITLE]</h2>
279
<br />';
280

  
281

  
282
// Insert default settings into database
283
$query_dates = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings where section_id != 0 and page_id != 0");
284
while($result = $query_dates->fetchRow()) {
285
	
286
	echo "<b>Add default settings data to database for news section_id= ".$result['section_id']."</b><br />";
287
	$section_id = $result['section_id'];
288

  
289
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `post_loop` = '$post_loop' WHERE `section_id` = $section_id")) {
290
		echo 'Database data post_loop added successfully<br />';
291
	}
292
	echo mysql_error().'<br />';
293
	
294
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `post_header` = '$post_header' WHERE `section_id` = $section_id")) {
295
		echo 'Database data post_header added successfully<br />';
296
	}
297
	echo mysql_error().'<br />';
298
	
299
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `post_footer` = '$post_footer' WHERE `section_id` = $section_id")) {
300
		echo 'Database data post_footer added successfully<br />';
301
	}
302
	echo mysql_error().'<br />';
303
	
304
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `comments_header` = '$comments_header' WHERE `section_id` = $section_id")) {
305
		echo 'Database data comments_header added successfully<br />';
306
	}
307
	echo mysql_error().'<br />';
308
	
309
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `comments_loop` = '$comments_loop' WHERE `section_id` = $section_id")) {
310
		echo 'Database data comments_loop added successfully<br />';
311
	}
312
	echo mysql_error().'<br />';
313
	
314
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `comments_footer` = '$comments_footer' WHERE `section_id` = $section_id")) {
315
		echo 'Database data comments_footer added successfully<br />';
316
	}
317
	echo mysql_error().'<br />';
318
	
319
	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `comments_page` = '$comments_page' WHERE `section_id` = $section_id")) {
320
		echo 'Database data comments_page added successfully<br />';
321
	}
322
	echo mysql_error().'<br />';
323

  
324
}
325

  
326
/**********************************************************
237 327
 *  - Set Version to WB 2.8RC1
238 328
 */
239 329
echo "<br />Update database version number to 2.8RC1 : ";

Also available in: Unified diff