Hack Name:
Avatar Showcase
Description:
This will add a little piece to your member.php to display the avatars of all members.
It comes with multipage support and shows 21 avatars per page.
All the member usernames will be links to their profiles.
For the Administrators there's an option to clear people's avatars, in case they are dead URLs for example.
Compatibility:
XMB 1.9.8 Engage Final SP2/SP3
Version:
1.3
Code Designed By:
FunForum
License Note:
This mod is released under the GPL License.
Notes:
- For your own safety, backup the effected PHP file before proceeding with this hack.
- All coding has been put in textboxes, please, use the copy/paste function to 'find' and 'replace' coding, then nothing can go wrong.
- 2004 / 10 / 28 : Adjusted the instructions to the "XMB 1.9.1 Final - Nexus" coding.
- 2006 / 04 / 08 : Added sanitazation from XMB 1.10's sanitize.inc.php, stretched internal tables to go from top to bottom.
To make things easier for me when you upgrade to XMB 1.10 later on ...
You're going to need the "sanitize.inc.php", this can be done in two ways.
Go to
http://cvs.xmbforum.com/
and download the latest
/include/sanitize.inc.php
Upload that file to your forum: /include/sanitize.inc.php
Edit PHP File: header.php
Find:
require ROOT.'include/functions.inc.php';
Select All
Add
Below
:
require ROOT.'include/sanitize.inc.php';
Select All
Find:
$links = implode(' ', $links);
Select All
Add Above:
// Avatar Showcase-link $links[] = '
'.$lang['avs_01'].'
';
Select All
Edit language file
Add to the very bottom:
// Avatar Showcase Mod Begin $lang['avs_01'] = "Avatar Showcase"; $lang['avs_02'] = "Member #"; $lang['avs_03'] = ": "; $lang['avs_04'] = "Administrator Options: "; $lang['avs_05'] = "Clear Avatar"; // Avatar Showcase Mod End
Select All
Edit PHP File: member.php
Find:
case 'coppa': nav($lang['textcoppa']); break;
Select All
Add Below:
case 'avs': nav($lang['avs_01']); break;
Select All
Find:
case 'viewpro':
Select All
Add Above:
case 'avs': $deletesubmit = fetchFromRequest('deletesubmit', X_POST); if (X_ADMIN && !is_null($deletesubmit)) { $avs_select = fetchFromRequest('avs_select', X_POST); if (!is_null($avs_select)) { $in = ''; foreach($avs_select as $value) { $in .= (safeInt($value) > 0 ? (empty($in) ? "uid='$value'" : " OR uid='$value'") : ''); } } $db->query("UPDATE $table_members SET avatar='' WHERE $in"); } $tlpp = '21'; // amount of Avatars per page. $page = safeInt(fetchFromRequest('page', X_GET|X_POST), 1); if ($page > 1) { $start_limit = ($page-1) * $tlpp; } else { $start_limit = 0; $page = 1; } $query = $db->query("SELECT count(uid) FROM ".X_PREFIX."members WHERE avatar!=''"); $num = $db->result($query, 0); $mpurl = 'member.php?action=avs'; $avsmultis = ''; if (false !== ($multipage = multi($num, $tlpp, $page, $mpurl))) { $avsmultis = '
'.$multipage.'
'; } eval('echo "'.template('header').'";'); echo '
'.$lang['avs_01'].'
'.$avsmultis; $C = 0; $FAquery = $db->query("SELECT uid, username, avatar FROM ".X_PREFIX."members WHERE avatar!='' ORDER BY uid ASC LIMIT $start_limit, $tlpp"); while ($M = $db->fetch_array($FAquery)) { $C++; if ($C == 1) { echo '
'; } echo '
'; if (X_ADMIN) { echo '
'.$lang['avs_02'].''.$M['uid'].''.$lang['avs_03'].'
'.$M['username'].'
'; } else { echo '
'.$lang['avs_02'].''.$M['uid'].''.$lang['avs_03'].'
'.$M['username'].'
'; } echo '
'; if ($C == 3) { echo '
'; $C = 0; } } if ($C == 1) { echo '
'; } if ($C == 2) { echo '
'; } if (X_ADMIN) { echo '
'.$lang['avs_04'].'
'; } echo $avsmultis.'
'; break;
Select All
Upload the image top_avatars.gif to all your theme folders if it does not already exist. You have now finished installing this modification.