I have searched this forum and read every thread over and over.
First I want to say that KL_PHP is a WONDERFUL MAMBOT!!!
I hope this project continues to expand with Joomla 1.5 etc.
I have a probelm where I have my content "collegesports.php" displaying properly. However, my PHP file has a "paging" (next / previous) feature in it.
When you click "NEXT/PREVIOUS" it goes to this URL.
http://freemyspacephotos.com/collegesports.php?page=2
The site can be found here....The content on the homepage is what I am trying to fix.
http://freemyspacephotos.com/
When this happens, the JOOMLA template is LOST/ REMOVED.
- I have published my mambot
- I have disabled my WYSIWYG
- I DO NOT want to use a WRAPPER.
- I have using code on the "NEXT" as index.php?option=com_content&task=view&id=12&Itemi d=27?page=2
The CollegeSports.php code is below. This PHP is an INCLUDE.
I believe that the PHP is what needs to be modified. Please provide some clues / support to what needs to be done.
Thanks in advance for your SUPPORT.
PHP Code:
<?php $title = "Free MySpace Photos College Sports Logo Images Teams"; ?>
<table width="100%">
<tr>
<td>
<?
// Configure these values for your site
$site_url = "www.freemyspacephotos.com"; // no http, no trailing /
$site_name = "Get Free Photos for your web page.";
$support_image = "";
// support_image is a logo for your site that will be placed in the top
// left of the users myspace page. Leave this blank if you don't want
// to use a support image.
$cat = 'library-images/sports/collegesports/';
$urlpath = 'library-images/sports/collegesports/';
$photobucket = 's29.photobucket.com/albums/c273/freemyspacehtmlcode/sports/collegesports';
$max2show = 25; //Amount you want to show per page
// END OF CONFIGURATION SECTION
// Do not edit below this line
$hook = opendir($cat) or die('cant open dir');
$total = 0;
if(!isset($_GET['page'])) $page = 1;
else $page = $_GET['page'];
$start = $max2show * $page - $max2show;
$end = $page * $max2show;
$ext = array("jpg", "png", "jpeg", "gif", "bmp");
while (false!==($file = readdir($hook))) {
for($i=0;$i<sizeof($ext);$i++)
if (stristr($file, ".".$ext[$i])) //NOT case sensitive
{
$files[] = $file;
$total++;
}
}
closedir($hook);
natcasesort($files);
$files = array_values($files);
if ($end > $total) { $end = $total; }
echo '<table width="100%" border="0" cellspacing="0" cellpadding="4" border="0" bgcolor="#eeeeee" style="border-bottom: 1px solid #cccccc"><tr>';
//if ($cnt >= $start && $cnt < $end)
if(isset($_GET['page'])&&($_GET['page'] != 1)) {
$pre = $_GET['page'] - 1;
echo '<td align="left" width="38%"><a href="' . $_SERVER['PHP_SELF'] . '?page=' . $pre . '"><b>Previous Page</b></a></td>';
}
$pages = $total/$max2show;
$lastpage = ceil($pages);
echo '<td></td>';
if($page < $lastpage) {
$next = $page + 1;
echo '<td align="right" width="45%"><a href="' . $_SERVER['PHP_SELF'] . '?page=' . $next . '"><b>Next Page</b></a></td>';
}
echo '</tr>
</table><br />';
for ($cnt = $start; $cnt < $end; $cnt++) {
$file = $files[$cnt];
?> <table border="0" width="100%" align="center" cellpadding="4" cellspacing="4" style="border-bottom: 1px dashed #cccccc">
<tr>
<td valign="top" style="padding-right: 10px;" align="right"><a href="<?php echo $urlpath . $file; ?>" target="_blank" title="<?php echo $file; ?>"><img src="<?php echo $urlpath . $file; ?>" alt="<?php echo $file; ?>" width="150" height="150"></a></td>
<td valign="top" align="left"><a href="<?php echo $urlpath . $file; ?>" target="_blank" title="<?php echo $urlpath . $file; ?>"><?php echo $file; ?></a><br />
<textarea name="textarea2" cols=23 rows=7 onClick="this.focus();this.select()">
<a href="http://<?php echo $site_url; ?>" target="_blank" title="<?php echo $site_name; ?>">
<img src="http://<?php echo $photobucket . "/" . $file; ?>" border="0" alt="<?php echo $site_name; ?>"></a> <br>
<?php if ($support_image != "") { ?>
<a href="http://<?php echo $site_url; ?>/" target="_blank" title="Free Photos for your Profile!">
<img src="http://<?php echo $support_image; ?>" alt="Free Photos for your MySpace Page!" style="position:absolute; left:0px; top: 0px; z-index:9;" border="0"></a>
<?php } ?>
<a href="http://<?php echo $site_url; ?>/" target="_blank" title="Free Myspace Photos!"><?php echo $site_name; ?></a></textarea>
</td>
</tr>
</table>
<?
}//for
echo '<br /><table width="100%" border="0" cellspacing="0" cellpadding="4" border="0" bgcolor="#eeeeee" style="border-bottom: 1px solid #cccccc"><tr>';
if(isset($_GET['page'])&&($_GET['page'] != 1)) {
$pre = $_GET['page'] - 1;
echo '<td align="left" width="38%"><a href="' . $_SERVER['PHP_SELF'] . '?page=' . $pre . '"><b>Previous Page</b></a></td>';
}
echo '<td></td>';
if($page < $lastpage) {
$next = $page + 1;
echo '<td align="right" width="45%"><a href="' . $_SERVER['PHP_SELF'] . '?page=' . $next . '"><b>Next Page</b></a></td>';
}
echo '</tr>
</table>';
?>
</td>
</tr>
</table>