Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: dsanchez on October 13, 2010, 04:32:47 AM

Title: [4880] Pages 1, 2, 3... when listing Members not working
Post by: dsanchez on October 13, 2010, 04:32:47 AM
So I was looking for some members with certain criteria. In my there were like 3 pages of results. However, when I click in the page "2" or "3" it shows the results page - with no results (see image attached). Same thing happens in the languages page. It shows two pages of languages but when I click in the page "2" it shows again page 1.
Title: Re: Pages 1, 2, 3... when listing Members not working
Post by: Norv on October 13, 2010, 05:05:19 AM
Does that happen on the default theme as well, or not?
On what version of SMF is it tested?
Title: Re: Pages 1, 2, 3... when listing Members not working
Post by: dsanchez on October 13, 2010, 05:29:32 AM
Quote from: Norv on October 13, 2010, 05:05:19 AM
Does that happen on the default theme as well, or not?
On what version of SMF is it tested?

Actually I'm using the default theme (a variant of Curve)

Version SMF 2.0 RC3 --> http://curefans.com
Title: Re: Pages 1, 2, 3... when listing Members not working
Post by: emanuele on November 14, 2011, 10:43:15 AM
In fact here there is a bug.

Searching for date greater or equal than , this is the query of the first page (when POST):
      SELECT
         mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.icq, mem.aim, mem.yim, mem.msn, mem.member_ip, mem.member_ip2, mem.last_login,
         mem.posts, mem.is_activated, mem.date_registered, mem.id_group, mem.additional_groups, mg.group_name
      FROM smf_members AS mem
         LEFT JOIN smf_membergroups AS mg ON (mg.id_group = mem.id_group)
      WHERE date_registered >= 1320102000
      ORDER BY member_name
      LIMIT 0, 30


while this is the query of the same page following the link:
      SELECT
         mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.icq, mem.aim, mem.yim, mem.msn, mem.member_ip, mem.member_ip2, mem.last_login,
         mem.posts, mem.is_activated, mem.date_registered, mem.id_group, mem.additional_groups, mg.group_name
      FROM smf_members AS mem
         LEFT JOIN smf_membergroups AS mg ON (mg.id_group = mem.id_group)
      WHERE 1
      ORDER BY member_name
      LIMIT 0, 30


And the problem is that the $_POST variable is converted to int with strtotime. See here (http://www.simplemachines.org/community/index.php?topic=404651.msg3216419#msg3216419) for a workaround.
[removed wrong fix]
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: Illori on November 15, 2011, 02:28:40 PM
ah i was testing this on the normal member list and did not see any issues
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: emanuele on November 16, 2011, 02:54:27 AM
Well, I knew there was a bug there (in 1.1 too) , but always forgot to report it and/or find the reason... :-[
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: sergeosn on November 25, 2011, 03:24:58 PM
Forgive me for my English. I from Ukraine.
Prompt please, at me the same problem with search of users in pages. A forum 1.1.11. Changed in file ManageMembers.php type on int but it hasn't helped. What to do?
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: emanuele on November 25, 2011, 03:53:34 PM
Hi sergeosn, welcome to SMF.

Are you searching by registration date or something else?
I just noticed that also the last_online needs the same fix.
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: sergeosn on November 26, 2011, 05:08:54 AM
Thanks)
Yes by date of registration. I enter a condition > = gggg-mm-dd as a result on bookmarks doesn't work. If I change type where it is written on int that in general anything plainly it is not displayed.
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: emanuele on November 26, 2011, 06:24:55 AM
Sorry, the fix was wrong...

For SMF 1.1:
Code (find) Select
$query_parts[] = '(' . implode(" LIKE '%{$_POST[$param_name]}%' OR ", $param_info['db_fields']) . " LIKE '%{$_POST[$param_name]}%')";
}
}


Code (replace with) Select
$query_parts[] = '(' . implode(" LIKE '%{$_POST[$param_name]}%' OR ", $param_info['db_fields']) . " LIKE '%{$_POST[$param_name]}%')";
}

// Restore the YYYY-MM-DD format for the dates
if ($param_info['type'] == 'date')
$_POST[$param_name] = date('Y-m-d', $_POST[$param_name]);
}



For SMF 2.0:
Code (find) Select
$query_parts[] = '(' . implode( ' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})';
$where_params[$param_name . '_normal'] = '%' . $parameter . '%';
}
}


Code (replace with) Select
$query_parts[] = '(' . implode( ' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})';
$where_params[$param_name . '_normal'] = '%' . $parameter . '%';
}

// Restore the YYYY-MM-DD format for the dates
if ($param_info['type'] == 'date')
$_POST[$param_name] = date('Y-m-d', $_POST[$param_name]);
}


Not exactly a proper fix but should work.
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: sergeosn on November 26, 2011, 10:38:51 AM
Thanks Huge!!! Like has helped.
Has made replacement on last post. Types described above didn't touch :)
Title: Re: [4880] Pages 1, 2, 3... when listing Members not working
Post by: dan4ever on June 20, 2014, 02:47:04 PM
Thanks!!!!!!!!