Support Forums

User Location on Different file

This is a discussion on User Location on Different file within the Technical Support forums, part of the Technical Support Forums category; What version of 68 Classifieds are you running? V4.10 Developer Hi, I am setting up a page to fetch the ...


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

Reply
 
Thread Tools Display Modes
Old 07-27-2010, 09:18 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 User Location on Different file

What version of 68 Classifieds are you running?
V4.10 Developer

Hi,
I am setting up a page to fetch the all the seller stores and list them.
What i currently have is below.

What i am stumped on is getting the city, state and phone for the sellers.
Any ideas how this could be done?
Regards,
Nick

PHP Code:
<?php
require_once('includes/init.php');
require_once(
FILESYSTEM_PATH .'modules/seller_store/includes/functions.php');
require_once(
FILESYSTEM_PATH .'includes/classes/kernel/Users.php');


        
$sSQL "SELECT s.sID,s.sUserID,s.sTitle,s.sDescription,s.sImage FROM ".PREFIX."store AS s LEFT JOIN ".PREFIX."users AS u ON s.sUserID = u.id";
        
$result=$db->query($sSQL);
        
$data=array();
        while(
$rs $result->fetch())
        {
            
$data[]=$rs;
        }
        
$class_tpl->assign('results'$data);
        
$class_tpl->assign('body','custom/dealers.tpl');
        
$class_tpl->display('layout.tpl');

?>
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 07-27-2010, 09:37 AM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
Default

You just need to add the user fields to your query.
Code:
$sSQL = "SELECT s.sID,s.sUserID,s.sTitle,s.sDescription,s.sImage,u.city,u.state,u.phone FROM ".PREFIX."store AS s LEFT JOIN ".PREFIX."users AS u ON s.sUserID = u.id";
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 07-27-2010, 10:10 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

Thank you very much, works like a charm.
I had it in my head that it was not going to be something simple.

Cheers,
Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying User Account requires user to re-enter Email Address nagrap2 Technical Support 2 02-16-2009 11:45 AM
Calling a tpl file from within a tpl file nagrap2 Technical Support 1 01-30-2009 12:46 PM
Location, Location, Location Maffo Site Marketing 0 07-30-2008 10:31 PM


All times are GMT -4. The time now is 05:29 AM.


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