Hi everyone,
Recently, I combined my package-info and modification parsers into one script: The Package Parser. Basically, you upload a packaged SMF modification to this script, and it will tell you how to install or uninstall the package :). This is great if you don't understand the XML format, or you just want a way to see exactly what changes a package will do (in case you have to do changes manually).
In addition, there's an option to only show theme edits, in the case that you want to edit your theme to support a mod.
Please go to http://modparser.dev.dansoftaustralia.net/ to use the package parser. Note that it's in beta at the moment, so there may be small bugs (there shouldn't be any major bugs, though).
Please tell me what you think, and if you encounter any bugs :D
Update 2007-03-22: After a long delay, the source code for the SMF Package Parser is now available! Please see http://modparser.dev.dansoftaustralia.net/about.php (temporary homepage) for more information :)
It doesn't seem to actually parse the submitted file :P
Cool, thanks! I just used it and it worked for me. Very nice.
Quote from: eldʌkaː on January 05, 2007, 11:30:40 PM
It doesn't seem to actually parse the submitted file :P
Do you get any errors?
Quote from: directtech on January 08, 2007, 06:19:58 PM
Cool, thanks! I just used it and it worked for me. Very nice.
Thank you :). Please tell me if you have any suggestions :D
No, it just parses another mod than what I submitted.
QuoteNo, it just parses another mod than what I submitted.
This is because it extracts the archive to a temporary directory, and then checks for a package-info.xml file. Since I forgot to make it empty the temporary directory after use, if the package doesn't have a package-info.xml file, it will use an old one :P
I'll change the code so it removes all the files after use :)
NICE!! thats usefull for me
This will save me a lot of time, thanks
Very useful, thanks!
this is going to be a major major life-saver if a Turkish version is made, whaddaya think? (pm if neccesary)
oh and I tried it with my mod, and I don't think it likes foreign characters :D The UTF-8 version of the mod passes thru fine, but otherwise I get these:
QuoteWarning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 184: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xF6 0x73 0x74 0x65 in /var/www/smf/package.php on line 360
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: $txt['enable_mini_avatars'] = 'Mesaj indeksinde minik avatar g�sterimini etkinle in /var/www/smf/package.php on line 360
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 360
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/smf/package.php:360 Stack trace: #0 /var/www/smf/package.php(360): SimpleXMLElement->__construct('<?xml version="...') #1 /var/www/smf/package.php(329): parseModificationXML('/tmp/smf_xml/mo...', Object(SimpleXMLElement), 'all') #2 /var/www/smf/package.php(49): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'all') #3 /var/www/smf/package.php(631): parseArchive('/tmp/phpSFohJG', 'install', 'all') #4 {main} thrown in /var/www/smf/package.php on line 360
No problem, guys :)
Quotethis is going to be a major major life-saver if a Turkish version is made, whaddaya think? (pm if neccesary)
I'll try to make it use language files, similar to what SMF does (currently, all text is hard-coded). Once I do this, I'll tell you ;).
Quoteoh and I tried it with my mod, and I don't think it likes foreign characters The UTF-8 version of the mod passes thru fine, but otherwise I get these:
I'm using PHP 5's SimpleXML functions, and it looks like it only likes UTF-8 input:
QuoteInput is not proper UTF-8
There's no real way for me to fix this, other than use a different XML parser...
Thanks Daniel15.
Turkish SMF Support (Modifikasyonlar)
http://www.simplemachines.org/community/index.php?topic=142332.0
Anyone willing to translate? I've edited the script to use a language file, and attached the language file here. Once I get a few languages, I'll add a "Choose Language" dropdown.
just tried to follow the link and got...
Warning: require_once(/var/www/smf/languages/package.english.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/smf/package.php on line 5
Fatal error: require_once() [function.require]: Failed opening required '/var/www/smf/languages/package.english.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/smf/package.php on line 5
richiehale, I've fixed that problem, it was due to a stupid mistake by me (I accidentally wrote package.english.php instead of english.php).
here is the turkish file
pm me if something doesn't look correct, the way Turkish is causes some of the sentence structures to be awkward, however I'm pretty sure it is okay as it is.
New file uploaded! In UTF-8, should solve character problems!
OK, thanks alperuzi, I'll implement this it as soon as I can (probably not until tommorow)
thanks alperuzi
where iz download links :'( ::) :-[ :-X
thanks daniel... wery good...
I just keep getting: parseArchive(): No package-info.xml in this mod! Is it corrupted?
My mods are fine, so I don't know why I get the message.
OK, I've almost finished implementing Turkish, but I'm having some problems with characters not displaying properly: http://server.daniel15.com/smf/package-dev.php?lang=turkish
Visualcode, are the mod's files in a directory inside the archive? The parser expects the package-info.xml to be in the root of the archive (you may have problems with SMF if the files are all inside a folder)
Ok - this is very cool. I am too stupid to figure out the XML files I don't have time to try it tonight but it is just what I am looking for to apply 2 mods that are giving me headaches.
HURRAY.... THANK YOU!
Ah, I see. I have had no problems with my mods being in a folder, on SMF. It seems for your parser though, that was the problem.
QuoteNew file uploaded! In UTF-8, should solve character problems!
Thanks for the fix alperuzi, it seems to work fine :)
Quote from: Daniel15 on January 19, 2007, 05:03:01 AM
QuoteNew file uploaded! In UTF-8, should solve character problems!
Thanks for the fix alperuzi, it seems to work fine :)
Working like a charm! :) Thanks Alperuzi and Daniel15 :)
Very Awesome utility!
I have it now bookmarked for useful utilities
It worked perfectly when try vbgamers Staff Page Mod , but when i tried Karlbesons WikiBBC Code mod i got the following errors
Quote
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 9: parser error : xmlParseEntityRef: no name in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <readme type="inline">For 1.1 versions RC1, RC2 & RC3 in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 24: parser error : Opening and ending tag mismatch: uninstall line 23 and readme in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: type="inline">This will remove the Alternative Wikipedia BBCode support</readme in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 27: parser error : Opening and ending tag mismatch: package-info line 3 and uninstall in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </uninstall> in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 28: parser error : Extra content at the end of the document in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </package-info> in /var/www/smf/package.php on line 77
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 77
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/smf/package.php:77 Stack trace: #0 /var/www/smf/package.php(77): SimpleXMLElement->__construct('<?xml version="...') #1 /var/www/smf/package.php(54): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'theme') #2 /var/www/smf/package.php(642): parseArchive('/tmp/phpt1XiAD', 'install', 'theme') #3 {main} thrown in /var/www/smf/package.php on line 77
Alan S, it looks like the & in the readme is causing that (the SimpleXML parser is very strict about things like that)
Are you talking about this mod: http://custom.simplemachines.org/mods/index.php?mod=434? I just tried it out, and while I don't get that error, I get another one:
QuoteWarning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 1: parser error : Start tag expected, '<' not found in /var/www/smf/package.php on line 364
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: com<?xml version="1.0"?> in /var/www/smf/package.php on line 364
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 364
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/smf/package.php:364 Stack trace: #0 /var/www/smf/package.php(364): SimpleXMLElement->__construct('com<?xml versio...') #1 /var/www/smf/package.php(333): parseModificationXML('/tmp/smf_xml/wi...', Object(SimpleXMLElement), 'all') #2 /var/www/smf/package.php(54): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'all') #3 /var/www/smf/package.php(642): parseArchive('/tmp/phpouG3Pq', 'install', 'all') #4 {main} thrown in /var/www/smf/package.php on line 364
This is because the wiki.xml file is malformed (the first line is com<?xml version="1.0"?>, the com shouldn't be there). I'll contact the author about it :).
This reminds me, I really need to implement better error checking :P
Worked great for me. Just installed PostBox Increase Decrease mod :D
It doesn't parse BoardMods. Do you have any plans to implement them?
Quote from: ZeroSkill on February 11, 2007, 10:53:46 AM
Worked great for me. Just installed PostBox Increase Decrease mod :D
Glad to hear it works for you, and glad to see you're trying my mods :D
Quote from: heavyccasey on February 11, 2007, 10:55:45 PM
It doesn't parse BoardMods. Do you have any plans to implement them?
Not in the near future. I use a XML parser inbuilt to PHP (SimpleXML) to parse the XML files. BoardMod requires a custom-written parser. I could use the parser that the Package Manager uses, but I don't have time to implement this at the moment ;)
In general, no new mods should be using BoardMod - XML is preferred ;)
Hi, terrific idea & work there :)
I tried uploading gobaloppers' location mod:
QuoteModifications to SMF files
Error: Modification XML file (/tmp/smf_xml/smf1.1.xinstall.xml) doesn't exist!
I guess that's because of the mod itself, right? What should be done in order to fix it? I'm really looking forward to use this tool to install this mod with my theme. :o
Then i went back and tried with the "PM on registration" mod.
QuoteERROR: The package-info.xml file is invalid!
Debugging Information
Error message: String could not be parsed as XML
Source: /var/www/smf/package.php:93
Errors encountered while parsing XML file:
Stack Trace:
#0 /var/www/smf/package.php(93): SimpleXMLElement->__construct('')
#1 /var/www/smf/package.php(54): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'all')
#2 /var/www/smf/package.php(707): parseArchive('/tmp/php2xun59', 'install', 'all')
#3 {main}
XML File:
After that it showed an empty space.
I tried it with MemberAwards Mod and it worked perfectly.
Finally, here's a spanish.php file i translated. Had to play with some phrases because grammar is sometimes different ( i.e. we don't say "Installation instructions", we kinda say "Instructions of installation" -or else, it doesn't make sense-. That's why i replaced the phrase with "Installation: Instructions for ...." which makes a lot more sense :) )
You might think the translation ain't reliable, that's why i'll go to the spanish forums to ask some people to come to the thread and validate it :)
Hope it works.
Spanish.php : http://m00.laughingllamas.com/fileupload/index.php?act=dl&file=c3BhbmlzaHBocC56aXAuemlw
OutofOrder, I'll take a look at that later (the first error), and see what's causing it. It looks like the / from the path is being removed, but I'm not sure what could be causing this. When I have more free time, I'll take a look at it :)
For the "PM on Registration" mod, it could possibly be because the mod is inside a seperate folder in the ZIP file. While SMF doesn't mind this, my parser does (due to the way it handles files). If you like, extract all the files in the ZIP, open the directory, and then recompress all the files (so they're in the 'root' of the archive).
Thanks for the Spanish translation, I'll implement it as soon as possible ;)
Portuguese translation
http://www.badongo.com/file/2243494
I've added the Spanish translation
Quote from: margarett on February 15, 2007, 10:00:19 AM
Portuguese translation
http://www.badongo.com/file/2243494
That download isn't working for me. Could you please email me the translation? My email address is daniel15 [-at-] simplemachines ([dot]) org ([-at-] is @, ([dot]) is .)
Sent ;)
Quote from: Daniel15 on February 13, 2007, 03:40:52 AM
OutofOrder, I'll take a look at that later (the first error), and see what's causing it. It looks like the / from the path is being removed, but I'm not sure what could be causing this. When I have more free time, I'll take a look at it :)
I think you're right. The path should be
.../smf1.1.x
/install.xml
Perhaps you've forgotten to add/parse a slash somewhere. :-X :-X
Anyway i hope you can fix it, and please post back if you do. Thanks in advance.
When package parser will be updated for SMF 1.1.2 ? :)
Quote from: ZeroSkill on February 23, 2007, 08:33:18 AM
When package parser will be updated for SMF 1.1.2 ? :)
Oops, I forgot about that :P
It's a very easy change, I'll fix it right now :)
Quote from: Daniel15 on February 12, 2007, 03:57:15 AM
Quote from: heavyccasey on February 11, 2007, 10:55:45 PM
It doesn't parse BoardMods. Do you have any plans to implement them?
Not in the near future. I use a XML parser inbuilt to PHP (SimpleXML) to parse the XML files. BoardMod requires a custom-written parser. I could use the parser that the Package Manager uses, but I don't have time to implement this at the moment ;)
You mean parseBoardMod()?
http://support.simplemachines.org/function_db/index.php?action=view_function;function=327
Quote from: Zeri YT! on February 26, 2007, 02:04:27 AM
Quote from: Daniel15 on February 12, 2007, 03:57:15 AM
Quote from: heavyccasey on February 11, 2007, 10:55:45 PM
It doesn't parse BoardMods. Do you have any plans to implement them?
Not in the near future. I use a XML parser inbuilt to PHP (SimpleXML) to parse the XML files. BoardMod requires a custom-written parser. I could use the parser that the Package Manager uses, but I don't have time to implement this at the moment ;)
You mean parseBoardMod()?
http://support.simplemachines.org/function_db/index.php?action=view_function;function=327
Yep, that's the one :).
I'm currently not using any SMF functions, other than read_tgz_data and read_zip_data. I may implement the BoardMod stuff, but it's not a big priority for me (I designed this to be an XML parser, after all ;))
Quote from: Daniel15 on February 26, 2007, 05:25:50 AM
I may implement the BoardMod stuff, but it's not a big priority for me...
...but it may be for other people. :)
For example, I was about to use your parser on TinyPortal's .mod file to see what changes it makes, so that I can modify another mod to work with TP.
Where can I download this package parser from?
I don't always have access to the net and would like to test and debug on my comp when offline also.
Quote from: The One on March 20, 2007, 10:21:59 AM
Where can I download this package parser from?
I don't always have access to the net and would like to test and debug on my comp when offline also.
Thanks for reminding me ;)
The source will be released within a week or so ;)
OK, as I promised, the source code is now available. The SMF Package Parser has a new home at http://modparser.dev.dansoftaustralia.net/, and http://modparser.dev.dansoftaustralia.net/about.php is a temporary homepage for it (until I have free time to do a real one). :)
When i make this theme http://custom.simplemachines.org/themes/index.php?lemma=80 my forum default theme,automatically SMForum places the code wherever you(package parser) suggested,after placing the code also ads are not displaying in all places(only displaying after 1st post correctly).What are the reasons? How to display ads in all places? http://findallinone.com/forums/
Quote from: Daniel15 on March 22, 2007, 05:47:49 AM
OK, as I promised, the source code is now available. The SMF Package Parser has a new home at http://modparser.dev.dansoftaustralia.net/, and http://modparser.dev.dansoftaustralia.net/about.php is a temporary homepage for it (until I have free time to do a real one). :)
Just one weird thought :).
Can this be released as a mod? Looking at the requirements this requires SMF so I was wondering...
QuoteCan this be released as a mod? Looking at the requirements this requires SMF so I was wondering...
Most people use this parser because, for whatever reason, they can't install packages. Making it a package would defeat the purpose :P
Also, all a mod would really do is copy the files over - Something easily done via FTP ;)
QuoteWhen i make this theme http://custom.simplemachines.org/themes/index.php?lemma=80 my forum default theme,automatically SMForum places the code wherever you(package parser) suggested,after placing the code also ads are not displaying in all places(only displaying after 1st post correctly).What are the reasons? How to display ads in all places? http://findallinone.com/forums/
This relates to that mod, and
not to this parser. Please post all support questions in the topic for said mod.
@ Daniel15 Thank u so much for a GREAT script....now i can prolly solve most of my own probs...lol thanks man
Works great added it to http://www.smfhacks.com
Quote from: tones_ie on March 24, 2007, 05:33:18 PM
@ Daniel15 Thank u so much for a GREAT script....now i can prolly solve most of my own probs...lol thanks man
Thanks :D
Quote from: vbgamer45 on March 24, 2007, 08:05:31 PM
Works great added it to http://www.smfhacks.com
Nice :). As you probably noticed, there's not much documentation, and not that many comments in the code - I never intended to release it publicly...
(oh, and speaking of smfhacks.com, how come I can't reply to news posts on smfhacks.com? The reply button doesn't appear for me)
Yeah didn't want people to say things on news used to have it till people will posting garbage.
Just tried to install ImageShack through the parser and got this error:
Installation instructions for SMF versions: 1.1, 1.1.1, 1.1.2
Error: Readme file (/tmp/smf_xml/DocsSISv203_readme.txt) doesn't exist!
Readme:
Notice: Undefined variable: readme in /home/groups/modparser/htdocs/index.php on line 232
PHP script to execute: Modfiles/SISv202_add_settings.php
Modifications to SMF files
Error: Modification XML file (/tmp/smf_xml/ModfilesSimpleImageShack_203b.xml) doesn't exist!
What does this all mean?
QuotePHP script to execute: Modfiles/SISv202_add_settings.php
Modifications to SMF files
Error: Modification XML file (/tmp/smf_xml/ModfilesSimpleImageShack_203b.xml) doesn't exist!
Ah, that's a bug which isn't fixed yet (I haven't had time to fix it :-[)
Sorry guys, but the SMF Package Parser will be down for a few days. The reason is that it's hosted off my home ADSL connection, and the phone line is currently being repaired. Until the telephone company (Telstra) repairs the phone line, the server will be down (and when I'm at home, I will not have any Internet access)
Sorry for the inconvenience ;).
Well, we all know what Telstra's like.
Could be weeks, guys! :P
Daniel, if you want the SMF Mod Parser up and running, until then I could host it on my server, I don't have a problem.
I have it as a beta at my site
http://sleepycode.com/index.php?action=modparser
Also have his old ones there as well :P
http://sleepycode.com/index.php?action=pack
http://sleepycode.com/index.php?action=mod
QuoteDaniel, if you want the SMF Mod Parser up and running, until then I could host it on my server, I don't have a problem.
Well, I could host it on my website (daniel15.com, which uses PHP 5)...
I'll have to wait until Friday to get the code anyways (that server is at my mum's house, I'm at my dad's house at the moment ;)).
Quote from: Aes-Sedai on April 17, 2007, 07:23:07 PM
Well, we all know what Telstra's like.
Could be weeks, guys! :P
Well...
I got to my mum's house today, and it suddenly started working again. So, all's well again (I hope it stays this way :P)
Daniel15, if you're interested, I attached the dutch translation ;)
Thanks for that xenovanis, I added your translation :)
Is the package parser gone? or is it temporary?
It's temporary, until I have the time to fix everything up. The server it was hosted on had a hard drive failure, and I'm in the process of setting everything up on a new server (I don't have much free time, so it's taking a while).
For now, use one of the versions other people are hosting:
http://www.smfhacks.com/smf-package-parser.html
http://sleepycode.com/index.php?action=modparser
The SMF package parser is now back up :)
Thanks Daniel...is your source code for the latest version available again?
TrueSatan, yes, the released source code for the Package Parser is available from http://dev.dansoftaustralia.net/frs/?group_id=12, and the very latest code (contains some small fixes as well as the XSLT stylesheets I'm working on) is available via SVN (see http://dev.dansoftaustralia.net/scm/?group_id=12)
Thanks again Daniel...I'll get a tortoise (Tortoise SVN) to pay a visit.
I've also got an SVN browser available at http://dev.dansoftaustralia.net/plugins/scmsvn/viewcvs.php/trunk/?root=modparser :)
The XSLT stylesheets in that directory, they're kinda related... Take a look at [Beta] XSLT stylesheets for Modification XML files - Make them look pretty (http://www.simplemachines.org/community/index.php?topic=167679.0) for information about them :)
Thanks A lot dan. Is it going to support 1.1.4
Sure, it's a very simple change so I'll update it really soon :)
uPdate for 1.17?
Is it compatible for 1.1.8 ?
How about 2.0 RC1 ? :(
For those looking to update this for newer versions of SMF, open the package.php and edit it to look something like this.
<label for="smfVersion"><?php echo $txt['choose_version'] ?>:</label>
<select name="smfVersion" id="smfVersion">
<optgroup label="SMF 2.0 Branch">
<option>2.0 RC1.2</option>
<option>2.0 RC1-1</option>
<option>2.0 RC1</option>
<option>2.0 Beta 4</option>
</optgroup>
<optgroup label="SMF 1.1 Branch">
<option>1.1.10</option>
<option>1.1.9</option>
<option>1.1.8</option>
<option>1.1.7</option>
<option>1.1.6</option>
<option>1.1.5</option>
<option>1.1.4</option>
<option>1.1.3</option>
<option>1.1.2</option>
<option>1.1.1</option>
<option>1.1</option>
</optgroup>
<optgroup label="SMF 1.0 Branch">
<option>1.0.13</option>
<option>1.0.12</option>
<option>1.0.11</option>
<option>1.0.10</option>
<option>1.0.9</option>
</optgroup>
</select><br />
I figured that one out a couple months ago, its simple to update, so far anyway. ;D
Now to figure out how to parse mods stored on site much like the one here at SMF does. :)
does anyone know of an updated parser?
TIA
Quote from: Kimmie on September 19, 2009, 12:15:39 AM
does anyone know of an updated parser?
TIA
http://dev.smfchat.com/parser ;D
Nice work JB :P
Does anyone have a parser i could use in my own website? :P
Quote from: bluedevil on March 31, 2010, 11:43:04 AM
Does anyone have a parser i could use in my own website? :P
download the files,upload them and change some aspects of one file, I can´t remember very well :P
I think he means that there is no available download from Dan's site now, and if someone could re-upload it for us. I'd also like a copy of this, I had it before but seem to have lost it :/
Quote from: Liam. on April 18, 2010, 05:00:40 PM
I think he means that there is no available download from Dan's site now, and if someone could re-upload it for us. I'd also like a copy of this, I had it before but seem to have lost it :/
Yes.... i'd like to have one in my test site.
No way to find it!