Advertisement:

Author Topic: [4880] Pages 1, 2, 3... when listing Members not working  (Read 8522 times)

Offline dsanchez

  • Jr. Member
  • **
  • Posts: 282
  • Gender: Male
[4880] Pages 1, 2, 3... when listing Members not working
« 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.
« Last Edit: November 15, 2011, 02:19:26 PM by emanuele »
Curefans.com - The meeting point for Curefans worldwide
http://www.curefans.com

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Pages 1, 2, 3... when listing Members not working
« Reply #1 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?
To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline dsanchez

  • Jr. Member
  • **
  • Posts: 282
  • Gender: Male
Re: Pages 1, 2, 3... when listing Members not working
« Reply #2 on: October 13, 2010, 05:29:32 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
Curefans.com - The meeting point for Curefans worldwide
http://www.curefans.com

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Pages 1, 2, 3... when listing Members not working
« Reply #3 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):
Code: [Select]
      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:
Code: [Select]
      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 for a workaround.
[removed wrong fix]
« Last Edit: November 26, 2011, 06:26:45 AM by emanuele »


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,075
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #4 on: November 15, 2011, 02:28:40 PM »
ah i was testing this on the normal member list and did not see any issues

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #5 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... :-[


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline sergeosn

  • Newbie
  • *
  • Posts: 3
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #6 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?

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #7 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.


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline sergeosn

  • Newbie
  • *
  • Posts: 3
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #8 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.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #9 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.


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline sergeosn

  • Newbie
  • *
  • Posts: 3
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #10 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 :)

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • SMF 2.0.11
Re: [4880] Pages 1, 2, 3... when listing Members not working
« Reply #11 on: June 20, 2014, 02:47:04 PM »
Thanks!!!!!!!!
/Dan Ohlsson, Admin at http://www.guldforum.se