Customizing SMF > Forks Discussion

BBCode pre-parsing

<< < (3/5) > >>

Ben_S:
I'd love to see the parsed entries stored in addition to the unparsed entries. Space is cheap.

SleePy:
Pre-parsing would be a good idea, and adding a suffix of the language code to the key is only trivial to solving the language issue

I would see best by using a separate table to hold this with id_msg, language, parsed_body.  If a new bbc is added or modified, it would be trivial to empty this.  Or better yet, add a expire column as well, put a specified time in there (like say 30 days).  Clearing the cache could simply set those to all be expired to the current time, which makes the code simply reparse it when it is requested again.  So you don't wonder why you have a 3gb drop in data usage after adding a bbc or clearing cache :D

That is, if I was developing the feature, how I would do that.

AngelinaBelle:
Of course, this all assumes that we want the text parsed the same way for all views.

The fact is that, when we have a low-bandwidth connection, are trying not to go over our smartphone data limit, or are using WAP or WAP2, we don't want all of the images. We'd like, perhaps, a link to an image, or a link to AJAX-download the image into place, or some such thing. So just pulling up the pre-parsed HTML with the image tag in it would not do.

If the msg is going to be sent out as an announcement, the view is "email-HTML" or "email-plaintext".  Because some users read email on their WAP phone, or are on a limited data plan, or are far from broadband connections altogether.  They sometimes get email via dialup, sat. phone, or HF radio digital modes (marine or amateur bands).

And what about print? Hyperlinked text doesn't work at all in print. If the view is "print/paper", then it would make more sense, when parsing, to render the link text, with the URL in parentheses () afterwards.

青山 素子:

--- Quote from: AngelinaBelle on August 19, 2011, 08:37:24 AM ---We'd like, perhaps, a link to an image, or a link to AJAX-download the image into place, or some such thing. So just pulling up the pre-parsed HTML with the image tag in it would not do.

--- End quote ---

You can use CSS to hide the image. You could also, if you wanted, edit the actual parsed source to enable a toggle. It's not as clean as it otherwise could be, but it can be done with preparsed text.


--- Quote from: AngelinaBelle on August 19, 2011, 08:37:24 AM ---And what about print? Hyperlinked text doesn't work at all in print. If the view is "print/paper", then it would make more sense, when parsing, to render the link text, with the URL in parentheses () afterwards.

--- End quote ---

You can actually use CSS to make those show up. I've done that before.

AngelinaBelle:
And I was thinking "semi-preparsed" was going to have to be the answer.
Though, I suppose, with appropriate embedded search strings (a special class string?) the pre-parsed text could be image-re-processed for some views.

Oooh. after content.  I forgot about that. Would need a workaround to support IE6 or IE7, or, probably, other older browsers.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version