Browse Source

Merge pull request #1 from Sorunome/master

Added NiceTooltip mod
Nathaniel van Diepen 9 years ago
parent
commit
7d694fc9bd
2 changed files with 9 additions and 6 deletions
  1. 7 4
      mod/modification.xml
  2. 2 2
      mod/package-info.xml

+ 7 - 4
mod/modification.xml

@@ -231,7 +231,7 @@ function RecentPosts2() {
 				IFNULL(meml.real_name, ml.poster_name) AS last_poster_name, ml.subject AS last_subject,
 				ml.icon AS last_icon, ms.icon AS first_icon, t.id_poll, t.is_sticky, t.locked, ml.modified_time AS last_modified_time,
 				IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from, SUBSTRING(ml.body, 1, 385) AS last_body,
-				SUBSTRING(ms.body, 1, 385) AS first_body, ml.smileys_enabled AS last_smileys, ms.smileys_enabled AS first_smileys, t.id_first_msg, t.id_last_msg';
+				SUBSTRING(ms.body, 1, ' . (!empty($modSettings['NiceTooltips_lenght']) ? $modSettings['NiceTooltips_lenght'] : 385) . ') AS first_body, ml.smileys_enabled AS last_smileys, ms.smileys_enabled AS first_smileys, t.id_first_msg, t.id_last_msg';
                             
 	// !!! Add modified_time in for log_time check?
 
@@ -392,7 +392,9 @@ function RecentPosts2() {
 			if (!isset($context['icon_sources'][$row['last_icon']]))
 				$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.gif') ? 'images_url' : 'default_images_url';
 		}
-
+		// * NiceTooltips mod
+		$row['nice_tooltip_first_msg'] = NiceTooltip($row['first_body'], $row['first_subject'], $row['first_smileys'], $row['id_first_msg']);
+     
 		// And build the array.
 		$context['topics'][$row['id_topic']] = array(
 			'id' => $row['id_topic'],
@@ -411,7 +413,8 @@ function RecentPosts2() {
 				'icon' => $row['first_icon'],
 				'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.gif',
 				'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0;topicseen',
-				'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0;topicseen">' . $row['first_subject'] . '</a>'
+				// * NiceTooltips mod
+    'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0;topscreen"'  . $row['nice_tooltip_first_msg'] . ' >' . $row['first_subject'] . '</a>'
 			),
 			'last_post' => array(
 				'id' => $row['id_last_msg'],
@@ -678,4 +681,4 @@ function template_recent() {
 ]]></add>
 		</operation>
 	</file>
-</modification>
+</modification>

+ 2 - 2
mod/package-info.xml

@@ -4,7 +4,7 @@
 	<id>cooliojazz:RecentPosts</id>
 	<name>Recent Posts Mod</name>
 	<type>modification</type>
-	<version>0.1</version>
+	<version>0.1.1</version>
 	<install>
 		<readme type="file">readme.txt</readme>
 		<modification type="file">modification.xml</modification>
@@ -13,4 +13,4 @@
 		<readme type="inline">This will uninstall the Recent Posts modification.</readme>
 		<modification type="file" reverse="true">modification.xml</modification>
 	</uninstall>
-</package-info>
+</package-info>