[Addon] RevCMS- Campaigns through database (habbo theme only) [Addon]

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 :D
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? :eek:
-
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:!!
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');
Now, on your me.php,under column 1 tag add this:
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 &raquo;</a></p>
                  </li> </ul>
                        ';
    }
    ?>
    </div></div>
</div>
</div>

Enjoy :)
 

DaLightz

See ya'll in the afterlife.
May 19, 2012
1,136
262
Lol. gimme it once its done, Id love to use a good HK. My grapeASE is shit :)
lol, release will be within 3-2 days im sure.
--
Ontopic: i forgot to point out that the campaigns WONT effect your page loading time, as it goes as quickly as possible (im quite sure.)
 

Zak

Posting Freak
Mar 12, 2011
848
453
I see rows are finally being used.

Great thing is that you don't need to define each variables with a explicit cast for each rows.
(One of the many PHP advantages)

Goodjob.
 

DaLightz

See ya'll in the afterlife.
May 19, 2012
1,136
262
I see rows are finally being used.

Great thing is that you don't need to define each variables with a explicit cast for each rows.
(One of the many PHP advantages)

Goodjob.
Thanks Zak :) it really means alot to me :D
 

Users who are viewing this thread

Top