Support Forums

How to display First Name, Last Name and Phone fields in showlisting2?

This is a discussion on How to display First Name, Last Name and Phone fields in showlisting2? within the Technical Support forums, part of the Technical Support Forums category; What version of 68 Classifieds are you running? V4.1.6 Developer What template are you using? default Please describe in detail ...


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

Reply
 
Thread Tools Display Modes
Old 01-07-2010, 10:08 AM   #1
Customer
 
Join Date: Dec 2009
Posts: 38
Rep Power: 4
user2616 has a spectacular aura about
Default How to display First Name, Last Name and Phone fields in showlisting2?

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

What template are you using?
default

Please describe in detail the issue you are having:
In Search Result Page (showlisting2.tpl), for each record, I would like to display First Name, Last Name and Phone fields.

Please help.

Thank you.
__________________
user2616
v4.1.9 Developer - Default Template (custom)
user2616 is offline   Reply With Quote
Old 01-07-2010, 10:44 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,716
Rep Power: 66
seymourjames is a jewel in the rough
Default

It seems to me that what you are actually trying to do is embed the viewlisting template into the showlisting one. Why not as you have developer, try to move the appropriate contents of viewlisting.php file into the searchresults.php one for example and then copy the appropriate bits of the viewlisting.tpl file in the showlisting.tpl file. It might be quicker than trying to do it in bits and pieces and wondering why some variables are available and others are not.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline   Reply With Quote
Old 01-07-2010, 10:53 AM   #3
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,470
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I would also recommend like lhotch suggested in the other thread and use the debug console. All of these are available for use on that page in the entry loop.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 01-11-2010, 03:53 PM   #4
Customer
 
Join Date: Dec 2009
Posts: 38
Rep Power: 4
user2616 has a spectacular aura about
Default

Thank you all for your reply.

I tried debug console for showlistings2. But, I cannot see the fields First Name, Last Name and Phone under {$results}. Following are the fields displayed under {$results}:

Array (2)
0 => Array (27)
id => "18"
owner => "2"
title => "3+1 Blk 201B Punggol Rent Rent Rent R..."
featured => "N"
section => "2"
shortDescription => ""
description => "Rent Rent Rent Rent Rent Rent Rent Re..."
price => "0.00"
dateadded => "2010-01-09 11:42:07"
expiration => "2010-02-08 11:42:19"
display => "Y"
pHighlighted => "N"
pBold => "N"
hitcount => "16"
url => ""
username => "MrAgent"
state => ""
city => ""
country => ""
extra => "Mr Agent"
extra2 => "11111111"
extra3 => "Agency One"
status => "Y"
image => false
class => ""
link => "viewlisting.php?view=18"
custom => ""

I really wish that the system can include the fields First Name, Last Name and Phone under {$results}.

As seymourjames rightly mentioned that I am actually trying to do is embed the viewlisting template into the showlisting one, in fact I am merging 3 templates search form, showlisting2 and viewlisting into one page. Because my requirement is to provide just one single page for the visitors to search and see the results for various categories and extra fields combination all in just one single page. I am quite excited that I almost achieved my requirement.

As seymourjames suggested to move the appropriate contents of viewlisting.php file into the searchresults.php, I managed to include the following codes in searchresults.php:

$Users= Library::loadLibrary('Users');
$allusersoptions = '';
$alluserspageNum = 1;
$alluserslist=$Users->getAllUsers($allusersoptions, $alluserspageNum, TRUE);
$class_tpl->assign('getallusers', $alluserslist["list"]);

Then I could see the fields First Name, Last Name and Phone displayed under {$getallusers} in debug console for showlistings2:

2 => Array (14)
id => "2"
firstname => "Agent"
lastname => "One"
address => ""
city => ""
state => ""
zip => ""
country => ""
email => "[email protected]"
phone => "11111111"
username => "MrAgent"
joindate => "2009-12-29"
custip => "203.92.105.2"
level => "2"

Now I am able to display the fields First Name, Last Name and Phone in showlistings2 page.

By the way, I purchased 68 Classifieds Developer V4.1.6 just few days ago after Blair suggested that I can buy and evaluate the 68 Classifieds, and if I do not want the software then I can claim 100% refund with no questions asked. Even though I purchased the software with the only intention to evaluate, now I appreciate myself that I really made a wise decision to purchase the software (evaluation). After trying the software hands on, I realized that this software can very well match my expectation.

As a newbie, while I am trying to understand the basics, I realized that 68 Classifieds released V4.1.7 and V4.1.8 also. Looks like 68 Classifieds release new versions very fast.

I already upgraded my system to V4.1.8 and the upgrading process was just breeze, absolutely no problem.

This experience tells me that it is not a good idea to change the core files such as php files. In my case, so far I changed only searchresults.php (added 6 lines at the end). Copied default template folder to custom and changed few template files and CSS file. After upgrading from V4.1.6 to V4.1.8, changed searchresults.php to include my custom code. But, I did not change any files under custom template folder. I hope that I have done the right thing. I really appreciate any comments from the experts in the forum.
__________________
user2616
v4.1.9 Developer - Default Template (custom)
user2616 is offline   Reply With Quote
Old 01-11-2010, 06:07 PM   #5
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,716
Rep Power: 66
seymourjames is a jewel in the rough
Default

