Helpful Information
 
 
Category: vBulletin 3.0
Truncate Looooooooooooong Usernames on ForumHome

Simple hack, answering request: http://www.vbulletin.org/forum/showthread.php?t=63179


What this does: It will shorten any username that is longer than XX characters on the forum home display.

Files to Modify: 1, functions_forumlist.php

Time to Install: 2 minutes

Difficulty: Simple

thank you very much, this is awesome :D

Very nice! Great job!

just installed although not sure if it's working or not, it doesn't seem to work in the moderators column or forums that appear in column format courtesy of Xenon's hack here (http://www.vbulletin.org/forum/showthread.php?t=59958)

nice
1st time to see a hack below 1KB ^^

just installed although not sure if it's working or not, it doesn't seem to work in the moderators column or forums that appear in column format courtesy of Xenon's hack here (http://www.vbulletin.org/forum/showthread.php?t=59958)
Looks nice, I will use it :D

See Ya

just installed although not sure if it's working or not, it doesn't seem to work in the moderators column or forums that appear in column format courtesy of Xenon's hack here (http://www.vbulletin.org/forum/showthread.php?t=59958)

That's beacuse the variable they are truncating is $lastpostinfo['lastposter'] which is only for the lastposter. ;)

why not just set a max in the options? Long usernames are gonna be a pain anywhere on the forums anyway.

That's beacuse the variable they are truncating is $lastpostinfo['lastposter'] which is only for the lastposter. ;)
but that wouldn't explain why it's not working in the columns on the forumhome would it?

but that wouldn't explain why it's not working in the columns on the forumhome would it?
Can you give an example URL? It is only set to work on the last poster info, not on usernames elsewhere. Point out which one's you'd like affected and we'll find the variable to substr.

<phrase 1="member.php?$session[sessionurl]find=lastposter&amp;f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase> just lifted this from the template. seem to be the same for me but for some reason it's not updated, i.e. old posts by users with long usernames aint now truncated, does it only work on new posts?

and also what would i have to do to make it work on the moderator column?

Should work on any part of forumhome that uses the $lastpostinfo variable. Sorry, can't say why it wouldn't work with Xenon's Hack.

For the moderator name, it would be the same thing. Find:


$showmods["$moderator[userid]"] = true;


Above that add


// Begin Username Truncate Hack - vBMechanic
if (strlen($moderator['musername'])>18)
{
$moderator['musername'] = substr($moderator['musername'],0,18)."...";
}
// End Username Truncate Hack

seems useful

what an awesome hack, thanks very much :D

How would you truncate the username listed under last post info on Forum Display?










privacy (GDPR)