Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMF Customization Team on September 06, 2009, 05:01:28 AM

Title: Version Emulate
Post by: SMF Customization Team on September 06, 2009, 05:01:28 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2113)

Version Emulate



Original Author: Arantor (http://www.simplemachines.org/community/index.php?action=profile;u=265135) | Current Author: SMF Customization Team (http://www.simplemachines.org/community/index.php?action=profile;u=1)

Supported Languages: English

Link To Mod (http://custom.simplemachines.org/mods/index.php?mod=2113) | Mod Discussion (http://www.simplemachines.org/community/index.php?topic=334952.0) | Other SMF Customization Team Mods (http://custom.simplemachines.org/mods/index.php?action=profile;u=1)


Summary:
Many mods will in fact work on versions other than those listed - without modification, but require coaxing to do so with a little trick called 'version_emulate', that essentially tells the package manager to pretend to be another version of SMF for the purposes of testing for installation.

This mod adds an option to 1.1 that allows you to input another version that will help with installation. It will not guarantee that it will work, simply that the version check will be passable. Some mods require changes to be compatible with a different version.

NB Similar functionality is already in 2.0, though it's a free-format text box there.

Compatibility:
Compatible with SMF 1.1

Installation Information:
The Package Manager should work in most cases, if you have problems installing please use the discussion thread as well as Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)

License:
Copyright (c) 2015, Simple Machines
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Change Log:
1.4 - October 12, 2011
Mod options place in package browser
1.3 - September 28, 2011
Fixed a problem in PackageGet.php
1.2 - September 22, 2011
Added support up to SMF 1.1.15
1.1 - February 10, 2009
Added 1.1.12 support
Updated language support
1.0 - September 06, 2009
Initial release
Title: Re: Version Emulate Dropdown
Post by: MaXiForum.cz on September 06, 2009, 01:56:13 PM
This is a great idea!
Thanks :)
Title: Re: Version Emulate Dropdown
Post by: w1z8it on September 06, 2009, 02:40:49 PM
Nice :D Would be cool if those using this could list which mods they have had success with this without further modifications, I'll certainly post my findings.

Cheers.
Title: Re: Version Emulate Dropdown
Post by: Sabre™ on September 06, 2009, 09:05:51 PM
Would this also work to uninstall mods that noloanger have the [uninstall] button?
It most certainly is a good idea mate :)

EDIT:
Never mind mate, I read its function incorrect :D
Cheers
Title: Re: Version Emulate Dropdown
Post by: Arantor on September 06, 2009, 09:25:44 PM
In answer to your question, yes it should do if the mod had uninstall for earlier versions than the current release.
Title: Re: Version Emulate Dropdown
Post by: Sabre™ on September 06, 2009, 10:18:36 PM
Yep, I made the failed assumption that if I put it back to smf 1.1.2, then they all would be ok, not taking into consideration that the packages install.xml may not go back that far for all of them
*smacks head

Thanks mate, another very useful mod :)
Title: Re: Version Emulate Dropdown
Post by: ~DS~ on December 28, 2009, 12:43:09 AM
Any update for 2.0 RC2?
Title: Re: Version Emulate Dropdown
Post by: Arantor on December 28, 2009, 07:59:16 AM
Quote from: Dismal Shadow on December 28, 2009, 12:43:09 AM
Any update for 2.0 RC2?

Read the mod page. Similar function is BUILT INTO 2.0.
Title: Re: Version Emulate Dropdown
Post by: ~DS~ on December 28, 2009, 11:18:46 AM
ah thanks. Guess I overlooked it.
Title: Re: Version Emulate Dropdown
Post by: Bugo on February 26, 2010, 04:33:13 PM
Russian text:

$txt['versionToEmulate'] = 'Эмуляция версии SMF';
Title: Re: Version Emulate Dropdown
Post by: Arantor on March 04, 2010, 05:12:53 PM
Thanks for the translation. I'd like to hope the SMF Customization Team updates it, because I can't at this time do so.
Title: Re: Version Emulate Dropdown
Post by: Cal O'Shaw on March 10, 2010, 01:59:53 AM
Hello,

Just did a quick running of the Parse option on the MOD page and noted that in getPackages.php the list of versions does not include 1.1.11, as it does in the other arrays of versions to emulate in the MOD.

Did that get missed or is it supposed to be that way?

