The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Better solution to find init
#1
So my biggest problem is calling init from different directories (in particular, my userpost.php file inside of /templates/)

I currently call using:
require_once $_SERVER['DOCUMENT_ROOT'] .'/mydash/users/init.php';

But if I move this to my prod server, I lose the /mydash/ dir - which means this function breaks

Thoughts?
  Reply
#2

That's the problem. init.php and z_us_root.php act like a magical pair of planets orbiting each other. Before we did it this way, you had to define your site's root in the init.php file itself and it caused all sorts of problems.

In fact, userspice is the only php app I've ever used that you can just move wherever and as long as the db credentials are intact, everything just works. Try doing that with joomla or wordpress.

So, what is the problem calling init from different places.

It should be a matter of just doing '../users/init.php' to back up one folder or ../../users.init.php to back up two.

Basically the question is how many folders deep is that templates folder and you need one set of ../ to back up and get to it. Or you can use your full domain. https://mydomain.com/users/init.php
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)