mini2
02-10-2003, 06:09 PM
Hello,
The story (you can skip this if you like)....
I've been hacking away at my forums, and trying to make what is basically a 'second' profile for each user.
My site is car enthusiasts site, and I have completed most of the work to make this happen.
The registration works, and I have integrated another hack on here (search custom fields) to enable searching of these 'car profiles'.
I now have two member.php and memberlist.php files. I want to keep it that way, I have member_mini.php and memberlist_mini.php (and they have some unique templates).
EVERYTHING works, apart from one snag.
The plea for help!
For the memberlist_mini.php to work (i.e. list ONLY members who have completed their car profiles) I need to add to the condition on "getall" (it think) so that it only ever lists users who have completed at least one of the customfields, field22.
I can get this to work using this code:
if ($usememberlistadvsearch) {
if (!strstr($condition,"field22 LIKE")) {
$condition.=" AND userfield.field22 LIKE '%e%'";
}
or something like this:
if ($usememberlistadvsearch) {
if (!strstr($condition,"field22 LIKE")) {
$condition.=" AND userfield.field22 LIKE '%e%'";
}
However the mysql take AGES to make this query.
There MUST be a way to do this (I need to check they are not searching for this particular field, hence the first 'if' statement).
I used the hack to show process times at the bottom of the page, and it takes about 33 seconds with the above solutions, and 90ish% is MySQL.
Anyone help at all?
The story (you can skip this if you like)....
I've been hacking away at my forums, and trying to make what is basically a 'second' profile for each user.
My site is car enthusiasts site, and I have completed most of the work to make this happen.
The registration works, and I have integrated another hack on here (search custom fields) to enable searching of these 'car profiles'.
I now have two member.php and memberlist.php files. I want to keep it that way, I have member_mini.php and memberlist_mini.php (and they have some unique templates).
EVERYTHING works, apart from one snag.
The plea for help!
For the memberlist_mini.php to work (i.e. list ONLY members who have completed their car profiles) I need to add to the condition on "getall" (it think) so that it only ever lists users who have completed at least one of the customfields, field22.
I can get this to work using this code:
if ($usememberlistadvsearch) {
if (!strstr($condition,"field22 LIKE")) {
$condition.=" AND userfield.field22 LIKE '%e%'";
}
or something like this:
if ($usememberlistadvsearch) {
if (!strstr($condition,"field22 LIKE")) {
$condition.=" AND userfield.field22 LIKE '%e%'";
}
However the mysql take AGES to make this query.
There MUST be a way to do this (I need to check they are not searching for this particular field, hence the first 'if' statement).
I used the hack to show process times at the bottom of the page, and it takes about 33 seconds with the above solutions, and 90ish% is MySQL.
Anyone help at all?