This is my Second release, And it is probably the Best for Ubercms that I have released so Far.
PLEASE NOTE:
You MUST! Have your OWN! C_images directory for this to work.
Pixel Badge Shop. (You can change between charging the buyer pixels or credits)
Follow these steps to get YOUR shop :P
1) Download the file -->Attachment 84747<-- Dont trust? dont download...
2) Run This into your Database:
2.5) Now run THIS into your Database BUT DO NOT EDIT IT!!!!!!Code:-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 28, 2011 at 07:15 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: `hobboa`
--
-- --------------------------------------------------------
--
-- Table structure for table `badges`
--
CREATE TABLE IF NOT EXISTS `badges` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`badge_id` varchar(100) NOT NULL,
`item_price` int(250) NOT NULL DEFAULT '1000',
`end_code` varchar(120) NOT NULL DEFAULT 'gif',
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
--
-- Dumping data for table `badges`
--
INSERT INTO `badges` (`id`, `badge_id`, `item_price`, `end_code`) VALUES
(1, '70S', 1000, 'gif'),
(2, 'ADM2', 1000, 'gif'),
(3, '50S', 1000, 'gif'),
(4, 'AC1', 10000, 'gif'),
(5, 'AU_ACMI', 1000, 'gif'),
(6, 'AWSM1', 1000, 'gif'),
(7, 'BBBH2', 1000, 'gif'),
(8, 'BE2', 1000, 'gif'),
(9, 'BGWV2', 1000, 'gif');
/*!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 */;
Code:-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 28, 2011 at 08:30 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: `hobboa`
--
-- --------------------------------------------------------
--
-- Table structure for table `pixel_shop`
--
CREATE TABLE IF NOT EXISTS `pixel_shop` (
`id` int(250) NOT NULL AUTO_INCREMENT,
`name` varchar(250) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `pixel_shop`
--
INSERT INTO `pixel_shop` (`id`, `name`) VALUES
(1, 'Battle Banzai'),
(2, 'Promotional furni'),
(3, 'Exchange'),
(4, 'Christmas Furni');
/*!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 */;
3) Now, Add this to your Htaccess
4) Add this to your CSS (IF YOU DONT HAVE A CSS FILE SEE 4.5)Code:RewriteRule ^badgeshop$ ./badgeshop.php
Code:#general_message2
{
padding: 5px;
font-size: 10px;
margin-right: -588px;
float: right;
font-family: Verdana;
width: 738px;
color: #E2001A;
border-width: 1px;
border-color: #E2001A;
border-style: solid;
background-color: #FFF4F2;
}
.boxbadge {
padding:10px;
margin-right: 100px;
width:60px;
height:70px;
font-size:10px;
background-color:#F6F6F6;
border:1px dotted navy;
}
#overview_overlay_badge
{
padding: 10px;
margin: 22px;
margin-right: -750px;
float: right;
width: 728px;
border-width: 1px;
border-color: #CCC;
border-style: solid;
background-color: #FFFFFF;
}
4.5) If you DONT Have a css file (WHY NOT?) doesn't matter.
Put THE BELOW CODE at the TOP OF YOUR comp-badge.tpl file
Code:
<style>
#general_message2
{
padding: 5px;
font-size: 10px;
margin-right: -588px;
float: right;
font-family: Verdana;
width: 738px;
color: #E2001A;
border-width: 1px;
border-color: #E2001A;
border-style: solid;
background-color: #FFF4F2;
}
.boxbadge {
padding:10px;
margin-right: 100px;
width:60px;
height:70px;
font-size:10px;
background-color:#F6F6F6;
border:1px dotted navy;
}
#overview_overlay_badge
{
padding: 10px;
margin: 22px;
margin-right: -750px;
float: right;
width: 728px;
border-width: 1px;
border-color: #CCC;
border-style: solid;
background-color: #FFFFFF;
}
</style>
Here are the images of the shop in action (IN ORDER)
Code:
This is the HK editing (The Badge at the bottom will be brought)
(Yes. I know this is just an edit of User badges, but it seemed easier that way)
http://i1038.photobucket.com/albums/...ebadgeshop.jpg
This is BEFORE buying the badge (Bottom left)
http://i1038.photobucket.com/albums/...badgeshop2.jpg
This is AFTER buying the badge (Notice the pixels have decreased)
http://i1038.photobucket.com/albums/...badgeshop3.jpg
This shows the Badge has been successfully added to user_badges
http://i1038.photobucket.com/albums/...badgeshop4.jpg
This shows the badge in-game
http://i1038.photobucket.com/albums/...nlineshop5.jpg
Remember to thank me if you liked it :P
I give NO credits to anybody but myself, as I designed/coded it.
EDIT!!!
For fixing the issue of being able to buy without pixels, or getting minus pixels when buying to many,
This fix makes it so once you hit 0 pixels, or if you just dont have enough to buy the badge, it wont give it to you, and wont remove any of your pixels.
THIS WONT WORK IF YOU HAVE VARYING PIXEL PRICES!Code:Look for
// Subtract the coins from the user like a foo does to a foo foo
in the purchasebadge.php file
Add THIS BELOW it.
$h = dbquery("SELECT item_price FROM badges");
$usercred = dbquery("SELECT activity_points FROM users WHERE username='$_SESSION[UBER_USER_N]'");
$g = $usercred - $row['item_price'];
Now look for
$tt = dbquery("SELECT * FROM users WHERE username='$_SESSION[UBER_USER_N]'");
And Replace That WHOLE LINE with
$tt = dbquery("SELECT * FROM users WHERE username='$_SESSION[UBER_USER_N]' AND activity_points >= 'item_price'");
If this helped you. Dont forget to thank me for my work XD

