vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Truncate Looooooooooooong Usernames on ForumHome (https://vborg.vbsupport.ru/showthread.php?t=63184)

vbmechanic 03-29-2004 10:00 PM

Truncate Looooooooooooong Usernames on ForumHome
 
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

deathemperor 03-30-2004 12:28 PM

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

Charlie Argueta 03-30-2004 12:30 PM

Quote:

Originally Posted by sabret00the
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

Looks nice, I will use it :D

See Ya

Boofo 03-30-2004 12:32 PM

Quote:

Originally Posted by sabret00the
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

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

Owen 03-30-2004 01:28 PM

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

Quote:

Originally Posted by Boofo
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

Quote:

Originally Posted by sabret00the
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

Code:

<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?

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:

PHP Code:

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

Above that add

PHP Code:

// 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?


All times are GMT. The time now is 03:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01103 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete