1
kerkyra
Block not visible to registered users
  • 2008/6/2 18:59

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hallo there! I made a block for my module wich displays fine to the webmasters group, but when i login as a normal registered user it doesnt display at all! I checked group permisions and in blocks section when i select the show in "registered users" its there! What could be the problem??
whttp://www.guidemap.gr - Beta is out...

2
Anonymous
Re: Block not visible to registered users
  • 2008/6/2 21:13

  • Anonymous

  • Posts: 0

  • Since:


Is access to the block granted in Admin>groups?

3
kerkyra
Re: Block not visible to registered users
  • 2008/6/2 23:01

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i have set the permissions to groups for webmasters and registered users!
whttp://www.guidemap.gr - Beta is out...

4
Burning
Re: Block not visible to registered users
  • 2008/6/3 0:14

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi,

... user account that you use for your test is in the right group ?

... very strange
Still learning CSS and... english

5
kerkyra
Re: Block not visible to registered users
  • 2008/6/3 8:30

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


these are the images from the admin area is there something i might have missed??
Resized Image

Resized Image
whttp://www.guidemap.gr - Beta is out...

6
kerkyra
Re: Block not visible to registered users
  • 2008/6/3 14:50

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i dont get it! every other block is shown properly if set to visible! the one i made is only visible to the admin!
whttp://www.guidemap.gr - Beta is out...

7
Anonymous
Re: Block not visible to registered users
  • 2008/6/3 16:22

  • Anonymous

  • Posts: 0

  • Since:


Is it the CPanel Menu block? If so, does it do what the name suggests?

Maybe it can't be seen because only the webmasters group has access to the CPanel?

Test it out by checking the "Blocks" entry in "System Admin Rights" under the registered users group settings.

HTH

8
kerkyra
Re: Block not visible to registered users
  • 2008/6/3 19:35

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


its just a block to show 3 drop down lists and 3 links! nothing less nothing more!as it can bee seen above in the pics the registered users group have block access rights and if i look in the blocks sections (again as seen above) for the blocks visible in all pages for registered users it is shown there! What could this be???
whttp://www.guidemap.gr - Beta is out...

9
trabis
Re: Block not visible to registered users
  • 2008/6/3 23:53

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


The code of the block returning empty in case you are no admin.

Can I have a look to the block code and template?

Check in xoops_version to see what files are used by the block and show them here, thanks.

10
kerkyra
Re: Block not visible to registered users
  • 2008/6/4 8:36

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i have written the code for the block and the template, so i post them here!

this is the block
Quote:

<{$mylinks}>






<{if count($waitinglinks) gt 0}>


<{$linkswaiting}>







<{/if}>

<{if count($expiredlinks) gt 0}>
<{$linksexpired}>





<{/if}>
<{if count($expiredlinks) == 0}>
<{$noexpiredlinks}>
<{/if}>



this is the php file

Quote:

function b_cpanel_menu() {
global $xoopsDB,$xoopsUser,$xoopsTpl,$xoopsConfig;
$uid = $xoopsUser->uid();

//load links
$result=$xoopsDB->query("SELECT lid, title FROM ".$xoopsDB->prefix("addresses_links")." WHERE submitter = $uid and status = 1 ORDER BY title") or exit("Error");
list($countactive)=$xoopsDB->fetchRow($result);
$q=0;
$links=array();

while($myrow2 = $xoopsDB->fetchArray($result)) {
$links[$q]['id'] = $myrow2['lid'];
$links[$q]['title'] = $myrow2['title'];
$q++;
}
$xoopsTpl->assign('links', $links);
$xoopsTpl->assign('uid', $uid);

$xoopsTpl->assign('countactive', $countactive);
$xoopsTpl->assign('nowaitinglinks', _MD_NOLINKSWAITING);
$xoopsTpl->assign('noexpiredlinks', "_MD_NOLINKSEXPIRED");
$xoopsTpl->assign('linksexpired', _MD_LINKSEXPIRED);
$xoopsTpl->assign('mylinks', _MD_MYLINKS);
$xoopsTpl->assign('linkswaiting', _MD_LINKSWAITING);
expired_links();
waiting_links();

return $links;
}

function expired_links() {
global $xoopsDB,$xoopsUser,$xoopsTpl;
$uid = $xoopsUser->uid();

$result2=$xoopsDB->query("SELECT lid, title FROM ".$xoopsDB->prefix("addresses_links")." WHERE submitter = $uid and status = 2 ORDER BY title") or exit("Error");
$q=0;
$expiredlinks=array();

while($myrow2 = $xoopsDB->fetchArray($result2)) {
$expiredlinks[$q]['id'] = $myrow2['lid'];
$expiredlinks[$q]['title'] = $myrow2['title'];
$q++;
}
$xoopsTpl->assign('expiredlinks', $expiredlinks);

return $expiredlinks;
}
function waiting_links() {
global $xoopsDB,$xoopsUser,$xoopsTpl,$xoopsConfig;
$uid = $xoopsUser->uid();

//load links
$result3=$xoopsDB->query("SELECT lid, title FROM ".$xoopsDB->prefix("addresses_links")." WHERE submitter = $uid and status = 0 ORDER BY title") or exit("Error");
$qq=0;
$waitinglinks=array();

while($myrow3 = $xoopsDB->fetchArray($result3)) {
$waitinglinks[$qq]['id'] = $myrow3['lid'];
$waitinglinks[$qq]['title'] = $myrow3['title'];
$qq++;
}
$xoopsTpl->assign('waitinglinks', $waitinglinks);

return $waitinglinks;
}
?>
whttp://www.guidemap.gr - Beta is out...

Login

Who's Online

293 user(s) are online (271 user(s) are browsing Support Forums)


Members: 0


Guests: 293


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