9
« on: March 17, 2007, 01:15:25 pm »
OK, here's the skinny:
in Load.php find:
$row['options'] = array();
$user_profile[$row['ID_MEMBER']] = $row;
}
mysql_free_result($request);
add below that:
//Load the pet data
$request2 = db_query("
SELECT COUNT(*) AS pets, ownerid
FROM {$db_prefix}shop_pets
WHERE ownerid IN ('" . implode("', '", $loaded_ids) . "')
GROUP BY ownerid", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request2))
$user_profile[$row['ownerid']]['pets'] = $row['pets'];
mysql_free_result($request2);
then find:
'post_group' => $profile['post_group'],
add below:
//another pets modification
'pets' => &$profile['pets'],
then in the display template.php find the code you suggested and add this below instead:
//finally a pets button
if ($message['member']['can_view_profile']){
if($message['member']['pets'] > 0){
echo '
<a href="', $message['member']['href'], ';sa=showPets">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/pets.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';
}
}
this will only show the link to the members pets in profile on two conditions:
1. person can view profiles
2. member actually has a pet
there you go...ENJOY!