Browse Source

Merge pull request #161 from Antes/rsslimit

RSS Limit
emanuele45 12 years ago
parent
commit
70a5a1804d

+ 1 - 0
Sources/ManageNews.php

@@ -1040,6 +1040,7 @@ function ModifyNewsSettings($return_config = false)
 			// Just the remaining settings.
 			array('check', 'xmlnews_enable', 'onclick' => 'document.getElementById(\'xmlnews_maxlen\').disabled = !this.checked;'),
 			array('text', 'xmlnews_maxlen', 'subtext' => $txt['xmlnews_maxlen_note'], 10),
+			array('text', 'rss_limit', 'subtext' => $txt['rss_limit_note'], 10),
 	);
 
 	call_integration_hook('integrate_modify_news_settings', array(&$config_vars));

+ 3 - 3
Sources/Subs.php

@@ -1038,7 +1038,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 			),
 			array(
 				'tag' => 'center',
-				'before' => '<div align="center">',
+				'before' => '<div class="centertext">',
 				'after' => '</div>',
 				'block_level' => true,
 			),
@@ -1264,7 +1264,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 			),
 			array(
 				'tag' => 'left',
-				'before' => '<div style="text-align: left;">',
+				'before' => '<div class="lefttext">',
 				'after' => '</div>',
 				'block_level' => true,
 			),
@@ -1397,7 +1397,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 			),
 			array(
 				'tag' => 'right',
-				'before' => '<div style="text-align: right;">',
+				'before' => '<div class="righttext">',
 				'after' => '</div>',
 				'block_level' => true,
 			),

+ 1 - 1
Themes/default/index.template.php

@@ -372,7 +372,7 @@ function template_body_below()
 			<ul class="reset">
 				<li class="copyright">', theme_copyright(), '</li>
 				<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
-				', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
+				', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss;limit='.$modSettings['rss_limit'].'" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
 				<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
 			</ul>';
 

+ 2 - 0
Themes/default/languages/Admin.english.php

@@ -495,6 +495,8 @@ $txt['groups_send_mail'] = 'Groups allowed to send out forum newsletters';
 $txt['xmlnews_enable'] = 'Enable XML/RSS news';
 $txt['xmlnews_maxlen'] = 'Maximum message length';
 $txt['xmlnews_maxlen_note'] = '(0 to disable, bad idea.)';
+$txt['rss_limit'] = 'RSS Limit';
+$txt['rss_limit_note'] = 'Default number of items in a feed';
 $txt['editnews_clickadd'] = 'Add another item';
 $txt['editnews_remove_selected'] = 'Remove selected';
 $txt['editnews_remove_confirm'] = 'Are you sure you want to delete the selected news items?';

+ 1 - 0
other/install_2-1_mysql.sql

@@ -1734,6 +1734,7 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('enableEmbeddedFlash', '0'),
 	('xmlnews_enable', '1'),
 	('xmlnews_maxlen', '255'),
+	('rss_limit', '5'),
 	('hotTopicPosts', '15'),
 	('hotTopicVeryPosts', '25'),
 	('registration_method', '0'),

+ 1 - 0
other/install_2-1_postgresql.sql

@@ -2223,6 +2223,7 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('theme_guests', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableEmbeddedFlash', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_enable', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_maxlen', '255');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('rss_limit', '5');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicPosts', '15');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicVeryPosts', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('registration_method', '0');

+ 1 - 0
other/install_2-1_sqlite.sql

@@ -1876,6 +1876,7 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('theme_guests', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableEmbeddedFlash', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_enable', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_maxlen', '255');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('rss_limit', '5');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicPosts', '15');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicVeryPosts', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('registration_method', '0');