Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

More than 5 featured properties

The code below is for featuring a properties from the database. How can I add more than 5 so that the user can scroll through them?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{$meta_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset={$meta_encoding}">
<meta name="keywords" content="{$meta_keyword}">
<meta name="description" content="{$meta_description}">
 
 
{$javascript_rightclick}
<script language="javascript" type="text/javascript" src="javascript.js"></script>
<link href="class.css" type="text/css" rel="stylesheet">
</head>
 
<body>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<!-- global_top.html -->
{include file="global_top.html"} 
<!-- global_top.html -->
 
<tr>
	<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>	
	<td valign="top">
	
		<!-- global_left.html -->
		{include file="global_left.html"} 
		<!-- global_left.html -->
	
	</td>
	<td width="5"><img src="images/spacer.gif" border="0" width="5" height="1"></td>	
	<td valign="top">
	
		<!-- center for content -->
		<table cellpadding="0" cellspacing="0" border="0" align="center">
		<tr>
			<td><img src="images/center_left_top.gif" width="10" height="6"></td>
			<td background="images/center_hor_top.gif"><img src="images/spacer.gif" width="1" height="1"></td>
			<td><img src="images/center_right_top.gif" width="10" height="6"></td>
		</tr>
		<tr>
			<td width="10" background="images/center_ver_left.gif"><img src="images/spacer.gif" width="1" height="1"></td>
			<td width="560" height="650" valign="top" style="padding-left:5px; padding-right:5px; padding-top:20px; padding-bottom:20px">
			
			
				<table width="560" cellpadding="0" cellspacing="0" class="normal_12_black" border="0">
				<tr>
					<td><img src="site_title_header.php?title=Welcome to Israel-Investments.com"></td>
				</tr>
				<tr>
					<td height="20"><img src="images/spacer.gif" width="1" height="1"></td>
				</tr>
				<tr>
					<td>
						.
					</td>
				</tr>
				<!-- some highlights here -->
				<tr>
					<td height="30"><img src="images/spacer.gif" width="1" height="1"></td>
				</tr>
				<tr>
					<td height="28" background="images/bg_tab.gif" style="background-repeat:no-repeat; padding-left:28px; padding-top:5px" class="normal_12_blue_verdana" valign="top">
						<strong>See Featured Properties Here ...</strong>
					</td>
				</tr>
				<!-- some highlights here -->
				
				
				<tr>
					<td height="30"><img src="images/spacer.gif" width="1" height="1"></td>
				</tr>
				<tr>
					<td>
 
 
						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="normal_12_black">
						{if $found == 0}
						<tr>
							<td width="28"><img src="images/spacer.gif" width="28" height="1"></td>
							<td height="10" colspan="3" class="normal_12_red">There is no search results found ...</td>
						</tr>
						{/if}
						{section name=var loop=$listing_id}
						<tr>
							<td height="10" colspan="3"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						<tr>
							<td width="28"><img src="images/spacer.gif" width="28" height="1"></td>
							<td width="120">
 
								<table bgcolor="#FFFFFF" border="0" cellpadding="2" cellspacing="0" style="border:0px solid #A3CAF1" class="list_picture_status">
								<tr>
									<td width="100" height="100" align="center" valign="middle"><a href="{$listing_url[var]}"><img src="photo_view_small.php?photo={$listing_photo_main[var]}" border="0"></a></td>
								</tr>
								</table>
 
							</td>
							<td width="470" valign="bottom" style="padding-left:10px;padding-right:20px;">
							
								<table border="0" cellpadding="2" cellspacing="0" class="normal_12_black">
								<tr>
									<td><a href="{$listing_url[var]}" class="normal_12_blue_verdana"><strong>{$listing_title[var]}</strong></a></td>
								</tr>
								<tr>
									<td>
										<table border="0" cellpadding="0" cellspacing="0" class="normal_12_black">
										<tr>
											<td width="320" style="padding-right:10px">
											
												{$listing_address[var]}<br>
												{$listing_city[var]}, {$listing_state[var]} {$listing_zip[var]}<br>
												{$listing_country[var]}
 
												<table border="0" cellpadding="1" cellspacing="0" class="normal_12_black">
												<tr>
													<td width="40"><strong>Price</strong></td>
													<td width="10"><strong> : </strong></td>
													<td width="150" nowrap><font class="normal_12_red"><strong>{$listing_price[var]}</strong></font></td>
												</tr>
												</table>
												
											</td>
											<td width="200">
											
												<table border="0" cellpadding="1" cellspacing="0" class="normal_12_black">
												<tr>
													<td width="60" valign="top"><strong>Type</strong></td>
													<td width="10" valign="top"><strong> : </strong></td>
													<td width="100" valign="top" nowrap><font class="normal_12_red"><strong>{$listing_type[var]}</strong></font></td>
												</tr>
												{if $listing_bedrooms[var]}
												<tr>
													<td><strong>Beds</strong></td>
													<td><strong> : </strong></td>
													<td><font class="normal_12_red"><strong>{$listing_bedrooms[var]}</strong></font></td>
												</tr>
												{/if}
												{if $listing_bathrooms[var]}
												<tr>
													<td><strong>Baths</strong></td>
													<td><strong> : </strong></td>
													<td><font class="normal_12_red"><strong>{$listing_bathrooms[var]}</strong></font></td>
												</tr>
												{/if}
												{if $listing_show_distance == "yes"}
												<tr>
													<td><strong>Distance</strong></td>
													<td><strong> : </strong></td>
													<td><font class="normal_12_red"><strong>{$listing_distance[var]} miles</strong></font></td>
												</tr>
												{/if}
												</table>
												
											
											</td>
										</tr>
										</table>
										
									</td>
								</tr>
								<tr>
									<td>
										<a href="{$listing_url[var]}" class="normal_11_red"><img src="images/btn_details.gif" hspace="5" vspace="0" border="0" align="left"></a>
									</td>
								</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td height="15" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						{if $listing_position[var] < $found}
						<tr>
							<td bgcolor="#A3CAF1" height="1" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						{/if}
						{/section}
 
						<!-- paging -->
						{if $navigation_page_total > 1}
						<tr>
							<td height="2" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#D0E5F9">
							{include file="global_paging.html"} 
							</td>
						</tr>
						{/if}
						<!-- paging -->
 
						<tr>
							<td height="20" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						</table>
						
					</td>
				</tr>
				</table>
 
				
			</td>
			<td width="10" background="images/center_ver_right.gif"><img src="images/spacer.gif" width="1" height="1"></td>
		</tr>
		<tr>
			<td><img src="images/center_left_bottom.gif" width="10" height="6"></td>
			<td background="images/center_hor_bottom.gif"><img src="images/spacer.gif" width="1" height="1"></td>
			<td><img src="images/center_right_bottom.gif" width="10" height="6"></td>
		</tr>
		</table>
		<!-- center for content -->
	
	</td>
	<td width="5"><img src="images/spacer.gif" border="0" width="5" height="1"></td>	
	<td valign="top">
	
		<!-- global_right.html -->
		{include file="global_right.html"} 
		<!-- global_right.html -->
	
	</td>
	<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>	
</tr>
 
<!-- global_bottom.html -->
{include file="global_bottom.html"} 
<!-- global_bottom.html -->
</table>
 
</body>
</html>

Open in new window

0
Starquest321
Asked:
Starquest321
  • 3
  • 2
1 Solution
 
MMDeveloperCommented:
well that's just the smarty template that loops over PHP arrays, you'll need to edit whatever raw PHP script(s) retrieve the data.
0
 
Starquest321Author Commented:
Can you point me to the file I need to post so I can move further?
0
 
Starquest321Author Commented:
Could this be the page I need to edit?
<?
 
	
 
	
	$section = "home";
	include("setting.php");
 
	$db_connect = mysql_connect($db_host, $db_username, $db_password);
	mysql_select_db($db_name, $db_connect) || die(mysql_error());
 
 
 
	// run the search system ...
	include("system_site_search.php");
 
 
	// calculate the total first ...
    $sql_query	= "SELECT * FROM listing, tmp_search_result WHERE result_listing = listing_id AND result_search = '$search_id'";
	$result		= mysql_query($sql_query) or die(mysql_error());
	$found      = mysql_num_rows($result);	
	
 
 
    // show the pages ...
    if (!$item) { $item = 0; }
	
	
	
	$sql_tables	= "listing, tmp_search_result, setup_type";
	if ($setup['enable_beds'] 		== "Y"	) { $sql_tables .= ", setup_bedroom"; 	}
	if ($setup['enable_baths'] 		== "Y"	) { $sql_tables .= ", setup_bathroom"; 	}
	if ($setup['enable_country'] 	== "Y"	) { $sql_tables .= ", setup_country"; 	}
	
	$sql_where	= "";
	$sql_where .= " result_listing 		=   listing_id	";
	$sql_where .= " AND result_search 	=  '$search_id'	";
	$sql_where .= " AND listing_type 	=   type_id		";
 
	if ($setup['enable_beds'] 		== "Y"	) { $sql_where .= " AND listing_bedrooms 	=  bedroom_id	"; }
	if ($setup['enable_baths'] 		== "Y"	) { $sql_where .= " AND listing_bathrooms 	=  bathroom_id	"; }
	if ($setup['enable_country'] 	== "Y"	) { $sql_where .= " AND listing_country 	=  country_id	"; }
 
	$sql_order	= "";
	if ($search_order	== "type"			) { $sql_order = "type_name"; 		}
	if ($search_order	== "price"			) { $sql_order = "listing_price"; 	}
	if ($search_order	== "beds"			) { $sql_order = "bedroom_order"; 	}
	if ($search_order	== "baths"			) { $sql_order = "bathroom_order"; 	}
	if ($search_order	== "city"			) { $sql_order = "listing_city"; 	}
	if ($search_order	== "state"			) { $sql_order = "listing_state"; 	}
	if ($search_order	== "zip"			) { $sql_order = "listing_zip"; 	}
	if ($search_order	== "distance"		) { $sql_order = "result_distance"; }
	if ($search_order	== "country"		) { $sql_order = "country_name"; 	}
	$sql_order	= "$sql_order $search_ordermethod";
 
 
	$i			= 0;
    $sql_query	= "SELECT * FROM $sql_tables WHERE $sql_where ORDER BY $sql_order LIMIT $item, $front_search_rows";
	$result		= mysql_query($sql_query) or die(mysql_error());
	while($row	= mysql_fetch_array($result))	{
 
		$listing_id						= $row[listing_id];
		$listing_number					= $listing_id + $start_listing;
		$listing_member					= $row[listing_member];
		$listing_package				= $row[listing_package];
		$listing_type					= $row[type_name];
		$listing_mls					= $row[listing_mls];
		$listing_title					= $row[listing_title];
		$listing_availability			= $row[listing_availability];
		$listing_purpose				= $row[listing_purpose];
		$listing_price					= $row[listing_price];
		$listing_price					= "$currency_symbol" . number_format($listing_price, 0, $web_decimal_separator, $web_thousand_separator);
		
		$listing_rent					= $row[listing_rent];
		$listing_address				= $row[listing_address];
		$listing_address2				= $row[listing_address2];
		$listing_suburb					= $row[listing_suburb];
		$listing_city					= $row[listing_city];
		$listing_state					= $row[listing_state];
		$listing_zip					= $row[listing_zip];
		$listing_distance				= $row[result_distance];
		$listing_country				= $row[country_name];
		$listing_bedrooms				= $row[bedroom_name];
		$listing_bathrooms				= $row[bathroom_name];
		$listing_story					= $row[listing_story];
		$listing_rooms					= $row[listing_rooms];
		$listing_garage					= $row[listing_garage];
		$listing_buildingstyle			= $row[listing_buildingstyle];
		$listing_lotsize				= $row[listing_lotsize];
		$listing_squarefeet				= $row[listing_squarefeet];
		$listing_yearbuilt				= $row[listing_yearbuilt];
		$listing_exterior				= $row[listing_exterior];
		$listing_interior				= $row[listing_interior];
 
 
		$sql_query						= "SELECT * FROM setup_renttype WHERE renttype_id = '$listing_rent'";
		$result_rent					= mysql_query($sql_query) or die(mysql_error());
		$row_rent						= mysql_fetch_array($result_rent);
		$listing_rent					= $row_rent[renttype_name];
 
		if (!$listing_title				) { $listing_title 		= $listing_address; 							}
		if ($listing_address2			) { $listing_address	= "$listing_address<br>$listing_address2";		}
		if ($listing_purpose == "rent"	) { $listing_price 		= "$listing_price $listing_rent"; 				}
 
		$listing_title_rewrite			= convert_rewrite($listing_title);
		$listing_url					= "site_detail.php?listing=$listing_number";
		if ($status_url_rewrite == "yes") { $listing_url		= "detail-$listing_number-$listing_title_rewrite.php";	}
		
		$sql_query						= "SELECT * FROM listing_photo WHERE photo_listing = '$listing_id' AND photo_status_main = 'yes' AND photo_status = 'approved'";
		$main_result					= mysql_query($sql_query) or die(mysql_error());
		$main_row						= mysql_fetch_array($main_result);
		$listing_photo_main				= $main_row[photo_id];
 
		
		$arr_listing_id[$i]				= $listing_id;
		$arr_listing_type[$i]			= $listing_type;
		$arr_listing_mls[$i]			= $listing_mls;
		$arr_listing_title[$i]			= $listing_title;
		$arr_listing_availability[$i]	= $listing_availability;
		$arr_listing_purpose[$i]		= $listing_purpose;
		$arr_listing_price[$i]			= $listing_price;
		$arr_listing_rent[$i]			= $listing_rent;
		$arr_listing_address[$i]		= $listing_address;
		$arr_listing_address2[$i]		= $listing_address2;
		$arr_listing_suburb[$i]			= $listing_suburb;
		$arr_listing_city[$i]			= $listing_city;
		$arr_listing_state[$i]			= $listing_state;
		$arr_listing_zip[$i]			= $listing_zip;
		$arr_listing_distance[$i]		= $listing_distance;
		$arr_listing_country[$i]		= $listing_country;
 
		$arr_listing_bedrooms[$i]		= $listing_bedrooms;
		$arr_listing_bathrooms[$i]		= $listing_bathrooms;
		$arr_listing_url[$i]			= $listing_url;
		$arr_listing_photo_main[$i]		= $listing_photo_main;
		$i++;
		
	
	}
	mysql_close($db_connect);
 
 
 
 
	// calculate total pages
    $nav_url 	= "site_search.php?$search_detail&page=[page]&item=[item]";
	$max_rows	= $front_search_rows;
    include("system_paging.php");
    
    if ($total_page > 0) { $paging = "yes"; } 
    else                 { $paging = "no";  }
 
 
 
 
	// smarty templates processing ...		
    $smarty->assign('paging'            				, $paging              	 		);
    $smarty->assign('found'             				, $found               	 		);
    $smarty->assign('search_detail'             		, $search_detail               	);
 
	$smarty->assign("listing_id"						, $arr_listing_id				);
	$smarty->assign("listing_type"						, $arr_listing_type				);
	$smarty->assign("listing_mls"						, $arr_listing_mls				);
	$smarty->assign("listing_title"						, $arr_listing_title			);
	$smarty->assign("listing_availability"				, $arr_listing_availability		);
	$smarty->assign("listing_purpose"					, $arr_listing_purpose			);
	$smarty->assign("listing_price"						, $arr_listing_price			);
	$smarty->assign("listing_rent"						, $arr_listing_rent				);
	$smarty->assign("listing_address"					, $arr_listing_address			);
	$smarty->assign("listing_address2"					, $arr_listing_address2			);
	$smarty->assign("listing_suburb"					, $arr_listing_suburb			);
	$smarty->assign("listing_city"						, $arr_listing_city				);
	$smarty->assign("listing_state"						, $arr_listing_state			);
	$smarty->assign("listing_zip"						, $arr_listing_zip				);
	$smarty->assign("listing_distance"					, $arr_listing_distance			);
	$smarty->assign("listing_country"					, $arr_listing_country			);
	$smarty->assign("listing_bedrooms"					, $arr_listing_bedrooms			);
	$smarty->assign("listing_bathrooms"					, $arr_listing_bathrooms		);
	$smarty->assign("listing_url"						, $arr_listing_url				);
	$smarty->assign("listing_photo_main"				, $arr_listing_photo_main		);
	$smarty->assign("listing_show_distance"				, $show_distance				);
	$smarty->display('site_search.html');
 
	
?>

Open in new window

0
 
MMDeveloperCommented:
The query limit is right here


$sql_query      = "SELECT * FROM $sql_tables WHERE $sql_where ORDER BY $sql_order LIMIT $item, $front_search_rows";

it appears to be using a built-in paging feature. I dont see where $front_search_rows is defined so it must be defined somewhere else...
0
 
Starquest321Author Commented:
Is this the built in paging feature you are talking about?
								{if $navigation_page_total > 1}
								<table width="100%" border="0" cellpadding="10" cellspacing="0">
									<tr>
										<td>
											<table width="0" border="0" cellpadding="0" cellspacing="0" class="normal_12_black">
												<tr>
													<td><font class="normal_12_black"><b> òîåã {$navigation_page_current} </b> î {$navigation_page_total} </font>  </td>
												</tr>
												<tr>
													<td height="10"><img src="images/spacer.gif" width="1" height="1"></td>
												</tr>
												<tr>
													<td>
														<table border="0" cellpadding="0" cellspacing="0" class="normal_12_black">
															<tr>
																
																
																<!-- previous -->
																{if $navigation_page_prev_name != $navigation_page_current}
																<td width="15"><a href="{$navigation_page_prev}" class="{$navigation_page_prev_class}"><img src="images/icon_arrow_left.gif" width="19" height="19" border="0"></a></td>
																<td width="60" style="padding-left:5px"><a href="{$navigation_page_prev}" class="{$navigation_page_prev_class}"><strong>÷åãí</strong></a></td>
																{else}
																<td width="15"><font class="{$navigation_page_prev_class}"><img src="images/icon_arrow_left.gif" width="19" height="19" border="0"></font></td>
																<td width="60" style="padding-left:5px"><font class="{$navigation_page_prev_class}"><strong>÷åãí</strong></font></td>
																{/if}
																<!-- previous -->
																
																
																<!-- page list -->
																{section name=var loop=$navigation_page2_name}
																{if $navigation_page2_name[var] != $navigation_page_current}
																<td nowrap style="padding-right:10px"><a href="{$navigation_page2_link[var]}" class="{$navigation_page2_class[var]}"><b>{$navigation_page2_name[var]}</b></a> </td>
																{else}
																<td nowrap style="padding-right:10px"><font class="{$navigation_page2_class[var]}"><b>{$navigation_page2_name[var]}</b></font></td>
																{/if}
																{/section}
																<!-- page list -->
																
																
																<!-- next -->
																{if $navigation_page_next_name != $navigation_page_current}
																<td align="right" width="40" style="padding-right:5px"><a href="{$navigation_page_next}" class="{$navigation_page_next_class}"><strong>äáà</strong></a></td>
																<td align="right" width="15"><a href="{$navigation_page_next}" class="{$navigation_page_next_class}"><img src="images/icon_arrow_right.gif" width="19" height="19" border="0"></a></td>
																{else}
																<td align="right" width="40" style="padding-right:5px"><font class="{$navigation_page_next_class}"><strong>äáà</strong></font></td>
																<td align="right" width="15"><font class="{$navigation_page_next_class}"><img src="images/icon_arrow_right.gif" width="19" height="19" border="0"></font></td>
																{/if}
																<!-- next -->
																
																
															</tr>
														</table>
													</td>
												</tr>
											</table>
										</td>
										<td align="right">
											<form name="form_page" style="margin:0px">
											<table width="0" border="0" cellpadding="0" cellspacing="0" class="normal_12_black">
												<tr>
													<td colspan="3" align="left"><b>òáåø ìòîåã</b></td>
												</tr>
												<tr>
													<td height="10"><img src="images/spacer.gif" width="1" height="1"></td>
												</tr>
												<tr>
													<td>
														<select name="paging_url" style="width:50px">
														{section name=var loop=$navigation_page_name}
														<option value="{$navigation_page_link[var]}" {if $navigation_page_name[var] == $navigation_page_current} selected {/if} >{$navigation_page_name[var]}</option>
														{/section}
														</select>
													</td>
													<td width="5"><img src="images/spacer.gif" width="1" height="1"></td>
													<td><input type="button" name="page_go" class="form_button" value="Go" style="width:30px" onClick="window.location=document.form_page.paging_url.options[document.form_page.paging_url.selectedIndex].value"></td>
												</tr>
											</table>
											</form>
										</td>
									</tr>
								</table>
								{/if}

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now