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
Hide links to users
#1
I'm using
<pre>
Code:
<? Php if (checkMenu (2, $ user-> data () -> id)) {?>
<! - <a href = "#"> Link </a> ->
<? Php}?>
</pre>

But that breaks some things on my site with
Code:
Notice: Undefined property: stdClass::
  Reply
#2
The stdClass error often occurs when you try to use a class property that doesn't exist. Change your code to the following and see if you still get errors:

Code:
<?php if (isset($user->data()->id) && checkMenu(2, $user->data()->id)) { ?> <! - <a href="#"> Link </a> -> <?php } ?>
  Reply
#3
I'm having the same problem. When I remove this fragment it is solved but if I add it it breaks. Thank you anyway.
  Reply
#4
Try this...

Code:
if($user->isLoggedIn() && hasPerm([2],$user->data()->id)){

checkMenu only allows you to put one permission level. hasPerm allows you to put a bunch [2,3,4].
  Reply
#5
I tried to try the blog of this link https://userspice.com/forums/topic/sistem-news/ that brandin wrote but I found that problem, anyway thank you.
  Reply
#6
So is everything working?
  Reply
#7
Everything is broken with this line
Code:
if (clickMenu (2, $ user-> data () -> id)) {
in the navigation.php as result
Code:
Notice: Undefined property: stdClass ::
If I remove the
Code:
if (clickMenu (2, $ user-> data () -> id)) {
works again.
  Reply
#8
If you enter usersc/blog.php as a visitor works great. But if logged in as admin to usersc/blog.php I get a
Code:
Notice: Undefined property: stdClass ::
.
  Reply
#9
It shouldn't be clickmenu, it should be this hasPerm
Code:
if($user->isLoggedIn() && hasPerm([2],$user->data()->id)){

Also, since you're in usersc, your link to the init file needs to be

Code:
<?php require_once '../users/init.php'; ?>

Don't get frustrated...we will fix this!

If that doesn't work, can you paste your entire usersc/blog.php file on pastebin.com and share the link in this forum post?


  Reply
#10
This https://hastebin.com/iyesacoweb.xml is blog.php and this https://hastebin.com/vayazuzuwu.sql is the taba.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)