Permalink
Browse files

! Fixed error where [attach] shortcut was not working

! Fixed error where previewing a modified message would not render the 'fake' thumb properly
+ Improved error handling for improperly constructed tags
  • Loading branch information...
1 parent cc03ed1 commit 8ac03728b97028994f2b7745b518c4757c89ba91 @Spuds committed Dec 14, 2011
Showing with 937 additions and 814 deletions.
  1. +791 −726 ILA-Subs.php
  2. +50 −20 ILA_integration.php
  3. +6 −2 add_remove_hooks.php
  4. +2 −18 add_settings.php
  5. +9 −1 changelog.txt
  6. +1 −2 ila.js
  7. +40 −19 install-2.0.xml
  8. +16 −0 license.txt
  9. +6 −6 package-info.xml
  10. +16 −20 readme.txt
View
1,517 ILA-Subs.php

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,28 +1,33 @@
<?php
-/**********************************************************************************
-* ILA_integration.php *
-***********************************************************************************/
+
+/**
+ *
+ * @package "Inline Attachments (ILA)" Mod for Simple Machines Forum (SMF) V2.0
+ * @author Spuds
+ * @copyright (c) 2011 Spuds
+ * @license license.txt (included with package) BSD
+ *
+ * @version 1.2
+ *
+ */
if (!defined('SMF'))
die('Hacking attempt...');
+/**
+ * ila_bbc_add_code()
+ *
+ * Adds in new BBC code tags for use with inline images
+ *
+ * @param mixed $codes
+ * @return
+ */
function ila_bbc_add_code($codes)
{
- global $txt;
-
- // Add in our new code on to the end of this array
+ // Add in our new codes, if found on to the end of this array
+ // here mostly used to null them out should they not be rendered
$codes = array_merge($codes, array(
array(
- 'tag' => 'attach',
- 'type' => 'closed',
- 'content' => '',
- ),
- array(
- 'tag' => 'attachment',
- 'type' => 'closed',
- 'content' => '',
- ),
- array(
'tag' => 'attachimg',
'type' => 'closed',
'content' => '',
@@ -43,24 +48,43 @@ function ila_bbc_add_code($codes)
'content' => '',
))
);
-
+
return;
}
+/**
+ * ila_integrate_admin_areas()
+ *
+ * add a line under modifcation config
+ * @param mixed $admin_areas
+ * @return
+ */
function ila_integrate_admin_areas(&$admin_areas)
{
global $txt;
$admin_areas['config']['areas']['modsettings']['subsections']['ila'] = array($txt['mods_cat_modifications_ila']);
}
+/**
+ * ila_integrate_modify_modifications()
+ *
+ * @param mixed $sub_actions
+ * @return
+ */
function ila_integrate_modify_modifications(&$sub_actions)
{
$sub_actions['ila'] = 'ModifyilaSettings';
}
+/**
+ * ModifyilaSettings()
+ *
+ * @param mixed $return_config
+ * @return
+ */
function ModifyilaSettings($return_config = false)
{
- global $txt, $scripturl, $context, $smcFunc;
+ global $txt, $scripturl, $context, $smcFunc, $sourcedir;
$context[$context['admin_menu_name']]['tab_data']['tabs']['ila']['description'] = $txt['ila_desc'];
$config_vars = array(
@@ -76,13 +100,19 @@ function ModifyilaSettings($return_config = false)
{
checkSession();
saveDBSettings($config_vars);
- writeLog();
+ // enabling the mod then lets have the main file available, otherwise lets not ;)
+ if (isset($_POST['ila_enabled']))
+ add_integration_function('integrate_pre_include', '$sourcedir/ILA-Subs.php');
+ else
+ remove_integration_function('integrate_pre_include', '$sourcedir/ILA-Subs.php');
+
+ writeLog();
redirectexit('action=admin;area=modsettings;sa=ila');
}
$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=ila';
- $context['settings_title'] = $txt['ila_title'];
+ $context['settings_title'] = $txt['mods_cat_modifications_ila'];
prepareDBSettingContext($config_vars);
}
View
@@ -23,12 +23,16 @@
'integrate_bbc_codes' => 'ila_bbc_add_code',
'integrate_modify_modifications' => 'ila_integrate_modify_modifications',
'integrate_admin_areas' => 'ila_integrate_admin_areas',
- 'integrate_pre_include' => '$boarddir/Sources/ILA_integration.php'
+ 'integrate_pre_include' => '$sourcedir/ILA_integration.php'
);
// Adding or removing them?
if (!empty($context['uninstalling']))
+{
+ // We only added this if they enabled the mod, need to make sure we clear it now
+ $hook_functions['integrate_pre_include'] = '$sourcedir/ILA-Subs.php';
$call = 'remove_integration_function';
+}
else
$call = 'add_integration_function';
@@ -37,6 +41,6 @@
$call($hook, $function);
if (SMF == 'SSI')
- echo 'Congratulations! You have successfully installed this mod!';
+ echo 'Congratulations! You have successfully installed The Hooks for ILA!';
?>
View
@@ -23,19 +23,12 @@
// List settings here in the format: setting_key => default_value. Escape any "s. (" => \")
$mod_settings = array(
- 'ila_enabled' => 1,
'ila_alwaysfullsize' => 0,
'ila_basicmenu' => 0,
);
-// Settings to create the new tables...
-$tables = array();
-
-// Add a row to an existing table
-$rows = array();
-
-// Add a column to an existing table
-$columns = array();
+// always start off as not enabled .... even on a reinstall
+updateSettings(array('ila_enabled' => 0));
// Update mod settings if applicable
foreach ($mod_settings as $new_setting => $new_value)
@@ -44,15 +37,6 @@
updateSettings(array($new_setting => $new_value));
}
-foreach ($tables as $table)
- $smcFunc['db_create_table']($table['table_name'], $table['columns'], $table['indexes'], $table['parameters'], $table['if_exists'], $table['error']);
-
-foreach ($rows as $row)
- $smcFunc['db_insert']($row['method'], $row['table_name'], $row['columns'], $row['data'], $row['keys']);
-
-foreach ($columns as $column)
- $smcFunc['db_add_column']($column['table_name'], $column['column_info'], $column['parameters'], $column['if_exists'], $column['error']);
-
if (SMF == 'SSI')
echo 'Congratulations! You have successfully installed this mod!';
View
@@ -1,8 +1,16 @@
Changelog
+[b]1.2 - 04 Dec 2011[/b]
+o + Release under proper open license
+o - Removed support for [attachment tags in message (if you are upgrading from a mod that uses these you will need to manually replace those tags in your database.
+o - Removed support for 'Highslide Image Viewer', only HS4SMF Highslide is supported
+o ! Fixed error where [attach] shortcut was not working
+o ! Fixed error where previewing a modified message would not render the 'fake' thumb properly
+o + Improved error handling for improperly constructed tags
+
[b]1.11 - 21 Mar 2011[/b]
o ! fixed issue where an ILA tag in a quote would not correctly render a back link
o ! minor code formatting updates
-o ! update for portaMX RC 1.0 tahnks to r2d2-trader
+o ! update for portaMX RC 1.0 thanks to r2d2-trader
[b]1.10 - 19 Feb 2011[/b]
o + RC5 support
View
3 ila.js
@@ -1,6 +1,5 @@
// ILA in line attachment changes
-function ILAexpandThumb(thumbID)
-{
+function ILAexpandThumb(thumbID) {
// basically the same as expandThumb, but maintains the style width and height attributes instead of feeding them to the bears
var img = document.getElementById('thumb_' + thumbID);
var link = document.getElementById('link_' + thumbID);
Oops, something went wrong.

0 comments on commit 8ac0372

Please sign in to comment.