Support Forums

Show First image in userbrowselistings

This is a discussion on Show First image in userbrowselistings within the Technical Support forums, part of the Technical Support Forums category; Hi, Can someone please point me in the right direction for showing the first image in userbrowselistings, i assume i ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

Reply
 
Thread Tools Display Modes
Old 07-15-2010, 06:14 AM   #1
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 37
bowers01 is on a distinguished road
Default Show First image in userbrowselistings

Hi,
Can someone please point me in the right direction for showing the first image in userbrowselistings, i assume i have to add something in here
Code:
$sSQL = "SELECT id,title,section,price,display,hitcount,dateadded,expiration,orderID,oType,oStatus,oProductID FROM ".PREFIX."listings LEFT JOIN ".PREFIX."orders ON orderID=oID WHERE owner = ".$userid." ". $where ." ORDER BY dateadded DESC";
But i am not sure on what to add?
Thanks for the help,
Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 07-15-2010, 07:15 AM   #2
All Hands On Deck
 
seymourjames's Avatar
 
Join Date: Mar 2008
Posts: 3,529
Rep Power: 89
seymourjames is a jewel in the rough
Default

Can you not add code like this into the table to mimic what showlistings.tpl does as it is looping on results.


<td class="{cycle values="row1,row2" advance=false}"><img src="{$smarty.const.URL}/thumbs/small_{$entry.image|escape:"url"}" border="0" width="100" height="86" /></td>

I have not tried it. It may need some modification.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Old 07-15-2010, 07:19 AM   #3
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 37
bowers01 is on a distinguished road
Default

Hi,
Thanks for the reply but no, looking in the debug console no pictures are there.
I did try your suggestion just then but it just shows the image as this http://localhost/thumbs/small_

Cheers,
Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 07-15-2010, 09:14 AM   #4
Developer & Moderator
 
Mike-N-Tosh's Avatar
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,427
Rep Power: 75
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I certainly hope you have a backup while your messing with the Listings core file.

I'm assuming your posted code is the initial query for the function getListingsForMember. If it were me, I would just loop through the rows and use the $row['id'] to call the built in function getListingSingleImage and assign the image to the row. Don't forget to then assign it to the template later in the code.

Also, make sure you document any changes you make in comments within the file.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 07-15-2010, 09:31 AM   #5
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 37
bowers01 is on a distinguished road
Default

Quote:
Originally Posted by Mike-N-Tosh View Post
If it were me, I would just loop through the rows and use the $row['id'] to call the built in function getListingSingleImage and assign the image to the row. Don't forget to then assign it to the template later in the code.
I didnt know that existed, i will have a crack at it when i get a chance.
Thanks for the reply.
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 07-16-2010, 06:45 AM   #6
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 37
bowers01 is on a distinguished road
Default

i spent about a hour trying to get this working, then found this
https://www.68classifieds.com/forums...stings-v4.html
all done in 2min.
Thanks for the help
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 07-16-2010, 01:16 PM   #7
All Hands On Deck
 
seymourjames's Avatar
 
Join Date: Mar 2008
Posts: 3,529
Rep Power: 89
seymourjames is a jewel in the rough
Default

Did say it will probably need an edit but glad you got it resolved. It is a nice addition actually. I personally would submit it as a feature enhancement. In my sites i actually have a reference number as a key to each listing. I put this in the first column and make it pop the listing so people can see what they are. This works really well when people have similar listings in their account.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
show image in showlistings jason1971 Templates, HTML, CSS, and Design Help 4 01-28-2010 10:31 AM


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


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