Example #1
0
 function ra_builder_css()
 {
     // dont remove this, unless you have purchased licence removal
     $this->output('<meta name="generator" content="rahularyan">');
     if ($this->template == 'user') {
         if (defined('QA_WORDPRESS_INTEGRATE_PATH')) {
             $id = $this->content['raw']['userid'];
             $cover = get_user_meta($id, 'cover');
             $cover = $cover[0];
         } else {
             @($cover = ra_user_profile(@$this->content['raw']['account']['handle'], 'cover'));
         }
         if ($cover) {
             $this->output('<style>#user .user-bar{background:url("' . qa_opt('site_url') . 'images/' . $cover . '") no-repeat scroll 0 0 / cover;}</style>');
         }
     }
     if (ra_is_home()) {
         $this->output('<style>' . ra_db_builder('css_home') . ra_db_builder('css_bottom') . '</style>');
     } elseif ($this->template == 'questions') {
         $this->output('<style>' . ra_db_builder('css_questions') . ra_db_builder('css_bottom') . '</style>');
     } elseif ($this->template == 'unanswered') {
         $this->output('<style>' . ra_db_builder('css_unanswered') . ra_db_builder('css_bottom') . '</style>');
     } elseif ($this->template == 'tags') {
         $this->output('<style>' . ra_db_builder('css_tags') . ra_db_builder('css_bottom') . '</style>');
     } elseif ($this->template == 'categories') {
         $this->output('<style>' . ra_db_builder('css_categories') . ra_db_builder('css_bottom') . '</style>');
     } elseif ($this->template == 'users') {
         $this->output('<style>' . ra_db_builder('css_users') . ra_db_builder('css_bottom') . '</style>');
     } elseif ($this->template == 'user') {
         $this->output('<style>' . ra_db_builder('css_user') . ra_db_builder('css_bottom') . '</style>');
     }
 }
Example #2
0
/js/bootstrap.js"></script>				
		<script src="<?php 
echo DUDE_THEME_URL;
?>
/js/jquery.dlmenu.js"></script>		

		<script src="<?php 
echo DUDE_THEME_URL;
?>
/js/dude.js"></script>
		<script type="text/javascript">
			<?php 
if (ra_is_home()) {
    echo base64_decode(ra_db_builder('js_home'));
} else {
    echo base64_decode(ra_db_builder('js_' . $context->template));
}
?>
		</script>
		<?php 
if (ra_edit_mode()) {
    ?>
			<script src="<?php 
    echo DUDE_THEME_URL;
    ?>
/js/ra_builder.js"></script>			
		<?php 
}
?>
		
		<?php 
Example #3
0
function ra_layout_cache($page)
{
    $file = DUDE_THEME_DIR . '/cache/' . $page . '.php';
    ob_start();
    //if in builder mode load from database
    if (ra_edit_mode() && ra_is_admin()) {
        if (file_exists($file)) {
            unlink($file);
        }
        return ra_db_builder($page);
    }
    // check if the cache file already exists
    if (file_exists($file)) {
        include $file;
    } else {
        $html = ra_db_builder($page);
        if (strlen($html)) {
            $dom = new DOMDocument();
            $dom->loadHTML('<?xml encoding="UTF-8">' . $html);
            $xpath = new DOMXPath($dom);
            $pDivs = $xpath->query(".//div[@class='config']");
            foreach ($pDivs as $div) {
                $div->parentNode->removeChild($div);
            }
            file_put_contents($file, builder_innerHTML($dom->documentElement->firstChild));
            include $file;
        } else {
            file_put_contents($file, '<h2 style="text-align:center">The layout of this page was not built before, please build the layout using builder.</h2>');
            include $file;
        }
    }
    $output = ob_get_clean();
    return $output;
}