Example #1
0
 /**
  * Function used to display templates in drop down
  */
 function display_templates()
 {
     //Get Tempplates
     $templates = CBTemplate::get_templates();
     $dd = "<select>\n";
     foreach ($templates as $template) {
         if ($template['name'] != '') {
             $dd .= "<option value='" . $template['dir'] . "'>" . $template['name'] . "</option>\n";
         }
     }
     $dd .= "</select>\n";
     return $dd;
 }
Example #2
0
 /**
  * Function used to get available templates
  */
 function get_templates()
 {
     $dir = STYLES_DIR;
     //Scaning Dir
     $dirs = scandir($dir);
     foreach ($dirs as $tpl) {
         if (substr($tpl, 0, 1) != '.') {
             $tpl_dirs[] = $tpl;
         }
     }
     //Now Checking for template template.xml
     $tpls = array();
     foreach ($tpl_dirs as $tpl_dir) {
         $tpl_details = CBTemplate::get_template_details($tpl_dir);
         if ($tpl_details && $tpl_details['name'] != '') {
             $tpls[$tpl_details['name']] = $tpl_details;
         }
     }
     return $tpls;
 }
 /**
  * Function used to get available templates
  */
 function get_templates($visible = false)
 {
     $dir = STYLES_DIR;
     //Scaning Dir
     $dirs = scandir($dir);
     foreach ($dirs as $tpl) {
         if (substr($tpl, 0, 1) != '.') {
             $tpl_dirs[] = $tpl;
         }
     }
     //Now Checking for template template.xml
     $tpls = array();
     foreach ($tpl_dirs as $tpl_dir) {
         if ($visible == true) {
             $hidden = get_hidden_templates();
             if ($hidden) {
                 if (in_array($tpl_dir, $hidden)) {
                     continue;
                 }
             }
         }
         $tpl_details = CBTemplate::get_template_details($tpl_dir);
         if ($tpl_details && $tpl_details['name'] != '') {
             $tpls[$tpl_details['name']] = $tpl_details;
         }
     }
     return $tpls;
 }
/**
 * Function gets the list of hidden tempaltes.
 * $details can be set to true, if we want there details
 * as-well
 * 
 * @author Fawaz Tahir <*****@*****.**>
 * @param boolean $details
 * @return boolean
 */
function get_hidden_templates($details = false)
{
    $hidden = config('hidden_templates');
    if ($hidden) {
        $hidden = json_decode($hidden, true);
        if ($details == true) {
            $hidden_details = array();
            foreach ($hidden as $tpl_dir) {
                $tpl_details = CBTemplate::get_template_details($tpl_dir);
                if ($tpl_details && $tpl_details['name'] != '') {
                    $hidden_details[$tpl_details['name']] = $tpl_details;
                }
            }
            $hidden = count($hidden_details) > 0 ? $hidden_details : false;
        }
        return $hidden;
    }
    return false;
}
Example #5
0
$cbphoto->thumb_height = $row['photo_thumb_height'];
$cbphoto->mid_width = $row['photo_med_width'];
$cbphoto->mid_height = $row['photo_med_height'];
$cbphoto->lar_width = $row['photo_lar_width'];
$cbphoto->cropping = $row['photo_crop'];
$cbphoto->position = $row['watermark_placement'];
//Enable youtube videos
define("YOUTUBE_ENABLED", $row['youtube_enabled']);
define("EMBED_VDO_WIDTH", $row['embed_player_width']);
define("EMBED_VDO_HEIGHT", $row['embed_player_height']);
//Checking Website Template
include 'plugin.functions.php';
include 'plugins_functions.php';
require BASEDIR . '/includes/classes/template.class.php';
require BASEDIR . '/includes/classes/objects.class.php';
$cbtpl = new CBTemplate();
// STOP CACHING
$cbtpl->caching = 0;
$cbobjects = new CBObjects();
$swfobj = new SWFObject();
//Initializng Userquery class
$userquery->init();
$cbvideo->init();
$cbpm->init();
$cbphoto->init_photos();
$thisurl = curPageURL();
//Setting Up Group Class
$cbgroup->gp_thumb_width = config('grp_thumb_width');
$cbgroup->gp_thumb_height = config('grp_thumb_height');
$Cbucket->set_the_template();
/**