Good you were able to prove your need was possible to do.

In general you should always keep a clean copy of your default template. If you do modify core php files then document your changes as well. A better way in general if you require core functionality changes is to create plugins and modules. Upgrade is then usually simpler still.

Finally, the v4.1.8 was issued because 4.1.7 had a critical bug in it and this was efficiently dealt with by 68C in the same day..
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline   Reply With Quote
Old 01-11-2010, 08:00 PM   #6
Customer
 
Join Date: Dec 2009
Posts: 38
Rep Power: 4
user2616 has a spectacular aura about
Default

seymourjames, Thank you for your advice.

I very much like the plugin concept.

For example, I use the plugin get_extra_field2 and is very easy to use.

I do not know how to write plugin.

I am not sure if any user has written a plugin to get the value of First Name, Last Name and Phone. If I can use a plugin to get the value of First Name, Last Name and Phone, it will be really nice. And I do not have to add code into searchresults.php.

Also, I wish to have a plugin to get Category Names.

If 68C can provide these plugins, that will be very nice.

Before I realize that V4.1.7 was released, I notice that V4.1.8 was out.

By the way, how do I know when a new version is released?
__________________
user2616
v4.1.9 Developer - Default Template (custom)
user2616 is offline   Reply With Quote
Old 01-11-2010, 08:15 PM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,716
Rep Power: 66
seymourjames is a jewel in the rough
Default

Do upgrade to 4.1.8 because 4.1.7 had a critical bug in it. 68C efficiently made a release correcting this bug within hours.

Eric announces new releases on the forum but you can also see them in your 68C customer account.

A plugin to get all of the main category names already exists in the plugins folder. Otherwise, again if you wish to pull a specific category it needs to be available to that template.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline   Reply With Quote
Old 01-11-2010, 10:34 PM   #8
Customer
 
Join Date: Dec 2009
Posts: 38
Rep Power: 4
user2616 has a spectacular aura about
Default

I upgraded from V4.1.6 to V4.1.8.

It is good that I skip the buggy version.

In my design, I included search.tpl into showlistings2.tpl.
But, I found that search form needs Category list that is suppose to come from search.php.
Since searchresult.php is calling showlistings2.tpl that includes search.tpl, I included the following line in searchresult.php:
$class_tpl->assign('getcats', $Categories->getCatTree('', 0));
Then, the search form in showlistings2.tpl is able to fill the search form.

For now, I solved the problem.

In summary, I included the following lines in searchresult.php:
$class_tpl->assign('getcats', $Categories->getCatTree('', 0));
$Users= Library::loadLibrary('Users');
$allusersoptions = '';
$alluserspageNum = 1;
$alluserslist=$Users->getAllUsers($allusersoptions, $alluserspageNum, TRUE);
$class_tpl->assign('getallusers', $alluserslist["list"]);

So far searchresult.php is the only php file I touched.

Now, I almost achieved my design and the page search+result works fine.
__________________
user2616
v4.1.9 Developer - Default Template (custom)
user2616 is offline   Reply With Quote
Old 01-12-2010, 06:12 AM   #9
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,716
Rep Power: 66
seymourjames is a jewel in the rough
Default

I wrote to you sometime ago to say I have a module for putting advanced search on any page. Its one line of code. We discontinued it for simplicity but in hindsight we may decide to reinstate it. We used it to present advanced search on any search results page which came up empty.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline   Reply With Quote
Old 01-12-2010, 05:12 PM   #10
Customer
 
Join Date: Dec 2009
Posts: 38
Rep Power: 4
user2616 has a spectacular aura about
Default

Thank you all for your valuable advice.

Currently extra, extra2 and extra3 fields are available under {$results} in showlistings2.tpl

For now, in order to work within the existing facility in the core software, I decided to make use of the 3 extra fields in the user registration fields:

extra = User Full Name
extra2 = Phone
extra3 = Company Name

Though, it looks bit strange to use extra fields while the actual field names are available in the database.

Now, I removed the following lines from searchresult.php:

$Users= Library::loadLibrary('Users');
$allusersoptions = '';
$alluserspageNum = 1;
$alluserslist=$Users->getAllUsers($allusersoptions, $alluserspageNum, TRUE);
$class_tpl->assign('getallusers', $alluserslist["list"]);

Now, I have only the following line hardcoded in searchresult.php:

$class_tpl->assign('getcats', $Categories->getCatTree('', 0));

The above line makes the category id, name available in showlistings2.tpl
__________________
user2616
v4.1.9 Developer - Default Template (custom)
user2616 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Featured Display Fields nagrap2 Technical Support 2 09-10-2008 01:37 PM
Display listing ID number and other fields crystal Technical Support 6 06-18-2008 07:10 AM
Searchable Fields Will Not Display megapix Technical Support 2 03-10-2008 08:40 AM
Display extra fields on showlistings.tpl cwp Technical Support 9 03-03-2008 08:52 AM
Display extra fields by themselves? cwp Technical Support 3 02-22-2008 03:34 AM


All times are GMT -4. The time now is 08:19 AM.


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