2
« on: October 30, 2013 - 11:36 11:36 »
./Themes/default/Post.template.php
Find: // Print a drop down list for all the colors we allow!
Add before // Java script to handle URL input boxes ...
echo '<script language="JavaScript" type="text/javascript">
// <!' . '--
function trim(str) {
return str.replace(/^\s |\s $/g,"");
}
function urlINPT()
{
// Enter URL .........................................
var urlLINK = prompt("URL:" ,"http://");
if (urlLINK == null )
{
//cancel pressed . . .
surroundText("", "", document.', $context['post_form'], '.', $context['post_box_name'], ');
//this sets focus back to textarea
}
else if (trim(urlLINK) == "" || trim(urlLINK) == "http://")
{
//ok pressed but with no text . . .
surroundText("", "", document.', $context['post_form'], '.', $context['post_box_name'], ');
//this sets focus back to textarea
}
else
{
//ok pressed and there is something :)
var textarea = document.', $context['post_form'], '.', $context['post_box_name'], ';
var selection_length = 0;
// Can a text range be created?
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
{
selection_length = textarea.caretPos.text.length;
}
// Mozilla text range wrap.
else if (typeof(textarea.selectionStart) != "undefined")
{
selection_length = textarea.selectionEnd - textarea.selectionStart;
}
//length could not be got
else
{
selection_length = 0;
}
//if text was selected in textarea
if (selection_length > 0)
{
surroundText(\'[url=\' urlLINK \']\' \'\', \'[/url]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
}
//if no text was selected in textarea
else
{
surroundText(\'[url=\' urlLINK \']\' urlLINK \'\', \'[/url]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
}
}
}
// --' . '>
</script>';
Find: foreach ($context['bbc_tags'][1] as $image => $tag)
{
if (isset($tag['before']))
{
// Is this tag disabled?
if (!empty($context['disabled_tags'][$tag['code']]))
continue;
Add after: // only replace the URL tag! . . . . . . . . . . .
if (isset($tag['code']) && $tag['code'] == 'url')
{
echo '<a href="javascript:void(0);" onclick="urlINPT(); return false;"><img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" border="0" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
continue;
}