Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 11-19-2010, 05:09 PM
staffurdu staffurdu is offline
 
Join Date: Jun 2010
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Username HTML Markup

Username HTML Markup
(Specify an opening and closing HTML tag with which to display the names of users in this group. This applies to names that appear on Logged-in Users, Who's Online, Users Browsing Forum, Users Browsing Thread, Posts, Member List etc.)
--------------------------------------------------------------------------------
Hello there,

I am trying to add following as my Username HTML Markup:
Code:
<img src="fr/admin.gif" style="border: 0pt none;"> <span style="color: #FF0000; background-image: url('bg/admin.gif')"><b>
After entering it when I save usergroup settings, it becomes
Code:
<img src="fr/admin.gif" style="border: 0pt none;"> <span style="color: #FF0000; background-image: ur
Is there a limit for characters in this usergroup field? If yes then how can I increase this limit?

Regards.
Reply With Quote
  #2  
Old 11-19-2010, 05:26 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, it looks like the database fields used to store the open and close tags each have a limit of 100 chars. You could try altering the table to increase that field. I'm not sure if there is any other PHP you'd have to change to get it to work - I looked around a little and it looks like changing the database might do it.

A similar question was posted recently, and someone suggested defining a class then using the class in span tag and maybe that would allow you to shorten the tag to under 100 chars.
Reply With Quote
  #3  
Old 11-19-2010, 06:13 PM
staffurdu staffurdu is offline
 
Join Date: Jun 2010
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Yes, it looks like the database fields used to store the open and close tags each have a limit of 100 chars. You could try altering the table to increase that field. I'm not sure if there is any other PHP you'd have to change to get it to work - I looked around a little and it looks like changing the database might do it.
Unfortunately I am totally unfamiliar with database. I only know how to run query in database. Can you please guide me how I can alter the table?

Quote:
Originally Posted by kh99 View Post
A similar question was posted recently, and someone suggested defining a class then using the class in span tag and maybe that would allow you to shorten the tag to under 100 chars.
I am unable to find it. Please give me link if defining a class is explained in that thread.
Reply With Quote
  #4  
Old 11-19-2010, 06:38 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by staffurdu View Post
Unfortunately I am totally unfamiliar with database. I only know how to run query in database. Can you please guide me how I can alter the table?
Well, first hopefully you have a database backup. It really shouldn't be a problem but just for safety's sake...

Next you need to know your table prefix, if any. You can look in includes/config.php if you don't know it. For this example, let's say it's "vb_" and you want to increase it to 130 chars.

The SQL would be:
Code:
ALTER TABLE vb_usergroup MODIFY opentag CHAR(130) NOT NULL DEFAULT ''
(of course, change "vb_" and "130" as needed). You could do the same for closetag if you feel you need it (but I'm guessing you wouldn't).

ETA: I tried this on a test site and it seems to work.


Quote:
I am unable to find it. Please give me link if defining a class is explained in that thread.
IIRC it didn't give details, just the idea of creating a class. I think you'd have to write the CSS for a class and put it somewhere like "Additional CSS" of your style, then you could probably reduce the tag to <span class="???"><img src="fr/admin.gif">
Reply With Quote
  #5  
Old 11-19-2010, 07:45 PM
staffurdu staffurdu is offline
 
Join Date: Jun 2010
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried to execute this query but following error occurred:

Quote:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1074
error desc: Column length too big for column 'opentag' (max = 255); use BLOB or TEXT instead
I reduced length to 255 and query was successful. Now my HTML Markup is working. What is BLOB and TEXT? If using them can increase length limit more than 255, then they would be more useful. If you have any info about them, please share with me.

And one more thing. kh99 Many many thanks for your help. Thanks a looooooooooooooooooooooooooooooot!
Reply With Quote
  #6  
Old 11-19-2010, 08:05 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think the column could be any text type and it would work, but I don't really know a lot about the different data types. If you're interested in trying it you could read about them here: http://dev.mysql.com/doc/refman/5.0/...ing-types.html

Just so you know, if you change the length to something shorter than the longest data it will truncate the fields (for example if you accidentally entered CHAR(1) you'd lose all your markups).
Reply With Quote
  #7  
Old 02-16-2011, 01:31 PM
washingtonboise washingtonboise is offline
 
Join Date: Mar 2009
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The "correct" way to do this is to edit a CSS style sheet and then reference the CSS class.
That is the reason why they don't allow us much space to type HTML markup.

referencing it would look like: <span class="admin">
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:17 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05742 seconds
  • Memory Usage 2,222KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete