Project

General

Profile

« Previous | Next » 

Revision 1918

Added by Dietmar over 11 years ago

! /modules/news/ beginning beginning recoding
replacing absolute MediaUrl with place holder

View differences:

add.php
4 4
 * @category        modules
5 5
 * @package         news
6 6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
17 17

  
18
// Must include code to stop this file being access directly
19
/* -------------------------------------------------------- */
20
if(defined('WB_PATH') == false)
21
{
22
	// Stop this file being access directly
23
		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
18
if(!defined('WB_PATH')) {
19
	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
20
	throw new IllegalFileException();
24 21
}
25
/* -------------------------------------------------------- */
26 22

  
27
$header = '<table class=\"loop-header\">'."\n";
28
$post_loop = '<tr class=\"post-top\">
29
<td class=\"post-title\"><a href=\"[LINK]\">[TITLE]</a></td>
30
<td class=\"post-date\">[PUBLISHED_DATE], [PUBLISHED_TIME]</td>
31
</tr>
32
<tr>
33
<td class=\"post-short\" colspan=\"2\">
34
[SHORT]
35
<span style=\"visibility:[SHOW_READ_MORE];\"><a href=\"[LINK]\">[TEXT_READ_MORE]</a></span>
36
</td>
37
</tr>';
38
$footer = '</table>
39
<table class="page-header" style="display: [DISPLAY_PREVIOUS_NEXT_LINKS]">
40
<tr>
41
<td class="page-left">[PREVIOUS_PAGE_LINK]</td>
42
<td class="page-center">[OF]</td>
43
<td class="page-right">[NEXT_PAGE_LINK]</td>
44
</tr>
45
</table>';
46
$post_header = addslashes('<table cellpadding="0" cellspacing="0" class="post-header">
47
<tr>
48
<td><h1>[TITLE]</h1></td>
49
<td rowspan="3" style="display: [DISPLAY_IMAGE]">[GROUP_IMAGE]</td>
50
</tr>
51
<tr>
52
<td class="public-info"><b>[TEXT_POSTED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [PUBLISHED_DATE]</b></td>
53
</tr>
54
<tr style="display: [DISPLAY_GROUP]">
55
<td class="group-page"><a href="[BACK]">[PAGE_TITLE]</a> &gt;&gt; <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>
56
</tr>
57
</table>');
58
$post_footer = '<p>[TEXT_LAST_CHANGED]: [MODI_DATE] [TEXT_AT] [MODI_TIME]</p>
59
<a href=\"[BACK]\">[TEXT_BACK]</a>';
60
$comments_header = addslashes('<br /><br />
61
<h2>[TEXT_COMMENTS]</h2>
62
<table class="comment-header">');
63
$comments_loop = addslashes('<tr>
64
<td class="comment_title">[TITLE]</td>
65
<td class="comment_info">[TEXT_BY] [DISPLAY_NAME] [TEXT_ON] [DATE] [TEXT_AT] [TIME]</td>
66
</tr>
67
<tr>
68
<td colspan="2" class="comment-text">[COMMENT]</td>
69
</tr>');
70
$comments_footer = '</table>
71
<br /><a href=\"[ADD_COMMENT_URL]\">[TEXT_ADD_COMMENT]</a>';
72
$comments_page = '<h1>[TEXT_COMMENT]</h1>
73
<h2>[POST_TITLE]</h2>
74
<br />';
23
	$header      = '<table class="loop-header"'.PHP_EOL
24
	             . '  <tbody>'.PHP_EOL;
25
	$post_loop   = '    <tr class="post-top">'.PHP_EOL
26
	             . '      <td class="post-title"><a href="[LINK]">[TITLE]</a></td>'.PHP_EOL
27
	             . '      <td class=\"post-date\">[CREATED_DATE], [CREATED_TIME]</td>'.PHP_EOL
28
	             . '    </tr>'.PHP_EOL
29
	             . '    <tr>'.PHP_EOL
30
	             . '      <td class="post-short" colspan="2">'.PHP_EOL
31
	             . '        <span style="visibility:[SHOW_READ_MORE];">'.PHP_EOL
32
	             . '         <a href="[LINK]">[TEXT_READ_MORE]</a>'.PHP_EOL
33
	             . '        </span>'.PHP_EOL
34
	             . '      </td>'.PHP_EOL
35
	             . '    </tr>';
36
	$footer      = '  </tbody>'.PHP_EOL
37
	             . '</table>'.PHP_EOL
38
	             . '<table class="page-header" style="display: [DISPLAY_PREVIOUS_NEXT_LINKS]'.PHP_EOL
39
	             . '  <tbody>'.PHP_EOL
40
	             . '    <tr>'.PHP_EOL
41
	             . '      <td class="page-left">[PREVIOUS_PAGE_LINK]</td>'.PHP_EOL
42
	             . '      <td class="page-center">[OF]</td>'.PHP_EOL
43
	             . '      <td class="page-right">[NEXT_PAGE_LINK]</td>'.PHP_EOL
44
	             . '    </tr>'.PHP_EOL
45
	             . '  </tbody>'.PHP_EOL
46
	             . '</table>'.PHP_EOL;
47
	$post_header = '<table class="post-header"'.PHP_EOL
48
	             . '  <tbody>'.PHP_EOL
49
	             . '    <tr>'.PHP_EOL
50
	             . '      <td><h1>[TITLE]</h1></td>'.PHP_EOL
51
	             . '      <td rowspan="3" style="display: [DISPLAY_IMAGE]">[GROUP_IMAGE]</td>'.PHP_EOL
52
	             . '    </tr>'.PHP_EOL
53
	             . '    <tr>'.PHP_EOL
54
	             . '      <td class="public-info"><b>[TEXT_POSTED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [PUBLISHED_DATE]</b></td>'.PHP_EOL
55
	             . '    </tr>'.PHP_EOL
56
	             . '    <tr style="display: [DISPLAY_GROUP]">'.PHP_EOL
57
	             . '      <td class="group-page"><a href="[BACK]">[PAGE_TITLE]</a> &gt;&gt; <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>'.PHP_EOL
58
	             . '    </tr>'.PHP_EOL
59
	             . '  </tbody>'.PHP_EOL
60
	             . '</table>'.PHP_EOL;
61
	$post_footer = '<p>[TEXT_LAST_CHANGED]: [MODI_DATE] [TEXT_AT] [MODI_TIME]</p>'.PHP_EOL
62
	             . '<a href=\"[BACK]\">[TEXT_BACK]</a>'.PHP_EOL;
63

  
64
	$comments_header  = ''.PHP_EOL
65
	                  . '<h3>[TEXT_COMMENTS]</h3>'.PHP_EOL
66
	                  . '<table class="comment-header">'.PHP_EOL
67
	                  . '  <tbody>'.PHP_EOL;
68
	$comments_loop    = ''.PHP_EOL
69
	                  . '    <tr>'.PHP_EOL
70
	                  . '      <td class="comment_title">[TITLE]</td>'.PHP_EOL
71
	                  . '      <td class="comment_info">[TEXT_BY] [DISPLAY_NAME] [TEXT_ON] [DATE] [TEXT_AT] [TIME]</td>'.PHP_EOL
72
	                  . '    </tr>'.PHP_EOL
73
	                  . '    <tr>'.PHP_EOL
74
	                  . '      <td colspan="2" class="comment-text">[COMMENT]</td>'.PHP_EOL
75
	                  . '    </tr>'.PHP_EOL
76
	                  . ''.PHP_EOL;
77
	$comments_footer  = ''.PHP_EOL
78
	                  . '  </tbody>'.PHP_EOL
79
	                  . '</table>'.PHP_EOL
80
	                  . '<br /><a href=\"[ADD_COMMENT_URL]\">[TEXT_ADD_COMMENT]</a>'.PHP_EOL
81
	                  . ''.PHP_EOL;
82
	$comments_page    = ''.PHP_EOL
83
	                  . '<h2>[TEXT_COMMENT]</h2>'.PHP_EOL
84
	                  . '<h3>[POST_TITLE]</h3><br />'.PHP_EOL
85
	                  . ''.PHP_EOL;
86

  
75 87
$commenting = 'none';
76 88
$use_captcha = true;
77 89

  
78
$database->query("INSERT INTO ".TABLE_PREFIX."mod_news_settings (section_id,page_id,header,post_loop,footer,post_header,post_footer,comments_header,comments_loop,comments_footer,comments_page,commenting,use_captcha) VALUES ('$section_id','$page_id','$header','$post_loop','$footer','$post_header','$post_footer','$comments_header','$comments_loop','$comments_footer','$comments_page','$commenting','$use_captcha')");
90
$sql = 'INSERT INTO `'.TABLE_PREFIX.'mod_news_settings` '
91
     . 'SET `section_id`='.$section_id.', '
92
     .     '`page_id`='.$page_id.', '
93
     .     '`header`=\''.$header.'\', '
94
     .     '`post_loop`=\''.$post_loop.'\', '
95
     .     '`footer`=\''.$footer.'\', '
96
     .     '`post_header`=\''.$post_header.'\', '
97
     .     '`post_footer`=\''.$post_footer.'\', '
98
     .     '`comments_header`=\''.$comments_header.'\', '
99
     .     '`comments_loop`=\''.$comments_loop.'\', '
100
     .     '`comments_footer`=\''.$comments_footer.'\', '
101
     .     '`comments_page`=\''.$comments_page.'\', '
102
     .     '`commenting`=\'none\', '
103
     .     '`use_captcha`=1 ';
104
$database->query($sql);

Also available in: Unified diff