View Full Version : plugin/hook issue
April 11th, 2013, 08:38 AM
I am trying to place an affiliate link/banner into the plugin system but when i do I get the following error.
Parse error: syntax error, unexpected T_STRING in /usr/*****/*****/*****/photopost/index.php(344) : eval()d code on line 1
This is how it looks
$pphook['sidebar_left_bottom'] .= '<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=123456&merchantID=1234&programmeID=16186&mediaID=12345&tracking=&url='><img border=0 src='http://banners.affiliatefuture.com/5917/131943.gif'></a>';
I have contacted the affiliate company but they suggest It is the way the code is implemented.
im a complete novice and would appreciate any assistance
Thanks in advance
April 11th, 2013, 10:20 AM
This would explain your issue which is why I posted it.
Whatever PHP plugin you create has to conform to the rules of PHP.
You can not use single quotes for html inside a php string that is defined by single qoutes double quotes would need to be used.
If you use double qoutes in the line on the outside then your html can use single quotes inside. If you use double or single qoutes through out the string then you must escape any quotes you use.
Therefore if you do not want to escape anything your plugin would have to look like this
I go into this in depth in the tutorial I posted. ;)
$pphook['sidebar_left_bottom'] .= '<a href="http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=123456&merchantID=1234&programmeID=16186&mediaID=12345&tracking=&url="><img border="0" src="http://banners.affiliatefuture.com/5917/131943.gif"></a>';
April 11th, 2013, 10:36 AM
Again my ignorance fails me!
I should have looked there, sorry Chuck :rolleyes:
anyway its working but I bet you knew it would B=0
April 11th, 2013, 10:39 AM
That is the reason I posted the tutorial. vb has had a plugin system for along time and the people posting plugins at vbulletin.org know how to write PHP. The majority of our users are beginners who know very little about PHP so I made sure when I wrote up our little plugin system to post a tutorial on how to formulate the plugins.
April 12th, 2013, 08:44 PM
let me know if you have any plugin ideas. always looking for new ideas. ;)
April 13th, 2013, 12:52 AM
Will do that.
For a novice like me it makes things so much easier.
April 13th, 2013, 06:14 AM
yeah I have posted common things just the gas tank gets empty trying to think of new ideas. ;)
May 29th, 2013, 02:41 AM
I have placed to plugins in the same place in the left side bar (bottom).
They display without errors however there does not appear to be a space between them and it looks a little clumsy. Is there anyway of spacing them ?
They are skyscraper banners one above the other.
May 29th, 2013, 08:00 AM
well place a <br /> tag after the link. It is all html so just code accordingly ;) if your doing multiple simple link html tags.
Obviously just a guess because I do not see what your doing exactly.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.