Add fields to the member templates
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 12 Jun 2013 18:13:39 +0000 (18:13 +0000)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 12 Jun 2013 18:13:39 +0000 (18:13 +0000)
Adding the fields to the search result template.
Correction on the detail variable for distance so it now shows.
Output the extra fields and comment out the address part.

Toolkit/Members/ProfilePage.php
Toolkit/Members/SearchList.php
Toolkit/Members/templates/memberDetail.tpl
Toolkit/Members/templates/membersList.tpl

index 75a5a57..5984a21 100644 (file)
@@ -506,9 +506,10 @@ class Toolkit_Members_ProfilePage
             $page->email       = $row['member_contact_email'];
             $page->paypal      = $row['paypal'];
             $page->reviewed    = $row['reviewed'];
-            $page->distance    = $row['discance'];
+            $page->distance    = $row['distance'];
             $page->trailtype   = $row['trailtype'];
             $page->terrain     = $row['terrain'];
+            $page->difficulty  = $row['difficulty'];
             $page->dogs        = $row['dogs'];
             $page->guide       = $row['guide'];
             $page->facilities  = $row['facilities'];
index 70724a5..5c38e45 100644 (file)
@@ -181,131 +181,122 @@ class Toolkit_Members_SearchList extends Toolkit_FlexyDataGridBuilder
         */
        protected function configureColumns()
        {
-               $logo = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Logo',
                        'logo',
                        'logo',
                        null,
                        null,
                        array(&$this, 'logo')
-               );
-               $this->addColumn($logo);
-
-               $name = new Structures_DataGrid_Column(
+               ));
+
+        $this->addColumn(new Structures_DataGrid_Column(
+                       'Reviewed',
+            'reviewed',
+            'reviewed'
+               ));
+
+        $this->addColumn(new Structures_DataGrid_Column(
+                       'Distance',
+            'distance',
+            'distance'
+               ));
+
+        $this->addColumn(new Structures_DataGrid_Column(
+                       'Type',
+            'trailtype',
+            'trailtype'
+               ));
+
+        $this->addColumn(new Structures_DataGrid_Column(
+                       'Terrain',
+            'terrain',
+            'terrain'
+               ));
+
+        $this->addColumn(new Structures_DataGrid_Column(
+                       'Difficulty',
+            'difficulty',
+            'difficulty'
+               ));
+
+        $this->addColumn(new Structures_DataGrid_Column(
+                       'Dogs',
+            'dogs',
+            'dogs'
+               ));
+
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Member Name',
             'member_name',
             'member_name'
-               );
-               $this->addColumn($name);
+               ));
 
-               $memberContactEmail = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Email',
             'member_contact_email',
             'member_contact_email'
-               );
-               $this->addColumn($memberContactEmail);
+               ));
 
-               $drivingDirections = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Address',
             'address',
             'address',
             null,
             null,
             array(&$this, 'drivingDirections')
-               );
-               $this->addColumn($drivingDirections);
+               ));
 
-               $street = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Street',
             'street',
             'street'
-               );
-               $this->addColumn($street);
+               ));
 
-               $city = new Structures_DataGrid_Column(
+               $this->addColumn( new Structures_DataGrid_Column(
                        'City',
             'city',
             'city',
             null,
             null,
             array(&$this, 'city')
-               );
-               $this->addColumn($city);
+               ));
 
-               $state = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'State',
             'state',
             'state'
-               );
-               $this->addColumn($state);
+               ));
 
-               $stateAbbr = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'State Abbr',
             'state_abbr',
             'state_abbr'
-               );
-               $this->addColumn($stateAbbr);
+               ));
 
-               $zip = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Zip',
             'zip',
             'zip'
-               );
-               $this->addColumn($zip);
+               ));
 
-               $phone = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'Phone',
             'phone',
             'phone',
             null,
             null,
             array(&$this, 'phone')
-               );
-               $this->addColumn($phone);
+               ));
 
-               $url = new Structures_DataGrid_Column(
+               $this->addColumn(new Structures_DataGrid_Column(
                        'URL',
             'url',
             'url',
             null,
             null,
             array(&$this, 'url')
-               );
-               $this->addColumn($url);
-
-               $reservationId = new Structures_DataGrid_Column(
-                       'Reservation Id',
-                       'reservation_id',
-            'reservation_id'
-               );
-               $this->addColumn($reservationId);
-
-               $numRooms = new Structures_DataGrid_Column(
-                       'Number of Rooms',
-                       'num_rooms',
-            'num_rooms'
-               );
-               $this->addColumn($numRooms);
-
-               $yearRound = new Structures_DataGrid_Column(
-                       'Year Round',
-                       'year_round',
-            'year_round',
-            null,
-            null,
-            array(&$this, 'yearRound')
-               );
-               $this->addColumn($yearRound);
-
-               $hasHotelInfo = new Structures_DataGrid_Column(
-                       null,
-            'has_hotel_info',
-                       'has_hotel_info',
-            null,
-            null,
-            array(&$this, 'hasHotelInfo')
-               );
-        $this->addColumn($hasHotelInfo);
+               ));
 
         if (defined("MEMBER_SESSION_LIST") && MEMBER_SESSION_LIST) {
             $this->addColumn(
@@ -331,32 +322,29 @@ class Toolkit_Members_SearchList extends Toolkit_FlexyDataGridBuilder
             )
         );
 
