vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Shield-Smilie as BB-Code without Hacking! (https://vborg.vbsupport.ru/showthread.php?t=89421)

imported_seraphex 10-07-2004 07:37 PM

Well after some work I have this.. Anyone know how I can pass the option through so people don't have to type it in. Here's the code I'm using.. I don't know if it's correct or not but it works for me. It prompts for the option but I want it to just automatically fill it in onclick.

Code:

<a href="#" onclick="return vbcode('banner', 'xxxxxx', 'xxx')"><img class="image" src="images/smilies/bannerwink.gif" alt="[banner=wink]text[/banner]" border="0" /></a> wink

dwh 01-10-2005 12:58 AM

I love this. It is amazing and clever idea. But

Quote:

Originally Posted by Hoffi
If you want more than one Image use the Option tag and name the Images to schield1.gif etc. and use Filepath shield{option}.gif

Than call with [ schield=1]test[/shield]

huh?

Another thing, you can make a smilie button but you have make it a bit smaller and then it will be clickable.

Does anyone have some gifs of other alternatives?

mindbuster 01-20-2005 09:13 AM

Quote:

Originally Posted by wintermute
if you want to change the font to bold, blue, comic sans:

Code:


<td align="center" style="background-color: none; border: 1px solid Black; padding: 1px;"><b> <font face="Comic Sans"; color=blue>{param}</font></b></td>


I had to use "Comic Sans MS" for it to work, but thanks anyway :D

And thanks to the author ;)

mindbuster 01-20-2005 02:15 PM

Rounded corners version with "Comic Sans MS" font.

PHP Code:

<table border="0" cellspacing="0" cellpadding="0">
<
div style="margin: 0 4px 0 4px; padding:0; border: solid 1px #000; background-color:White; z-index:1;">
<
div style="margin: 0 -2px 0 -2px; padding:1px; border-left: solid 1px #000;border-right: solid 1px #000; background-color:White; z-index:2;">
    <
div style="margin: 0 -3px 0 -3px; padding:1px; border-left: solid 1px #000;border-right: solid 1px #000; background-color:White; z-index:3;">
     <
div style="margin: 0 -3px 0 -3px; padding:1px; border-left: solid 1px #000;border-right: solid 1px #000; background-color:White; z-index:4;">
        <
div style="margin: 0 -3px 0 -3px; padding: 0 4px 0 4px; border-left: solid 1px #000; border-right: solid 1px #000; background-color:White; z-index:5;">
<
div align="center" style="background-color: White; "><b><font face="Comic Sans MS"color=black>{param}</font></b></div>
    </
div>
     </
div>
    </
div>
</
div>
</
div>
<
tr><td align="center"
<
img src="path/to/your/image.gif" alt="" border="0">
</
td></tr>
</
table

Example attached ;)

ChrisSy 02-02-2005 11:16 AM

I cant get the image to show up, i have double checked my absolute path :(

KW802 02-03-2005 11:46 PM

Very nice. Needs TD & TR tags in the first row though. ;)

Quote:

Originally Posted by MindBuster
Rounded corners version with "Comic Sans MS" font.

PHP Code:

<table border="0" cellspacing="0" cellpadding="0">
<
div style="margin: 0 4px 0 4px; padding:0; border: solid 1px #000; background-color:White; z-index:1;">
<
div style="margin: 0 -2px 0 -2px; padding:1px; border-left: solid 1px #000;border-right: solid 1px #000; background-color:White; z-index:2;">
    <
div style="margin: 0 -3px 0 -3px; padding:1px; border-left: solid 1px #000;border-right: solid 1px #000; background-color:White; z-index:3;">
     <
div style="margin: 0 -3px 0 -3px; padding:1px; border-left: solid 1px #000;border-right: solid 1px #000; background-color:White; z-index:4;">
        <
div style="margin: 0 -3px 0 -3px; padding: 0 4px 0 4px; border-left: solid 1px #000; border-right: solid 1px #000; background-color:White; z-index:5;">
<
div align="center" style="background-color: White; "><b><font face="Comic Sans MS"color=black>{param}</font></b></div>
    </
