SimplePortal
Support => English Support => Topic started by: abvs on April 22, 2014, 06:41:56 AM
-
Want to add font to shoubox but does not work ...
added to PortalShoutbox.template.php
if (!isset($context['disabled_tags']['font']))
echo ',
{
sType: \'select\',
sName: \'sel_face\',
oOptions: {
\'\': ', JavaScriptEscape($txt['font_face']), ',
\'courier\': \'Courier\',
\'arial\': \'Arial\',
\'arial black\': \'Arial Black\',
\'impact\': \'Impact\',
\'verdana\': \'Verdana\',
\'times new roman\': \'Times New Roman\',
\'georgia\': \'Georgia\',
\'andale mono\': \'Andale Mono\',
\'trebuchet ms\': \'Trebuchet MS\',
\'comic sans ms\': \'Comic Sans MS\'
}
}';
-
I'm not sure exactly where you have emitted that bit of js. Where did it actually wind up?
And in what way exactly did it fail?
Were there any js errors?
-
I have not used js simply used this modified code after I get like
-
It looks to me that you have added some php code that will emit some javascript onto your page.
My question is -- in what way is your javascript code failing?
I see that there appears to be a control added from which to select font.
What happens when you attempt to use it?
Do you get any errors? Have you traced / debugged the javascript code to find out what happens while it is running?
What kind of debugging have you attempted?
-
I use this code when you pull the font does nothing, nor does it show anything.
There is another form or other type of code to do this function?
PortalShoutbox.template.php
if (in_array('font', $shoutbox['allowed_bbc']))
echo '
<span id="Shoutbox Font Select', $shoutbox['id'], '">
<select id="Shoutbox Font Select', $shoutbox['id'], '" onchange="if (this.value) surroundText(\'[font=\'+this.value+\']\', \'[/font]\', document.getElementById(\'new_shout_', $shoutbox['id'], '\')); this.style.backgroundColor = this.options[this.selectedIndex].style.backgroundColor; return false;" style="height: 20px; line-height: 20px; position: absolute;">
<option value="">', $txt['font_face'], '</option>
<value="courier" title="', $txt['courier'], '"></option>
\'courier\': \'Courier\',
\'arial\': \'Arial\',
\'arial black\': \'Arial Black\',
\'impact\': \'Impact\',
\'verdana\': \'Verdana\',
\'times new roman\': \'Times New Roman\',
\'georgia\': \'Georgia\',
\'andale mono\': \'Andale Mono\',
\'trebuchet ms\': \'Trebuchet MS\',
\'comic sans ms\': \'Comic Sans MS\'
';
echo '
</div>';
}
-
The picture you attached above -- did this come from your shoutbox? It shows "tipo de texto". Is that what your shoutbox looks like?
The javascript code you have included twice -- where did you get it from?
-
this image is showing in my shoutbox, this code was taken from:
Themes>default>GenericControls.template.php
-
abvs -- it is very difficult to tell what is going on just by looking at a picture.
I can see that the code did something -- it appears that it has added an input field for "font face".
It looks like you have not put it exactly where you want it.
And perhaps all the associated javascript is not working properly.
Do you get any javasrcript errors in your browser when you run this javascript code?
What kind of debugging have you tried?