[REL] RevCMS hot campaigns W/ Housekeeping

Kristopher

Photographer
Dec 25, 2010
803
68
PHP:
<?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"];
            $description = $row["description"];
            $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>'.$description.'</p>
                  <p class="link"><a href="'.$url.'">Go there &raquo;</a></p>
                  </li> </ul>
                        ';
    }
    ?>
    </div></div>

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,
  `description` text NOT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;


For Housekeeping:

Credits:
Cookiemonsta - Campaigns
Sledmore - HK
Myself - Little edit
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Nice release, but you should of done it how the news is loaded and used the template system ;-P
 

Users who are viewing this thread

Top