Skip to content

Commit

Permalink
Split the css/js vars and the copyright notice
Browse files Browse the repository at this point in the history
fix some install issues too

Signed-off-by: Suki <suki@missallsunday.com>
  • Loading branch information
MissAllSunday committed Feb 18, 2016
1 parent 54e8f28 commit 1be2d02
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions OharaYTEmbed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<file name="$sourcedir/Post.php">
<operation>
<search position="replace"><![CDATA[<img>]]></search>
<add><![CDATA[<img><iframe><div>]]></add>
<search position="replace"><![CDATA[if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))]]></search>
<add><![CDATA[if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><iframe><video><div>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<img>]]></search>
<add><![CDATA[<img><iframe><video><div>]]></add>
<search position="replace"><![CDATA[if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')]]></search>
<add><![CDATA[if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><iframe><video><div>')) === '')]]></add>
</operation>
</file>
<file name="$sourcedir/Subs.php">
Expand Down
17 changes: 12 additions & 5 deletions Sources/OharaYTEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function OYTE_bbc_add_code(&$codes)
'block_level' => true,
)
);

OYTE_care();
}

// The bbc button.
Expand Down Expand Up @@ -307,14 +309,10 @@ function ($matches) {
return $message;
}

// DUH! WINNING!.
function OYTE_care(&$dummy)
function OYTE_css()
{
global $context, $settings, $modSettings;

if (!empty($context['current_action']) && $context['current_action'] == 'credits')
$context['copyrights']['mods'][] = '<a href="http://missallsunday.com" target="_blank" title="Free SMF mods">Ohara YouTube Embed mod &copy Suki</a>';

// Add our css and js files. Dear and lovely mod authors, if you're going to use $context['html_headers'] MAKE SURE you append your data .= instead of re-declaring the var! and don't forget to add a new line and proper indentation too!
$context['html_headers'] .= '
<script type="text/javascript"><!-- // --><![CDATA[
Expand All @@ -326,5 +324,14 @@ function OYTE_care(&$dummy)
<link rel="stylesheet" type="text/css" href="'. $settings['default_theme_url'] .'/css/oharaEmbed.css" />';
}

// DUH! WINNING!
function OYTE_care()
{
global $context;

if (!empty($context['current_action']) && $context['current_action'] == 'credits')
$context['copyrights']['mods'][] = '<a href="http://missallsunday.com" target="_blank" title="Free SMF mods">Ohara YouTube Embed mod &copy Suki</a>';
}

/* Slowly repeating
...Sunday morning */
2 changes: 1 addition & 1 deletion addHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'integrate_bbc_codes' => 'OYTE_bbc_add_code',
'integrate_bbc_buttons' => 'OYTE_bbc_add_button',
'integrate_general_mod_settings' => 'OYTE_settings',
'integrate_load_theme' => 'OYTE_care', // Yes, a whole hook function for a copyright...
'integrate_load_theme' => 'OYTE_css',
);

foreach ($hooks as $hook => $function)
Expand Down
2 changes: 1 addition & 1 deletion removeHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'integrate_bbc_codes' => 'OYTE_bbc_add_code',
'integrate_bbc_buttons' => 'OYTE_bbc_add_button',
'integrate_general_mod_settings' => 'OYTE_settings',
'integrate_menu_buttons' => 'OYTE_care', // Yes, a whole hook function for a copyright...
'integrate_load_theme' => 'OYTE_css',
);

foreach ($hooks as $hook => $function)
Expand Down

0 comments on commit 1be2d02

Please sign in to comment.