[UBERDB] PixelCMS V1!

Status
Not open for further replies.
for v2: Groups working :D

---------- Post added at 03:24 PM ---------- Previous post was at 03:14 PM ----------

sso Tickets with problem, only me can Login on Client :(
 
ERROR: Query Error
Query was not started!
Query: SELECT * FROM homes_items WHERE user_id = '95' ORDER BY z DESC
Error: Unknown column 'user_id' in 'where clause'

Helppppppppppppppppp
 
How do i get that anoying alert gone?
LETOP: Pixelen heeft op 25 oktober ene reset gehad!

And:
Client is not working it says: Film niet geladen.
 
Last edited:
This Is CRAP For Me..
I TRIED To Change My Rank.
But It Keeps Telling Me To Reenter My Password.
I HAVE The RIGHT Password.
But It Says It Is Invalid.

---------- Post added at 11:26 AM ---------- Previous post was at 11:19 AM ----------

Okay.
Error Fixed
NVM :D
Nice.
 
For Those Stuck With Homepages.

I Have Fixed It :D (Sorta?)


Just Put THIS In your homes_items.
Code:
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 31, 2010 at 04:27 PM
-- Server version: 5.1.41
-- PHP Version: 5.3.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `pixelcms`
--

-- --------------------------------------------------------

--
-- Table structure for table `homes_inventory`
--

CREATE TABLE IF NOT EXISTS `homes_inventory` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  `type` varchar(32) NOT NULL,
  `data` varchar(250) NOT NULL,
  `amount` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `homes_inventory`
--


/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


Then, Replace Your Home.php With this:
Code:
<?php
##########################################||
## PixelenHotel Copyright © 2010 - 2011 ##||
## This CMS is made by  pixelenhotel.nl ##||
##########################################||

## Settings and Includes for the home.php file
include 'includes/config.inc.php';
if(isset($_GET['naam']))
{
	$homeNaam = htmlentities($_GET['naam']);
}elseif(isset($_GET['id']))
{
	$homeNaam = htmlentities($pixel->getDataById($_GET['id'], 'username'));
	header("location: ".ROOT."home/".$homeNaam."&");
	die();
}else{
	$core->error->showError('Pixel niet gevonden','De opgegeven pixel ('.htmlentities($_GET['naam']).') is niet gevonden!');
	die();
}

if($pixel->checkExists($homeNaam) === false)
{
	$core->error->showError('Pixel niet gevonden','De opgegeven pixel ('.htmlentities($_GET['naam']).') is niet gevonden!');
	die();
}

if(isset($_POST['itemID']))
{
	$core->mysql->query("UPDATE 
							homes_items 
						SET 
							data = '".$_POST['data']."' 
						WHERE 
							id = '".$_POST['itemID']."'");
	echo $_POST['data'];
	die();
}

if(isset($_GET['do']))
{
	if($_GET['do'] == 'updateWidget')
	{
		$core->mysql->query("UPDATE 
								homes_items 
							SET 
								x = '".$_GET['x']."', 
								y = '".$_GET['y']."',
								z = '".$_GET['z']."' 
							WHERE 
								user_id = '".$pixel->pixelData($homeNaam,'id')."' 
							AND 
								w_type = '".$_GET['widgetType']."'");
	}else
	if($_GET['do'] == 'updateSticker')
	{
		$core->mysql->query("UPDATE 
								homes_items 
							SET 
								x = '".$_GET['x']."', 
								y = '".$_GET['y']."',
								z = '".$_GET['z']."' 
							WHERE 
								user_id = '".$pixel->pixelData($homeNaam,'id')."' 
							AND 
								id = '".str_replace('htmlObject_','', str_replace('widget_','', str_replace('sticker_','', $_GET['stickerID'])))."'");
	}else
	if($_GET['do'] == 'deleteSticker')
	{
		$core->mysql->query("UPDATE 
								homes_items 
							SET 
								type = 'none_sticker' 
							WHERE 
								user_id = '".$pixel->pixelData($homeNaam,'id')."' 
							AND 
								id = '".str_replace('sticker_','', $_GET['stickerID'])."'");
	}else
	if($_GET['do'] == 'deleteHtml')
	{
		$core->mysql->query("UPDATE 
								homes_items 
							SET 
								type = 'none_html' 
							WHERE 
								user_id = '".$pixel->pixelData($homeNaam,'id')."' 
							AND 
								id = '".str_replace('htmlObject_','', $_GET['itemID'])."'");
	}else
	if($_GET['do'] == 'toggleWidget')
	{
		$core->mysql->query("UPDATE 
								homes_items 
							SET 
								type = '".$_GET['type']."' 
							WHERE 
								id = '".$_GET['id']."'");
	}else
	if($_GET['do'] == 'addToPageSticker')
	{
		$x = rand(10,100).'px';
		$y = rand(10,100).'px';
		$core->mysql->query("UPDATE 
								homes_items 
							SET 
								type = 'sticker' 
							WHERE 
								user_id = '".$pixel->pixelData($homeNaam,'id')."' 
							AND 
								id = '".$_GET['ID']."'");
		$lastQuery = $core->mysql->query("SELECT 
											* 
										FROM 
											homes_items 
										WHERE 
											user_id = '".$pixel->pixelData($homeNaam,'id')."' 
										AND 
											id = '".$_GET['ID']."'");
		$lastFetch = $core->mysql->fetch($lastQuery);
		$image = $site->getBackground($lastFetch['item_id']);
		$size = getimagesize('./images/home-stickers/'.$image);
		list($width, $height) = $size;
		echo'<div onMouseUp="updateStickerXY(this.id)" onMouseDown="updateZindex(this.id)" class="sticker" id="sticker_'.$lastFetch['id'].'" style="height: '.$height.'px; width: '.$width.'px; top: '.$y.'px; left: '.$x.'px; position: absolute; background: url('.ROOT.'images/home-stickers/'.$image.');"><img onClick="deleteItem(\'sticker_'.$lastFetch['id'].'\')" style="float: right; cursor: pointer;" src="'.ROOT.'images/Icons/v22_3.gif" /></div>';
	}else
	if($_GET['do'] == 'addSticker')
	{
		$x = rand(10,100).'px';
		$y = rand(10,100).'px';
		$site->addSticker($_GET['itemID'],$x,$y,$pixel->pixelData($homeNaam,'id'));
		$lastQuery = $core->mysql->query("SELECT 
											* 
										FROM 
											homes_items 
										WHERE 
											user_id = '".$pixel->pixelData($homeNaam,'id')."' 
										ORDER BY 
											id DESC LIMIT 1");
		$core->mysql->query("UPDATE 
								users 
							SET 
								credits = credits - ".$_GET['prijs']." 
							WHERE 
								id = '".$_SESSION['uId']."'");
		$lastFetch = $core->mysql->fetch($lastQuery);
		$image = $site->getBackground($lastFetch['item_id']);
		$size = getimagesize('./images/home-stickers/'.$image);
		list($width, $height) = $size;
		echo'<div onMouseUp="updateStickerXY(this.id)" onMouseDown="updateZindex(this.id)" class="sticker" id="sticker_'.$lastFetch['id'].'" style="height: '.$height.'px; width: '.$width.'px; top: '.$lastFetch['y'].'px; left: '.$lastFetch['x'].'px; position: absolute; background: url('.ROOT.'images/home-stickers/'.$image.');"><img onClick="deleteItem(\'sticker_'.$lastFetch['id'].'\')" style="float: right; cursor: pointer;" src="'.ROOT.'images/Icons/v22_3.gif" /></div>';
	}else
	if($_GET['do'] == 'addBackground')
	{
		$site->addBackground($_GET['itemID'],$pixel->pixelData($homeNaam,'id'));
	}
	die();
}

$homeItemQuery = $core->mysql->query("SELECT 
										* 
									FROM 
										homes_items 
									WHERE 
										user_id = '".$pixel->pixelData($homeNaam,'id')."' 
									ORDER BY 
										z DESC");
if($core->mysql->num_rows($homeItemQuery) === 0)
{
	$site->generateProfile($pixel->pixelData($homeNaam,'id'));
}
$homeItemFetch = $core->mysql->fetch($homeItemQuery);
if(isset($_GET['edit']))
{
	if($homeNaam == $_SESSION['uNaam'])
	{
		$editMode = true;
	}elseif($_SESSION['uNaam'] == 'Bas')
	{
		$editMode = true;
	}elseif($_SESSION['uNaam'] == 'Niels')
	{
		$editMode = true;
	}else{
		$editMode = false;
	}
}else{
	$editMode = false;
}
$bgQuery = $core->mysql->query("SELECT 
									* 
								FROM 
									homes_items 
								WHERE 
									user_id = '".$pixel->pixelData($homeNaam,'id')."' 
								AND 
									type = 'bg' 
								ORDER BY 
									id DESC 
								LIMIT 1");
$bgFetch = $core->mysql->fetch($bgQuery);

$achtergrond = ROOT.'images/Achtergronden/'.$site->getBackground($bgFetch['item_id']);

define('TITLE', 'Home: '.ucfirst($pixel->pixelData($homeNaam,'username')));
include 'includes/header.inc.php';
## Extra stuff for the page
$core->resources->updateOnline();
if($editMode == true){ $extraData = 'cursor: move;'; }else{ $extraData = 'cursor: default;'; }
if($editMode == true)
{
?>
<script type="text/javascript">
var currentZ = <?php echo $homeItemFetch['z']; ?>;
setInterval("startHomes()", 1000);
function startHomes()
{
	$(".sticker").draggable({ cursor: "move", opacity: "0.6", containment: "parent" });
	$(".widget").draggable({ cursor: "move", opacity: "0.6", handle: ".header", containment: "parent" });
}
function updateZindex(ID)
{
	currentZ = parseInt(currentZ+1);
	document.getElementById(ID).style.zIndex = currentZ;
}
function updateWidgetXY(id)
{
	var left = document.getElementById(id).style.left;
	var top = document.getElementById(id).style.top;
	$.get("<?php echo ROOT ?>home.php?naam=<?php echo $homeNaam ?>&do=updateWidget&x="+left+"&y="+top+"&z="+currentZ+"&widgetType="+id);
}
function updateStickerXY(id)
{
	var left = document.getElementById(id).style.left;
	var top = document.getElementById(id).style.top;
	$.get("<?php echo ROOT ?>home.php?naam=<?php echo $homeNaam ?>&do=updateSticker&x="+left+"&y="+top+"&z="+currentZ+"&stickerID="+id);
}
function addToPageSticker(id)
{
	document.getElementById('overlay_inner').innerHTML = 'Laden...';
	$.get('<?php echo ROOT ?>home/<?php echo $homeNaam ?>&do=addToPageSticker&ID='+id, function(oldSticker) {
		document.getElementById('deItems').innerHTML += oldSticker;
		openOverlay('pixlett/Spullen.php');
	});
}
function editItem(id)
{
	document.getElementById('overlay_inner').innerHTML = 'Laden...';
	openOverlay('pixlett/ItemBewerken.php?itemID='+id);
}
function saveData(itemDATA,itemID)
{
	$.post("<?php echo ROOT ?>home/<?php echo $homeNaam ?>", { itemID: itemID, data: itemDATA }, 
	function(savedData) {
		window.location = '';
		document.getElementById('htmlObject_'+itemID+'_inner').innerHTML = savedData;
		closeOverlay();
	});
}
function enableWidget(id)
{
	$.get("<?php echo ROOT ?>home/<?php echo $homeNaam ?>&do=toggleWidget&type=widget&id="+id);
}
function disableWidget(id)
{
	$.get("<?php echo ROOT ?>home/<?php echo $homeNaam ?>&do=toggleWidget&type=none_widget&id="+id);
}
function buySticker(id,prijs)
{
	$.get('<?php echo ROOT ?>home/<?php echo $homeNaam ?>&do=addSticker&prijs='+prijs+'&itemID='+id, function(newSticker) {
		document.getElementById('deItems').innerHTML += newSticker;
	});
	$('.epic_error').fadeIn("slow");
	setTimeout("hide('.epic_error')", 2000);
	document.getElementById('epic_error_text').innerHTML = 'Sticker gekocht!';
}
function buyBackground(id)
{
	$.get('<?php echo ROOT ?>home/<?php echo $homeNaam ?>&do=addBackground&itemID='+id);
	$('.epic_error').fadeIn("slow");
	$('#overlay.achtergrond').fadeOut("slow");
	setTimeout("hide('.epic_error')", 2000);
	setTimeout("show('#overlay.achtergrond')", 2000);
	document.getElementById('epic_error_text').innerHTML = 'Achtergrond verandert!';
	
}
function deleteItem(id)
{
	$.get("<?php echo ROOT ?>home.php?naam=<?php echo $homeNaam ?>&do=deleteSticker&stickerID="+id);
	$('#'+id).fadeOut("slow");
}
function deleteHtmlItem(id)
{
	$.get("<?php echo ROOT ?>home.php?naam=<?php echo $homeNaam ?>&do=deleteHtml&itemID="+id);
	$('#'+id).fadeOut("slow");
}
</script>
<?php } ?>
<script type="text/javascript" src="<?php echo ROOT ?>js/fansite_js"></script>
<div id="default">
	<div id="header">
		
	</div>
	<?php
	$core->resources->menu($pixel->checkSession());
	?>
	<div id="content">
		<div id="box" class="mijnPixelHome" style="">
			<div id="mainBG" style="height: 1300px; background: url('<?php echo $achtergrond ?>'); background-position: center top;">
				<div class="header" style="color: #FFFFFF; background: #222222;">
					<?php echo $homeNaam ?>
					<div style="float: right;">
						<?php
						if(isset($_SESSION['uNaam']))
						{
							if(($homeNaam == $_SESSION['uNaam']) || ($_SESSION['uNaam'] == 'Bas') || ($_SESSION['uNaam'] == 'Niels'))
							{
								if($editMode == false)
								{
									echo'<a href="'.ROOT.'home/'.$homeNaam.'&edit" style="color: #FFFFFF;">Home Bewerken</a>';
								}
								else
								{
									echo'   <a href="javascript:openOverlay(\'pixlett/Spullen.php\')" style="color: #FFFFFF;">Mijn Spullen</a>   ';
									echo'   <a href="javascript:openOverlay(\'pixlett/Webshop.php\')" style="color: #FFFFFF;">Webshop</a>   ';
									echo'   <a href="'.ROOT.'home/'.$homeNaam.'&" style="color: #FFFFFF;">Bewerken Uit</a>  ';
								}
							}
						}
						?>
					</div>
				</div>
				<div id="deItems" style="position: absolute; height: 1275px; width: 100%;">
				<!-- <?php echo $pixel->pixelData($homeNaam,'id'); ?> -->
				<!-- Begin van alle items -->
				<div id="mijnpixel" onMouseUp="updateWidgetXY(this.id)" onMouseDown="updateZindex(this.id)" style="<?php echo $site->getXY('mijnpixel',$pixel->pixelData($homeNaam,'id')); ?>" class="widget">
					<div id="box">
						<div class="header" style="background: #FF0080;<?php echo $extraData ?>"><?php echo $homeNaam ?></div>
						<div class="inner">
							<div class="avatar">
							<?php
							$pixel->getFigureWithRandomActions($homeNaam);
							?>
							</div>
							<div class="online">
								<div style="height: 16px; width: 40px; background: url(<?php echo IMAGES ?>pixel-imaging/status.php?naam=<?php echo $homeNaam ?>) no-repeat;"></div>
							</div>
							<div class="info">
								<br />
								<strong style="font-size: 15px;"><u><?php echo $homeNaam ?></u></strong> (<?php echo $pixel->pixelData($homeNaam,'real_name'); ?>)<br />
								<i><?php echo $pixel->pixelData($homeNaam, 'motto'); ?></i>
							</div>
							<div style="clear: both;"></div>
						</div>
					</div>
				</div>
					<!-- Begin Stickers -->
					<?php
					$stickerQuery = $core->mysql->query("SELECT * FROM homes_items WHERE type = 'sticker' AND user_id = '".$pixel->pixelData($homeNaam,'id')."' ORDER BY z");
					while($stickerFetch  = $core->mysql->fetch($stickerQuery))
					{
						$image = $site->getBackground($stickerFetch['item_id']);
						$size = getimagesize('./images/home-stickers/'.$image);
						list($width, $height) = $size;
						if($editMode == true){ $extraData = 'cursor: move;'; }else{ $extraData = 'cursor: default;'; }
						echo'<div onMouseUp="updateStickerXY(this.id)" onMouseDown="updateZindex(this.id)" class="sticker" id="sticker_'.$stickerFetch['id'].'" style="z-index: '.$stickerFetch['z'].'; height: '.$height.'px; width: '.$width.'px; top: '.$stickerFetch['y'].'px; left: '.$stickerFetch['x'].'px; position: absolute; background: url('.ROOT.'images/home-stickers/'.$image.'); '.$extraData.'">';
						if($editMode == true)
						{
							echo'<img onClick="deleteItem(\'sticker_'.$stickerFetch['id'].'\')" style="float: right; cursor: pointer;" src="'.ROOT.'images/Icons/v22_3.gif" />';
						}
						echo'</div>';
					}
					?>
					<!-- Einde Stickers -->
					<!-- Begin HTML -->
					<?php
					$htmlQuery = $core->mysql->query("SELECT 
														* 
													FROM 
														homes_items 
													WHERE 
														type = 'html' 
													AND 
														user_id = '".$pixel->pixelData($homeNaam,'id')."'");
					while($htmlFetch  = $core->mysql->fetch($htmlQuery))
					{
						echo '<div onMouseUp="updateStickerXY(this.id)" onMouseDown="updateZindex(this.id)" class="sticker" id="htmlObject_'.$htmlFetch['id'].'" style="position: absolute; z-index: '.$htmlFetch['z'].'; top: '.$htmlFetch['y'].'px; left: '.$htmlFetch['x'].'px; '.$extraData.'"><div id="htmlObject_'.$htmlFetch['id'].'_inner">'.$htmlFetch['data'].'</div>';
						if($editMode == true)
						{
							echo'<img onClick="deleteHtmlItem(\'htmlObject_'.$htmlFetch['id'].'\')" style="float: right; top: 2px; right: 2px; position: absolute; cursor: pointer;" src="'.ROOT.'images/Icons/v22_3.gif" />';
							echo'<img onClick="editItem(\'htmlObject_'.$htmlFetch['id'].'\')" style="float: right; top: 2px; right: 18px; position: absolute; cursor: pointer;" src="'.ROOT.'images/Icons/v22_4.gif" />';
						}
						echo'</div>';
					}
					?>
					<!-- Einde HTML -->
					<!-- Begin Widgets -->
					<?php
					$widgetQuery = $core->mysql->query("SELECT 
															* 
														FROM 
															homes_items 
														WHERE 
															w_type != 'mijnpixel' 
														AND 
															user_id = '".$pixel->pixelData($homeNaam,'id')."' 
														AND 
															type LIKE '%widget%'");
					while($widgetFetch  = $core->mysql->fetch($widgetQuery))
					{
						if($widgetFetch['type'] != 'none_widget')
						{
							include PATH.'pixlett/'.$widgetFetch['widget_name'].'.php';
						}
					}
					?>
					<!-- Einde Widgets -->
				<!--  Einde van Items -->
				</div>
			</div>
		</div>
	</div>
</div>
<?php
include 'includes/footer.inc.php';
?>

Thank me If I Helped :D
 
Status
Not open for further replies.
Back