Jump to content

[SOLVED] [Quote] system


convinceme

Recommended Posts

i needed some help with ['quote'] system

Currently I am using following code to replace the tags

$string = str_replace("[Quote]", "<table bgcolor=#000000><tr><td>",$string);
$string = str_replace("[/Quote]", "</font></td></tr></table>",$string);

The problem with this is that in case there is no

at the end, the <table> wont end which means it would distort the whole page. Is there a way to ensure that is there in the $string or if its not than just close the table where the string ends.

 

using explode to check if the word exists in the string could be one possible option maybe havent tried it though it think should work.. is there any other?

Link to comment
Share on other sites

I personally wouldnt use tables. Tables are for TABULAR data.

 

This is what i use for quotes something similar anyway:

 

<?php
function doQuotes($str) {
  $code = array("#\[quote\](.*?)\[/quote\]#is");
  $html = array("<div class\"quote\"<span>Quote:</span>\n\\1</div>");
  $str = preg_replace($code, $html, $str);
   
   return $str;
}

?>

 

So i use regular expressions to find

and
within a str and then replace them with the <div></div> tags that are CSS formatted etc.

 

 

Link to comment
Share on other sites

css if good, hell it's great.

 

but there are still a few places that tables are better for layout.

 

granted most of these css design flaws are being ironed out in css3 but there's also still some browser problems as well with css support from i.e as there prob will always be.

 

Microsoft have out and out said they don't care about the acid test or standards, that it's not their primary goal.

 

Personally I'd like to see I.E go don the drain

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.