View Full Version : Truncate Looooooooooooong Usernames on ForumHome
vbmechanic
03-29-2004, 10:00 PM
Simple hack, answering request: https://vborg.vbsupport.ru/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
sabret00the
03-30-2004, 10:48 AM
thank you very much, this is awesome :D
Logikos
03-30-2004, 10:55 AM
Very nice! Great job!
sabret00the
03-30-2004, 11:01 AM
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 (https://vborg.vbsupport.ru/showthread.php?t=59958)
deathemperor
03-30-2004, 12:28 PM
nice
1st time to see a hack below 1KB ^^
Charlie Argueta
03-30-2004, 12:30 PM
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 (https://vborg.vbsupport.ru/showthread.php?t=59958)
Looks nice, I will use it :D
See Ya
Boofo
03-30-2004, 12:32 PM
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 (https://vborg.vbsupport.ru/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.
sabret00the
03-30-2004, 01:41 PM
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?
vbmechanic
03-30-2004, 01:43 PM
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.
sabret00the
03-30-2004, 02:10 PM
<phrase 1="member.php?$session[sessionurl]find=lastposter&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?
vbmechanic
03-30-2004, 02:56 PM
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
???`S?LV?R???`
03-31-2004, 07:16 AM
seems useful
sabret00the
03-31-2004, 07:24 AM
what an awesome hack, thanks very much :D
CreedFeed
06-24-2004, 04:09 AM
How would you truncate the username listed under last post info on Forum Display?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.