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??
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!
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
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!
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???
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:
<div style="background-color:#eeeeff;padding:2px">
<font size="1"><a href="<{$xoops_url}>/modules/addresses/cpanel/cpanel.php?status=1"><{$mylinks}></a></font>
<center>
<form name="activelinksform" id="activelinksform">
<select name="selectactivelink" onchange="location.href='/modules/addresses/cpanel/cpanel.php?status=1'">
<option value="null">------------</option>
<{foreach item=links from=$links}>
<option value="<{$links.id}>"><{$links.title}></option>
<{/foreach}>
</select>
</form>
</center>
</div>
<{if count($waitinglinks) gt 0}>
<div style="background-color:#FFAAEE;margin-top:3px;padding:2px">

<font size="1"><a href="<{$xoops_url}>/modules/addresses/cpanel/cpanel.php?status=0"><{$linkswaiting}></a></font>
<center>
<form name="submitedlinksform" id="submitedlinksform">
<select name="submitedlink" onchange="location.href='/modules/addresses/cpanel/cpanel.php?status=0'">
<option value="null">------------</option>
<{foreach item=links from=$waitinglinks}>
<option value="<{$links.id}>"><{$links.title}></option>
<{/foreach}>
</select>
</form>
</center>

</div>
<{/if}>
<div style="background-color:#ff9966;margin-top:3px;padding:2px">
<{if count($expiredlinks) gt 0}>
<font size="1"><a href="<{$xoops_url}>/modules/addresses/cpanel/cpanel.php?status=2"><{$linksexpired}></a></font>
<center>
<form name="expiredlinksform" id="expiredlinksform">
<select name="selectexpiredlink" onchange="location.href='/modules/addresses/cpanel/cpanel.php?status=2'">
<option value="null">------------</option>
<{foreach item=links from=$expiredlinks}>
<option value="<{$links.id}>"><{$links.title}></option>
<{/foreach}>
</select>
</form>
</center>
<{/if}>
<{if count($expiredlinks) == 0}>
<{$noexpiredlinks}>
<{/if}>
</div>


this is the php file

Quote:

<?php
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;
}
?>
www.guidemap.gr - Beta is out...

Login

Who's Online

217 user(s) are online (132 user(s) are browsing Support Forums)


Members: 0


Guests: 217


more...

Donat-O-Meter

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

Latest GitHub Commits