
carlosdiaz
New User
Aug 30, 2009, 11:12 PM
Post #3 of 4
(6344 views)
Shortcut
|
|
Re: [chris] how to publish 2 listings in 1 page? (homepages & listings in one single page)
[In reply to]
|
Can't Post
|
|
hi, this is the code <?php /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */ require_once "init.php"; list($listingRecords, $listingDetails) = getRecords(array( 'tableName' => 'listings', 'joinTable' => 'homepages', 'perPage' => '10', )); ?> <?php include "include_header.php"; ?> <style type="text/css"> <!-- .box { font-size: 10px; } --> </style> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } --> </style> <div class="subheader"> <table width="760" height="183" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="529" rowspan="2" align="left" valign="top"><div class="subheader"><font color="#FFFFFF">Ver Listado de Antros</font></div> <br/> <!-- show listings --> <table width="96%" border="0" cellpadding="4" cellspacing="0"> <?php foreach ($listingRecords as $listing): ?> <tr> <td width="115" rowspan="2" align="center" valign="top"> <?php foreach ($listing['uploads'] as $upload): ?> <?php if ($upload['hasThumbnail']): ?> <a href="<?php echo $listing['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="0" alt="" /></a><br/> <?php break /* only show one image */ ?> <?php endif; ?> <?php endforeach ?> <?php if (!$listing['uploads']): /* if no uploads show this: */ ?> <table border="0" cellspacing="0" cellpadding="0" width="150" height="100"> <tr> <td bgcolor="#EEEEEE" align="center"><b>Photo<br/> Not<br/> Available</b></td> </tr> </table> <?php endif; ?> </td> <td valign="top" background="../images/boxtitulojpg.jpg"><a href="<?php echo $listing['_link'] ?>" class="title"><font color="#FF3300"><?php echo $listing['product'] ?></font></a> <font color="#FF3300">.</font><font color="#FFFFFF"><br> </font></td> </tr> <tr> <td width="300" valign="top"><font color="#FFFFFF"><br> Zona: <?php echo $listing['zona']; ?><br/> Tipo: <?php echo $listing['tipo']; ?><br/> Genero: <?php echo $listing['genero']; ?><br/> </font> <p> <font color="#FFFFFF"><?php echo $listing['summary']; ?></font></p></td> </tr> <?php endforeach ?> </table> <font color="#FFFFFF"> <!-- /show listings --> <!-- show errors --> <?php if ($listingDetails['invalidPageNum']): ?> Results page '<?php echo $listingDetails['page']?>' not found, <a href="<?php echo $listingDetails['firstPageLink'] ?>">start over >></a>.<br/> <br/> <?php elseif (!$listingRecords): ?> No listings were found!<br/> <br/> <?php endif ?> <!-- /show errors --> <!-- show prev/next page links --> </font> <div align="center"><font color="#FFFFFF"><br/> <?php if ($listingDetails['prevPage']): ?> <a href="<?php echo $listingDetails['prevPageLink'] ?>"><< prev</a> <?php else: ?> << prev <?php endif ?> - page <?php echo $listingDetails['page'] ?> of <?php echo $listingDetails['totalPages'] ?> - <?php if ($listingDetails['nextPage']): ?> <a href="<?php echo $listingDetails['nextPageLink'] ?>">next >></a> </font> <?php else: ?> .next <font color="#FFFFFF">>> <?php endif ?> </font></div> <font color="#FFFFFF"> <!-- /show prev/next page links --> </font></td> <td colspan="4" align="center" valign="top" bgcolor="#111111"><p> </p> <p><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Buscar Antros</font> <br> </p> <form method="post" action="listings.php"> <div align="left"> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="30"><font color="#CCCCCC"> Nombre </font></td> <td> <font color="#CCCCCC"> <input name="product" type="text" class="box" size="20"> </font></td> </tr> <tr> <td height="30"><font color="#CCCCCC"> Zona </font></td> <td> <font color="#CCCCCC"> <select name="zona" class="box"> <option value=""><selecciona></option> <option value="">Any</option> <option>Benito Juarez</option> <option>Coyoacan</option> <option>Cuauthemoc</option> <option>Miguel Hidalgo</option> </select> </font></td> </tr> <tr> <td height="30"><font color="#CCCCCC"> Tipo</font></td> <td> <font color="#CCCCCC"> <select name="tipo" class="box"> <option value=""><select></option> <option value="">Any</option> <option>Antro</option> <option>Cantina</option> <option>Bar</option> <option>Club</option> </select> </font></td> </tr> <tr> <td height="30"><font color="#CCCCCC"> Genero</font></td> <td> <font color="#CCCCCC"> <select name="genero" class="box"> <option value="">Cualquiera</option> <option>Rock</option> <option>Pop</option> <option>Electronico</option> <option>Gay</option> <option>Hip Hop</option> <option>80s & 90s</option> </select> </font></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td><font color="#CCCCCC"> Near School </font></td> <td><font color="#CCCCCC"> <input type="checkbox" name="near_school" value="1" /> </font></td> </tr> <tr> <td><font color="#CCCCCC"> Near Transit </font></td> <td><font color="#CCCCCC"> <input type="checkbox" name="near_transit" value="1" /> </font></td> </tr> </table> <font color="#CCCCCC"><br/> </font> </div> <div align="center"> <font color="#CCCCCC"> <input type="submit" name="search" value=" Buscar Antros"/> </font></div> </form></td> </tr> <tr> <td width="203" colspan="4" align="center" valign="top" bgcolor="#111111"> <p align="left"> </p> <h1><font color="#FFFFFF">Homepages - List Page Viewer</font></h1> <font color="#FFFFFF"> <?php foreach ($homepagesRecords as $record): ?> Record Number: <?php echo $record['num'] ?><br/> Full Name: <?php echo $record['fullname'] ?><br/> Specialty: <?php echo $record['specialty'] ?><br/> Phone: <?php echo $record['phone'] ?><br/> Email: <?php echo $record['email'] ?><br/> Background: <?php echo $record['background'] ?><br/> Qualifications: <?php echo $record['qualifications'] ?><br/> _link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/> <!-- STEP 2a: Display Uploads for field 'uploads' (Paste this anywhere inside STEP2 to display uploads) --> <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 --> <?php foreach ($record['uploads'] as $upload): ?> <?php if ($upload['hasThumbnail']): ?> <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/> <?php elseif ($upload['isImage']): ?> <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/> <?php else: ?> <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/> <?php endif ?> <?php endforeach ?> <!-- STEP2a: /Display Uploads --> </font> <hr/> <font color="#FFFFFF"> <?php endforeach; ?> <?php if (!$homepagesRecords): ?> No records were found!<br/> <br/> <?php endif ?> <!-- /STEP2: Display Records --> </font> <p align="left"> </p> </td> </tr> <tr> <td colspan="5" align="left" valign="top"><div align="center"><font color="#FFFFFF"> <?php include "include_footer.php"; ?> </font></div></td> </tr> </table> <div align="center"><font color="#FFFFFF"> </font></div> </div>
|