The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Ampersand encoding in links in custom BBCode (Solved)
Hi Folks,
I'm looking to add some custom BBCode that uses an IFrame to link to a predetermined base site (for use with Amazon's Associates program). The problem I'm coming across is when trying to put the source in the HTML in the BBCode manager, it's encoding the &'s in the src URL into & which then breaks the iframe link. Is there any way to prevent vB from encoding ampersands in a URL? I've tried passing them in a parameter that appends on to the end of the base URL but it similarly encodes them as & and breaks the link. |
#2
|
|||
|
|||
I find that if you have a bbcode replacement with "&" in it, when it displays the replacement in the bbcode manager it changes & to &, but when you actually use the bbcode in a post, the resulting html in the page is correct. I guess what I'm saying is, are you sure it's a misplaced & that's breaking the url? Does it look wrong if you view the html source of a page where that bbcode was used in a post?
|
#3
|
|||
|
|||
Quote:
I've viewed the source of a test post using it and the link contains & instead of & as it should. If I copy the link and manually correct them to & it work's fine again. |
#4
|
|||
|
|||
OK, another dumb question - you don't have & actually in your replacement anywhere?
Is there any way you can post your bbcode replacement so we can try it? |
#5
|
|||
|
|||
Quote:
I also have a google speadsheet embidding bbcode that has a similar issue, but it's less sensative to the URL (it works so long as the first parameter is passed, the rest just get ignored). Replacement: Code:
<div><iframe width="125" height="125" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0" src="http://rcm.amazon.com/e/cm?t=mayhem-20&o=1&p=21&l=ur1&category=game_downloads&banner=13PTQH69Q2290VF8SR82&f=ifr"></iframe></div> Code:
<div><iframe width="125" height="125" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0" src="http://rcm.amazon.com/e/cm?t=mayhem-20&o=1&p=21&l=ur1&category=game_downloads&banner=13PTQH69Q2290VF8SR82&f=ifr"></iframe></div> Replacement Code:
<div align="center"><iframe width="95%" height="500" frameborder="0" src="https://spreadsheets.google.com/pub?key={param}&hl=en&single=true&gid=0&output=html&widget=true">IFRAME Not Available. <a href="https://spreadsheets.google.com/pub?key={param}&hl=en&single=true&gid=0&output=html">Direct Link to Spreadsheet.</a></iframe></div> &hl=en&single=true&gid=0&output=ht ml I didn't notice the issue before since google spreadsheets will output the spreadsheet in the iframe just with the first parameter (key=) and the rest just get ignored. For my Amazon link however all the parameters are needed or it doesn't generate anything. |
#6
|
|||
|
|||
OK, I tried it, and when I put the bbcode in a post then view the html source I see &s in it. But I also see it in other src and href tags, and when I clicked on the link it seemed to work. Here's what the browser said when I got to amazon.com:
Code:
http://www.amazon.com/b/?node=979455011&tag=mayhem-20&camp=213517&creative=391561&linkCode=ur1&adid=16R7ZVMDJE5FD0HS2D4Z&&ref-refURL=http%3A%2F%2F10.0.0.4%2Fforum4%2Fshowthread.php%3F2-test2 |
#7
|
|||
|
|||
*Sigh* it's the little things that get us.
Turns out it was Adblock in Firefox that was preventing it from showing up, not the odd change to & in the source. It must have reenabled on my home domain during an update and I didn't even notice it (since my site otherwise uses no ads). Thanks for trying to figure things out with me kh99. It's still very odd that the page loads fine even when the source shows it using & and yet if I try copying and pasting the src url that includes them into the nav bar it breaks. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|