View Full Version : Username Decorations
AnkisethGallant
05-05-2002, 10:00 PM
Username Decorations!
As requested by myself and JohnWarwick.
What does this hack do?
It allows you to change your username's font color, background color, border, and make it italicized or underlined.
It uses profile fields (discussed in the readme), so you can allow the users to do it themselves, or leave it to the admins.
What is needed for this hack?
1 File Edit
8 New Templates
How long does it take?
About 10-15 minutes, 3-8 with the Template Importer by FireFly.
Everything else is in the readme attached.
ADDITIONAL TEMPLATE EDIT NOT IN README:
Template edit - postbit template
REPLACE: $post[username]
WITH: $post[namecolor]
If you're using a store hack that replaces the $post[username] with $storeextraglow, simply edit the postbit_namecolor templates, and replace $post[username] with $storeextraglow.
AnkisethGallant
05-06-2002, 12:52 AM
Screenshot of a username with font color, background color, and matching border color, plus italicized.
CeleronXL
05-06-2002, 12:52 AM
It would be nice to see these features integrated into the Store Hack. :)
AnkisethGallant
05-06-2002, 01:28 AM
So do I, but I don't know too much about the Store Hack or PHP.
All you would have to do is find out how to make a user profile field editable when they buy it.
MrLister
05-06-2002, 02:10 AM
hehe pretty much any new hack that comes out is nominated to be placed in the store hack :D
AnkisethGallant
05-06-2002, 02:15 AM
Seriously. I can't think of any hack out there that can't be put into the store some way.
i don't know, how to do that user can change username's font color .. by himself
can you tell me ?? :p
AnkisethGallant
05-06-2002, 02:33 AM
It says it in the readme.
It uses profile fields, so just let that field be editable by the user.
afterlab
05-06-2002, 02:36 AM
I can work in a way for it to work with Lesane's Store Hack.. His doesn't look to hard to customize.
AnkisethGallant
05-06-2002, 02:37 AM
Afterlab, you are a machine.
No, it isn't that hard to customize. It did take me a while to figure out how to do it without 120 templates though.
sorry !!
i just to view "README" :p
LangTuDaTinh
05-06-2002, 04:44 AM
does this hack for with 2.2.4? thanks
Couldnt get it to work at all... Im gonna pass on this one.. Nice hack though.
After installing and setting up the options in USERCP would not change to the settings I had set. Still showed up as normal Username. Hmmm, no clue.. Thanks though
Using 2.2.5
Be careful when predefining custom profile fields - other people might have more than 6 (like me for example), so the ending of the variables will be different (e.g. [fieldx])
adtestvb
05-06-2002, 07:50 AM
2.2.2 coldent get it to work either. nothing showed up :(
Vivi Ornitier
05-06-2002, 01:10 PM
I have noticed this Hack Slows down the Browser.
Originally posted by Vivi Ornitier
I have noticed this Hack Slows down the Browser.
But it's worth it ;)
Nope, doesn't work here either :confused:
ZiRu$
05-06-2002, 07:47 PM
Originally posted by CeleronXL
It would be nice to see these features integrated into the Store Hack. :)
same here
AnkisethGallant
05-06-2002, 07:55 PM
It doesn't work?
Make sure you change the field values correctly in the Functions.php AND all the templates. The defaults are listed in the readme. It should work fine if all of that's done.
I haven't noticed that it slows down the browser at all, mine still works fine.
AnkisethGallant
05-06-2002, 07:57 PM
In fact, if you really want, PM me with the field IDs you want to use. I can change everything for you and then see if it works.
I triple checked it, with each of the field ids two higher than in functions.php and in the templates (my IDs started at 8)
AnkisethGallant
05-06-2002, 10:25 PM
And you're still having a problem? Check to make sure your fields match the ones that were the defaults (i.e., the text color field is field8, et cetera). If you're still getting a problem, show me your functions.php section.
AnkisethGallant
05-07-2002, 12:19 PM
HERE'S THE PROBLEM PEOPLE
I knew I'd screw something up in my first hack.
Template edit - postbit template
REPLACE: $post[username]
WITH: $post[namecolor]
That should solve everything.
:( Just spent hours removing this hack, now I've got to install it again
But thanks for the fix ;)
Dakota
05-07-2002, 06:04 PM
Nice hack. I like it.
bonnmac
05-07-2002, 06:30 PM
I like the looks of it but... when applied the user name doesn't show up at all? I've used the default profile fields and edited the additional file you posted. Here's what my "functions.php" looks like. Maybe you can tell me what's wrong? I hope cause this is a really cool hack. Thanks
<?php
error_reporting(7);
// start prep shutdown function
$noshutdownfunc = 0; // #CHANGE ME IF YOU CAN'T USE register_shutdown_function
$ourtimenow = time(); // Make this available to all files
// Defined constants used for user field.
// Hope to convert all user fields into one integer.
define ("SHOWSIGNATURES", 1);
define ("SHOWAVATARS", 2);
define ("SHOWIMAGES", 4);
define ("SHOWVBCODE", 8);
unset($templatecache);
// ###################### Start getpagenav #######################
// template-based page splitting system from 3dfrontier.com :)
function getpagenav($results,$address) {
global $perpage,$pagenumber,$pagenavpages;
if ($results <= $perpage) {
return "";
}
$totalpages = ceil($results/$perpage);
if ($pagenumber>1) {
$prevpage = $pagenumber-1;
eval("\$prevlink = \"".gettemplate("pagenav_prevlink")."\";");
}
if ($pagenumber<$totalpages) {
$nextpage = $pagenumber+1;
eval("\$nextlink = \"".gettemplate("pagenav_nextlink")."\";");
}
while ($curpage++<$totalpages) {
if ( ( $curpage <= $pagenumber-$pagenavpages || $curpage >= $pagenumber+$pagenavpages ) && $pagenavpages!=0 ) {
if ($curpage==1) {
eval("\$firstlink = \"".gettemplate("pagenav_firstlink")."\";");
}
if ($curpage==$totalpages) {
eval("\$lastlink = \"".gettemplate("pagenav_lastlink")."\";");
}
} else {
if ($curpage==$pagenumber) {
eval("\$pagenav .= \"".gettemplate("pagenav_curpage")."\";");
} else {
eval("\$pagenav .= \"".gettemplate("pagenav_pagelink")."\";");
}
}
}
eval("\$pagenav = \"".gettemplate("pagenav")."\";");
return $pagenav;
}
// ###################### Start buildpostbit #######################
$firstnew = 0;
function getpostbit($post) {
// sorts through all the stuff to return the postbit template
// user
global $bbuserinfo,$session,$ignore,$cookietimeout;
// showthread
global $counter,$firstnew,$sigcache,$highlight,$postid,$f orum;
// global options
global $showdeficon,$displayemails,$enablepms,$allowsigna tures,$wordwrap,$dateformat,$timeformat,$logip,$re placewords,$postsperday,$avatarenabled,$registered dateformat,$viewattachedimages;
$datecut = time() - $cookietimeout;
if ($counter%2==0) {
$post[backcolor]="{firstaltcolor}";
$post[bgclass] = "alt1";
} else {
$post[backcolor]="{secondaltcolor}";
$post[bgclass] = "alt2";
}
// find first new post
if (isset($bbuserinfo[lastvisit])) {
if ($post[dateline]>$bbuserinfo[lastvisit] and $firstnew==0) {
$firstnew=1;
$post[firstnewinsert]="<a name=\"newpost\"></a>";
} else {
$post[firstnewinsert]="";
}
}
$post[postdate]=vbdate($dateformat,$post[dateline]);
$post[posttime]=vbdate($timeformat,$post[dateline]);
if ($wordwrap!=0) {
$post[title]=dowordwrap($post[title]);
}
if ($post[attachmentid]!=0 and $post[attachmentvisible]) {
$post[attachmentextension]=strtolower(getextension($post[filename]));
if ($post[attachmentextension]=="gif" or $post[attachmentextension]=="jpg" or $post[attachmentextension]=="jpeg" or $post[attachmentextension]=="jpe" or $post[attachmentextension]=="png") {
if (($viewattachedimages) and ($bbuserinfo[userid]==0 or $bbuserinfo[showimages])) {
eval("\$post[attachment] = \"".gettemplate("postbit_attachmentimage")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} else {
$post[attachment]="";
}
//AnkisethGallant's Username Edits
if ($post[field6]!="" && $post[field9]=="1" && $post[field10]=="1") {
eval("\$post[namecolor] = \"".gettemplate("postbit_nameciu")."\";");
} elseif ($post[field6]!="" && $post[field9]=="1" && $post[field10]=="2") {
eval("\$post[namecolor] = \"".gettemplate("postbit_nameci")."\";");
} elseif ($post[field6]!="" && $post[field9]=="2" && $post[field10]=="2") {
eval("\$post[namecolor] = \"".gettemplate("postbit_namec")."\";");
} elseif ($post[field6]!="" && $post[field9]=="2" && $post[field10]=="1") {
eval("\$post[namecolor] = \"".gettemplate("postbit_namecu")."\";");
} elseif ($post[field6]=="" && $post[field9]=="1" && $post[field10]=="1") {
eval("\$post[namecolor] = \"".gettemplate("postbit_nameiu")."\";");
} elseif ($post[field6]=="" && $post[field9]=="1" && $post[field10]=="2") {
eval("\$post[namecolor] = \"".gettemplate("postbit_namei")."\";");
} elseif ($post[field6]=="" && $post[field9]=="2" && $post[field10]=="1") {
eval("\$post[namecolor] = \"".gettemplate("postbit_nameu")."\";");
} else {
eval("\$post[namecolor] = \"".gettemplate("postbit_namenothing")."\";");
}
if ($post[edituserid]!=0) {
if ($post['edituserid']!=$post['userid']) {
$edituser=getuserinfo($post[edituserid]);
} else {
$edituser = $post;
}
$post[edittime]=vbdate($timeformat,$post[editdate]);
$post[editdate]=vbdate($dateformat,$post[editdate]);
eval("\$post[editedby] = \"".gettemplate("postbit_editedby")."\";");
} else {
$post[editedby]="";
}
I just put up to the point of the edit I'm supposed to do for this hack. Thanks a bunch. :)
AnkisethGallant
05-07-2002, 07:26 PM
That functions.php section looks right from what I remember (I'm not at my comp). When you say you edited the file, you mean the postbit template, right?
MAKE SURE ALL your profile fields match the correct FIELD NUMBERS from what I specified in the readme. Also, make sure ALL the templates are done correctly. If you're still having problems I'll try and figure it out.
bonnmac
05-07-2002, 11:22 PM
It's after I add this:
Template edit - postbit template
REPLACE: $post[username]
WITH: $post[namecolor]
that it takes away the user name. Then I don't see any username at all.
AnkisethGallant
05-08-2002, 12:01 AM
Make sure you have your templates in correctly then. If your profile fields match right, the functions .php should notice that the user doesn't have anything in the field, and it should do the normal name. Double-check the profile fields and the templates.
bonnmac
05-08-2002, 12:59 AM
Well I give up. I've triple and quadruple checked and everything is exactly the way you say and I still can't get it to work. But it's a nice hack. :) Hope some others are able to get it to work. Thanks a bunch for your efforts.
AnkisethGallant
05-08-2002, 02:03 AM
You're welcome. I still have no idea why it isn't working though if you've checked everything. Maybe next time.
adtestvb
05-08-2002, 06:17 AM
yep same here also, added the fix and the user name went bye bye :( soory it dont work on my board. its a nice hack
Arjun
05-14-2002, 08:32 PM
how do you find out what your profile fields are numbered???
Sweet Cheeks
06-23-2002, 02:17 PM
ooh this is cool Thank you! :cool:
bonnmac
07-05-2002, 11:34 PM
Has anyone gotten this to work yet?
Shawn1036902
09-04-2002, 07:11 PM
Nice, I will try this hack! :D
Shawn1036902
09-04-2002, 08:00 PM
Tried it; names disappear. Anything that could cause this?
Erwin
09-04-2002, 11:57 PM
You can do this with templates - I have something similar running at my site for a while using just templates. :)
Shawn1036902
09-05-2002, 07:07 PM
Okay, so how do you do it from there?
Dark_Angel2
11-09-2002, 11:01 PM
I've installed this hack exactly as you said but nothing happens. Little help?
Henry-RS
11-09-2002, 11:17 PM
Can you set which user groups can make use of this?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.