Browse Source

Merge pull request #857 from Arantor/release-2.1

Remove the latest-packages JS file
Arantor 11 years ago
parent
commit
7d0909949d

+ 31 - 9
Themes/default/Packages.template.php

@@ -530,16 +530,15 @@ function template_browse()
 	if ($context['sub_action'] == 'browse')
 	{
 		echo '
+		<div id="update_section"></div>
 		<div id="admin_form_wrapper">
 			<div class="cat_bar">
 				<h3 class="catbg">
-					<a href="', $scripturl, '?action=helpadmin;help=latest_packages" onclick="return reqOverlayDiv(this.href);" class="help"><img class="icon" src="', $settings['images_url'], '/helptopics_hd.png" alt="', $txt['help'], '" /></a> ', $txt['packages_latest'], '
+					', $txt['packages_adding_title'], '
 				</h3>
 			</div>
 			<div class="windowbg2">
-				<div class="content">
-					<div id="packagesLatest">', $txt['packages_latest_fetch'], '</div>
-				</div>
+				', $txt['packages_adding'], '
 			</div>
 
 			<script type="text/javascript"><!-- // --><![CDATA[
@@ -551,18 +550,38 @@ function template_browse()
 		echo '
 				window.smfInstalledPackages = ["', implode('", "', $context['installed_mods']), '"];
 				window.smfVersion = "', $context['forum_version'], '";
-			// ]]></script>';
+			// ]]></script>
+			<div id="yourVersion" style="display:none">', $context['forum_version'], '</div>';
 
 		if (empty($modSettings['disable_smf_js']))
 			echo '
-			<script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-packages.js"></script>';
+			<script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
 
+		// This sets the announcements and current versions themselves ;).
 		echo '
 			<script type="text/javascript"><!-- // --><![CDATA[
-				var tempOldOnload;
-				smfSetLatestPackages();
-			// ]]></script>
+				var oAdminIndex = new smf_AdminIndex({
+					sSelf: \'oAdminCenter\',
+					bLoadAnnouncements: false,
+					bLoadVersions: false,
+					bLoadUpdateNotification: true,
+					sUpdateNotificationContainerId: \'update_section\',
+					sUpdateNotificationDefaultTitle: ', JavaScriptEscape($txt['update_available']), ',
+					sUpdateNotificationDefaultMessage: ', JavaScriptEscape($txt['update_message']), ',
+					sUpdateNotificationTemplate: ', JavaScriptEscape('
+						<h3 id="update_title">
+							%title%
+						</h3>
+						<div id="update_message" class="smalltext">
+							%message%
+						</div>
+					'), ',
+					sUpdateNotificationLink: smf_scripturl + ', JavaScriptEscape('?action=admin;area=packages;pgdownload;auto;package=%package%;' . $context['session_var'] . '=' . $context['session_id']), '
+	
+				});
+			// ]]></script>';
 
+		echo '
 		</div>';
 	}
 
@@ -579,6 +598,9 @@ function template_browse()
 	if (!$mods_available)
 		echo '
 		<div class="descbox">', $context['sub_action'] == 'browse' ? $txt['no_packages'] : $txt['no_mods_installed'], '</div>';
+	else
+		echo '
+		<br />';
 
 	// the advanced (emulation) box, collapsed by default
 	echo '

+ 0 - 1
Themes/default/languages/Help.english.php

@@ -507,7 +507,6 @@ $helptxt['coppaPost'] = 'The contact boxes are required so that forms granting p
 $helptxt['allow_hideOnline'] = 'With this option enabled all members will be able to hide their online status from other users (except administrators). If disabled only users who can moderate the forum can hide their presence. Note that disabling this option will not change any existing member\'s status - it just stops them from hiding themselves in the future.';
 $helptxt['meta_keywords'] = 'These keywords are sent in the output of every page to indicate to search engines (etc) the key content of your site. They should be a comma separated list of words, and should not use HTML.';
 
-$helptxt['latest_packages'] = 'Here you can see some of the most popular and some random packages or mods, with quick and easy installations.<br /><br />If this section doesn\'t show up, your computer probably cannot connect to <a href="http://www.simplemachines.org/" target="_blank" class="new_win">www.simplemachines.org</a>.';
 $helptxt['latest_themes'] = 'This area shows a few of the latest and most popular themes from <a href="http://www.simplemachines.org/" target="_blank" class="new_win">www.simplemachines.org</a>.  It may not show up properly if your computer can\'t find <a href="http://www.simplemachines.org/" target="_blank" class="new_win">www.simplemachines.org</a>, though.';
 
 $helptxt['secret_why_blank'] = 'For your security, your password and the answer to your secret question are encrypted so that the SMF software will never tell you, or anyone else, what they are.';

+ 2 - 2
Themes/default/languages/Packages.english.php

@@ -75,8 +75,8 @@ $txt['package_installed_redirecting'] = 'Redirecting...';
 $txt['package_installed_redirect_go_now'] = 'Redirect Now';
 $txt['package_installed_redirect_cancel'] = 'Return to Package Manager';
 
