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
Project structure
#1
I luv UserSpice. I've already developed the pages for a new site and I want to use UserSpice for logins, security, etc. Is UserSpice meant to be used as a wrapper for all my web pages or should I use set_include_path to access it?
  Reply
#2
Glad you're enjoying it!

The great thing about UserSpice is that it doesn't really matter how you use it.
You basically need to require_once the init.php (with proper path) and add the line
Code:
<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>

Beyond that, as long as userspice knows where to look for your files, you can use as much or as little as our code/structure as you want.
  Reply
#3
OK, Thanks alot!
  Reply
#4
I guess I just don't know what I'm doing.

You said "You basically need to require_once the init.php (with proper path) " and I've been really struggling to find a way to get the proper path.

I added the userSpice41 folder within my site folder, but in users/init.php the value of
$abs_us_root.$us_url_root is C:/xampp/htdocs/, and if I add "userSpice41" to $us_url_root of course I get $abs_us_root.$us_url_root is C:/xampp/htdocs/userSpice41. But I also get the message:"
You must go into the Admin Panel and click the Manage Pages button to add this page to the database. Doing so will make this error go away."

I need some help figuring out a workable way to work userSpice41 into my site file structure.

Can ya help?
  Reply
#5
Ok. So you're using xampp. Let's say that you have your project installed in C:/xampp/htdocs/userSpice41, which would come up in the browser as http://localhost/userSpice41

Then inside that you have folders like /users and /usersc

If you want to put all of your files in the http://localhost/userSpice41 then all you need to do is point the init file to
Code:
require_once 'users/init.php';

If you're putting your files in http://localhost/userSpice41/myFiles then all of your project files in that folder need to have
Code:
require_once '../users/init.php';


So the second question is if userspice is monitoring the folder that your files are in. If your files are in
http://localhost/userSpice41/
http://localhost/userSpice41/users
http://localhost/userSpice41/usersc

then the answer is automatically yes. If you're doing something like
http://localhost/userSpice41/myFiles

Open the file z_us_root.php.

Line 2 has an array,

Code:
$path=[”,’users/’,’usersc/’];
change it to
Code:
$path=[”,’users/’,’usersc/’,'myFiles/'];

I hope that helps.
  Reply
#6
It works! Thanks again.
  Reply
#7
Awesome. Glad it worked!
  Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)