Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Randem on June 18, 2019, 07:23:07 PM

Title: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 18, 2019, 07:23:07 PM
Using version 2.0.15. How can one get the Package Manager to install image files in all themes that are installed. Currently I can only get it to install the images in the default theme. I need theme in every them for the MOD to work properly in every theme. This line only works on the default them and it does not matter if another theme is active:


<require-dir name="Program/Images/image/" destination="$themedir" />


when I check-mark the other themes to install into it will only do code changes to files, not file coping to the other themes.

Is this something that Package Manager does not handle?
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 03:14:48 AM
Well, I had to write a MOD to correct Package Manager for it was not installing Images, Languages or Templates to the selected themes at MOD install time if one selected Package Manager to do so. It basically only made code changes to some template files (basically one from my usage). So now with this MOD Package Manager will now do create-file, move-file, remove-file, create-dir, remove-dir,  move-dir, require-file, require-dir to the selected installed themes.
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Kindred on June 19, 2019, 08:56:18 AM
If that's so, then you must have broken it at some point, since all of those are dealt with correctly in the default installation....
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 04:14:09 PM
No, but nice of you to blame me... It is simple to recreate if you just really want to find out and not just blame people. You have no idea of what I am referring to do you? In a new installation (which I must have broken at some point BEFORE the download...) it operate the same in 2.0.15, RC1 and RC2 and it would be very clear to see the difference in the MOD I created. I prefer proof over speculation...
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Kindred on June 19, 2019, 05:24:05 PM
Hey, all I know is that I have installed about 200 mods into several forums and they have always properly copied files into the correct directories for each theme that I chose to install it into.... (proof)

I don't know what you did differently, but it never performed the way you describe for me, over the past 10 years...
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 05:38:11 PM
It couldn't have... There is an inherent problem in the coding in 2.0.15, RC1 and RC2 which would prevent that from happening at all and it is still overlooked. It is simple to recreate but you have to know what you are looking for... Why do you think no one answered my original post if it were as simple as you say? They all come a running, but not to help...
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Illori on June 19, 2019, 07:25:43 PM
you do know that we all have real lives and not everyone can come and run to a topic when it is not even 24 hours old?
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 07:33:28 PM
Yes, I do. But it seems like the first response is always blame and ridicule... Surely that can be better. No?
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 07:54:00 PM
And back to the actual topic. I have went back to version 2.0.5 and the same situation is still present. That is the last version that I have available. I will acquire older version to test.
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 08:26:06 PM
It is actually the same ever since the introduction of version 2.0

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Randem Systems "PackageManagerFix" Installation Instructions ver 1.x
// SMF mod package for use with the Simple Machines Forum versions 2.0 AND 2.1 RC1, 2.1 RC2, PHP, mySQL & Apache
// For more information and support.
//
// Author - Randem (http://www.simplemachines.org/community/index.php?action=profile;u=384160)
//
// Randem Systems Website: https://randemsystems.com
// Randem Systems Support: https://randemsystems.com/support/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////


Mod Information:
For SMF 2.0.x

PackageManagerFix is designed to assist you in porting your MOD installation to other installed themes. The current Package Manager does not copy image or language files and folder to the other installed themes, only to the default theme which if you were using any other theme than the SMF default theme
your MOD would not work correctly if it used images, templates or language files from the install.

The PackageManagerFix MOD fixes ONLY this issue.

To see the difference:

You must have more than 1 theme installed.
Attempt to install a MOD that updates at least one portion of a theme (I.E. Icons, Lanaguage or Images), but do not completely install it. Just click thru the first install button but not the second.
Note the area at the bottom of the screen that refers to other themes. Note the number of items it actually updates.
Install The Package Manager Fix, then follow the above procedure again to see the difference.

It will be clear of what is missing from the original package manager.
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 19, 2019, 08:41:22 PM
The before and after visuals (the proof):

(https://botbanish.com/images/PM1.png)

Clean install with only two MODS uploaded. Multiple Themes.

(https://botbanish.com/images/PM2.png)

What the Package Manager will install and change.

(https://botbanish.com/images/PM3.png)

Installation of Package Manager MOD

(https://botbanish.com/images/PM4.png)

What the Package Manager will NOW install and change.
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: shawnb61 on June 19, 2019, 11:48:09 PM
I see the same as Kindred in my vanilla 2.0.15.  Image files end up in all the theme directories properly. 

However...  I see the package definition is different.  The ones that work don't use a destination to $themedir for images - instead I see $imagesdir as a destination for images.  Similarly, there is a $languagedir

More here:
https://wiki.simplemachines.org/smf/Package-info.xml

Have you tried using these?
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 20, 2019, 01:01:25 AM
Aloha shawnb61,

Yes, I use $languagedir and $themesdir but not $imagedir. Let see if that clears up the issue.

Thanks
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 20, 2019, 02:47:33 AM
Using the $imagesdir directive, the images get where they should be in all the selected themes but the language and template files do not go to all the selected themes with the $languagedir and $themedir directives. Those files only go to the default Theme and language folders...
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Arantor on June 20, 2019, 03:08:39 AM
Working as designed. There is no need to spray copies of language files and templates in every theme when SMF will happily fall back to fetching from the default theme without any help. Also I'd suggest putting all the language files in a folder and installing that (loadLanguage is fine with this) so you only have to write one install and uninstall line.

Also, for images and so on, I habitually used $themes_dir/default specifically to get one copy installed and just point to the images directory since users are not good at installing on other themes and then report bugs.
Title: Re: Package Manager to install image files in ALL installed Themes
Post by: Randem on June 20, 2019, 03:21:13 AM
Thanks, good to know. The explanation make sense...