Cal
Title: Re: Version Emulate Dropdown
Post by: Arantor on March 10, 2010, 06:04:03 AM
I probably missed it last time I updated the mod.
Title: Re: Version Emulate Dropdown
Post by: thesicilian on March 27, 2010, 05:56:46 PM
I installed this mod today to try and add a mod, but still couldn't install this particular mod. I was trying to add http://custom.simplemachines.org/mods/index.php?mod=1211

I've un-installed the emulator but it left the drop down behind, see attached screenshot.

I'm also now having problem installing a couple of mods that are defo compatible with 1.1.11. Such as search_focus_dropdown http://custom.simplemachines.org/mods/index.php?mod=1634 and Additional Home Page Title | S-Ace http://custom.simplemachines.org/mods/index.php?mod=2154

I had no problems installing mods prior to using the version emulator. Before I uninstalled I set back to 1.1.11. I think it might have left something behind.
Title: Re: Version Emulate Dropdown
Post by: Arantor on March 27, 2010, 06:00:01 PM
Did you "uninstall" or "delete" the mod?
Title: Re: Version Emulate Dropdown
Post by: thesicilian on March 27, 2010, 06:02:48 PM
Uninstall, then deleted the files after. I since tried re-install and uninstall, but still the drop down remains.
Title: Re: Version Emulate Dropdown
Post by: Arantor on March 27, 2010, 06:04:47 PM
Weird.

Follow the steps outlined in Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402.0) - but in reverse - to see the code in question that needs to be removed.

/me would point out this worked flawlessly for him when he tested it while coding it...
Title: Re: Version Emulate Dropdown
Post by: thesicilian on March 27, 2010, 06:24:38 PM
I've looked in install11.xml, it mentions the following files: -

ManageServer.php
Subs-Package.php
Packages.php
PackageGet.php

I'm assuming they are the four files that need checking/editing?

I've looked in ManageServer.php and it looks like there is defo remants of the install in there. Now I'm concerend about messing with files myself. Would it be possible to attached the to be checked out please?
Title: Re: Version Emulate Dropdown
Post by: Arantor on March 27, 2010, 06:27:01 PM
Sure you can. Whether I get time to look them over is another matter (I wrote the mod originally)...
Title: Re: Version Emulate Dropdown
Post by: thesicilian on March 27, 2010, 06:35:15 PM
It would very much appreciated if you can please.

I'm really lost when it comes editing code. Took me ages setting the forums up & members are joining, last thing I want to do is break it.

I'm assuming its only those four files?

Your help would be very much appreciated.

I'm assuming that drop down isn't there as standard?
Title: Re: Version Emulate Dropdown
Post by: Arantor on March 27, 2010, 06:47:53 PM
Yup, it's a modification.

Here are the same files with the edits removed.
Title: Re: Version Emulate Dropdown
Post by: thesicilian on March 28, 2010, 01:57:11 AM
Quote from: Arantor on March 27, 2010, 06:47:53 PM
Yup, it's a modification.

Here are the same files with the edits removed.

m8 your a star, thank you very very much :)
Title: Re: Version Emulate Dropdown
Post by: Apllicmz on October 31, 2010, 07:31:52 PM
when Update

dont forget portuguese

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['versionToEmulate'] = 'Vers&atilde;o do SMF para emular';
]]></add>
        </operation>
    </file>
   
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['versionToEmulate'] = 'Vers&atilde;o do SMF para emular';
]]></add>
        </operation>
    </file>
Title: Re: Version Emulate Dropdown
Post by: TDNY on November 05, 2010, 08:05:22 AM
Is this going to be updated for 1.1.12?
Title: Re: Version Emulate Dropdown
Post by: impreza on November 06, 2010, 06:05:43 AM
Super Thanks
Title: Re: Version Emulate Dropdown
Post by: Cal O'Shaw on December 23, 2010, 10:46:29 PM
Could this be updated for 1.1.12?  I don't want to have to uninstall this so I can install a MOD that doesn't accept anything but 1.1.12.

Grazie
Title: Re: Version Emulate Dropdown
Post by: Arantor on January 25, 2011, 05:40:11 AM
It installs just fine on 1.1.12 (and works) - none of the changes in 1.1.12 affect this mod.

