So I created an option where the view can select so many results per page; 25, 50, 100, etc. I wanted to have the limit linked when not selected, but NOT linked when selected, so I did this:
if ($limit != 25) {
echo "<a href='" . $_SERVER['PHP_SELF'] . "?sort=" . $sort . "&limit=25&'>";
}
echo "25";
if ($limit != 25) {
echo "</a>";
}
echo " | ";
if ($limit != 50) {
echo "<a href='" . $_SERVER['PHP_SELF'] . "?sort=" . $sort . "&limit=50&'>";
}
echo "50";
if ($limit != 50) {
echo "</a>";
}
echo " | ";
if ($limit != 100) {
echo "<a href='" . $_SERVER['PHP_SELF'] . "?sort=" . $sort . "&limit=100&'>";
}
echo "100";
if ($limit != 100) {
echo "</a>";
}
And of course that worked, no big deal, but I got to wondering if there was a more condensed way to write all that out. Anyone have a suggestion on how to make something like that shorter?