You are not logged in! If you have not registered yet then click here to join the community!

TOLRA Community Forums


Go Back   TOLRA Community Forums > TOLRA Products (PHP Scripts) > Web Directory Script > Directory Script Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 19-05-2007, 08:45 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
Business Address Mod

The attached mod accepts a business address for each listing:

Company Name
Street
City/Town (required)
State/County (required)
Region
Zip/Postal Code
Country (required)

It requires V4 of the directory script.

To install:
  • Create a folder called extensions if it doesn't already exist.
  • Unpack the attached zip file
  • Upload the address folder from the archive to the extensions folder on the server.
  • Create a file called extensioninfo.php with the following:
    <?php
    $extBasePath = dirname(__FILE__) . '/';
    include($extBasePath . 'address/init_address.php');
    ?>
  • Upload extensioninfo.php to the extensions folder on the server.
  • In your browser access extensions/address/addressinst.php
  • Add {$address} to the t!wddetail.html template where the address should be shown.
Note: If the file extensioninfo.php already exists on the server then edit it and add the following line just above ?>:

include($extBasePath . 'address/init_address.php');

Making all fields optional
All fields can be made optional as follows:
  • Edit extensions/address/address.php
  • Replace all instances of City__req_txt_max64 with City__txt_max64
  • Replace all instances of State__req_txt_max64 with State__txt_max64
  • Replace all instances of Country__txt_req with Country__txt
  • Save and upload address.php
Attached Files
File Type: zip address.zip (3.6 KB, 93 views)

Last edited by Paul; 25-09-2007 at 03:00 PM. Reason: Added information on making all fields optional
Reply With Quote
Sponsored Links
  #2  
Old 06-09-2007, 03:44 PM
progressive progressive is offline
Junior Member
 
Join Date: Sep 2007
Posts: 8
Hello,

Is there a way with this mod and the phone/fax mod to only show on the detail if the field is filled out, some places in my directory are restaurants and many others are online shops or just online only companies.

Thanks!
Reply With Quote
  #3  
Old 06-09-2007, 03:49 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
It should only be filling out the template variable {$address} if the listing has an address.

You should be able to put <!--@address--> ... <!--/address--> around any HTML in the template you don't want shown if the address is not present.
Reply With Quote
  #4  
Old 06-09-2007, 11:14 PM
progressive progressive is offline
Junior Member
 
Join Date: Sep 2007
Posts: 8
Wow! Thanks!
Reply With Quote
  #5  
Old 07-08-2008, 08:22 PM
opbook opbook is offline
Junior Member
 
Join Date: Aug 2008
Posts: 13
Is there a way to make it so the countries section does not show up at all on the fill in form? I'm only interested in local TX. i tried just deleting it but caused error messages from MySql.
Reply With Quote
  #6  
Old 07-08-2008, 08:46 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
From function fields_draw($data) delete the form element and from function fields_validate delete:

,
'Country__txt_req'

I think that should be enough to remove it.
Reply With Quote
  #7  
Old 07-08-2008, 10:36 PM
opbook opbook is offline
Junior Member
 
Join Date: Aug 2008
Posts: 13
That emptied the drop down menu - but the word country and the drop down menu still show up
Reply With Quote
  #8  
Old 07-08-2008, 10:56 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
Did you delete all of the following:
Code:
        <tr>
        	<td><label for="Country__txt_req">Country:</label></td>
			<td><select name="Country__txt_req" size="1" tabindex="<?php echo $data['tabindex']++; ?>"><?php
				echo "<option value=\"\">-- Please Select --</option>\n";
				foreach($countries as $code => $name) {
					echo "<option value=\"$code\"";
					if($this->fields['country'] == $code) echo ' selected="selected"';
					echo ">$name</option>\n";
				}
			?></select></td>
		</tr>
Reply With Quote
  #9  
Old 10-08-2008, 09:46 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
I've attached a ZIP file with a version of address.php which doesn't have the country field, you need to upload the original files then overwrite the address.php with the one from the attached.
Attached Files
File Type: zip nocountry.ZIP (1.8 KB, 5 views)
Reply With Quote
  #10  
Old 08-07-2009, 06:36 PM
quokka quokka is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
address lost in DB on update of listing

Hi,
Awesome mod..
Got it working, at least it seemed so.
When making new listing, address gets stored as it should..

But when updating a listing, both from admin as from website, the address information is removed from database.

Version of script: 4.0.4

I got 4 mods running:
1-business address mod
2-phone & fax mod
3-Google Maps API W/Street View
4-listing comment mod

Any help would be highly apppreciated,
Thanks in advance!
Quokka
Reply With Quote
Reply

Bookmarks

Tags
address, business, mod

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:23 AM.