Enable <a name=" "> tag


Notice: Undefined variable: params in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 63

Warning: array_merge(): Argument #2 is not an array in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 63

Sat 22nd Feb 2014
Updated [/plugins/_quicktags.plugin.php], which I now call MyQuickTags.plugin.php so as not to get my mods overridden by any b2evo version update.

The idea is to have the ability to use [#example] in the URL prompt and add this to the calling page.

Changes are:
start at line 391
function b2evoInsertLink(myField, i, defaultValue)
{
var ref= '<?php echo $_SERVER[HTTP_REFERER] ?>';
if (!defaultValue)
{
defaultValue = '';
}
if (!b2evoCheckOpenTags(i))
{
var URL = prompt( '<?php echo T_('URL') ?>:', defaultValue);
var hash = URL.substring(0,1);
if (hash == '#')
{
URL = ref+URL;
}
if (URL)
......
......

Version 5.0.7 SORTED February 2014
NOTE: You will have to enter the full URL in the calling tag

25th May 23:21 SORTED
It has taken me many hours to find the right file to hack, its inc/xhtml_validator/_xhtml_dtd.inc.php version v 1.3 2008/02/08 22:24:46

Added id and name attributes to the 'a' tag
Line 341 'a' => $A_attrs.' charset type href hreflang rel rev shape coords target id name',

NOTES
1. The internal link/bookmark should contain both the id and name attributes having the same value
2. The href has to be an absolute url.

26th May 00:08 Updated post on forum
Is it possible to enable the [a name=""] option.


Have also hacked the quicktags plugin by adding a button to automate the id and name attributes.
To do this I added three bits of code.

Feb 2014 Just updated @copyright (c)2003-2013 by Francois Planque by inserting at line 218
1. First I added a new button. I copied the section for the href link, and replaced the words 'link and href' with 'name' in three places and provided a new Hot Key option of Alt-N.
b2evoButtons[b2evoButtons.length] = new b2evoButton(
'b2evo_name',
'name',
'text-decoration:underline;',
'',
'</a>',
'a',
'<?php echo T_('A name [Alt-N]') ?>'
); // special case

Feb 2014 Just updated @copyright (c)2003-2013 by Francois Planque by inserting at line 262

2. Then added another elseif statement, by copying the href elseif and changing two instances of the word 'link' to 'name'

else if( button.id == 'b2evo_name' )
{
document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" title="' + button.tit
+ '" style="' + button.style + '" class="quicktags" onclick="b2evoInsertName(b2evoCanvas, ' + i + ');" value="' + button.display + '" />');
}

Feb 2014 Just updated @copyright (c)2003-2013 by Francois Planque by inserting at line 415

3. Finally I copied the function b2evoInsertLink().
The name was altered to b2evoInsertName, the default value has been removed, although I haven't as yet removed the code for it, and lastly the start tag was altered to automate the addition of an id and name attribute rather than the 'href' Oh Feb 2014 the prompt needed changing from URL to id and name

function b2evoInsertName(myField, i, defaultValue)
{
 if (!defaultValue)
  {
   defaultValue = '';
  }
 
 if (!b2evoCheckOpenTags(i))
  {
   var URL = prompt( '<?php echo T_('id and name') ?>:', defaultValue);
   if (URL)
    {
     b2evoButtons[i].tagStart = 
      '<a id="' + URL + '" name="' + URL + '">';
     b2evoInsertTag(myField, i);
    }
   }
    else
     {
      b2evoInsertTag( myField, i );
     }
}