11
trabis
Re: Block not visible to registered users
  • 2008/6/4 13:00

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


You must be careful using

$uid = $xoopsUser->uid();

You should use:

if (is_object($xoopsUser) && $xoopsUser->getVar('uid') > 0){
$uid = xoopsUser->getVar('uid');
} else {
$uid = 0;
}

I do not know if this is the problem but you should use this anyway.

12
kerkyra
Re: Block not visible to registered users
  • 2008/6/4 13:52

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


what kind of problems could be caused by that line of code??
i replaced it with what u suggest but it gave me a white page, by changing it to ...
Quote:

if (is_object($xoopsUser) && $xoopsUser->uid() > 0){
$uid = $xoopsUser->uid();
}
else {
$uid = 0;
}


it worked again but with the same effect! this thing is getting me crazy!!!
whttp://www.guidemap.gr - Beta is out...

13
kerkyra
Re: Block not visible to registered users
  • 2008/6/4 14:16

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i also added the testing user to the webmasters group and ranked as webmaster and yet the block is invisible!!!!!Now isnt that crazy or not?
whttp://www.guidemap.gr - Beta is out...

14
trabis
Re: Block not visible to registered users
  • 2008/6/4 18:30

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

kerkyra wrote:
what kind of problems could be caused by that line of code??
i replaced it with what u suggest but it gave me a white page, by changing it to ...
Quote:

if (is_object($xoopsUser) && $xoopsUser->uid() > 0){
$uid = $xoopsUser->uid();
}
else {
$uid = 0;
}


it worked again but with the same effect! this thing is getting me crazy!!!


If your block was visible to anonymous you would get an error because $xoopsUser would not be defined.

15
trabis
Re: Block not visible to registered users
  • 2008/6/4 18:45

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Check your block template name. It should not conflict with any other. But I can't understand Why this does not work for users with same permissions. Check your debug info.

You test user is active I believe or you would not be able to edit his info.Well, I´m missing it.

16
kerkyra
Re: Block not visible to registered users
  • 2008/6/5 12:31

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


finally i figured it out! At the end of my php code the line

return $links;

was causing the problem. If the user hadnt submit any then the $links array was empty and the block was invisible! I replaced that with

return true;

and works now finally!

How stupid can i be??? Dont answer that
whttp://www.guidemap.gr - Beta is out...

17
trabis
Re: Block not visible to registered users
  • 2008/6/5 17:36

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Is not your fault man, bugs are stupid and contagious, we just can´t find a cure for that. Happy to know you succeded!

Login

Who's Online

324 user(s) are online (268 user(s) are browsing Support Forums)


Members: 0


Guests: 324


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits