[4880] Pages 1, 2, 3... when listing Members not working

Started by dsanchez, October 13, 2010, 04:32:47 AM

Previous topic - Next topic

dsanchez

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.

Norv

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

dsanchez

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

emanuele

#3
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 for a workaround.
[removed wrong 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.

Illori

ah i was testing this on the normal member list and did not see any issues

emanuele

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.

sergeosn

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?

emanuele

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.

sergeosn

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.

emanuele

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.

sergeosn

Thanks Huge!!! Like has helped.
Has made replacement on last post. Types described above didn't touch :)

dan4ever

/Dan Olsson, Webmaster at https://www.guldforum.se

Advertisement: