When I enter a URL in my blog entry form i.e. www.sitepoint.com I want it to be clickable on the index page where my blog entries display.
On the index page I have this code which works for bold tags:I tried changed this hoping it would work forPHP Code:$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 was trying to get a new window load when you click on the link.PHP Code:$find[] = "[url]"; //Look for bold tag
$replace[] = "<span class="class2"><a href="http://www.sitepoint.com" onclick="window.open (this.href, 'child',
'height=650,width=525,scrollbars'); return false">"; //Replace with span tag
$find[] = "[/url]"; //Look for bold end tag
$replace[] = "</a></span>"; //replace with end span
I didnt get that far because the browser gave me this error on that line:
I have tried making it simple by using just the <a href="www.sitepoint.com"> but the browser still gives me an error. Another problem with this method is all text that is wrapped with [ur|][/url] will go to the same siteParse error: parse error, unexpected T_STRING in /home/webmedia/public_html/jecgardner/index.php on line 46
I put this into the blog entry form <a href="http://www.skaffers.com">www.sitepoint.com</a> which turned into a link on the index page but when I clicked on it the browser said:
The requested URL /jecgardner/http<img src='../jecgardner/images/facehm.gif' alt='hmm'/>/www.sitepoint.com was not found on this server.![]()
Ultimately I would like the links to look like this sites:
http://www.tanfa.co.uk/css/articles/...ers-design.asp
![]()
![]()
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:
Any ideas how I can get the links to work and fix the border problem?PHP Code:$find[] = "[code]"; //Look for code tag
$replace[] = "<span style='border-style: outset; background-color:#646464; color: white;'>"; //Replace with span tag
$find[] = "[/code]"; //Look for code end tag
$replace[] = "</span>"; //replace with end span








Bookmarks