vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Advanced Memberlist Search (https://vborg.vbsupport.ru/showthread.php?t=102405)

porschinho 12-22-2005 06:05 PM

Quote:

Originally Posted by JoergZ

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

Quote:

Originally Posted by Andreas
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

Quote:

Originally Posted by Andreas
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

PHP Code:

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:

PHP Code:

    $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,

PHP Code:

// 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

PHP Code:

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

but

PHP Code:

    ($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

Quote:

Originally Posted by Andreas
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.


All times are GMT. The time now is 01:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01213 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete