HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
New Addon
422
MVP
Saturday here so had some time to create a very basic Mod.
I try to upload it but keeps stating Could not analyze the addon file.
Not sure what the Go is there, as its all plain and simple stuff. Read thru http://vanillaforums.org/docs/pluginquickstart and
http://vanillaforums.org/docs/plugins and
I also downloaded sample file... just not sure what the go is.
So I have to go out now to a function and uploaded it to one of our dev domains.
Link: sitehelp.com.au/Emocss.zip
Hopefully one of the guys here can check it out and see what I have done wrong.
Its a Emoticon replacement , using pure css instead. Could be useful for very busy forums.
I try to upload it but keeps stating Could not analyze the addon file.
Not sure what the Go is there, as its all plain and simple stuff. Read thru http://vanillaforums.org/docs/pluginquickstart and
http://vanillaforums.org/docs/plugins and
I also downloaded sample file... just not sure what the go is.
So I have to go out now to a function and uploaded it to one of our dev domains.
Link: sitehelp.com.au/Emocss.zip
Hopefully one of the guys here can check it out and see what I have done wrong.
Its a Emoticon replacement , using pure css instead. Could be useful for very busy forums.
There was an error rendering this rich post.
0
Best Answer
-
Todd Vanilla StaffThe comments you put after each item in the plugin info array are confusing the parser. We don't want to run php that is uploaded to our site so I just do some crude regex analysis and didn't account for comments in the plugin info array. If you remove those then the plugin should upload fine.1
Answers
Ste
There was an error rendering this rich post.
Download link is here: ( new ) http://www.sitehelp.com.au/Emocss.zip
There was an error rendering this rich post.
What I noticed when I downloaded your .zip file is that you didn't include the directory of the plugin.
I made a new .zip and uploaded it, but I also get the same error message, therefore I ask to get the sample file and upload it.
In the meantime I'll dive into the PHP code to analyze the error message.
Edit
First result:
\models\class.addonmodel.php line 388
// Analyze and fix the file. if (isset($Path) && !$V1) { try { $Addon = UpdateModel::AnalyzeAddon($Path, FALSE); } catch (Exception $Ex) { $Addon = FALSE; $this->Validation->AddValidationResult('File', '@'.$Ex->getMessage()); } if (!is_array($Addon)) { $this->Validation->AddValidationResult('File', 'Could not analyze the addon file.'); return FALSE; } $Addon = array_merge($Stub, $Addon); } else { $Addon = $Stub; if (isset($Path)) { $Addon['MD5'] = md5_file($Path); $Addon['FileSize'] = filesize($Path); } }
Edit2
I think the error is in this piece of logic:
try { $Addon = UpdateModel::AnalyzeAddon($Path, FALSE); } catch (Exception $Ex) { $Addon = FALSE; $this->Validation->AddValidationResult('File', '@'.$Ex->getMessage()); }
The addon file (array) is analyzed. There is an exception that's caught. The $Addon variable is set to false and the message is ... hidden from screen by applying the '@' sign.Now we need to ask if @Todd can look at the validation result that's written in a File.
Can you upload the sample file in the meantime please, to eliminate that it's all files that are having problems.
There was an error rendering this rich post.
Ste
There was an error rendering this rich post.
Also a suggestion, because you have ability to add edits, they aren't time stamped in the thread , so gets confusing following the thread. When an edit is made in this way , could a time stamp also be added ? Would clarify things.
There was an error rendering this rich post.
So not sure what to try next as I dont want to spam the addons with existing addons. Its no big deal, perhaps best to forget it.
There was an error rendering this rich post.
There was an error rendering this rich post.
// Define the plugin: $PluginInfo['Emocss'] = array( 'Name' => 'Emocss', 'Description' => 'Replaces emoticons in forum comments with css images.', 'Version' => '1.0', 'RequiredTheme' => FALSE, 'RequiredPlugins' => FALSE, 'HasLocale' => FALSE, 'Author' => "422", 'AuthorEmail' => 'steve@422.com.au', 'AuthorUrl' => 'http://30.com.au', 'License' => 'GPL v2', 'RequiredApplications' => array('Vanilla' => '2.0.17') ); /** * EMOcss * * This is a very simple plugin, which replaces image smileys with pure css simleys. * Thus it saves on server requests, each time an image is requested thats one trip back and * forth to your server. Got a thread with 50 posts, and 3 smileys in each post ? then pure css * can make sense **/ class EmocssPlugin implements Gdn_IPlugin { public function PostController_Render_Before($Sender) { $this->_Emocss($Sender); } public function DiscussionController_Render_Before($Sender) { $this->_Emocss($Sender); } private function _Emocss($Sender) { $Sender->AddJsFile('plugins/Emocss/emocss.js'); $Sender->AddCssFile('plugins/Emocss/emocss.css'); } public function Setup() { } }
There was an error rendering this rich post.
They have google code projects so you can easily browse the source if you like.
There was an error rendering this rich post.
I use eclipse to do development, there's a plugin for PHP development that works out rather well. I have an ANT build script that automatically generates the zip files necessary to upload my addon to the site here.
There was an error rendering this rich post.
When you find some time, please, could you update the approved status of my plugins?
I've updated them and republished them with the new launch of .18
TYVM in advance
There was an error rendering this rich post.
@422, I tried downloading your plugin, extracting it, re-zipping and then uploading it and it worked no problem. I don't know why, but I guess our php zip library can't recognize your zip. I'll switch the author to you soon.