PDA

View Full Version : Advanced Memberlist Search


Andreas
12-06-2005, 10:00 PM
Advanced Memberlist Searching

Description
This Hack adds the criteria "Profile Picture" (Only Users with/Only users without/Don't care) and "Age" (From/To) for memberlist searching.
Of course it does take care of birthday privacy settings: Only users who do allow their age to be displayed will be found if you search for age.

Details
1 Product XML (2 Plugins, 3 Phrases)

Important
This Hack requires at least vBulletin 3.5.2

This Hack is unsupported! All support requests except proven bugs will be ignored

AshokForums.com
12-07-2005, 07:52 AM
Thanks.. good feature to have

SHANE-D-PAIN
12-07-2005, 08:03 AM
Seems good, I reckon my members would like to be able to only search fro profiles with a picture. Brings us one step closer to a myspace style profiled site. ;)

Nice one Kirby/Andreas, why change to your real name anyway?

Andreas
12-07-2005, 08:07 AM
Jelsoft staff policy :)

Developer
12-07-2005, 08:45 AM
good hack

FleaBag
12-07-2005, 09:31 AM
Yeah great little addition. Must admit 3.5.2 is news to me though... Back to the upgrade!

Nice to see that some people realise a forum is not only about threads and forums but members and community also! :)

JoergZ
12-07-2005, 11:05 AM
*INSTALLED*



Can you please check this: It seems, the search for members with profilepicture is not working. Searching for members without picture is working correct. (I have installed your profile-pic-icon-hack)


uninstalled

moonclamp
12-07-2005, 11:47 AM
I've been looking for something like this for ages.

One question though ... what is in it that makes 3.5.2 important?

I've just tested it on 3.5.0 and have found that it doesn't work ... But due to serious lack of time I would rather not upgrade just yet

mskgr
12-21-2005, 10:11 PM
Search for Members with/without Profile Picture doesn't work correctly. No I don't have "profile picture icon hack", which is mentioned on the plugin. Age works fine though, but I guess I won't click on Install until the code is fixed :)

p.s. in my site, when clicking on members with profile picture enabled, it returns all of them, but in addition some others, who don't have a profile picture. Amongs 55.000 members, it returns about 292, while the correct number should be ~212 (based on the related entries on the table).

JoergZ
12-21-2005, 10:30 PM
I told Anreas already exactly the same, but he says, the hack works for him fine (which I really doubt), and the hack is not supported, so he is not willed to look at this.

There is definitely a bug in the hack, because after changing some statements in the code it works correct.


Jörg

porschinho
12-22-2005, 06:05 PM
There is definitely a bug in the hack, because after changing some statements in the code it works correct.


J?rg

and why don?t you post the code?

Andreas
12-23-2005, 08:49 PM
It does work just fine for me - http://kirbydemos.ath.cx/forum
The profile picture icon hack is not installed.

I've added a checkbox to the advanced search form so you can run an explain.

JoergZ
12-23-2005, 10:14 PM
Just tested on a fresh 3.5.2 installation. It is not working.

Maybe there is an old version of code in your plugin ?

Andreas
12-23-2005, 10:28 PM
Reinstalled the product from the ZIP here - still works fine?

moonclamp
12-24-2005, 12:53 AM
Reinstalled the product from the ZIP here - still works fine?

Could there be a conflict with custom profile fields?

mskgr
12-25-2005, 12:11 PM
Reinstalled the product from the ZIP here - still works fine?

Hello Andreas,

It doesnt work.

I went through debugging your code, in order to find out whats wrong. After the installation of the script, Advanced Memberlist Searching adds itself as a plugin to Hook Location : memberlist_query_userscount .

All the variables are passed correctly into the memberlist.php.

Let's say we want to search for users with profile pic enabled


if ($vbulletin->GPC['profilepic'] == 1)


The script runs, and we have the following variables populated:

$hook_query_joins and $hook_query_where

Thats fine. The membercount of users with enabled avatars, appears correctly. But, what happens with the results in the list?

The results have nothing to do with the... truth.

On line 520 of memberlist.php we have the following line:


$hook_query_fields = $hook_query_joins = '';
($hook = vBulletinHook::fetch_hook('memberlist_fetch')) ? eval($hook) : false;


As you can see, $hook_query_joins equals to NULL.

The query after that line gets "$hook_query_joins" and "$condition".

In the case of your script, $hook_query_joins pass as empty, and $condition doesnt contain our specific needs.

That's the problem.

I have added another plugin at Hook Location : memberlist_fetch,


// search for users with profile pic
if ($vbulletin->GPC['profilepic'] == 1)
{
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (customprofilepic.userid=user.userid)";
$condition.= " AND NOT ISNULL(customprofilepic.userid)";

}
$urladd .= (($urladd != '') ? '&' : '') .'profilepic=1';


Guess what? Now, everything works fine! :)

