The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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
Fetch data from DB
#31
i checked with the fresh installation

Step1 : Freshly installed no changes - every pages works fine as intended

Step2 : Just changed login form layout - entered account.php , no issues . clicked admin panel , no issues . in admin panel total pages shows 21 . click manage now that 21 becomes "0" and displays following error

Notice: Undefined offset: 0 in C:\xampp\htdocs\s-lu\classes\DB.php on line 150

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 349

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 349

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 349

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 351

now if i go to any page including account.php this error stays at the top
  Reply
#32
My Login.php code https://codeshare.io/qnjMF

My _login_form.php code https://codeshare.io/GPUrF

Nothing more i changed
  Reply
#33
Notice: Undefined offset: 0 in C:\xampp\htdocs\s-lu\classes\DB.php on line 150

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 349

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 349

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 349

Notice: Trying to get property of non-object in C:\xampp\htdocs\s-lu\users\helpers\us_helpers.php on line 351

That error means those pages are not in your database. I will make that error more graceful in the future.

You have to go into the admin panel and open the link to administer your pages and the database should autopopulate them back. It should all work from there.
  Reply
#34
@mudmin , i tried but its not auto populating mate . check the screenshot link below mate

https://i.imgsafe.org/c1dec83.png
  Reply
#35
I see....have you modified anything at all in the helpers folder?

Have you modified any thing in your database that has anything to do with pages or permissions?
  Reply
#36
Nope mate , just the two files i said know above thats it .

One thing . if i do fresh installing works perfectly

after making changes if i enter admin_pages it shows 21 pages then if i refresh or come back this occurs and not going even if i undo the work
  Reply
#37
can you upload your login.php and _login_form.php again? i'm getting at error from your links.
  Reply
#38
First off, at the beginning of login.php you have removed the includes/userspice/us_header.php file and replaced it with a "includes/header.php". What is in this file? The us_header.php file that was removed includes a lot of initialization code. In general, you can't not include it unless you want to go and do a bunch of things manually.

I'm going to try your files on a site of my own to see what can be made working again. In short, if there is a reference to include/userspice/* you probably shouldn't be touching it without knowing exactly what impact it will have (in this case, a potentially big one).
  Reply
#39
With the changes to the code, the missing us_header.php (unless that is in your header.php somewhere), and the additional mix of styling, it makes it very difficult to debug what is going on. I would suggest making smaller changes as you go, and verify the functionality as you go along.

I think to successfully use UserSpice as a framework you build on top of and wish to heavily modify, you may need to study the structure of how the different files are used, and this will only come with time. For example, in the _login_form.php it doesn't call the </body></html> tags in stock US because there is another file that does that.

Understanding the structure of the various includes, especially the function of core/init.php will be key to the success of your project.
  Reply
#40
I'm with Brian on this one. Best practice with userspice is to revert your official userspice pages back to the ones that came with the download and add your code to one of the blank pages provided. Once you start messing with the original pages, lots of stuff can go wrong. In other words, if you want to make changes to the admin panel that contains all the controls, you're a lot better making an admin2.php or something like that and doing your changes on that. There is lots of functionality in UserSpice that may not look like anything if you're not familiar with the code, but changing it can break lots of things down the road.

The other thing is test and test often. Every time you make a major change...just double check it to make sure it hasn't broken anything else. UserSpice is very robust and pretty tolerant of whatever is in your code...as long as you leave the core code alone so it can do its thing.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)