remp
07-17-2010, 03:40 AM
I have a function with get information (Events) from database and it displays then on the index page using the function below, however, i want to limit the number of events it displays in the front page but display them all in the events.php page... what is the easiest way to do this?? Any help would be appeciated. Thanks.
function displayEvents($row)
{
$day = substr($row['date'], 8, 2);
$day = $day - 0;
$month = substr($row['date'], 5, 2);
$year = substr($row['date'], 0, 4);
$dayw = date("D", mktime(0, 0, 0, $month, $day, $year));
$monthName = date("M", mktime(0, 0, 0, $month, $day, $year));
$hour = realHour($row['time']);
$minute = substr($row['time'], 3, 2);
$ampm = realAMPM($row['time']);
$showTime = $row['showTime'];
echo "<div class='post no_border'>
<div class='post_image'>
<iframe width='170' height='104' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://maps.google.com/maps?q={$row['address']},&ie=UTF8&hq=&hnear={$row['address']}&z=14&iwloc=&output=embed'></iframe>
</div>";
echo "<div class='post_content'>
<h1><a >{$row['name']} </a></h1>
<p>{$row['description']}</p>
<a href='index.htm#'>Read more ...</a><br>
<a href='http://maps.google.com/maps?q={$row['address']} '>Ver mapa mas grande.</a>
</div>";
echo " <div class='post_info'>
<ul>
<li> <strong>Lugar:</strong> <br> {$row['venue']} </li>
<li> <strong>Fecha:</strong> <br> $dayw, $monthName $day, $year </li>
<li><strong>Hora:</strong> <br> ";
if ($showTime) {echo "$hour:$minute $ampm";}
echo "</li>
</ul>
</div>
<img src='http://www.luiyiruiz.com/site/images/post_sep.gif' width='960' height='2' alt='post sep' />
";
echo "</div>";
}
function displayEvents($row)
{
$day = substr($row['date'], 8, 2);
$day = $day - 0;
$month = substr($row['date'], 5, 2);
$year = substr($row['date'], 0, 4);
$dayw = date("D", mktime(0, 0, 0, $month, $day, $year));
$monthName = date("M", mktime(0, 0, 0, $month, $day, $year));
$hour = realHour($row['time']);
$minute = substr($row['time'], 3, 2);
$ampm = realAMPM($row['time']);
$showTime = $row['showTime'];
echo "<div class='post no_border'>
<div class='post_image'>
<iframe width='170' height='104' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://maps.google.com/maps?q={$row['address']},&ie=UTF8&hq=&hnear={$row['address']}&z=14&iwloc=&output=embed'></iframe>
</div>";
echo "<div class='post_content'>
<h1><a >{$row['name']} </a></h1>
<p>{$row['description']}</p>
<a href='index.htm#'>Read more ...</a><br>
<a href='http://maps.google.com/maps?q={$row['address']} '>Ver mapa mas grande.</a>
</div>";
echo " <div class='post_info'>
<ul>
<li> <strong>Lugar:</strong> <br> {$row['venue']} </li>
<li> <strong>Fecha:</strong> <br> $dayw, $monthName $day, $year </li>
<li><strong>Hora:</strong> <br> ";
if ($showTime) {echo "$hour:$minute $ampm";}
echo "</li>
</ul>
</div>
<img src='http://www.luiyiruiz.com/site/images/post_sep.gif' width='960' height='2' alt='post sep' />
";
echo "</div>";
}