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
/printthread.php 16 require_once



UserSpice
Project structure - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Project structure (/showthread.php?tid=311)



Project structure - lastnerve - 10-16-2016

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?


Project structure - mudmin - 10-16-2016

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.


Project structure - lastnerve - 10-16-2016

OK, Thanks alot!


Project structure - lastnerve - 10-19-2016

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?


Project structure - mudmin - 10-20-2016

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.


Project structure - lastnerve - 10-20-2016

It works! Thanks again.


Project structure - mudmin - 10-20-2016

Awesome. Glad it worked!