I've added a couple of plugins to extend the functionality of memberlist.php. The plugin tool means I can do this with no template or code changes. Awesome, thankyou.
Here's something I've had to workaround...
Around line 455 I have
and I'm able to set values into $hook_query_where.
Scroll down the page to where we fetch the actual list of members and there is
My variable isn't being used and I can't set it. I have to actually manipulate $condition.
Now that isn't a problem but it would be great if the code allowed variables to be manipulated consistently.
While I'm here I'm also not sure how to extend the code that builds the page navigation. No clear allowance for a hook. Currently I add the value to $sortaddon in memberlist_fetch.
thanks
Sarah
Here's something I've had to workaround...
Around line 455 I have
PHP Code:
$hook_query_joins = $hook_query_where = '';
($hook = vBulletinHook::fetch_hook('memberlist_query_userscount')) ? eval($hook) : false;
$userscount = $db->query_first_slave("
SELECT COUNT(*) AS users
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield USING (userid)
$hook_query_joins
WHERE $condition
AND user.usergroupid IN ($ids)
$hook_query_where
");
Scroll down the page to where we fetch the actual list of members and there is
PHP Code:
$hook_query_fields = $hook_query_joins = '';
($hook = vBulletinHook::fetch_hook('memberlist_fetch')) ? eval($hook) : false;
$users = $db->query_read_slave("
SELECT user.*,usertextfield.*,userfield.*, user.userid, options,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
$repcondition
" . iif($show['avatarcol'], ',avatar.avatarpath,NOT ISNULL(customavatar.userid) AS hascustomavatar,customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight') ."
" . iif($show['profilepiccol'], ',customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight') . "
$lastvisitcond
" . iif($usergroupid, ", NOT ISNULL(usergroupleader.usergroupid) AS isleader") . "
$hook_query_fields
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid=user.userid)
" . iif($show['reputationcol'], "LEFT JOIN " . TABLE_PREFIX . "reputationlevel AS reputationlevel ON(user.reputationlevelid=reputationlevel.reputationlevelid) ") . "
" . iif($show['avatarcol'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . "
" . iif($show['profilepiccol'], "LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid) ") . "
" . iif($usergroupid, "LEFT JOIN " . TABLE_PREFIX . "usergroupleader AS usergroupleader ON (user.userid = usergroupleader.userid AND usergroupleader.usergroupid=$usergroupid) ") . "
$hook_query_joins
WHERE $condition
AND user.usergroupid IN ($ids)
ORDER BY $sqlsort $sortorder $secondarysortsql
LIMIT " . ($limitlower - 1) . ", $perpage
");
Now that isn't a problem but it would be great if the code allowed variables to be manipulated consistently.
While I'm here I'm also not sure how to extend the code that builds the page navigation. No clear allowance for a hook. Currently I add the value to $sortaddon in memberlist_fetch.
PHP Code:
$pagenav = construct_page_nav(
Sarah
Comment