UserSpice
Duplicated files in /usersc are not taken - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27)
+--- Thread: Duplicated files in /usersc are not taken (/showthread.php?tid=1571)



Duplicated files in /usersc are not taken - phenomenia - 07-05-2019

Hello,

I'm very new to the userspice system but I love it with every day I work with it! I'm usually working with WordPress as a web developer so I'm familiar with, what wordpress calles 'Child Theme' system. You never change a file in the original folder structure but copy it to a childtheme, or here the /usersc folder and the system automaticaly uses this file over the original one.
Sounds great in theory, but for some reason this is not really working in the userspice I'm using on my localhost. I'm working with the latest version, 4.4.14, according to the dashboard.

At the moment I want to change the logo for example. To do that I dropped my logo file in the template folder I created at /usersc/templates. (I activated the template in the backend). Then I created a new folder /images inside my template folder.
Next step would be to replace the old path to the dummy logo to my actual one. I found out that it's in the database_navigation_stype.php file located at /users/includes/template

I would assume I copy this file to /usersc/includes/templates and the userspice system should automatically use this copy over the original version in /users - but it doesn't. The dropped file is completely ignored and the file in the original path is used.

What am I doing wrong?

Any hints would be much appreciated.

Thanks in advance
Felix


RE: Duplicated files in /usersc are not taken - mudmin - 07-07-2019

Sorry for the slow response. I'm on vacation, so I don't have great internet. The usersc thing is not universal. To change the logo you can do one of 2 things. You can either form the theme by going into usersc/templates and copying a theme like bs4 to a new folder called yourtheme and then you can edit away. Since the theme points to users/images/logo.png, you can just change where that link goes in the template.

The other option is to just overwrite logo.png in users. It's rare that we tell you to overwrite something in users, but that has been where the logo is stored since version 2.x, so we haven't changed it for compatibility reasons.

Regarding usersc/ that encompasses several things...
1. You can copy any of the "main" php files that are located in users/ to usersc/ with the same file name and your page will load instead of ours. You can edit away without fear that updates will overwrite your code.
2. usersc/scripts includes a place for custom scripts where you can put your own code to run at certain instances. Like there is a script in there where you could run some code when a user logs out or when they're created etc.
3. usersc/includes has a bunch of files that are more like "shims" . It's a way to inject your code into our files without actually having to maintain your own duplicate file in usersc. Most of those have relatively clear file names and a little documentation at the top.

I hope that helps. Let me know if you have any other questions.