| Author |
Post |
|
|
#1 Mon Dec 03, 2007 10:55 pm
|
|
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
|
Hi, For those who have followed this thread: http://www.usebb.net/community/topic-1822.htmlI was wondering if this could be implemented, when the user clicks on URL, a drop-down panel would appear (see pic) and after inserting the link name and URL, it would simply insert the right code into the post (the panel would also have a "Submit" or "Insert" button). This inspiration came from Gaia's Links Page Mod and I've also seen this on a few forums.  Thanks, Gene « Last edit by Raygene on Mon Dec 03, 2007 10:58 pm. »
|
|
|
#2 Fri Jan 04, 2008 1:48 am
|
|
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
|
Found some code for doing that, wonder if it could be made to work with UseBB. <file name="$themedir/Post.template.php">
<operation>
<search position="after"><![CDATA[ // Print a drop down list for all the colors we allow!]]>
</search>
<add><![CDATA[ // Java script to handle URL input boxes ...
echo '<script language="JavaScript" type="text/javascript">
// <!' . '--
function urlINPT()
{
// Enter URL .........................................
var urlLINK = prompt("Please enter URL address:","http://");
if (urlLINK == null )
{
//cancel pressed . . .
}
else if (urlLINK == "" || urlLINK == " ")
{
//ok pressed but with Notext . . .
alert("Sorry no text entered!");
}
else
{
//ok pressed and there is something :)
// Enter Description ...................................
var urlNAME = prompt("Please enter URL name:","");
if (urlNAME == null )
{
//cancel pressed . . .
}
else if (urlNAME == "" || urlNAME == " ")
{
//ok pressed but with notext so use URL only!
surroundText(\'[url]\'+urlLINK+\'\', \'[/url]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
}
else //ok pressed with text so use URL and Name!
surroundText(\'[url=\'+urlLINK+\']\'+urlNAME+\'\', \'[/url]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
}
}
// --' . '>
</script>';]]>
</add>
</operation>
<operation>
<search position="before"><![CDATA[ foreach ($context['bbc_tags'][1] as $image => $tag)
{
if (isset($tag['before']))
{
// Is this tag disabled?
if (!empty($context['disabled_tags'][$tag['code']]))
continue;]]></search>
<add><![CDATA[ // 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;
}]]>
</add>
</operation>
</file>
Would end-up looking like this: http://img2.freeimagehosting.net/image.php?51dd244358.jpghttp://img2.freeimagehosting.net/image.php?f4c967adbb.jpgCheers, Gene
|
|
|
#3 Thu Feb 07, 2008 9:42 pm
|
|
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
|
Hmm, no takers? Is this something that could be implemented in UseBB 2?
|
|
|
#4 Thu Feb 14, 2008 4:10 pm
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
Something like this probably will be in v2.
|
|
|
#5 Thu Feb 14, 2008 11:49 pm
|
|
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
|
Dietrich wrote Something like this probably will be in v2.
Wonderful! Gene
|