And when I originally wrote it, I made sure that it checks for any 1.1.x version, it's just a case of the Cust team updating the page now.
Title: Re: Version Emulate Dropdown
Post by: Cal O'Shaw on January 25, 2011, 12:29:13 PM
Oh, I agree it works great and I'm very glad you wrote it.

The only concern is that it won't "emulate" 1.1.12.  That is, with the MOD installed, MODs that ONLY install on 1.1.12 will not.  And there are some authors who change the install script to only work on the current versions.

So hopefully it will have "1.1.12" added to the dropdown list, so one can configure it to "emulate" 1.1.12.

Cal
Title: Re: Version Emulate Dropdown
Post by: Spoogs on January 25, 2011, 12:54:23 PM
attach your
sources:
/ManageServer.php
/Subs-Package.php
/Packages.php
/PackageGet.php


Better yet install the mod then

Code (sources/ManageServer.php FIND) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11');

Code (REPLACE with) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11', '1.1.12');


Code (FIND) Select

array('select', 'versionToEmulate', array(&$smf_versions[0], &$smf_versions[1], &$smf_versions[2], &$smf_versions[3], &$smf_versions[4], &$smf_versions[5], &$smf_versions[6], &$smf_versions[7], &$smf_versions[8], &$smf_versions[9], &$smf_versions[10], &$smf_versions[11], &$smf_versions[12], &$smf_versions[13], &$smf_versions[14])),

Code (REPLACE with) Select

array('select', 'versionToEmulate', array(&$smf_versions[0], &$smf_versions[1], &$smf_versions[2], &$smf_versions[3], &$smf_versions[4], &$smf_versions[5], &$smf_versions[6], &$smf_versions[7], &$smf_versions[8], &$smf_versions[9], &$smf_versions[10], &$smf_versions[11], &$smf_versions[12], &$smf_versions[13], &$smf_versions[14], &$smf_versions[15])),




Code (sources/Subs-Package.php FIND) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11');

Code (REPLACE with) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11', '1.1.12');




Code (sources/Pacgaes.php FIND) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11');

Code (REPLACE with) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11', '1.1.12');




Code (sources/PackageGet.php FIND) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10',);

Code (REPLACE with) Select

