vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Username HTML Markup (https://vborg.vbsupport.ru/showthread.php?t=253959)

staffurdu 11-19-2010 05:09 PM

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.

kh99 11-19-2010 05:26 PM

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.

staffurdu 11-19-2010 06:13 PM

Quote:

Originally Posted by kh99 (Post 2123619)
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 (Post 2123619)
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.

kh99 11-19-2010 06:38 PM

Quote:

Originally Posted by staffurdu (Post 2123633)
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">

staffurdu 11-19-2010 07:45 PM

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!

kh99 11-19-2010 08:05 PM

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).

washingtonboise 02-16-2011 01:31 PM

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


All times are GMT. The time now is 03:55 PM.

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.01022 seconds
  • Memory Usage 1,736KB
  • 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
  • (3)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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