The above code is for searching on database with no profile pic hack installed. I am not using Andrea's other script :) It needs modification to cover both situations, but the purpose of posting this thing is to let Andrea's understand what was going wrong with his excellent plugin: Installed! :)

Andreas
12-25-2005, 05:00 PM
Aaah! That's why it is working on my dev box, it does not have


$hook_query_fields = $hook_query_joins = '';
($hook = vBulletinHook::fetch_hook('memberlist_fetch')) ? eval($hook) : false;


but


($hook = vBulletinHook::fetch_hook('memberlist_fetch')) ? eval($hook) : false;


I remember experimenting with hooks before memberlist_query_userscount was avialable ...

Gonna update the code, thanks.

ahmed-samara
12-26-2005, 11:12 AM
Thanks.. good feature to have

mskgr
12-27-2005, 12:35 AM
Gonna update the code, thanks.

Not a problem at all Andreas, thanks for such a useful plugin :)

akanevsky
12-27-2005, 12:45 AM
Screenshot, please.

Andreas
12-27-2005, 03:21 PM
I don't have a screenshot and I am not going to take one :)
http://kirbydemos.ath.cx/forum/memberlist.php?do=search

PennylessZ28
12-27-2005, 06:28 PM
I still can't make it work for all the tea in china

Nordinho
12-28-2005, 11:27 AM
Database error in vBulletin 3.5.2:

Invalid SQL:

SELECT user.*,usertextfield.*,userfield.*, user.userid, options,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid

,avatar.avatarpath,NOT ISNULL(customavatar.userid) AS hascustomavatar,customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight
,customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight
, lastactivity AS lastvisittime

, journals.journal_id
FROM user AS user
LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
LEFT JOIN userfield AS userfield ON(userfield.userid=user.userid)

LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)
LEFT JOIN customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)

LEFT JOIN journals AS journals ON (journals.journalist_id=user.userid) LEFT JOIN customprofilepic AS customprofilepic ON (customprofilepic.userid=user.userid)
WHERE 1=1 AND user.showbirthday > 0 AND IFNULL(YEAR(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(user.birthday_search))), 0) >= 15 AND IFNULL(YEAR( FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(user.birthday_search))), 0) <= 36 AND ISNULL(customprofilepic.userid)
AND user.usergroupid IN (-1,6,7,9,120,2,5,81,123)
ORDER BY user.username asc
LIMIT 0, 30;

MySQL Error : Not unique table/alias: 'customprofilepic'

Getting this error now...uninstalled the old product and reimported the new one

edit: get this error by email when installing

Invalid SQL:
DELETE FROM productrequirement WHERE product='';

and when the product installs it gives these errors

Warning: mysql_query(): 7 is not a valid MySQL-Link resource in /includes/class_core.php on line 395

Warning: mysql_error(): 7 is not a valid MySQL-Link resource in /includes/class_core.php on line 837

Warning: mysql_errno(): 7 is not a valid MySQL-Link resource in /includes/class_core.php on line 855

There seems

but the script redirects too fast to copy the whole error...

Nordinho
12-29-2005, 08:10 PM
Database error in vBulletin 3.5.2:

Invalid SQL:

SELECT user.*,usertextfield.*,userfield.*, user.userid, options,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid

,avatar.avatarpath,NOT ISNULL(customavatar.userid) AS hascustomavatar,customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight
,customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight
, lastactivity AS lastvisittime

, journals.journal_id
FROM user AS user
LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
LEFT JOIN userfield AS userfield ON(userfield.userid=user.userid)

LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)
LEFT JOIN customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)

LEFT JOIN journals AS journals ON (journals.journalist_id=user.userid) LEFT JOIN customprofilepic AS customprofilepic ON (customprofilepic.userid=user.userid)
WHERE 1=1 AND user.showbirthday > 0 AND IFNULL(YEAR(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(user.birthday_search))), 0) >= 15 AND IFNULL(YEAR( FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(user.birthday_search))), 0) <= 36 AND ISNULL(customprofilepic.userid)
AND user.usergroupid IN (-1,6,7,9,120,2,5,81,123)
ORDER BY user.username asc
LIMIT 0, 30;

MySQL Error : Not unique table/alias: 'customprofilepic'

Getting this error now...uninstalled the old product and reimported the new one

edit: get this error by email when installing

Invalid SQL:
DELETE FROM productrequirement WHERE product='';

and when the product installs it gives these errors

Warning: mysql_query(): 7 is not a valid MySQL-Link resource in /includes/class_core.php on line 395

Warning: mysql_error(): 7 is not a valid MySQL-Link resource in /includes/class_core.php on line 837

Warning: mysql_errno(): 7 is not a valid MySQL-Link resource in /includes/class_core.php on line 855

There seems

but the script redirects too fast to copy the whole error...

any idea's about this one...also receiving dberrors now

'mysql_connect(): Too many connections
/mydir/includes/class_core.php on
line 273'

moonclamp
01-16-2006, 02:08 AM
It's working for me now.

However, I'm cheating. I can't get the time to upgrade from 3.5.0 so I just uploaded the memberlist.php from 3.5.3 ... not sure if I messed anything else up but it works just fine now :)

sensimilla
01-19-2006, 06:28 AM
Invalid SQL:

SELECT COUNT(*) AS users
FROM user AS user
LEFT JOIN userfield AS userfield USING (userid)

WHERE 1=1 AND field12 LIKE 'Female' AND field8 & 128
AND user.usergroupid IN (-1,10,6,7,12,2,5)
AND user.showbirthday > 0 AND IFNULL(YEAR(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(user.birthday_search))), 0) >= 25 AND IFNULL(YEAR( FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(user.birthday_search))), 0) <= 35 AND NOT ISNULL(customprofilepic.userid);

MySQL Error : Unknown table 'customprofilepic' in where clause Error Number : 1109


any ideas ?

Rukas
02-19-2006, 10:38 PM
^^ Same exact problem, running 3.5.3, clean install.

quanvo81
02-22-2006, 06:25 PM
nice shot, nice hack, clicked installed

quanvo81
02-22-2006, 06:27 PM
^^ Same exact problem, running 3.5.3, clean install.
I have no problem running it, I am running 3.5.3 :rolleyes:

Rukas
02-28-2006, 11:44 PM
^^ What other hacks do you have installed?

Everything works fine apart from searching by profile pic.

noonespecial
03-07-2006, 05:11 AM
it bothers me that this is in this site's database when it doesn't work.

moonclamp
03-07-2006, 08:20 AM
it bothers me that this is in this site's database when it doesn't work.Works fine for me

Andreas
03-17-2006, 03:18 AM
it bothers me that this is in this site's database when it doesn't work.
I am using this in a production board since several month and it works just fine.

noonespecial
03-17-2006, 06:15 PM
The age works fine, the Profile Picture checkbox doesn't at all.

Andreas
03-17-2006, 06:44 PM
<a href="http://kirbydemos.ath.cx/forum/memberlist.php?do=search&styleid=11&langid=6" target="_blank">http://kirbydemos.ath.cx/forum/membe...id=11&langid=6</a>

No other products, plugins or file edits except this hack are installed.

Though I wonder which checkbox you mean ... this hack does not have any checkbox?

hiiped
03-17-2006, 11:40 PM
http://kirbydemos.ath.cx/forum/memberlist.php?do=search&styleid=11&langid=6

No other products, plugins or file edits except this hack are installed.
I just searched on that link for users WITH pic and 2 came up

Kirby (http://kirbydemos.ath.cx/forum/member.php?u=1)
Testpicuser (http://kirbydemos.ath.cx/forum/member.php?u=56)

but I dont see any pic in their profile


?????

Andreas
03-17-2006, 11:47 PM
Well ... guests wern't allowed to view profile pictures.
Now they are.

hiiped
03-17-2006, 11:52 PM
Well ... guests wern't allowed to view profile pictures.
Now they are.
OK

I thought about that after I posted..LOL

but the hack DOES WORK, major credit for this

thanks

< clicks install >

pcoskat
03-28-2006, 08:55 PM
Could this hack be re-worked to produce the advanced memeber search seen here:

http://www.njnyc.com/
www.tampaforums.com

foulplay
04-20-2006, 07:52 AM
Nice! *clicks install*

Nuguru
12-13-2006, 06:01 AM
Hello,

I'm running 3.5.6., just installed it and it seems to working perfectly.



Thank You,

Nuguru :)

TheBlackPoet
12-13-2006, 09:27 PM
this is installed on 3.63 .. thanks.....

FleaBag
12-16-2006, 06:52 PM
Cool to know it works for the 3.6 series. I'm going to install now.

Konstantinos
12-17-2006, 08:18 AM
didint work for 3.6.4

mescalin
04-02-2007, 10:31 AM
Is it possible to search with avatars only? i dont use porfile pics:S can anybody help me with changing some codes? i tried to modify but i couldnt:S

NeutralizeR
04-17-2007, 09:14 AM
Is it possible to search with avatars only? i dont use porfile pics:S can anybody help me with changing some codes? i tried to modify but i couldnt:S
It would be nice to have this feature.

Exitilus
04-29-2008, 11:30 PM
Works' fine on 3.7 ...

GameWizard
05-01-2008, 07:19 AM
Tested and working on 3.7 aswell! Fantastic Hack, greatly appreciated.

Small request through, is it possible to perform a member search via URL? Something like this:

/memberlist.php?do=getall&age=22

This would bring up everyone else that is 22 years old. Possibly even have a way to do the same for the profile pictures aswell? such as:

/memberlist.php?do=getall&age=22&pp=1

Although I'm more concerned about getting the age search via url to function. Let me know if this is possible.