$smf_versions = array('1.1 RC1', '1.1 RC2', '1.1 RC3', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.1.9', '1.1.10', '1.1.11', '1.1.12');
Title: Re: Version Emulate Dropdown
Post by: Arantor on January 25, 2011, 02:05:36 PM
Yeah, that'll do it :) All it is is literally extending the list of versions it has.

I'd do it but 1) I'm not on the team and don't have the power to update it and 2) even if I had the power, I wouldn't owing to the fact that I'm moving off most of my sites (all my active ones, at least) off SMF later this year.
Title: Re: Version Emulate Dropdown
Post by: chrishicks on April 09, 2011, 11:55:29 AM
Stupid question but I have an older version of this(stops at 1.1.10) and was wondering, is it possible this is stopping me from updating my forum(currently at 1.1.11) to the newer versions through Package Manager? I have tried multiple times to upgrade and the updates keep telling me they're not correct(corrupt or not the correct version). I looked over the code for the newer version and don't really mind doing a manual update to this mod but I just wanted to see if this could be the root of my issue or if it's something else before I did any playing around with the code. Thanks.
Title: Re: Version Emulate Dropdown
Post by: Arantor on April 09, 2011, 12:54:59 PM
Yes, considering that the mod mangles the way version checks are done... uninstall it, do the updates, then install the latest version of it.
Title: Re: Version Emulate Dropdown
Post by: chrishicks on April 09, 2011, 04:45:06 PM
Quote from: Arantor on April 09, 2011, 12:54:59 PM
Yes, considering that the mod mangles the way version checks are done... uninstall it, do the updates, then install the latest version of it.
Thanks for the quick reply Arantor. I removed it and am currently doing the updates now. Thanks again, I really appreciate the help.
Title: Re: Version Emulate Dropdown
Post by: T3CHN0 on October 21, 2011, 09:26:37 AM
can this be done with 2.0.1 as well, I have just over 100 mods installed starting from smf rc1 up to 2.0.1
and if this could work with 2.0.1 it would be a big help...
Title: Re: Version Emulate Dropdown
Post by: Illori on October 21, 2011, 09:28:35 AM
2.0.1 has version emulation built in via the advanced link on the packages page.
Title: Re: Version Emulate Dropdown
Post by: T3CHN0 on October 21, 2011, 10:16:44 AM
Quote from: Illori on October 21, 2011, 09:28:35 AM
2.0.1 has version emulation built in via the advanced link on the packages page.
I mean I don't want to have to change the version emulation all the time, I want an open version emulation
so I don't need to change it to suit the mod I am installing or uninstalling.. I thought thats what this mod did, Sorry
Title: Re: Version Emulate Dropdown
Post by: Illori on October 21, 2011, 10:18:30 AM
no this mod does not do that, and it would be a major risk to some users who would try to install mods for 1.1.1* on 2.0 with that feature
Title: Re: Version Emulate Dropdown
Post by: T3CHN0 on October 21, 2011, 10:22:09 AM
Quote from: Illori on October 21, 2011, 10:18:30 AM
no this mod does not do that, and it would be a major risk to some users who would try to install mods for 1.1.1* on 2.0 with that feature
agreed it would be,, would have to have a big warning message about unless you know what you are doing with php coding!!! don't not install this mod..
as for more advanced users it would be a great option.
Title: Re: Version Emulate Dropdown
Post by: Illori on October 21, 2011, 10:23:50 AM
if you wish for a mod like that please open a separate thread in the mod requests board although i dont think anyone will pick it up
Title: Re: Version Emulate Dropdown
Post by: jmil on April 02, 2012, 01:04:44 PM
I Installed this on a 1.1.16 SMF Forum and the Mod does not show (No Drop down selection)  in the Admin Section - I also checked the Default Theme - No Luck.

I then did a Manual Parse and the files were 100% Correct!

Any thoughts on this?
Title: Re: Version Emulate Dropdown
Post by: Matthew K. on April 02, 2012, 01:25:01 PM
You know it gets added to Server Settings, right?
Title: Re: Version Emulate Dropdown
Post by: IchBin™ on April 02, 2012, 01:27:07 PM
Lab, the link was moved in SMF1 to be the same as it is in SMF2.

You should see an Version Emulate link on the Admin > Package Manager > Browse Packages . Can you post a screen shot of this page? If it's not there, please attach your Package.php and Package.template.php file to your next post.
Title: Re: Version Emulate Dropdown
Post by: jmil on April 02, 2012, 01:28:40 PM
YES - Thats why I am perplexed! I do know how to install and Change code! this is a VERY simple Mod too!
Title: Re: Version Emulate Dropdown
Post by: Matthew K. on April 02, 2012, 01:30:54 PM
Oops...I just looked at the screenshot, my bad :P Can you post the screenshot and attach the files like Ich said?

/me decides he is a lazy bum
Title: Re: Version Emulate Dropdown
Post by: jmil on April 02, 2012, 01:35:57 PM
Attached the Files! And yes it Does show as Installed in the Admin Packages - Browse Packages!
Title: Re: Version Emulate Dropdown
Post by: IchBin™ on April 02, 2012, 01:38:48 PM
No I'm not talking about the installed link. This is what you should see.
Title: Re: Version Emulate Dropdown
Post by: jmil on April 02, 2012, 01:39:31 PM
GOT - IT - I Deleted it and I then Cleaned all the Files reloaded it and BINGO - There it is!!!!

::)   Solved and the Quick response was unbelievable!
Title: Re: Version Emulate Dropdown
Post by: jmil on April 02, 2012, 01:40:02 PM
We Posted at the same time! It is now properly installed!
Title: Re: Version Emulate Dropdown
Post by: Matthew K. on April 02, 2012, 01:42:23 PM
Not a problem, glad you got it all straightened out :)
Title: Re: Version Emulate Dropdown
Post by: IchBin™ on April 02, 2012, 01:57:07 PM
Updated the mod page to show my screen shot so it would be more clear.
Title: Re: Version Emulate Dropdown
Post by: Matthew K. on April 02, 2012, 02:00:47 PM
Awesome :D
Title: Re: Version Emulate Dropdown
Post by: Jessica. on April 02, 2012, 04:47:00 PM
the one for 2.0.x needs to be a drop down. I'm tired of having to type it in all the time
Title: Re: Version Emulate Dropdown
Post by: Matthew K. on April 02, 2012, 05:20:31 PM
Throw that in Feature Request maybe then eh? Although I doubt this would be as much of an issue in 2.1.