View Full Version : Avatar Taken Hack
Littlebit
11-04-2001, 03:13 PM
I added the modify avatarbit taken template and changes to version 2.03...I just upgraded to 2.20 and need to make some modifications to have the avatars taken option work with the new registration pick avatar option ( was glad to see that in the update!). Could someone give me a hand? I still have the modify avatarbit taken template and I made the old change in the member.php already...hope it was okay to do it in the new ver.2.20 member.php.
:surprised
hey hey, where is this hack, i saw it now i can find it..
Littlebit
11-06-2001, 03:49 PM
This was thanks to Firefly and it was for version 2.03
In member.php, replace this code:
code:
------------------------------------------------------------------------
eval("\$avatarlist .= \"".gettemplate("modifyavatarbit")."\";");[/php]
with this:
[code] if ($istaken=$DB_site->query_first("SELECT userid FROM user WHERE avatarid='$avatarid'")) {
eval("\$avatarlist .= \"".gettemplate("modifyavatarbit_taken")."\";");
} else {
eval("\$avatarlist .= \"".gettemplate("modifyavatarbit")."\";");
}
------------------------------------------------------------------------
Now create a new template, name it modifyavatarbit_taken, and use this:
code:
------------------------------------------------------------------------
<td bgcolor="#13486D" valign="bottom" align="center"><normalfont>
Taken! <img src="$avatar[avatarpath]">
<br>$avatar[title]</normalfont></td>
------------------------------------------------------------------------
I have made these same changes in version 2.20, just need some help modifying the new avatar additions to 2.20 as well.
:)
Admin
11-06-2001, 04:01 PM
Littlebit, can you maybe post the URL to your forum so I can see the new system and learn it?
As we don't offer our own avatars here, and I don't have any other forum, I have no idea how it looks like / works. :)
You can PM me if you wish.
Admin
11-06-2001, 04:52 PM
Try this. :)
In register.php, replace this:
if (!$avatar['title']) {
$avatar['title'] = $avatar['avatarpath'];
if (strstr($avatar['title'], '/')) {
$avatar['title'] = substr( strrchr($avatar['title'], '/') , 1);
}
$avatar['title'] = str_replace('_', ' ', $avatar[title]);
$dotpos = strrpos($avatar[title], '.');
$avatar[title] = substr($avatar[title], 0, $dotpos);
}
eval("\$avatarbits .= \"".gettemplate("register_avatarbit")."\";");
with this:
if (!$istaken=$DB_site->query_first("SELECT userid FROM user WHERE avatarid='$avatar[avatarid]'")) {
if (!$avatar['title']) {
$avatar['title'] = $avatar['avatarpath'];
if (strstr($avatar['title'], '/')) {
$avatar['title'] = substr( strrchr($avatar['title'], '/') , 1);
}
$avatar['title'] = str_replace('_', ' ', $avatar[title]);
$dotpos = strrpos($avatar[title], '.');
$avatar[title] = substr($avatar[title], 0, $dotpos);
}
eval("\$avatarbits .= \"".gettemplate("register_avatarbit")."\";");
}
this should work. :)
so umm... which code should i use?
Littlebit
11-06-2001, 05:07 PM
Firefly,
I just uploaded changes to the register.php. Opps..I got this:
Parse error: parse error in register.php on line 659
Admin
11-06-2001, 05:10 PM
Littlebit, I'm getting a parse error when trying to go to register.php.
Are you sure you did everything correctly?
neo, the last code is for us in register.php, to hide taken avatars.
What Littlebit posted above is for member.php.
Admin
11-06-2001, 05:14 PM
If you want you can send me your register.php attached in an e-mail (firefly@poolie.net) and I'll get it taken care of.
Littlebit
11-06-2001, 05:17 PM
Did I miss a { or something maybe? I copied a few extra lines for you to see also..here's my code:
if (!$istaken=$DB_site->query_first("SELECT userid FROM user WHERE avatarid='$avatar[avatarid]'")) {
if (!$avatar['title']) {
$avatar['title'] = $avatar['avatarpath'];
if (strstr($avatar['title'], '/')) {
$avatar['title'] = substr( strrchr($avatar['title'], '/') , 1);
}
$avatar['title'] = str_replace('_', ' ', $avatar[title]);
$dotpos = strrpos($avatar[title], '.');
$avatar[title] = substr($avatar[title], 0, $dotpos);
}
eval("\$avatarbits .= \"".gettemplate("register_avatarbit")."\";");
}
eval("\$avatarbit = \"".gettemplate("register_avatar")."\";");
}
}
if ($who=="adult") {
wasnt there a taken avatar hack that under the avatar put a taken?
Littlebit
11-06-2001, 05:24 PM
Sending you e-mail :)
Thank you!
Littlebit
11-06-2001, 05:34 PM
wasnt there a taken avatar hack that under the avatar put a taken?
Neo,
The hack for that is what I posted at the top to change in member.php the other stuff is what I'm needing to hide the used avatars for registering members. :)
Admin
11-06-2001, 05:39 PM
Seems to be working fine Littlebit.
I can only see 3 out of 4 avatars when I try to register. :)
Littlebit
11-06-2001, 05:40 PM
Firefly,
All better! What did I do wrong? Incidently, where do I go to change the neongreen color highlighting the avatar pick section? Is it in one of the register templates? You'll see what I mean when you check it...
Thank you for your speedy save!
*referse to sig ;)*
thanks man
Admin
11-06-2001, 05:43 PM
No problem Littlebit! :)
That green background in the register page is actually a bug, see this thread for more info:
http://www.vbulletin.com/forum/showthread.php?s=&threadid=32474
Littlebit
11-06-2001, 05:48 PM
Thanks again! Checking out the bug thread now
:kiss:
Firefly. Any chance of adding onto this hack so that Admins and mods can have some special ones that members can't see? Or at least can't access?
Stryker
11-11-2001, 11:13 AM
I've installed this hack and everything works fine except I'm getting an error in register.php. Could this be because I've got so many avatars or is it caused by something else?
More info here - http://www.vbulletin.com/forum/showthread.php?s=&threadid=32776&highlight=register.php
Stryker
11-12-2001, 11:13 PM
Surely someone must know? This is really starting to bug me now (did you like the pun guys? Sorry I couldn't resist). :stupid:
Does anyone know how I'd go about removing the avatar selection dropdown menu from register.php? I've got a feeling that will solve the problem.
DarkReaper
11-13-2001, 02:57 AM
What's this do...?
Littlebit
11-17-2001, 05:55 AM
Firefly,
I just realized that something else needs modified. In the get info for Avatars, it has the taken avatars listed as available.
Will you help with this part too?
Admin
11-17-2001, 06:21 AM
What's the "get info for avatars"? :confused:
Littlebit
11-17-2001, 11:44 AM
Oops, I meant more info. Its usercp--------->edit options-------->more info at the bottom Avatar section.
Stryker
11-17-2001, 01:10 PM
My problem has been solved now thanks to Firefly, but I was just thinking, wouldn't it be better if these hacks were put in a read only forum or on a separate non-dynamic page so they could be easily updated and people would know when they've been modified? As it is it's a bit confusing going through old posts and reading through all the problems, updates and modifications. It's also not very clear which hacks will work with which board version.
Don't mean to whinge, just constructive criticism :)
Admin
11-17-2001, 02:24 PM
In misc.php, replace this:
$minposts=0;
$avatarbits="";
$avatars=$DB_site->query("SELECT title,minimumposts,avatarpath FROM avatar ORDER BY minimumposts,title");
with this:
$minposts=0;
$avatarbits="";
$takenids="";
$avatarids=$DB_site->query("SELECT avatarid FROM user");
while ($avatarid=$DB_site->fetch_array($avatarids)) {
$takenids.=",$avatarid[avatarid]";
}
$avatars=$DB_site->query("SELECT title,minimumposts,avatarpath FROM avatar WHERE avatarid NOT IN (0$takenids) ORDER BY minimumposts,title");
Littlebit
11-22-2001, 01:36 PM
Worked like a charm. Thank you Firefly!
Littlebit
11-22-2001, 02:37 PM
Stryker, I agree ...also, it might make it easier to re-do all the hacks after updating the board by always having your list of installed hacks and referring to them in a read only forum with last updated and version info clear...so novice people like me don't try to piece together bits of old and new hacks and mess everything up!
DarkReaper
11-23-2001, 05:14 PM
Originally posted by DarkReaper
What's this do...?
:confused:
Littlebit
11-23-2001, 05:18 PM
It makes it so if you are offering avatars for people to choose and a person picks one, it will say "taken" under the avatars already being used.
HellRazor
03-23-2002, 08:26 PM
If you are getting a parse error, you've probably left off a trailing bracket } on the end. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.