Hello,
I have been creating a website the last few weeks and I have a Linux Debian Ubuntu 12.x Server @ my home.
That is where i have been developing the website on. Everything works and is fine…
Now when I upload it to a webserver it runs a few functions inside my class and after a few it just quits the class and it says that the class doesn’t exists…
When I include the class at the top then it tells me that another class is missing.
I have been searching for hours and hours and I just can’t find a way to solve it…
Here is the website not working website: http://beta.robrotgersfotografie.nl
Here is the working website: http://larsrotgers.nl/~rrf
Both URLS are the same website…
The strangest thing is that the whole website works except for the portfolio page…
And the referenties (references) page uses exactly the same method as I use for my portfolio page and that one does work…
Here is some code:
My portfolio.class.php
[php]<?php
class portfolio extends main {
// Define globals
static $category;
static $categories;
static $cat;
// Get category Id that has to be loaded.
function getCategory() {
if(portfolio::$cat[$_GET['c']]['name']) {
portfolio::$category = $_GET['c'];
}
else {
portfolio::$category = 0;
}
}
// Load the menu.
function loadMenu() {
include 'portfolio/menu.php';
}
// Define all the categories.
function setCategories() {
// Set directory of the portfolio folder.
$directory = "portfolio/";
// Load dir
$dir = dir($directory);
// Loop through the folder
while(($file = $dir->read()) !== false) {
// Explode file name
list($fileName, $ext) = explode(".", $file);
// If the file name has more that 0 characters and there is no extension
if(strlen($fileName) > 0 && !$ext) {
// Load name into the $categories global
portfolio::$categories[] = $fileName;
}
}
// Close dir
$dir->close();
}
// Load category data and set array variables.
function loadCategories() {
// Sort all the categories alphabetic
sort(portfolio::$categories);
// Loop all global $categories
foreach(portfolio::$categories as $id=>$name) {
// Set global variables for $cat
portfolio::$cat[$id]['id'] = $id;
portfolio::$cat[$id]['name'] = $name;
portfolio::$cat[$id]['active'] = "";
}
}
// Load all photos and show them on the webpage.
function loadPhotos($folder) {
// Set folder data for JQ
echo "<div id="folder">portfolio/".$folder."/</div>";
// Load dir
$dir = dir("portfolio/".$folder."/");
$id = 0;
// Loop through folder
while(($file = $dir->read()) !== false) {
$arrImages[] = list($fileName, $ext) = explode(".", $file);
}
sort($arrImages);
//print_r($arrImages);
foreach($arrImages as $img=>$key) {
if($key[1] == "jpg") {
echo '<div class="thumb"><img src="portfolio/'.$folder.'/thumbs/'.ereg_replace(" ", "%20", $key[0]).'.'.$key[1].'" alt="'.$key[0].'" onclick="pfGoto('.$id.');"/></div>';
$id++;
}
}
}
// Photo Viewer
function photoViewer() {
if(page::$p_name == "portfolio") {
include 'html/photoViewer/photoViewer.html';
}
}
function hideFooter() {
if(page::$p_name == "portfolio") {
echo '
<script type="text/javascript">
$( function() {
$(".logo, .slogan").remove();
$(".extras .portfolio").remove();
});
</script>
';
}
}
function getInformation($catId) {
include "portfolio/text_". $catId .".txt";
}
}
?>[/php]
My portfolio.php
[php]<?php
portfolio::setCategories();
portfolio::loadCategories();
portfolio::getCategory();
?>
Also I have been programming for PHP like 3 years… And never had I messy problem like these but I just can’t figure it out.
Hope that someone can help me.
Best regards,
L. Rotgers