The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Changes to init.php and classes - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: Changes to init.php and classes (/showthread.php?tid=1258) |
Changes to init.php and classes - trequel - 12-11-2018 1) If I make changes to init.php, should I copy init.php to userc/ or can init.php be edited without causing problems with future updates? 2) If I make changes to the existing classes, is there a recommended way of doing that to avoid problems during future upgrades? Thanks. RE: Changes to init.php and classes - mudmin - 12-11-2018 (12-11-2018, 12:43 PM)trequel Wrote: 1) If I make changes to init.php, should I copy init.php to userc/ or can init.php be edited without causing problems with future updates? You can change init.php to your heart's content. As far as classes goes, that gets a little trickier. Can you give me an idea of what kind of changes you want to make? Also, what about doing something like class DBPRo extends DB { RE: Changes to init.php and classes - trequel - 12-11-2018 (12-11-2018, 01:38 PM)mudmin Wrote:(12-11-2018, 12:43 PM)trequel Wrote: 1) If I make changes to init.php, should I copy init.php to userc/ or can init.php be edited without causing problems with future updates? Thank you for that information. I have added a column to the profiles table and want to store an additional piece of information in that table when a User is created. Additionally, when a user is logging in, I want to get profile information back. I've created a Profile class to retrieve profiles table info, but have modified User to insert that additional field. RE: Changes to init.php and classes - mudmin - 12-11-2018 We don't update classes very often, so you could just look for changes on those updates. There's another way to do it where you won't have to worry about class updates breaking it. usersc/scripts/during_user_creation.php allows you to do custom things when a user is created usersc/scripts/custom_login_script.php allows you to run tasks on login |