Support Forums

Searching ad by id

This is a discussion on Searching ad by id within the Templates, HTML, CSS, and Design Help forums, part of the General category; Hi, How can I add a search ad by id in my search.tpl? What would be the code for this? ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 08-23-2010, 10:26 PM   #1
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default Searching ad by id

Hi,

How can I add a search ad by id in my search.tpl? What would be the code for this? I think the variable is something like this: {$entry.id} or {$id} but how would I make a search option with this?

Thanks.
EnergyFreak is offline   Reply With Quote
Old 08-24-2010, 05:08 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

First of all the ID is a unique identifier which is system generated so I am not sure it makes sense to combine it with search. You can't have multiple items being returned for a unique ID.

What I might do although it seems like a lot of hassle is create a plugin which accepts an ID number and returns the viewlisting url for that ID. You will need to create a simple form which accepts a number, do some error checking on the input and then "on submit" produce the viewlisting page using viewlisting.php.

Someone else may think of a simpler way to do it using javascript. Basically, you need a way to enter the ID into the viewlisting url and pop the page.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 08-24-2010, 06:47 AM   #3
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 35
bowers01 is on a distinguished road
Default

I have this in the top corner of my website
Code:
<form action="{$smarty.const.URL}/viewlisting.php?view={$smarty.get.adid}" method="get"><input type="text" name="view" size="4" {literal} value="Ad REF#" onfocus="if(this.value == 'Ad REF#') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Ad REF#';}"{/literal} />
<input type="submit"  value="" />
</form>
You will have to style it as i have a custom search box so it is all out wack now.

Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 08-24-2010, 08:07 AM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

Not a bad way to proceed and certainly simpler.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOME Extra Fields Are Not Searching MrGForce Technical Support 22 06-15-2009 07:41 PM
Can We Limit Guests from Searching dexignz Technical Support 2 09-22-2008 05:38 PM
Searching my website Angelus07 Pre Sales Questions 3 01-10-2008 12:46 PM


All times are GMT -4. The time now is 06:42 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0