Wrong userlist shown

15 years 5 months ago #80312 by KatoKalin
Wrong userlist shown was created by KatoKalin
I have a weird issue with userlists:

I have 2 userlists. Userlist1 is accessible for guests, userlist2 for registered users.

In the backend for each userlist a link is shown for calling the search function. I am using these links and everything works find: Link1 opens the seach function for userlist1, link2 for userlist2.

This changes completely when I remove the userlist change dropdownfield by uncommenting the corresponding lines in comprofiler.html.php:

[code:1] <div class="cbUserListChanger">
<!--<?php
// selector for user-list:
if ( ( $lists !== null ) || ( count( $lists ) > 1 ) ) {
foreach ( $lists as $kname => $ncontent ) {
?>

<div class="cbUserListChangeItem cbUserList<?php echo $kname; ?>"><?php
echo $ncontent;
?></div>

<?php
}
}
if ( count( $searchableFields ) > 0 ) {
if ( $search === null ) {
?>
<div class="cbUserListSearchButtons" id="cbUserListsSearchTrigger"><a class="pagenav" href="#"><?php echo _UE_SEARCH_USERS; ?></a></div>
<?php
} else {
?>-->
<div id="cbUserListListAll"><a class="pagenav" href="<?php echo cbSef($ue_base_url); ?>" onclick="javascript:adminForm.search.value=''"><?php echo _UE_LIST_ALL; ?></a></div>
<!--<?php
}
}
?>-->
</div>
[/code:1]
After this change the dropdownfield is no longer visible, but only search results of userlist1 show up.
Using the link to the search function of userlist2 opens the search function for userlist2 but when pressing the search buttons, it switches to userlist1 and presenting its results only.

So it seems that in some way the dropdownfield is connected with the seach result page and when the dropdownfield is disabled this value does not get passed on so that the correct userlist gets displayed. I wonder what code changes are necessary to pass the userlist information to the result page.

Please Log in to join the conversation.

15 years 5 months ago #80319 by KatoKalin
Replied by KatoKalin on topic Re:Wrong userlist shown
It seems that uncommenting the list changer removes some necessary function. It seems that the issue can be solved by using the hidden visibility style.
As I wanted to keep the "list all" function I had to move around some code:

[code:1] <div class="cbUserListChanger" style="visibility:hidden">
<?php
// selector for user-list:
if ( ( $lists !== null ) || ( count( $lists ) > 1 ) ) {
foreach ( $lists as $kname => $ncontent ) {
?>

<div class="cbUserListChangeItem cbUserList<?php echo $kname; ?>"><?php
echo $ncontent;
?></div> </div>

<?php
}
}
if ( count( $searchableFields ) > 0 ) {
if ( $search === null ) {
?>
<div class="cbUserListSearchButtons" id="cbUserListsSearchTrigger"><a class="pagenav" href="#"><?php echo _UE_SEARCH_USERS; ?></a></div>
<?php
} else {
?>

<!-- <?php
}
}
?> -->
</div>
<?php
}


// List title:
?>
<div id="cbUserListListAll" style="margin-left:850px;"><a class="pagenav" href="<?php echo cbSef($ue_base_url); ?>" onclick="javascript:adminForm.search.value=''"><?php echo _UE_LIST_ALL; ?></a></div>[/code:1]

Post edited by: KatoKalin, at: 2008/11/21 19:14

Please Log in to join the conversation.

15 years 5 months ago #80324 by hippo
Replied by hippo on topic Re:Wrong userlist shown
You can't comment out the foreach loop at the start and expect multiple lists to be available. I also found this line interesting...

if ( $search === null )

I guess that means it really, really equals null.

:cheer:

Please Log in to join the conversation.

15 years 5 months ago #80326 by KatoKalin
Replied by KatoKalin on topic Re:Wrong userlist shown
hippo wrote:

You can't comment out the foreach loop at the start and expect multiple lists to be available.:cheer:


Hmmm. Good point. I thought that lines were for displaying the different options in the dropdown fifeld only. :laugh:

At least I wasnt wrong that something important is going in those lines. :woohoo:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.201 seconds

Facebook Twitter LinkedIn