rejetto forum

Software => HTML & templates => HFS ~ HTTP File Server => RAWR-Designs => Topic started by: Kochleffel on September 10, 2010, 03:02:17 PM

Title: Comment language (HTML/BB)
Post by: Kochleffel on September 10, 2010, 03:02:17 PM
Hi,

could someone tell me which language will be used for comments when i wanna add an image or formated text inside the comment?

Title: Re: Comment language (HTML/BB)
Post by: TSG on September 10, 2010, 03:03:58 PM
HTML
Title: Re: Comment language (HTML/BB)
Post by: Kochleffel on September 10, 2010, 03:20:04 PM
i use your new live 3.01..


Access:
    You can access this item!
Added:
    02.07.2010 12:32:36
Hit Count:
    4
Comment:
    < strong > just a test < /strong >

i see it unformatted
Title: Re: Comment language (HTML/BB)
Post by: SilentPliz on September 11, 2010, 08:21:52 AM
    < strong > just a test < /strong >

correct syntax:

<strong> just a test </strong>

Title: Re: Comment language (HTML/BB)
Post by: TSG on September 11, 2010, 09:45:16 AM
That is because comments are not allowed to use HTML with Live 3.0.1.

If you had read the readme.txt about tooltips, I did outline this issue.

Code: [Select]
---------------------------------------------------------------------------
----- Tooltips.
---------------------------------------------------------------------------

  Live template has never been able to display the extra item information
  that HFS can provide (such as comments), until now.

  We have come up with a tooltip system, it integrates with the current
  interface and displays when you hover on items, or the server
  information in the footer. You can hover on the tooltip itself to pause
  and read the information.

  If you do not want tooltips you can turn them off in the
  template settings.
[color=red]
  HTML markup and Double Quotes are not allowed in the comment field
  of Live. A small HFS macro is used to prevent this issue from breaking
  the template.[/color]

Actually I will expand as to why that is here,

I use a custom attribute on each item, and fill the content of the tooltip dynamically with JavaScript. I can't use double quotes otherwise it breaks the attribute string, and I can't use HTML because it breaks the template, depends on the markup you use, but its bad to let it happen. You shouldn't need to use anything for the comments, Live is only designed to have small informative item comments anyway.
Title: Re: Comment language (HTML/BB)
Post by: SilentPliz on September 12, 2010, 04:47:40 AM
That is because comments are not allowed to use HTML with Live 3.0.1.
...

In this case, you should perhaps add a macro to prohibit display of comments containing <, >, </ ...
because, if a user has previously created comments containing HTML commands with HFS, the result in web page, with items containing such comments is rather ugly. :-\
Title: Re: Comment language (HTML/BB)
Post by: TSG on September 12, 2010, 07:45:08 AM
It was a quick fix, and it shows the error they have caused. I suppose a macro could be created to just remove all elements between < and >, so it simply hides it away.
Title: Re: Comment language (HTML/BB)
Post by: rejetto on September 12, 2010, 01:02:22 PM
maybe {.replace|<|&lt;|>|&gt;|%item-comment%.}
but it shows the tags, it's ugly.

maybe {.regexp|<([^>]+>)([^<>]+)</\1|%item-comment%|replace=$2.}
it's supposed to keep only the content of the tags, but it works only with tag+closingTag.
after that you should remove remained tags

i'm not sure on the \1 and $2
just check it out, because i tested nothing i just posted