-        $member_id = new Structures_DataGrid_Column(
+        $this->addColumn(new Structures_DataGrid_Column(
                        'member_id',
             'member_id',
             'member_id'
-               );
-        $this->addColumn($member_id);
+               ));
 
-               $website = new Structures_DataGrid_Column(
+        $this->addColumn(new Structures_DataGrid_Column(
                        'Website',
                        'website',
                        'website',
                        null,
                        null,
                        array(&$this, 'website')
-               );
-        $this->addColumn($website);
+               ));
 
-               $mapIcon = new Structures_DataGrid_Column(
+        $this->addColumn(new Structures_DataGrid_Column(
                        'map_icon',
                        'map_icon',
                        'map_icon',
                        null,
                        null,
                        array(&$this, 'mapIcon')
-               );
-        $this->addColumn($mapIcon);
+               ));
 
     }
 
index fa1b034..89ec2c1 100644 (file)
@@ -37,7 +37,7 @@
                                <div flexy:if="terrain"><b>Terrain:</b> {terrain:h}</div>
                                <div flexy:if="dogs"><b>Dogs:</b> {dogs:h}</div>
                                <div flexy:if="difficulty"><b>Difficulty:</b> {difficulty:h}</div>
-                               <div flexy:if="paypal">{paypal:h}</div>
+
                        </div>
                        <div flexy:if="phone" class="tel">
                                <span class="type">Phone</span>:
@@ -65,7 +65,9 @@
                                        </form>
                                </div><!--/.customDialog -->
                        </div><!-- /#google-div -->
+
                </div><!-- /.vcard -->
+        <div flexy:if="paypal"><a href="{paypal:h}">Buy Map</a></div>
                {if:addToLink}
                <a id="add-{member_id}" class="list-add-link" rel="{member_id}" flexy:if="plink" href="{plink:h}">
                        Add to Trip Planner
index 256274e..a1f40a7 100644 (file)
        <div class="memberSR">
 
 
-{if:row[logo]}
+        {if:row[logo]}
                <img class="search-result-img" alt="{row[logo]}" src="{row[logo]}">
-{end:}
-{if:row[addToLink]}
+        {end:}
+        {if:row[addToLink]}
                <a id="add-{row[member_id]}" class="list-add-link" rel="{row[member_id]}" flexy:if="row[plink]" title="Add to Your Travel List" href="{row[plink]:h}">
                        Add To Trip Planner
                        <!--<img alt="Add to Your Travel List" src="baseurl/assets/addto.gif">-->
                </a>
-{else:}
+        {else:}
                <a class="list-view-link" flexy:if="row[plink]" title="View Your Travel List" href="{row[plink]:h}">
                        View Trip Planner
                        <!--<img alt="View Your Travel List" src="baseurl/assets/viewTravelPlanner.gif">-->
                </a>
-{end:}
+        {end:}
        </div><!-- /.memberSR -->
                <h2 class="fn org"><a title="More Info" href="{row[url]:h}">{row[member_name]:h}</a></h2>
                <div class="search-result-item-info">
         </div>
     {end:}
                        <div class="search-result-location adr">
+                <div flexy:if="row[distance]">Distance: {row[distance]}</div>
+                <div flexy:if="row[trailtype]">Trail Type: {row[trailtype]}</div>
+                <div flexy:if="row[terrain]">Terrain: {row[terrain]}</div>
+                <div flexy:if="row[difficulty]">Difficulty: {row[difficulty]}</div>
+                <div flexy:if="row[dogs]">Dogs Allowed: {row[dogs]}</div>
+                <!--
                                <div class="street-address">{row[street]:h}</div>
                                <span class="locality" flexy:if="city">{row[city]:h},</span>
                                <span class="region" title="{row[state]:h}">{row[state_abbr]:h}</span>
                                <span class="postal-code">{row[zip]:h}</span>
+                -->
                                <div flexy:if="row[phone]" class="search-result-phones">
                                        <div class="tel">Phone: {row[phone]:h}</div>
                                </div>
                                        </div>
                                </div>
                        </div>
-
-
-
-
-                       <div flexy:if="row[has_hotel_info]" class="member-hotel-result">
-                               <a flexy:if="row[reservation_id]"
-                                       href="{base_url:h}index.php?catid=50&set_property={row[reservation_id]:h}">
-                                       <img alt="Online Reservations"
-                                               src="baseurl/assets/buttons/reservations.gif">
-                               </a>
-                               {if:row[num_rooms]}
-                                       Number of Rooms: {row[num_rooms]:h}
-                               {end:}
-                               <br>
-                               Open Year Round: {row[year_round]:h}
-                       </div>
                </div>
        </div>