div>
     </
div>
    </
div>
</
div>
</
div>
<
tr><td align="center"
<
img src="path/to/your/image.gif" alt="" border="0">
</
td></tr>
</
table

Example attached ;)


Hoffi 02-07-2005 08:58 PM

You should not use the Font-Tag! This ist not XHTML compilant. Use this
HTML Code:

<div style="font-family: "Comic Sans"; font-weight: bold;">{param}</div>

KW802 02-08-2005 04:50 AM

Hoffi, what would be needed to your chance to get the text color back to black?

Thanks,
Kevin

Hoffi 02-08-2005 08:26 AM

OK, a small tutorial for CSS. ;)

Take this div-Tag for the one in the Middle which includes the {param}. All Font-formatting can be done with this.
HTML Code:

<div align="center" style="background-color: White;  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;  font-size: small;  font-style: normal;  font-weight: bold;  font-variant: small-caps; color: black;">{param}</div>
alternative:
Enter a new Class in the Additinal Style-Settings called this.
HTML Code:

.shield { background-color: White;  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;  font-size: small;  font-style: normal;  font-weight: bold;  font-variant: small-caps;  color: black;    }
and use this div tag.
HTML Code:

<div class="shield">{param}</div>
Description of the used Flags:
background-color: OK, I think no explanation necessary ;)
font-family: The Font or Font-Family you want to use. You can enter more than one Font like in my demo. For higher compatibility use fonts which are installed on any OS and Include serif, sans-serif or monospace.
font-size: The Size you wanr to use. You can use hier absolute Size like 10pt oder 12px, or you can use words like smaller or bigger. just test around what fits perfectly in your design.
font-style: normal or italic.
font-weight: normal, bold, bolder, lighter. In normal case normal and bold are the only differences.
font-varian: normal or small-caps.
color: The Font color you want to use. You can enter names Colors or hex-Numbers like #000000 for black.

additinal entrys that can be interesting:
text-decoration: underline, overline, none or line-through
text-transform: uppercase, lowercase, capitalize or none
letter-spacing: eg. 5px

you also may add a background-Image to the Shield if you insert the following into the div-tag.
background-image: url(path/to/bgfile.gif);

I hope this helps you.

venomx 03-21-2005 05:23 AM

Quote:

Originally Posted by KW802
Very nice. Needs TD & TR tags in the first row though. ;)

Can you paste the code with the missing TD and TR?

KW802 03-21-2005 02:03 PM

Quote:

Originally Posted by venomx
Can you paste the code with the missing TD and TR?

Huh? The post that you quoted me above in has the code in question in it.

venomx 03-22-2005 02:44 PM

When I used it and did a test post then looked at my vBadvanced CMPS the right colum was dropped way down and into the center one. :(

Hoffi 05-17-2005 07:56 PM

Wich Code did you use? the one in the first Post or some other?

venomx 05-17-2005 08:01 PM

One of the ones above. The original works. :)

stan111 09-19-2005 01:07 PM

kool little hack
thanks a ton

ambumann 09-19-2005 08:28 PM

Will this work in 3.5 as well? I only get the textbox, not the smilie..

Clayton 09-26-2005 08:25 PM

Hi there

I have tried this and got this to work with 1 smilie, I even added the option so that it showed up in the WYSIWYG

however, in trying to understand this

If you want more than one Image use the Option tag and name the Images to schield1.gif etc. and use Filepath shield{option}.gif

Than call with [ schield=1]test[/shield]


could anyone please add some light to this, to make it more understandable for me, please

Much appreciated

C

sketch42 09-26-2005 08:36 PM

Quote:

Originally Posted by Clayton
Hi there

I have tried this and got this to work with 1 smilie, I even added the option so that it showed up in the WYSIWYG

however, in trying to understand this

