<?php $only_phones = isset($_REQUEST['phones']); $addr_per_line = $only_phones ? 4 : 3; while ($r = mysql_fetch_array($result)) { $r = trimAll($r); $address = new Address($r); if ($address->hasPhone() || !$only_phones) { if ($cnt % (2 * $addr_per_line) == 0) { echo "<tr class='odd'>"; } if ($cnt % (2 * $addr_per_line) == $addr_per_line) { echo "<tr class='even'>"; } echo "<td valign='top'>"; showOneEntry($r, $only_phones); echo "</td>"; $cnt++; if ($cnt % $addr_per_line == 0) { echo "</tr>"; } } } while ($cnt % $addr_per_line != 0) { echo "<td>.</td>"; $cnt++; } ?> </tr></table> <?php
$list_recid = array(); $query = "SELECT TITLE, url, RECIPE.ID as recid, photos.id as photoid FROM photos,RECIPE where photos.recipeid=RECIPE.ID"; $resultID = mysql_query($query, $linkID) or die("Data not found."); for ($x = 0; $x < mysql_num_rows($resultID); $x++) { $row = mysql_fetch_assoc($resultID); array_push($list_url, $row['url']); array_push($list_title, $row['TITLE']); array_push($list_photoid, $row['photoid']); array_push($list_recid, $row['recid']); } foreach ($jpgs as $jpeg) { if (in_array($jpeg, $list_url)) { $index = array_search($jpeg, $list_url); showOneEntry($list_url[$index], $list_title[$index], $list_recid[$index], $names, $recids, $list_photoid[$index]); } else { showOneEntry($jpeg, NULL, NULL, $names, $recids, NULL); } } /* for */ ?> </div> <?php printFooter(); ?> </div> </div> </body> </html>