Sorunome 9 years ago
parent
commit
fad611a25a
2 changed files with 47 additions and 0 deletions
  1. 31 0
      modification.xml
  2. 16 0
      package-info.xml

+ 31 - 0
modification.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
+<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
+	<id>sorunome:smf-fixes</id>
+	<version>0.1</version>
+	
+	<file name="$sourcedir/Subs.php">
+		<operation>
+			<search position="replace"><![CDATA[$code = strtr($tag['content'], array('$1' => $data));]]></search>
+			<add><![CDATA[if(is_array($data)){
+				$code = strtr($tag['content'], array('$1' => $data[0]));
+			}else{
+				$code = strtr($tag['content'], array('$1' => $data));
+			}]]></add>
+		</operation>
+		<operation>
+			<search position="replace"><![CDATA[if  (preg_match(\'~^(?:http://((?:www|au|br|ca|es|fr|de|hk|ie|in|il|it|jp|kr|mx|nl|nz|pl|ru|tw|uk)\.)?youtube\.com/(?:[^"]*?)(?:(?:video_)?id=|(?:v|p)(?:/|=)))?([0-9a-f]{16}|[0-9a-z-_]{11})~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $link, $matches))]]></search>
+			<add><![CDATA[if  (preg_match(\'~^(?:https?://((?:www|au|br|ca|es|fr|de|hk|ie|in|il|it|jp|kr|mx|nl|nz|pl|ru|tw|uk)\.)?youtube\.com/(?:[^"]*?)(?:(?:video_)?id=|(?:v|p)(?:/|=)))?([0-9a-f]{16}|[0-9a-z-_]{11})~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $link, $matches))]]></add>
+		</operation>
+	</file>
+	
+	<file name="$themedir/index.template.php">
+		<operation>
+			<search position="after"><![CDATA[foreach ($context['menu_buttons'] as $act => $button)
+	{
+]]></search>
+			<add><![CDATA[if(!isset($button['href']) || !isset($button['title'])) continue;]]></add>
+		</operation>
+	</file>
+</modification>
+

+ 16 - 0
package-info.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
+<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
+	<id>sorunome:smf-fixes</id>
+	<name>SMF fixes</name>
+	<type>modification</type>
+	<version>0.1</version>
+	<install>
+		<readme type="file">readme.txt</readme>
+		<modification type="file">modification.xml</modification>
+	</install>
+	<uninstall>
+		<readme type="inline">This will fix various things on SMF. DON'T use it if you don't have all the packages installed.</readme>
+	<modification type="file" reverse="true">modification.xml</modification>
+	</uninstall>
+</package-info>