If you want more than one Image use the Option tag and name the Images to schield1.gif etc. and use Filepath shield{option}.gif

Than call with [ schield=1]test[/shield]


could anyone please add some light to this, to make it more understandable for me, please

Much appreciated

C

sure its simple


if you notice when you make a bbcode it asks you whether or not you want to enable the option.

select yes

next when you goto name your multiple files your going to give them the name schield1.gif or schield2.gif

whatever text or number or whatever you put after the word schield is what you will enter when posting a message

so if i g=have 3 pictures im using and i named them schieldtest.gif than i would input [schield=test]My text[schield]

Clayton 09-27-2005 03:44 AM

thanks Sketch

will give this a try, have a vague idea what to try and will see how it comes out

Thanks

C

edit: this is what I have tried .. the code


<table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" style="background-color: White; border: 1px solid Black; padding: 1px;"><normalfont>{param}</normalfont></td> </tr> <tr><td align="center"> <img src="hxxp://www.yourdomain.name/forum/images/smilies/schield{option}.gif" alt="" border="0"></td></tr> </table>

This worked in providing the changeable option with 1 image in the WYSIWYG

however how do I add the extra image to the panel .. I loaded one image to where it says:
Button Image (Optional) If you would like this bbcode to appear as a clickable button on the message editor toolbar, enter the URL of an image 21 x 20 pixels in size that will act as the button to insert this bbcode.

trying to figure out how to add 2 images there, presently I have:
hxxp://www.yourdomain.name/forum/images/smilies/schield1.gif

Ghanem 10-19-2005 05:45 PM

hi.

I am sory I got confused..

can some one post it to show:
1) more than one schield we can click to select from (like the smilies)
2) after selecting it a popup will appear asking to put the text

and thats it..

regards.

Crapaddict 10-26-2005 02:41 PM

Quote:

Originally Posted by unicorn
hi.

I am sory I got confused..

can some one post it to show:
1) more than one schield we can click to select from (like the smilies)
2) after selecting it a popup will appear asking to put the text

and thats it..

regards.

Both easy:
1) use the {option} for the actual imagename:
Code:

<img src="path/to/imagename{option}.gif">
This way users can specify the option wich directly refers to the name.
This way you can't call the images 'happysmile.gif', 'frowningface.gif' etc... but give them numbers: 1.gif, 2.gif etc... or perhaps 'shield1.gif', 'shield2.gif' etc...


2) just specify a 'Button Image' in your bb-code editor for usage with this tag.
this image will be put next to the other images in your editbox.
When clicked it will popup a inputbox for the text, followed by (if you chose to use {option} for this tag) a inputbox asking for the option, in your case the number for the sign.

davidw 11-09-2005 05:35 PM

<font color="Green">* christianb clicks install</font>

Ghanem 12-09-2005 07:01 AM

Quote:

Originally Posted by imported_seraphex
Well after some work I have this.. Anyone know how I can pass the option through so people don't have to type it in. Here's the code I'm using.. I don't know if it's correct or not but it works for me. It prompts for the option but I want it to just automatically fill it in onclick.

Code:

<a href="#" onclick="return vbcode('banner', 'xxxxxx', 'xxx')"><img class="image" src="images/smilies/bannerwink.gif" alt="[banner=wink]text[/banner]" border="0" /></a> wink

hi
What should I use for 3.5.x

Brew 01-02-2007 03:28 PM

Quote:

Originally Posted by KW802 (Post 722000)
Very nice. Needs TD & TR tags in the first row though. ;)

Hello KW802,

Where are the tr and td supposed to be?

I've tried a few variations but they aren't working :cool:

Thanks!

Clayton 04-20-2007 10:49 AM

does this work for 3.6 and above, please?

Traxdata 12-20-2007 12:23 AM

loo. works on vb 3.7.0. beta2, looks a bit strange but it works :D thanks!!!


All times are GMT. The time now is 09:37 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.01301 seconds
  • Memory Usage 1,822KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_html_printable
  • (2)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (26)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete