DaLightz
See ya'll in the afterlife.
- May 19, 2012
- 1,136
- 262
Hi there devbest , as many of you should know, ive left ubercms to start working on revcms
Now, my php skills are ok, but i feel i want to advance in my skills so i am releasing some good stuff this week ^.^
----------------
So here is the release,
Campaigns on your cms BUT database powered!
------------------
WHAT DOES THIS DO?
-
Ok well, as you know in ubercms, it would read campaigns from the db.. This also does that
--------------------
Screen shot of it on cms:
Screen shot of db (for proof):
Note: once my revcms hk is out, you will be able to edit, or delete campaigns instead of using the db.
-------------------
VERY IMPORTANT! RUN THIS IN YOUR DATABASE:!!
Now, on your me.php,under column 1 tag add this:
Enjoy
Now, my php skills are ok, but i feel i want to advance in my skills so i am releasing some good stuff this week ^.^
----------------
So here is the release,
Campaigns on your cms BUT database powered!
------------------
WHAT DOES THIS DO?
-
Ok well, as you know in ubercms, it would read campaigns from the db.. This also does that
--------------------
Screen shot of it on cms:
You must be registered for see links
Screen shot of db (for proof):
You must be registered for see links
Note: once my revcms hk is out, you will be able to edit, or delete campaigns instead of using the db.
-------------------
VERY IMPORTANT! RUN THIS IN YOUR DATABASE:!!
Code:
CREATE TABLE IF NOT EXISTS `cms_campaigns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '1',
`enabled` enum('0','1') NOT NULL DEFAULT '1',
`image_url` text NOT NULL,
`caption` text NOT NULL,
`descr` text NOT NULL,
`url` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
INSERT INTO `cms_campaigns` (`id`, `order_id`, `enabled`, `image_url`, `caption`, `descr`, `url`) VALUES
(2, 1, '1', 'http://65.96.141.124/app/tpl/skins/Habbo/images/facebookconnect.gif', 'Test 2', 'MOAR MOAR MOAR!', 'http://devbest.com'),
(3, 1, '1', 'http://65.96.141.124/app/tpl/skins/Habbo/images/facebookconnect.gif', 'MOAR TEST!', 'LOOOOOL MOAR!', 'http://devbest.com'),
(1, 1, '1', 'http://65.96.141.124/app/tpl/skins/Habbo/images/facebookconnect.gif', 'Test', 'This is a test for my shit..', 'http://devbest.com');
Code:
<?php
$campaign = mysql_query("SELECT * FROM cms_campaigns ORDER BY `id` DESC"); // Query, Select data from cms_camps..
if(mysql_num_rows($campaign) == 0){
echo 'MAKE A CAMPAIGN TO FIX ME!!!'; // No campaigns? This will show.
}else{
echo '<div class="habblet-container ">'; // Container..
echo '<div class="cbb clearfix orange ">'; // Decor..
echo '<h2 class="title">Hot Campaigns</h2>
<div id="hotcampaigns-habblet-list-container">
<div class="hotcampaign-container">';
}
while($row = mysql_fetch_array($campaign)){ // Fetch shit from $camps..
// Start variables
$id = $row["id"];
$caption = $row["caption"];
$image_url = $row["image_url"];
$descr = $row["descr"];
$url = $row["url"];
// End variables
echo '<ul id="hotcampaigns-habblet-list">
<li class="even">
<a href="'.$url.'">
<img src="'.$image_url.'" align="left" alt="'.$caption.'" /></a>
<h3>'.$caption.'</h3>
<p>'.$descr.'</p>
<p class="link"><a href="'.$url.'">Go there »</a></p>
</li> </ul>
';
}
?>
</div></div>
</div>
</div>
Enjoy