foevah Posted May 14, 2007 Share Posted May 14, 2007 Hi everyone I have made my own PHP blog. I would like to make my blog form more advanced so when I wraped [ur|] [/url] around some text it will then be a link on the index page where my blog entries display. I am having trouble doing this.. On the index page I have this code which works for bold tags: $find[] = "[b]"; //Look for bold tag $replace[] = "<span style='font-weight: bold;'>"; //Replace with span tag $find[] = "[/b]"; //Look for bold end tag $replace[] = "</span>"; //replace with end span I changed the above code to the code below hoping it would work but the browser gave me an error: $find[] = "[url=http://"; //Look for bold tag $replace[] = "<span class="class2"><a href="http://www.experts-exchange.com" onclick="window.open (this.href, 'child'); return false">"; //Replace with span tag $find[] = "]"; //Look for bold tag $replace[] = "<span class="class2"><a href="http://www.experts-exchange.com" onclick="window.open (this.href, 'child'); return false">"; //Replace with span tag $find[] = "[/url]"; //Look for bold end tag $replace[] = "</a></span>"; //replace with end span Parse error: parse error, unexpected T_STRING in /home/webmedia/public_html/jecgardner/index.php on line 46 Ultimately I would like the links to look like this sites: http://www.tanfa.co.uk/css/articles/css-borders-design.asp :o Another problem I encountered which is not so serious is the code tag that changes the background colour. I have achieved this but if I add a border to the code it repeats the top border on every new line.. This is a screenshot of what it looks like using a border: This is the code for the border: $find[] = "[code]"; //Look for code tag $replace[] = "<span style='border-style: outset; background-color:#646464; color: white;'>"; //Replace with span tag $find[] = " "; //Look for code end tag $replace[] = "</span>"; //replace with end span[/code] Any ideas how I can get the links to work and fix the border problem? I dont mind trying a new method either! Quote Link to comment https://forums.phpfreaks.com/topic/51263-how-to-use-urlurl-codecode-in-blog-entry-form/ Share on other sites More sharing options...
foevah Posted May 14, 2007 Author Share Posted May 14, 2007 up Quote Link to comment https://forums.phpfreaks.com/topic/51263-how-to-use-urlurl-codecode-in-blog-entry-form/#findComment-253125 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.