SimplePortal

Support => English Support => Topic started by: abvs on April 22, 2014, 06:41:56 AM

Title: add font to type shoutbox
Post 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

Code: [Select]
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\'
}
}';
Title: Re: add font to type shoutbox
Post by: AngelinaBelle on April 23, 2014, 10:09:31 AM
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?
Title: Re: add font to type shoutbox
Post by: abvs on April 23, 2014, 12:34:28 PM
I have not used js simply used this modified code after I get like
Title: Re: add font to type shoutbox
Post by: AngelinaBelle on April 24, 2014, 02:22:02 PM
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?
Title: Re: add font to type shoutbox
Post by: abvs on April 24, 2014, 04:08:30 PM
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

Code: [Select]
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>';
}
Title: Re: add font to type shoutbox
Post by: AngelinaBelle on April 24, 2014, 04:11:44 PM
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?
Title: Re: add font to type shoutbox
Post by: abvs on April 25, 2014, 06:38:37 AM
this image is showing in my shoutbox, this code was taken from:
Themes>default>GenericControls.template.php
Title: Re: add font to type shoutbox
Post by: AngelinaBelle on April 25, 2014, 07:11:00 AM
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?
SimplePortal 2.3.8 © 2008-2024, SimplePortal