Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorVaz
    • CommentTimeNov 26th 2007 edited
     # 1
    Hi guys,
    I'd like to edit the <code> function. Could someone direct me to where I'd find it?

    I'd like to edit the function so it adds the following text around the tags:


    <dl><dt><a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd>
    &
    </dd></dl>

    So:
    <dl><dt><a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd>
    <code>MY TEXT GOES HERE</code>
    </dd></dl>
    • CommentAuthorGrahack
    • CommentTimeNov 26th 2007
     # 2
    Hi, are you talking about the HTML formatter?
    •  
      CommentAuthorVaz
    • CommentTimeNov 26th 2007 edited
     # 3
    nope, just the default function which allows me to do


    this


    Can I just achieve my goal by making an edit to the css?
    • CommentAuthorGrahack
    • CommentTimeNov 26th 2007
     # 4
    I think that what you just used is the HTML formatter that is installed here (try without!). And I don't think you'll be able to add tags with css.
    •  
      CommentAuthorVaz
    • CommentTimeNov 26th 2007
     # 5
    Ah yep, that's it.
    • CommentAuthorSirNot
    • CommentTimeNov 26th 2007 edited
     # 6
    in the html formatter you should see a function call that looks like this:$String = preg_replace(
    array(
    '/<code((?>[^>]*))>(.+?)<\/code(?>[^>]*)>/sei',
    '/<(?![A-Za-z\/'.(HTML_ALLOW_COMMENTS?'!':'').'])/i'
    ), //yet again, order is important
    array(
    '\'<code\'.$this->RemoveQuoteSlashes(\'\1\').\'>\'.htmlspecialchars($this->RemoveQuoteSlashes(\'\2\')).\'<./code>\'',
    '&lt;'
    ),
    $String
    );
    Edit what you want in the replacement array. In your case you'd want to change the first element to something like:'\'<dl><dt><a href="#" onclick="selectCode(this); return false;">Select All</a></dt><dd><code\'.
    $this->RemoveQuoteSlashes(\'\1\').\'>\'.htmlspecialchars($this->RemoveQuoteSlashes(\'\2\')).\'<./code></dd></dl>\'',
    (changing <./code> to </code>, obviously)
Add your comments
    Username Password
  • Format comments as