MyBB Community Forums

Full Version: Linking bad Links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need some basic assistance. I want to make a MyCode that replaces a line of text with a hyperlink. What is happening is that I am using the RSS Feed Poster to bring in an RSS, but the external RSS is not using full addresses for the links. So get this line that say something along the lines of:

/campaigns/test/characters/adam

I want to convert that into a complete link. So I was calling "/campaigns/(?)", but then the replacement adds the rest of the line at the end of the replacement code regardless of where I put the $1. So if I use the replacement code:

<a href=http://www.obsidianportal.com/campaigns/$1>http://www.obsidianportal.com/campaigns/$1</a>

I get:
<a href=http://www.obsidianportal.com/campaigns/>http://www.obsidianportal.com/campaigns</a>/campaigns/test/characters/adam

So, what am I doing wrong?
I'm not sure if this will fix the problem but try using this replacement:
<a href="http://www.obsidianportal.com/campaigns/$1">http://www.obsidianportal.com/campaigns/$1</a>
Could you also post your full regular expression.
This is what I get as a link from the RSS

/campaigns/test/characters/adam

This is the Regular Express I'm trying (I really don't know these)

/campaigns/(?)

This is the replacement I'm now trying

<a href="http://www.obsidianportal.com/campaigns/$1">http://www.obsidianportal.com/campaigns/$1</a>

This is what what I get

<a href="http://www.obsidianportal.com/campaigns/">http://www.obsidianportal.com/campaigns/</a>/campaigns/test/characters/adam

Nevermind. I worked it out.
Try this as your regular expression:
/campaigns/(.*?)