PDA

View Full Version : Linking to Pollstar Search Engine (embedded code - where to put?)


Dave234
05-16-2012, 04:26 AM
Hello,
I want to include in my website an embedded search engine from the website Pollstar (http://www.pollstar.com). It would include what looks like a google search window but it is for concerts.

I want to put this in a main page in my news section (at the top right), and also in a forum post (which I will make a "sticky").

Can you please tell me where I can embed the code, for these two locations? I'm really worried about messing up my website by putting code where I shouldn't put it.

Here is the link to the Pollstar page which discusses the different options for embedding: http://www.pollstar.com/linkToUs.aspx

Here is the code I want to embed, which if I am not mistaken would be all I need:

<img src="http://www.pollstar.com/images/logo.gif" width="100" alt="Powered by Pollstar" /><form action="http://www.pollstar.com/eventSearch.aspx?" method="GET"><input type="text" name="SearchBy" id="SearchBy" /> <input type="submit" value="Search" /></form>

webmastershome
05-16-2012, 05:21 PM
hi there

you have not mention the site url to find top right side.

It's look like very simple edit the template section

admincp-> style manager - > select the template to edit ( past the code )

try this

Dave234
05-17-2012, 01:06 AM
But which template?

Dave234
05-21-2012, 12:25 PM
Anybody?

kh99
05-21-2012, 12:38 PM
As someone mentioned above, we can't tell you how to add it to your main page without more information (ideally a link to your main page).

The problem with including it in a post is that you normally can't put html in a post (and it's not a good idea to enable html). What you could do it create a new bbcode and put that html as the replacement, then you can use the bbcode in a post.

If you're worried about experimenting with inserting the code in templates, you could create a new style and use that to experiment, then if it gets messed up just delete it (you just need to be careful when you're editing template to make sure it's a template in your experimental style).

Dave234
05-21-2012, 01:24 PM
Or I could just copy and paste the old code into a notepad, then if it gets messed up I can replace the new code with the old (copied) code, right?

How can I create a new bbcode and put the html as the replacement?

kh99
05-21-2012, 04:13 PM
Or I could just copy and paste the old code into a notepad, then if it gets messed up I can replace the new code with the old (copied) code, right?


Sure, of course you can do that. The only thing is if you had a busy site, your members might see some strange things happening while you experiment.


How can I create a new bbcode and put the html as the replacement?

Find "Custom BB Codes" on the left in the adminCP, click on "Add New BB Code" and go from there. The code would go in the replacement text box, and the rest you can probably figure out (you can use the help by clicking on the ? icons). The only thing I'd mention is that you'd want to set "Remove Tag if Empty" to No. You can leave the other radio buttons set at the default.

So maybe you put pollstar as your tag name, then in the post you'd just put (you can also use that as the "example" when you're creating the bbcode). It's a bit of a hack because anyone will be able to use that in a post and insert a search box, but it's otherwise harmless.

Dave234
05-22-2012, 05:01 PM
I just made the BB code and did in my forum post, and the image looks good. It has the search box next to the "Pollstar" logo.

However, when I enter a band name and click enter it takes me to a page that says:

"Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error."

kh99
05-22-2012, 05:30 PM
Oh...yeah, I didn't notice that your code includes a form, and I think the problem is that for admins and moderators the posts are already inside a form, and you can't nest them.

Given that there's only one input field (SearchBy) and it's method="GET", it should be the same as going to the url http://www.pollstar.com/eventSearch.aspx?SearchBy=keyword, so you could probably replace the form with some javascript that sets location.href to that url. But you'd also need to encode the search term for a url...it starts going from an easy hack to a complicated one.

Dave234
05-22-2012, 05:32 PM
Actually it works now. Strangely enough, when I place the in the first post, it shows that error. However, when I do it in a reply post, it works! All the BB code is enabled in the forum.....so I have NO IDEA how this it's not working, ha ha

kh99
05-22-2012, 05:35 PM
Hmm...maybe you can nest forms. Oh well, as long as it's working.

Dave234
05-22-2012, 05:55 PM
How can i nest forms?

kh99
05-22-2012, 05:59 PM
How can i nest forms?

I just meant that if it's working now, then I must have been wrong about the problem.

When I did a search I found that the official html spec says that the behavior of nesting forms is "undefined", so I guess that means it may or may not work, and of course it might work differently on different browsers.

--------------- Added 1337714663 at 1337714663 ---------------

Here's some code that uses javascript instead of a form. It seems to work but I only tested it with firefox.

<img src="http://www.pollstar.com/images/logo.gif" width="100" alt="Powered by Pollstar" /><input type="text" name="SearchBy" id="SearchBy" /> <input type="button" value="Search" onclick="location.href='http://www.pollstar.com/eventSearch.aspx?SearchBy=' + encodeURIComponent(document.getElementById('Search By').value);"/>