-$txt['packages_latest'] = 'Latest Packages';
-$txt['packages_latest_fetch'] = 'Attempting to fetch the most popular and recent packages from www.simplemachines.org...';
+$txt['packages_adding_title'] = 'Obtaining Packages';
+$txt['packages_adding'] = 'You can always find new packages for your forum from the SMF modifications area - <strong><a href="http://custom.simplemachines.org/mods/" target="_blank">http://custom.simplemachines.org/mods/</a></strong>. You can browse them on the website, read the comments, and download them to your computer and then upload them to your forum from there.<br /><br />If you run into any questions with modifications, each modification published on simplemachines.org has a dedicated topic about it where support and comments should be directed to.';
 
 $txt['package_upgrade'] = 'Upgrade';
 $txt['package_uninstall_readme'] = 'Uninstallation Readme';

+ 0 - 9
Themes/default/scripts/script.js

@@ -1593,15 +1593,6 @@ function updateActionDef(optNum)
 	}
 }
 
-function smfSetLatestPackages()
-{
-	if (typeof(window.smfLatestPackages) != "undefined")
-		setInnerHTML(document.getElementById("packagesLatest"), window.smfLatestPackages);
-
-	if (tempOldOnload)
-	tempOldOnload();
-}
-
 function updateAuthMethod()
 {
 	// What authentication method is being used?

+ 2 - 3
other/install_2-1_mysql.sql

@@ -26,9 +26,8 @@ VALUES
 	(1, 'current-version.js', '/smf/', 'version=%3$s', '', 'text/javascript'),
 	(2, 'detailed-version.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript'),
 	(3, 'latest-news.js', '/smf/', 'language=%1$s&format=%2$s', '', 'text/javascript'),
-	(4, 'latest-packages.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript'),
-	(5, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript'),
-	(6, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+	(4, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript'),
+	(5, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 # --------------------------------------------------------
 
 #

+ 2 - 3
other/install_2-1_postgresql.sql

@@ -172,9 +172,8 @@ CREATE INDEX {$db_prefix}admin_info_files_filename ON {$db_prefix}admin_info_fil
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (1, 'current-version.js', '/smf/', 'version=%3$s', '', 'text/javascript');
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (2, 'detailed-version.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (3, 'latest-news.js', '/smf/', 'language=%1$s&format=%2$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (4, 'latest-packages.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (5, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (6, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (4, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (5, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 # --------------------------------------------------------
 
 #

+ 2 - 3
other/install_2-1_sqlite.sql

@@ -28,9 +28,8 @@ BEGIN TRANSACTION;
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (1, 'current-version.js', '/smf/', 'version=%3$s', '', 'text/javascript');
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (2, 'detailed-version.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (3, 'latest-news.js', '/smf/', 'language=%1$s&format=%2$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (4, 'latest-packages.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (5, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (6, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (4, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (5, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 COMMIT;
 
 # --------------------------------------------------------

+ 2 - 3
other/install_2-1_sqlite3.sql

@@ -28,9 +28,8 @@ BEGIN TRANSACTION;
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (1, 'current-version.js', '/smf/', 'version=%3$s', '', 'text/javascript');
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (2, 'detailed-version.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (3, 'latest-news.js', '/smf/', 'language=%1$s&format=%2$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (4, 'latest-packages.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (5, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
-INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (6, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (4, 'latest-smileys.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
+INSERT INTO {$db_prefix}admin_info_files (id_file, filename, path, parameters, data, filetype) VALUES (5, 'latest-themes.js', '/smf/', 'language=%1$s&version=%3$s', '', 'text/javascript');
 COMMIT;
 
 # --------------------------------------------------------

+ 9 - 0
other/upgrade_2-1_mysql.sql

@@ -452,6 +452,15 @@ DELETE FROM {$db_prefix}settings
 WHERE variable IN ('enableStickyTopics', 'guest_hideContacts');
 ---#
 
+/******************************************************************************/
+--- Removing old Simple Machines files we do not need to fetch any more
+/******************************************************************************/
+---# We no longer call on the latest packages list.
+DELETE FROM {$db_prefix}admin_info_files
+WHERE filename = 'latest-packages.js'
+	AND path = '/smf/';
+---#
+
 /******************************************************************************/
 --- Upgrading "verification questions" feature
 /******************************************************************************/

+ 9 - 0
other/upgrade_2-1_postgresql.sql

@@ -515,6 +515,15 @@ DELETE FROM {$db_prefix}settings
 WHERE variable IN ('enableStickyTopics', 'guest_hideContacts');
 ---#
 
+/******************************************************************************/
+--- Removing old Simple Machines files we do not need to fetch any more
+/******************************************************************************/
+---# We no longer call on the latest packages list.
+DELETE FROM {$db_prefix}admin_info_files
+WHERE filename = 'latest-packages.js'
+	AND path = '/smf/';
+---#
+
 /******************************************************************************/
 --- Upgrading "verification questions" feature
 /******************************************************************************/

+ 9 - 0
other/upgrade_2-1_sqlite.sql

@@ -505,6 +505,15 @@ DELETE FROM {$db_prefix}settings
 WHERE variable IN ('enableStickyTopics', 'guest_hideContacts');
 ---#
 
+/******************************************************************************/
+--- Removing old Simple Machines files we do not need to fetch any more
+/******************************************************************************/
+---# We no longer call on the latest packages list.
+DELETE FROM {$db_prefix}admin_info_files
+WHERE filename = 'latest-packages.js'
+	AND path = '/smf/';
+---#
+
 /******************************************************************************/
 --- Upgrading "verification questions" feature
 /******************************************************************************/