function content_56afd78cd2a9a7_65584604($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/global_header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

    <body>
    <?php 
        echo ANCHOR(array('place' => 'premium_button'), $_smarty_tpl);
        ?>

    <?php 
        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

    <div id="container">

        <!-- Message -->
        <?php 
        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/message.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>


        <?php 
        $_smarty_tpl->tpl_vars['file'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['file']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['template_files']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['file']->key => $_smarty_tpl->tpl_vars['file']->value) {
            $_smarty_tpl->tpl_vars['file']->_loop = true;
            ?>
            <?php 
            echo include_template_file(array('file' => $_smarty_tpl->tpl_vars['file']->value), $_smarty_tpl);
            ?>

        <?php 
        }
        ?>
    </div>

    <?php 
        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

    </body>
</html><?php 
    }
<?php

$this->includeeasyview('easydemo/begin');
$this->includeeasyview('easydemo/header');
DIV_BEGIN('', $this->type);
DIV_BEGIN('', $this->type . 'message');
echo $this->errormessage;
DIV_END();
if ($this->backurl) {
    ANCHOR($this->backurl, 'Home');
}
DIV_END();
$this->includeeasyview('easydemo/footer');
$this->includeeasyview('easydemo/end');
    function content_55e44854c085f1_90364963($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_truncate')) {
            include '/var/www/includes/smartyv3/plugins/modifier.truncate.php';
        }
        if ($_smarty_tpl->tpl_vars['display_type']->value == 'normal' || $_smarty_tpl->tpl_vars['display_type']->value == '') {
            ?>
<div class="item_video">
    <div class="cb_item_container clearfix">
        <div class="cb_item_thumb video_thumb relative" >
        <a href="<?php 
            echo videoLink($_smarty_tpl->tpl_vars['video']->value);
            ?>
" title="<?php 
            echo title($_smarty_tpl->tpl_vars['video']->value['title']);
            ?>
">
        <?php 
            if ($_smarty_tpl->tpl_vars['video']->value['broadcast'] == 'private') {
                ?>
         <span class="private_video">PRIVATE</span>
        <?php 
            }
            ?>
            <span class="fa fa-play play-icon"></span>
            <span class="duration"><?php 
            if ($_smarty_tpl->tpl_vars['video']->value['duration'] > 1) {
                echo SetTime($_smarty_tpl->tpl_vars['video']->value['duration']);
            } else {
                ?>
00:00<?php 
            }
            ?>
            </span>
            <img class="img" src="<?php 
            echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video']->value, 'size' => '160x90'), $_smarty_tpl);
            ?>
 " border="1" />
        </a>
        <?php 
            echo ANCHOR(array('place' => 'in_video_thumb', 'data' => $_smarty_tpl->tpl_vars['video']->value), $_smarty_tpl);
            ?>

         <img src="<?php 
            echo $_smarty_tpl->tpl_vars['imageurl']->value;
            ?>
/dot.gif" data-quick="quick-<?php 
            echo $_smarty_tpl->tpl_vars['video']->value['videoid'];
            ?>
"
         class="add_icon cb_quickie cb-btn-quick-<?php 
            echo $_smarty_tpl->tpl_vars['video']->value['videoid'];
            ?>
" onclick="add_quicklist(this,'<?php 
            echo $_smarty_tpl->tpl_vars['video']->value['videoid'];
            ?>
')" title="Add <?php 
            echo $_smarty_tpl->tpl_vars['video']->value['title'];
            ?>
 to Quicklist" alt="Quicklist" />
        </div>
        <h5>
           <a href="<?php 
            echo videoLink($_smarty_tpl->tpl_vars['video']->value);
            ?>
"><?php 
            echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video']->value['title'], 20);
            ?>
</a>
        </h5>
        <div class="clearfix views-time">
			<span class="font1"><span class="bg-eye"></span>&nbsp;<?php 
            echo $_smarty_tpl->tpl_vars['video']->value['views'];
            ?>
 views</span>
			<span class="font2"><span class="bg-time"></span>&nbsp;<?php 
            echo niceTime($_smarty_tpl->tpl_vars['video']->value['date_added']);
            ?>
</span>
		</div>
    </div>
</div>
<?php 
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['display_type']->value == 'user_videos') {
            ?>
<div class="col-md-3  col-sm-4  col-xs-6 video_thumb ">
    <a href="<?php 
            echo videoLink($_smarty_tpl->tpl_vars['video']->value);
            ?>
" title="<?php 
            echo title($_smarty_tpl->tpl_vars['video']->value['title']);
            ?>
">
        <span class="fa fa-play play-icon"></span>
        <img alt="<?php 
            echo title($_smarty_tpl->tpl_vars['video']->value['title']);
            ?>
" src="<?php 
            echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video']->value, 'size' => '171x120'), $_smarty_tpl);
            ?>
" id="thumbs_<?php 
            echo $_smarty_tpl->tpl_vars['video']->value['videoid'];
            ?>
"  title="<?php 
            echo title($_smarty_tpl->tpl_vars['video']->value['title']);
            ?>
"/>
    </a>
    <p class="cbHomeVidDuration duration_view">
        <?php 
            if ($_smarty_tpl->tpl_vars['video']->value['duration'] > 1) {
                ?>
            <?php 
                echo SetTime($_smarty_tpl->tpl_vars['video']->value['duration']);
                ?>

        <?php 
            } else {
                ?>
            00:00
        <?php 
            }
            ?>
    </p>
    <a href="<?php 
            echo videoLink($_smarty_tpl->tpl_vars['video']->value);
            ?>
" title="<?php 
            echo title($_smarty_tpl->tpl_vars['video']->value['title']);
            ?>
"><h5>
    <b> <?php 
            echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video']->value['title'], 25);
            ?>
</b></h5></a>                     
    <span class="pull-left"><h5><small><?php 
            echo $_smarty_tpl->tpl_vars['video']->value['views'];
            ?>
 views</small></h5></span>
    <span class="pull-right"><h5><small><?php 
            echo niceTime($_smarty_tpl->tpl_vars['video']->value['date_added']);
            ?>
</small></h5></span>
</div>
<?php 
        }
    }
    function content_55e44443075054_87310853($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_truncate')) {
            include '/var/www/includes/smartyv3/plugins/modifier.truncate.php';
        }
        ?>
<div class="container">
	<div id="fb-root"></div>
	<script>(function(d, s, id) {
	    var js, fjs = d.getElementsByTagName(s)[0];
	    if (d.getElementById(id)) return;
	    js = d.createElement(s); js.id = id;
	    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=120542078043680";
	    fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));
	</script>
	<div class="row cb-box marginBottom">

		<?php 
        if (isset($_smarty_tpl->tpl_vars['row'])) {
            $_smarty_tpl->tpl_vars['row'] = clone $_smarty_tpl->tpl_vars['row'];
            $_smarty_tpl->tpl_vars['row']->value = $_smarty_tpl->tpl_vars['myquery']->value->Get_Website_Details();
            $_smarty_tpl->tpl_vars['row']->nocache = null;
            $_smarty_tpl->tpl_vars['row']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['row'] = new Smarty_variable($_smarty_tpl->tpl_vars['myquery']->value->Get_Website_Details(), null, 0);
        }
        ?>

	    <!--<div class="alert alert-info margin-bottom-10 ">-->
	    <?php 
        echo ANCHOR(array('place' => 'global'), $_smarty_tpl);
        ?>
 
	    <!--	</div> -->
	    <div class="clearfix"></div>
	       
		<?php 
        if (is_installed('editorspick')) {
            ?>
		<?php 
            if ($_smarty_tpl->tpl_vars['editor_picks']->value) {
                ?>
		<div class="row">
	        <div class="col-md-8">
				<!-- Editor Pick Video Main Container START //-->
				<div id="ep_video_container">
					<?php 
                if (is_installed('editorspick')) {
                    ?>
					<?php 
                    if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list'])) {
                        unset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']);
                    }
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['name'] = 'e_list';
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['editor_picks']->value) ? count($_loop) : max(0, (int) $_loop);
                    unset($_loop);
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] = (int) 1;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = true;
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] < 0) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'];
                    }
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] = 1;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] - 1;
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = min(ceil(($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] > 0 ? $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] : $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] + 1) / abs($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'])), $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max']);
                        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] == 0) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = false;
                        }
                    } else {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = 0;
                    }
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                        for ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration']++) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == 1;
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'];
                            ?>
					<?php 
                            echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/editor_pick/video_block.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('video' => $_smarty_tpl->tpl_vars['editor_picks']->value[$_smarty_tpl->getVariable('smarty')->value['section']['e_list']['index']]), 0);
                            ?>

					<?php 
                        }
                    } else {
                        ?>
					There is no video in editor's pick, Please Add Videos In Editor's Pick<br />Videos Manager > Add to editor's pick
					<?php 
                    }
                    ?>
					<?php 
                }
                ?>
				</div>
				
				<!-- Editor Pick Video Main Container END //-->

	        </div>

			<!-- Editor Pick Videos Slider Container START //-->
	        <div class="col-md-4 col-sm-12 col-xs-12 editorpick-holder pull-right custom-elements">
	            <div id="slide" class="scrollable-area">
					<?php 
                if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list'])) {
                    unset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']);
                }
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['name'] = 'e_list';
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['editor_picks']->value) ? count($_loop) : max(0, (int) $_loop);
                unset($_loop);
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = true;
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] = 1;
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] - 1;
                if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'];
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] == 0) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = false;
                    }
                } else {
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = 0;
                }
                if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                    for ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration']++) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'];
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == 1;
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'];
                        ?>
	            	<?php 
                        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/editor_pick/index_featured_video.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('video' => $_smarty_tpl->tpl_vars['editor_picks']->value[$_smarty_tpl->getVariable('smarty')->value['section']['e_list']['index']]), 0);
                        ?>

					<?php 
                    }
                }
                ?>
	        	</div>
				<div class="next_pre_hold">
					<a href="#" class="col-md-6 btn btn-primary" id="slide_prev">
					<span class="glyphicon glyphicon-chevron-up"></span>
					</a>
					<a href="#" class="col-md-6 btn btn-primary" id="slide_next">
					<span class="glyphicon glyphicon-chevron-down"></span>
					</a>
				</div>
			</div>
	        <!-- Editor Pick Videos Slider Container END //-->
		</div>
		<?php 
            }
            ?>
		<?php 
        }
        ?>
	    <!-- ******************************************* //-->
		<!-- ************ EDITORS BLOCK END ************ //-->
	    <!-- ******************************************* //-->
	       
	    
	         
	   <!-- <div align="center" class="margin-bottom-10">
	    	<a href="http://www.arvixe.com/clipbucket_hosting">
	    		<img class="banner" src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/assets/images/ad-box-728x90.jpg" >

			</a>
		</div>-->
		<div class="ad"><?php 
        echo getAd(array('place' => 'ad_728x90'), $_smarty_tpl);
        ?>
</div>
		<!-- ******************************************* //-->
		<!-- *********** LATEST VIDEOS START *********** //-->
		<!-- ******************************************* //-->
		<div class="row">
			<div class="col-md-12 clearfix">
				<div class="col-md-8 nopadding padding-right-10 featuredvideos-wrapper">
					<h2 class="myHeading theme_color"><?php 
        echo smarty_lang(array('code' => "Featured Videos"), $_smarty_tpl);
        ?>
</h2>
					<?php 
        if (isset($_smarty_tpl->tpl_vars['featured_videos'])) {
            $_smarty_tpl->tpl_vars['featured_videos'] = clone $_smarty_tpl->tpl_vars['featured_videos'];
            $_smarty_tpl->tpl_vars['featured_videos']->value = get_videos(array('featured' => 'yes', 'limit' => 6));
            $_smarty_tpl->tpl_vars['featured_videos']->nocache = null;
            $_smarty_tpl->tpl_vars['featured_videos']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['featured_videos'] = new Smarty_variable(get_videos(array('featured' => 'yes', 'limit' => 6)), null, 0);
        }
        ?>
					<?php 
        if ($_smarty_tpl->tpl_vars['featured_videos']->value) {
            ?>
					<div class="col-md-12 featured-videos nopadding">
						<div class="col-md-12 text-center nopadding ">
							<div class="col-md-8 text-center nopadding mouse_hover featured-imglg">
							
								<?php 
            if (isset($_smarty_tpl->tpl_vars['video_01'])) {
                $_smarty_tpl->tpl_vars['video_01'] = clone $_smarty_tpl->tpl_vars['video_01'];
                $_smarty_tpl->tpl_vars['video_01']->value = $_smarty_tpl->tpl_vars['featured_videos']->value[0];
                $_smarty_tpl->tpl_vars['video_01']->nocache = null;
                $_smarty_tpl->tpl_vars['video_01']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['video_01'] = new Smarty_variable($_smarty_tpl->tpl_vars['featured_videos']->value[0], null, 0);
            }
            ?>
								<div class="col-md-12 text-center nopadding video_thumb_lg">
									<a href="<?php 
            echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['video_01']->value), $_smarty_tpl);
            ?>
" title="<?php 
            echo $_smarty_tpl->tpl_vars['video_01']->value['title'];
            ?>
">
										<span class="play-icon fa fa-play"></span>
										<img class="cb_img_thum" src="<?php 
            echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video_01']->value, 'num' => '4', 'size' => 'big'), $_smarty_tpl);
            ?>
" width="500" height="285" border="0" <?php 
            echo ANCHOR(array('place' => "video_thumb", 'data' => $_smarty_tpl->tpl_vars['video_01']->value), $_smarty_tpl);
            ?>
 />
									</a>
									<div class="cbHomeVidTitle cbHomeVidTitle_Big mouse_hover_on"><?php 
            echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video_01']->value['title'], 30);
            ?>
</div>
								</div>
					            <div class="cbHomeVidDuration mouse_hover_on">
					            <?php 
            if ($_smarty_tpl->tpl_vars['video_01']->value['duration'] > 1) {
                echo SetTime($_smarty_tpl->tpl_vars['video_01']->value['duration']);
            } else {
                ?>
00:00ewwew<?php 
            }
            ?>
					            </div>
					            <div class="cbHomeVidDuration_left mouse_hover_on">
					            	<?php 
            echo $_smarty_tpl->tpl_vars['video_01']->value['username'];
            ?>

					            </div>
							</div>
							<div class="col-md-4 col-sm-6 hidden-xs text-center nopadding-right pull-right tumb-sm">
							<?php 
            $_smarty_tpl->tpl_vars['video_02'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['video_02']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['featured_videos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['video_02']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['video_02']->key => $_smarty_tpl->tpl_vars['video_02']->value) {
                $_smarty_tpl->tpl_vars['video_02']->_loop = true;
                $_smarty_tpl->tpl_vars['video_02']->iteration++;
                ?>
								<?php 
                if ($_smarty_tpl->tpl_vars['video_02']->iteration > 1 && $_smarty_tpl->tpl_vars['video_02']->iteration < 4) {
                    ?>
								<div class="col-md-12 text-center nopadding mouse_hover1 featured-video video_thumb" style="<?php 
                    if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['foo']['last']) {
                        ?>
 <?php 
                    }
                    ?>
 " >
									<a href="<?php 
                    echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
" title="<?php 
                    echo $_smarty_tpl->tpl_vars['video_02']->value['title'];
                    ?>
">
										<span class="play-icon fa fa-play"></span>
										<img class="cb_img_thum" src="<?php 
                    echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value, 'size' => '240x133'), $_smarty_tpl);
                    ?>
" width="240" height="133" <?php 
                    echo ANCHOR(array('place' => "video_thumb", 'data' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
 />
										<div class="cbHomeVidTitle mouse_hover_on1"><?php 
                    echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video_02']->value['title'], 10);
                    ?>
</div>
										<div class="cbHomeVidDuration mouse_hover_on1">
						            		<?php 
                    if ($_smarty_tpl->tpl_vars['video_02']->value['duration'] > 1) {
                        echo SetTime($_smarty_tpl->tpl_vars['video_02']->value['duration']);
                    } else {
                        ?>
00:00<?php 
                    }
                    ?>
						            	</div>
									</a>
								</div>
								<?php 
                }
                ?>

							<?php 
            }
            ?>
							</div>
							<div class="col-lg-12 col-md-12 text-center nopadding">
							<?php 
            $_smarty_tpl->tpl_vars['video_02'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['video_02']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['featured_videos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['video_02']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['video_02']->key => $_smarty_tpl->tpl_vars['video_02']->value) {
                $_smarty_tpl->tpl_vars['video_02']->_loop = true;
                $_smarty_tpl->tpl_vars['video_02']->iteration++;
                ?>
							<?php 
                if ($_smarty_tpl->tpl_vars['video_02']->iteration > 3) {
                    ?>
								<div class="col-lg-4 col-md-4 col-sm-6 hidden-xs video_thumb text-center nopadding-right mouse_hover featured-video <?php 
                    if ($_smarty_tpl->tpl_vars['video_02']->iteration == 4) {
                        ?>
nopadding<?php 
                    }
                    ?>
 ">
									<a href="<?php 
                    echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
" title="<?php 
                    echo $_smarty_tpl->tpl_vars['video_02']->value['title'];
                    ?>
">
										<span class="play-icon fa fa-play"></span>
										<img class="cb_img_thum" src="<?php 
                    echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value, 'size' => '240x133'), $_smarty_tpl);
                    ?>
" width="240" height="133" <?php 
                    echo ANCHOR(array('place' => "video_thumb", 'data' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
 />
									
										<div class="cbHomeVidTitle mouse_hover_on"><?php 
                    echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video_02']->value['title'], 10);
                    ?>
</div>

										<div class="cbHomeVidDuration mouse_hover_on">
							            <?php 
                    if ($_smarty_tpl->tpl_vars['video_02']->value['duration'] > 1) {
                        echo SetTime($_smarty_tpl->tpl_vars['video_02']->value['duration']);
                    } else {
                        ?>
00:00<?php 
                    }
                    ?>
							            </div>
									</a>
								</div>
							<?php 
                }
                ?>
							<?php 
            }
            ?>
							</div>
			                
			            </div>
					
		        		<div class="clearfix"></div>    
					</div>
					<?php 
        } else {
            ?>
					<div class="col-md-12 nopadding">No featured Video</div>
					<?php 
        }
        ?>
			        <div class="clearfix"></div>
			        <div class="row nopadding">
			        	<h3 class="myHeading theme_color"><?php 
        echo lang('Recent videos');
        ?>
</h3>
			        	<?php 
        if (isset($_smarty_tpl->tpl_vars['videos'])) {
            $_smarty_tpl->tpl_vars['videos'] = clone $_smarty_tpl->tpl_vars['videos'];
            $_smarty_tpl->tpl_vars['videos']->value = get_videos(array("order" => "date_added DESC", "limit" => 12));
            $_smarty_tpl->tpl_vars['videos']->nocache = null;
            $_smarty_tpl->tpl_vars['videos']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['videos'] = new Smarty_variable(get_videos(array("order" => "date_added DESC", "limit" => 12)), null, 0);
        }
        ?>
						<div class="clearfix recent-videos row">
				        	<?php 
        $_smarty_tpl->tpl_vars['video'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['video']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['videos']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['video']->key => $_smarty_tpl->tpl_vars['video']->value) {
            $_smarty_tpl->tpl_vars['video']->_loop = true;
            ?>

				        	<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 mbm cb-video-fixed-block">
				        		<!-- <div class="marginBottom grid_view recent-col list_view nopadding-right"> -->
								<?php 
            echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/videos/video.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
            ?>

								<!-- </div> -->
							</div>
				        	<?php 
        }
        ?>
			        	</div>
			        </div>
					
	              	<div class="ad"><?php 
        echo getAd(array('place' => 'ad_468x60'), $_smarty_tpl);
        ?>
</div>
			    	<div class="row nopadding">
			    		<?php 
        if ($_smarty_tpl->tpl_vars['row']->value['photosSection'] == 'yes') {
            ?>
						<div class="col-md-12 clearfix nopadding ">
			        		<h2 class="myHeading theme_color"><?php 
            echo smarty_lang(array('code' => "Photos"), $_smarty_tpl);
            ?>
</h2>
							<?php 
            if (isset($_smarty_tpl->tpl_vars['result_photos1_01'])) {
                $_smarty_tpl->tpl_vars['result_photos1_01'] = clone $_smarty_tpl->tpl_vars['result_photos1_01'];
                $_smarty_tpl->tpl_vars['result_photos1_01']->value = get_photos(array('order' => ' RAND() LIMIT 15 '));
                $_smarty_tpl->tpl_vars['result_photos1_01']->nocache = null;
                $_smarty_tpl->tpl_vars['result_photos1_01']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['result_photos1_01'] = new Smarty_variable(get_photos(array('order' => ' RAND() LIMIT 15 ')), null, 0);
            }
            ?>
		
			        		<?php 
            if ($_smarty_tpl->tpl_vars['result_photos1_01']->value) {
                ?>
	        				<!-- *********** FIRST PHOTOS START ************ //-->
	        				<!-- <div class="row clearfix fill-background lg-img"> -->
							<div class="clearfix featured-images">
								<div class="clearfix">
								<?php 
                $_smarty_tpl->tpl_vars['result_photo1_01'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['result_photo1_01']->_loop = false;
                $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['result_photos1_01']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['result_photo1_01']->key => $_smarty_tpl->tpl_vars['result_photo1_01']->value) {
                    $_smarty_tpl->tpl_vars['result_photo1_01']->_loop = true;
                    $_smarty_tpl->tpl_vars['i']->value = $_smarty_tpl->tpl_vars['result_photo1_01']->key;
                    ?>
									
								<?php 
                    if ($_smarty_tpl->tpl_vars['i']->value == 0) {
                        ?>
			

									<div class="ft-img col-md-7">
									

						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => "cb_img_thum"), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						          
						            </div>
						        <?php 
                    } elseif ($_smarty_tpl->tpl_vars['i']->value < 3) {
                        ?>
    

						           
						            
									
									<div class="ft-img col-md-5">
						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_08']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						           
						       	    </div>
						           
								<?php 
                    } elseif ($_smarty_tpl->tpl_vars['i']->value < 7) {
                        ?>
						           
									<div class="ft-img col-md-6">
						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_08']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						            
						       	    </div>
						            
								<?php 
                    } else {
                        ?>
			
						           
									<div class="ft-img col-md-3" style="height:140px;">
						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_08']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						            
						       	    </div>
						         <?php 
                    }
                    ?>
   
						        
						        <?php 
                }
                ?>
						        </div>
								<!-- </div> -->
							</div>
					        <!-- *********** FIRST PHOTOS END ************ //-->
				     		<?php 
            }
            ?>

							<?php 
            if (isset($_smarty_tpl->tpl_vars['result_photos2_08'])) {
                $_smarty_tpl->tpl_vars['result_photos2_08'] = clone $_smarty_tpl->tpl_vars['result_photos2_08'];
                $_smarty_tpl->tpl_vars['result_photos2_08']->value = get_photos(array('order' => '  photo_id ASC LIMIT 4 '));
                $_smarty_tpl->tpl_vars['result_photos2_08']->nocache = null;
                $_smarty_tpl->tpl_vars['result_photos2_08']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['result_photos2_08'] = new Smarty_variable(get_photos(array('order' => '  photo_id ASC LIMIT 4 ')), null, 0);
            }
            ?>
						    
						    <?php 
            if ($_smarty_tpl->tpl_vars['result_photos2_08']->value) {
                ?>
 		
					        <!-- *********** SECOND PHOTOS START ************ //-->
							<!-- <div class="col-md-12 fill-background clearfix lg-img">
						        <div class="col-md-5 nopadding sm-imgs clearfix left-aligned">
								<?php 
                $_smarty_tpl->tpl_vars['result_photo2_08'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['result_photo2_08']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['result_photos2_08']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['result_photo2_08']->key => $_smarty_tpl->tpl_vars['result_photo2_08']->value) {
                    $_smarty_tpl->tpl_vars['result_photo2_08']->_loop = true;
                    ?>
									<div class="col-md-6 col-sm-6">
						        	<a href="<?php 
                    echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo2_08']->value, 'view_item');
                    ?>
">
						        	<?php 
                    echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo2_08']->value, 'output' => 'html', 'width' => "128", 'height' => "118", 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                    ?>

						        	</a>
						        <?php 
                    if ($_smarty_tpl->tpl_vars['photos']->iteration > 1) {
                        break 1;
                    }
                    ?>
						   	    </div>
						        <?php 
                }
                ?>
								</div>
								<?php 
                if (isset($_smarty_tpl->tpl_vars['result_photos2_01'])) {
                    $_smarty_tpl->tpl_vars['result_photos2_01'] = clone $_smarty_tpl->tpl_vars['result_photos2_01'];
                    $_smarty_tpl->tpl_vars['result_photos2_01']->value = get_photos(array('order' => '  RAND() LIMIT 1 '));
                    $_smarty_tpl->tpl_vars['result_photos2_01']->nocache = null;
                    $_smarty_tpl->tpl_vars['result_photos2_01']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['result_photos2_01'] = new Smarty_variable(get_photos(array('order' => '  RAND() LIMIT 1 ')), null, 0);
                }
                ?>
								<div class="col-md-7 big_img">
								<?php 
                $_smarty_tpl->tpl_vars['result_photo2_01'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['result_photo2_01']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['result_photos2_01']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['result_photo2_01']->key => $_smarty_tpl->tpl_vars['result_photo2_01']->value) {
                    $_smarty_tpl->tpl_vars['result_photo2_01']->_loop = true;
                    ?>
						        	<a href="<?php 
                    echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo2_01']->value, 'view_item');
                    ?>
">
						        	<?php 
                    echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo2_01']->value, 'output' => 'html', 'width' => "420", 'height' => "235", 'size' => "l", 'class' => "cb_img_thum"), $_smarty_tpl);
                    ?>

						        	</a>
						        <?php 
                }
                ?>
						        </div>
							</div> -->
							<!-- *********** SECOND PHOTOS END ************ //-->
							<?php 
            }
            ?>
						</div>
						<?php 
        } else {
            ?>
						<div class="col-md-12 nopadding">No featured Photo</div>
						<?php 
        }
        ?>
	
					</div>

			        <!-- ******************************************* //-->
			        <!-- *********** PHOTOS END ************ //-->
			        <!-- ******************************************* //-->

				</div>
				<!-- ******************************************* //-->
		        <!-- ******** ADVERTISEMENT BLOCK START ******** //-->
		        <!-- ******************************************* //-->
				<!--<div class="col-md-4" style="background-color:#F2F2F2; padding-top:10px; padding-bottom:10px; margin-bottom:10px;">
				<h2 class="myHeadingBLK" style="margin-top:0;">Advertisement</h2>
					<div class="col-md-12 text-center nopadding" style="font-size:18px; border:1px solid #CCC; background:#FFF; display:block; height: 250px; width: 300px; line-height: 200px; text-align:center; left:7%;">
					Ad Box 300 x 250
					</div>
				</div>-->
				<!-- ******************************************* //-->
		        <!-- ******** ADVERTISEMENT BLOCK END ******** //-->
		        <!-- ******************************************* //-->


				<!-- ******************************************* //-->
		        <!-- ************* USER BLOCK START ************ //-->
		        <!-- ******************************************* //-->
				<?php 
        if (isset($_smarty_tpl->tpl_vars['feature_users'])) {
            $_smarty_tpl->tpl_vars['feature_users'] = clone $_smarty_tpl->tpl_vars['feature_users'];
            $_smarty_tpl->tpl_vars['feature_users']->value = get_users(array('featured' => 'yes', 'limit' => 5));
            $_smarty_tpl->tpl_vars['feature_users']->nocache = null;
            $_smarty_tpl->tpl_vars['feature_users']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['feature_users'] = new Smarty_variable(get_users(array('featured' => 'yes', 'limit' => 5)), null, 0);
        }
        ?>
				<?php 
        if ($_smarty_tpl->tpl_vars['feature_users']->value) {
            ?>
	     		<div class="col-md-4 side_user_home">
					<h2 class="myHeading theme_color"><?php 
            echo smarty_lang(array('code' => "Featured Users"), $_smarty_tpl);
            ?>
</h2>
	               
	               <?php 
            $_smarty_tpl->tpl_vars['user'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['user']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['feature_users']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['user']->key => $_smarty_tpl->tpl_vars['user']->value) {
                $_smarty_tpl->tpl_vars['user']->_loop = true;
                ?>
					
	                <div class="col-md-12 nopadding clearfix user-view-home">
						<div class="col-md-3 nopadding">
							<img src="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->getuserthumb($_smarty_tpl->tpl_vars['user']->value, 'small');
                ?>
" width="56" height="56" class="img-circle" />
						</div>
						<div class="col-md-9 nopadding">
							<h4 class="nopadding "><a href="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['user']->value);
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['user']->value['username'];
                ?>
</a></h4>

							<div class=" nopadding col-md-6 min-height-20">
								<div class="pull-left small"><span class="bg-eye"></span>&nbsp;<span><?php 
                echo number_format($_smarty_tpl->tpl_vars['user']->value['profile_hits']);
                ?>
 <?php 
                echo smarty_lang(array('code' => 'views'), $_smarty_tpl);
                ?>
</span></div>
								<div class="pull-right small"><span class="bg-videocam"></span>&nbsp;<span><?php 
                echo number_format($_smarty_tpl->tpl_vars['user']->value['total_videos']);
                ?>
 <?php 
                echo smarty_lang(array('code' => 'Videos'), $_smarty_tpl);
                ?>
</span></div>
							</div>
		                    <br>
		                    <div class="row pull-left" style="margin-left: 0px; width: 99%;">
			                    <div class="progres">
			                        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
			                            <span class="sr-only">40% Complete (success)</span>
			                        </div>
			                    </div>
		                    </div>
							<!--<div class="col-md-12 nopadding progress no-border-radius">
			      				<div style="width: 40%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="40" role="progressbar" class="progress-bar progress-bar-success">
			        			<span class="sr-only">40% Complete (success)</span>
			  					</div>
			    			</div>-->
						</div>
						<div class="user_icon">
							<a href="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['user']->value);
                ?>
">
							<img class="" src="<?php 
                echo $_smarty_tpl->tpl_vars['imageurl']->value;
                ?>
/user_next_icon.png" width="25" height="25" />
							</a>
						</div>
					</div>
					<?php 
            }
            ?>
				</div>
				<?php 
        }
        ?>
				<!-- ******************************************* //-->
		        <!-- ************* USER BLOCK END ************ //-->
		        <!-- ******************************************* //-->
		        <?php 
        if ($_smarty_tpl->tpl_vars['row']->value['collectionsSection'] == 'yes') {
            ?>
				<?php 
            if (isset($_smarty_tpl->tpl_vars['collections'])) {
                $_smarty_tpl->tpl_vars['collections'] = clone $_smarty_tpl->tpl_vars['collections'];
                $_smarty_tpl->tpl_vars['collections']->value = $_smarty_tpl->tpl_vars['cbcollection']->value->get_collections(array('limit' => 5, 'active' => 'yes'));
                $_smarty_tpl->tpl_vars['collections']->nocache = null;
                $_smarty_tpl->tpl_vars['collections']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['collections'] = new Smarty_variable($_smarty_tpl->tpl_vars['cbcollection']->value->get_collections(array('limit' => 5, 'active' => 'yes')), null, 0);
            }
            ?>
				<div class="col-md-4 comment_home side_user_home" >
					<h2 class="myHeading"><?php 
            echo smarty_lang(array('code' => "Top Collections"), $_smarty_tpl);
            ?>
</h2>
					<?php 
            if (isset($_smarty_tpl->tpl_vars['limit'])) {
                $_smarty_tpl->tpl_vars['limit'] = clone $_smarty_tpl->tpl_vars['limit'];
                $_smarty_tpl->tpl_vars['limit']->value = 10;
                $_smarty_tpl->tpl_vars['limit']->nocache = null;
                $_smarty_tpl->tpl_vars['limit']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['limit'] = new Smarty_variable(10, null, 0);
            }
            ?>
		        	<?php 
            if ($_smarty_tpl->tpl_vars['collections']->value) {
                ?>
        
					<?php 
                $_smarty_tpl->tpl_vars['collection'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['collection']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['collections']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['collection']->key => $_smarty_tpl->tpl_vars['collection']->value) {
                    $_smarty_tpl->tpl_vars['collection']->_loop = true;
                    ?>
					<div class="clearfix collection-section">
						<div class="category-header row clearfix">
							<div class="col-sm-6 clearfix"><?php 
                    echo $_smarty_tpl->tpl_vars['collection']->value['collection_name'];
                    ?>
</div>
							<div class="col-sm-6 clearfix"><span class="total-obj"><?php 
                    echo $_smarty_tpl->tpl_vars['collection']->value['total_objects'];
                    ?>
</span></div>

							<!--  -->
							<!-- <div class="col-sm-6 clearfix"><span class="total-obj"><?php 
                    echo $_smarty_tpl->tpl_vars['limit']->value;
                    ?>
</span></div> -->
						</div>
						<div class="collection-grid clearfix"> 
						<?php 
                    if ($_smarty_tpl->tpl_vars['collection']->value['type'] == 'photos') {
                        ?>
							<?php 
                        if (isset($_smarty_tpl->tpl_vars['items'])) {
                            $_smarty_tpl->tpl_vars['items'] = clone $_smarty_tpl->tpl_vars['items'];
                            $_smarty_tpl->tpl_vars['items']->value = $_smarty_tpl->tpl_vars['cbphoto']->value->collection->get_collection_items_with_details($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false);
                            $_smarty_tpl->tpl_vars['items']->nocache = null;
                            $_smarty_tpl->tpl_vars['items']->scope = 0;
                        } else {
                            $_smarty_tpl->tpl_vars['items'] = new Smarty_variable($_smarty_tpl->tpl_vars['cbphoto']->value->collection->get_collection_items_with_details($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false), null, 0);
                        }
                        ?>
						<?php 
                    } else {
                        ?>
							<?php 
                        if (isset($_smarty_tpl->tpl_vars['items'])) {
                            $_smarty_tpl->tpl_vars['items'] = clone $_smarty_tpl->tpl_vars['items'];
                            $_smarty_tpl->tpl_vars['items']->value = get_videos_of_collection($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false);
                            $_smarty_tpl->tpl_vars['items']->nocache = null;
                            $_smarty_tpl->tpl_vars['items']->scope = 0;
                        } else {
                            $_smarty_tpl->tpl_vars['items'] = new Smarty_variable(get_videos_of_collection($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false), null, 0);
                        }
                        ?>
						<?php 
                    }
                    ?>
	



						<?php 
                    if ($_smarty_tpl->tpl_vars['items']->value) {
                        ?>
							<?php 
                        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['item']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['items']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                            $_smarty_tpl->tpl_vars['item']->_loop = true;
                            ?>
								<div class="collection-item">
									<a href="<?php 
                            echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['item']->value, 'view_item');
                            ?>
">
										<?php 
                            if ($_smarty_tpl->tpl_vars['collection']->value['type'] == 'photos') {
                                ?>
											<?php 
                                echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['item']->value, 'output' => 'html', 'size' => "l", 'class' => "cb_img_thum"), $_smarty_tpl);
                                ?>

										<?php 
                            } else {
                                ?>
											<img alt="<?php 
                                echo $_smarty_tpl->tpl_vars['item']->value['title'];
                                ?>
" title="<?php 
                                echo $_smarty_tpl->tpl_vars['item']->value['title'];
                                ?>
" class="cb_img_thum" id="photo_<?php 
                                echo $_smarty_tpl->tpl_vars['item']->value['ci_id'];
                                ?>
" src="<?php 
                                echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['item']->value), $_smarty_tpl);
                                ?>
">
										<?php 
                            }
                            ?>
									</a>
								</div>
							<?php 
                        }
                        ?>
						<?php 
                    }
                    ?>
						</div>
					</div>

					<?php 
                }
                ?>
					<?php 
            } else {
                ?>
					<div class="col-md-12 nopadding">No Collection</div>
					<?php 
            }
            ?>
		    	</div>
		    	<?php 
        }
        ?>
				
				<?php 
        if (isset($_smarty_tpl->tpl_vars['playlists'])) {
            $_smarty_tpl->tpl_vars['playlists'] = clone $_smarty_tpl->tpl_vars['playlists'];
            $_smarty_tpl->tpl_vars['playlists']->value = get_playlists(array('limit' => 5, 'order' => 'total_items DESC'));
            $_smarty_tpl->tpl_vars['playlists']->nocache = null;
            $_smarty_tpl->tpl_vars['playlists']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['playlists'] = new Smarty_variable(get_playlists(array('limit' => 5, 'order' => 'total_items DESC')), null, 0);
        }
        ?>
                <div class="col-md-4 comment_home side_user_home " >
                	<h2 class="myHeading"><?php 
        echo smarty_lang(array('code' => "Top Playlists"), $_smarty_tpl);
        ?>
</h2>
                	<?php 
        if ($_smarty_tpl->tpl_vars['playlists']->value) {
            ?>
					<?php 
            $_smarty_tpl->tpl_vars['playlist'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['playlist']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['playlists']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['playlist']->key => $_smarty_tpl->tpl_vars['playlist']->value) {
                $_smarty_tpl->tpl_vars['playlist']->_loop = true;
                ?>

						<div class="clearfix collection-section">
							<div class="category-header row clearfix">
								<div class="col-sm-6 clearfix"><span class=""><?php 
                echo $_smarty_tpl->tpl_vars['playlist']->value['playlist_name'];
                ?>
</span></div>
								<div class="col-sm-6 clearfix">
									<span class="total-obj">
										<?php 
                echo number_format($_smarty_tpl->tpl_vars['cbvid']->value->action->count_playlist_items($_smarty_tpl->tpl_vars['playlist']->value['playlist_id']));
                ?>

									</span>
								</div>
                            </div>

							<div class="collection-grid clearfix"> 
							<?php 
                if (isset($_smarty_tpl->tpl_vars['items'])) {
                    $_smarty_tpl->tpl_vars['items'] = clone $_smarty_tpl->tpl_vars['items'];
                    $_smarty_tpl->tpl_vars['items']->value = get_playlist_items($_smarty_tpl->tpl_vars['playlist']->value['playlist_id']);
                    $_smarty_tpl->tpl_vars['items']->nocache = null;
                    $_smarty_tpl->tpl_vars['items']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['items'] = new Smarty_variable(get_playlist_items($_smarty_tpl->tpl_vars['playlist']->value['playlist_id']), null, 0);
                }
                ?>
								<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['items']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
								    <div class="collection-item">
										    <?php 
                    if (isset($_smarty_tpl->tpl_vars['videoid'])) {
                        $_smarty_tpl->tpl_vars['videoid'] = clone $_smarty_tpl->tpl_vars['videoid'];
                        $_smarty_tpl->tpl_vars['videoid']->value = $_smarty_tpl->tpl_vars['item']->value['videoid'];
                        $_smarty_tpl->tpl_vars['videoid']->nocache = null;
                        $_smarty_tpl->tpl_vars['videoid']->scope = 0;
                    } else {
                        $_smarty_tpl->tpl_vars['videoid'] = new Smarty_variable($_smarty_tpl->tpl_vars['item']->value['videoid'], null, 0);
                    }
                    ?>
										    <?php 
                    if ($_smarty_tpl->tpl_vars['videoid']->value) {
                        ?>
		                                    <?php 
                        if (isset($_smarty_tpl->tpl_vars['videos'])) {
                            $_smarty_tpl->tpl_vars['videos'] = clone $_smarty_tpl->tpl_vars['videos'];
                            $_smarty_tpl->tpl_vars['videos']->value = get_videos(array('videoid' => $_smarty_tpl->tpl_vars['videoid']->value, 'limit' => '4'));
                            $_smarty_tpl->tpl_vars['videos']->nocache = null;
                            $_smarty_tpl->tpl_vars['videos']->scope = 0;
                        } else {
                            $_smarty_tpl->tpl_vars['videos'] = new Smarty_variable(get_videos(array('videoid' => $_smarty_tpl->tpl_vars['videoid']->value, 'limit' => '4')), null, 0);
                        }
                        ?>
											    <?php 
                        $_smarty_tpl->tpl_vars['video'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['video']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['videos']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['video']->key => $_smarty_tpl->tpl_vars['video']->value) {
                            $_smarty_tpl->tpl_vars['video']->_loop = true;
                            ?>
				                                    <a href="<?php 
                            echo videoLink($_smarty_tpl->tpl_vars['video']->value);
                            ?>
">
														<?php 
                            if (isset($_smarty_tpl->tpl_vars['thumb'])) {
                                $_smarty_tpl->tpl_vars['thumb'] = clone $_smarty_tpl->tpl_vars['thumb'];
                                $_smarty_tpl->tpl_vars['thumb']->value = get_thumb($_smarty_tpl->tpl_vars['video']->value);
                                $_smarty_tpl->tpl_vars['thumb']->nocache = null;
                                $_smarty_tpl->tpl_vars['thumb']->scope = 0;
                            } else {
                                $_smarty_tpl->tpl_vars['thumb'] = new Smarty_variable(get_thumb($_smarty_tpl->tpl_vars['video']->value), null, 0);
                            }
                            ?>
				                                        <img src="<?php 
                            echo $_smarty_tpl->tpl_vars['thumb']->value;
                            ?>
" />
						                            </a>
												<?php 
                        }
                        ?>
											<?php 
                    } else {
                        ?>
											<span class="label label-default">no items</span>
											<?php 
                    }
                    ?>
                                    </div>
								<?php 
                }
                ?>
							</div>
						</div>	

                    <?php 
            }
            ?>
                    <?php 
        } else {
            ?>
						<div class="col-md-12 nopadding">No Playlists</div>
					<?php 
        }
        ?>
				</div>

			</div>
		</div>
	</div>
	
</div>

<div style="height:20px;"></div>
<script type="text/javascript">
	$(function() {
				
	    $('#slide').ulslide({
	        width: 350,
	        height: 88,
			effect: {
				type: 'carousel', // slide or fade
	            axis: 'y',        // x, y
				showCount: 5
			},
	        nextButton: '#slide_next',
	        prevButton: '#slide_prev',
	        duration: 800,
	        /*autoslide: 2000*/
			easing: 'easeOutBounce'
	    });
	    $('#slide1').ulslide({
	        width: 150,
	        height: 80,
			effect: {
				type: 'carousel', // slide or fade
	            axis: 'x',        // x, y
				showCount: 5
			},
	        nextButton: '#slide_next1',
	        prevButton: '#slide_prev1',
	        duration: 800,
	        autoslide: 2000
			/*easing: 'easeOutBounce'*/
	    });
	    $('#slide3').ulslide({
	        width: 150,
	        height: 80,
			effect: {
				type: 'carousel', // slide or fade
	            axis: 'x',        // x, y
				showCount: 5
			},
	        nextButton: '#slide_next3',
	        prevButton: '#slide_prev3',
	        duration: 800,
	        autoslide: 2000,
			easing: 'easeOutBounce'
	    });
	});
</script>

<!--<style>

.ad{
    background: none repeat scroll 0 0 #F3F3F3;
    border: 1px solid #CCCCCC;
    font-size: 15px;
    height: 90px;
    margin: 0 auto 25px;
    padding: 0;
    text-align: center;
    width: 728px;
}
</style>--><?php 
    }
    function content_55e44441897a91_94399789($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_date_format')) {
            include '/var/www/includes/smartyv3/plugins/modifier.date_format.php';
        }
        ?>
<!DOCTYPE HTML>

<html>
    <head>
        <?php 
        if (in_dev()) {
            ?>
            <?php 
            if (isset($_smarty_tpl->tpl_vars['cache_buster'])) {
                $_smarty_tpl->tpl_vars['cache_buster'] = clone $_smarty_tpl->tpl_vars['cache_buster'];
                $_smarty_tpl->tpl_vars['cache_buster']->value = microtime(true);
                $_smarty_tpl->tpl_vars['cache_buster']->nocache = null;
                $_smarty_tpl->tpl_vars['cache_buster']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['cache_buster'] = new Smarty_variable(microtime(true), null, 0);
            }
            ?>
        <?php 
        } else {
            ?>
            <?php 
            if (isset($_smarty_tpl->tpl_vars['cache_buster'])) {
                $_smarty_tpl->tpl_vars['cache_buster'] = clone $_smarty_tpl->tpl_vars['cache_buster'];
                $_smarty_tpl->tpl_vars['cache_buster']->value = $_smarty_tpl->tpl_vars['Cbucket']->value->version;
                $_smarty_tpl->tpl_vars['cache_buster']->nocache = null;
                $_smarty_tpl->tpl_vars['cache_buster']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['cache_buster'] = new Smarty_variable($_smarty_tpl->tpl_vars['Cbucket']->value->version, null, 0);
            }
            ?>
        <?php 
        }
        ?>

        <script src="//code.jquery.com/jquery-latest.min.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script>
            var loading = '<i class="fa fa-spinner fa-spin"></i> <?php 
        echo smarty_lang(array('code' => "loading"), $_smarty_tpl);
        ?>
...';
            var baseurl = "<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
";
            var imageurl = "<?php 
        echo $_smarty_tpl->tpl_vars['imageurl']->value;
        ?>
";
        </script>
      
          <!-- custom scrollbars plugin -->
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/js/jquery.mCustomScrollbar.concat.min.js"></script>
        <script>
            (function($){
                $(window).load(function(){
                    $("#content_1").mCustomScrollbar({
                        scrollButtons:{
                            enable:true
                        }
                    });
                });
            })(jQuery);
        </script>

        <!-- ClipBucket v<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->version;
        ?>
 -->
        <meta name="copyright" content="ClipBucket - Integrated Units 2007 - <?php 
        echo smarty_modifier_date_format(time(), "%Y");
        ?>
" />
        <meta name="author" content="Arslan Hassan - http://clip-bucket.com/arslan-hassan" />
        <meta name="author" content="Fawaz Tahir - http://clip-bucket.com/fawaz-tahir" />
        <link rel="shortcut icon" href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/favicon.ico">
        <link rel="icon" type="image/ico" href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/favicon.ico" />

        <!-- RSS FEEDS -->
        <?php 
        echo rss_feeds(array('link_tag' => true), $_smarty_tpl);
        ?>


        <meta name="keywords" content="<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['keywords'];
        ?>
" />
        <meta name="description" content="<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['description'];
        ?>
" />
        <meta name="distribution" content="global" />


        <title><?php 
        echo cbtitle(array(), $_smarty_tpl);
        ?>
</title>


        <link href='//fonts.googleapis.com/css?family=Rambla:400,700|Roboto:400,700|Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>


        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/bootstrap.min.css?cache=<?php 
        echo $_smarty_tpl->tpl_vars['cache_buster']->value;
        ?>
" />
        <?php 
        if (this_page('index')) {
            ?>
        <link rel="stylesheet" href="<?php 
            echo $_smarty_tpl->tpl_vars['theme']->value;
            ?>
/css/home.css?cache=<?php 
            echo $_smarty_tpl->tpl_vars['cache_buster']->value;
            ?>
" />
        <?php 
        }
        ?>
        
     
        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/main.css?cache=<?php 
        echo $_smarty_tpl->tpl_vars['cache_buster']->value;
        ?>
" />
        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/ClipBucket.css?cache=<?php 
        echo $_smarty_tpl->tpl_vars['cache_buster']->value;
        ?>
" />
        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/channel.css?cache=<?php 
        echo $_smarty_tpl->tpl_vars['cache_buster']->value;
        ?>
" />
        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/groups.css?cache=<?php 
        echo $_smarty_tpl->tpl_vars['cache_buster']->value;
        ?>
" />
        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/header.css?cache=<?php 
        echo $_smarty_tpl->tpl_vars['cache_buster']->value;
        ?>
">

        

        <link href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/jquery.mCustomScrollbar.css" rel="stylesheet" />
        <link rel="stylesheet" href="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/css/font-awesome.min.css">

        <?php 
        if (this_page('watch_video') || this_page('view_item') || this_page('view_channel')) {
            ?>
        <link rel="stylesheet" href="<?php 
            echo $_smarty_tpl->tpl_vars['theme']->value;
            ?>
/css/watch-video.css">
        
    	<?php 
        }
        ?>

    	<?php 
        if (this_page('view_channel')) {
            ?>
        <link rel="stylesheet" href="<?php 
            echo $_smarty_tpl->tpl_vars['theme']->value;
            ?>
/css/view-channel-header.css">
    	<?php 
        }
        ?>


    	
        <?php 
        if (this_page('photo_upload') || this_page('upload')) {
            ?>
        <link rel="stylesheet" href="<?php 
            echo $_smarty_tpl->tpl_vars['theme']->value;
            ?>
/css/uploader.css">
        <?php 
        }
        ?>
        <?php 
        if (this_page('view_channel')) {
            ?>
         <link rel="stylesheet" href="<?php 
            echo $_smarty_tpl->tpl_vars['theme']->value;
            ?>
/css/view_channel.css">
        <?php 
        }
        ?>

        <?php 
        if (this_page('signup')) {
            ?>
        <link rel="stylesheet" href="<?php 
            echo $_smarty_tpl->tpl_vars['baseurl']->value;
            ?>
/styles/global/jquery_ui.css">
        <?php 
        }
        ?>
       
		<?php 
        if (this_page('index')) {
            ?>
			<script src="<?php 
            echo $_smarty_tpl->tpl_vars['theme']->value;
            ?>
/js/custom-elements.js"></script>
		<?php 
        }
        ?>
        <?php 
        echo ANCHOR(array('place' => 'ajax_data'), $_smarty_tpl);
        ?>

        <script type="text/javascript" src="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/js/functions.js"></script>
        <script type="text/javascript" src="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/js/admin_functions.js"></script>
        
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/bootstrap.min.js"></script>
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/masonary.desandro.min.js"></script>
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/js/clipbucket.js"></script>
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/masonary.desandro.min.js"></script>
        <script src='https://www.google.com/recaptcha/api.js'></script



		<!-- Script For Home Page Videos Slider //-->
		<script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/jssor.slider.min.js"></script>

        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/uslider_js/jquery.easing.js"></script>
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/uslider_js/jquery.mousewheel.js"></script>
        <script src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/js/uslider_js/jquery.ulslide.js?v=4"></script>
		<!-- Script For Home Page Videos Slider //-->

        <?php 
        if (isset($_smarty_tpl->tpl_vars['quicklist'])) {
            $_smarty_tpl->tpl_vars['quicklist'] = clone $_smarty_tpl->tpl_vars['quicklist'];
            $_smarty_tpl->tpl_vars['quicklist']->value = json_encode($_smarty_tpl->tpl_vars['cbvid']->value->get_quicklist());
            $_smarty_tpl->tpl_vars['quicklist']->nocache = null;
            $_smarty_tpl->tpl_vars['quicklist']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['quicklist'] = new Smarty_variable(json_encode($_smarty_tpl->tpl_vars['cbvid']->value->get_quicklist()), null, 0);
        }
        ?>
        
        <script>
            $(document).ready(function(){
                var quicklist_videos = '<?php 
        echo $_smarty_tpl->tpl_vars['quicklist']->value;
        ?>
';
                if (quicklist_videos)
                quicklist_videos_check(quicklist_videos);

                loading = '<i class="fa fa-spinner fa-spin"></i> <?php 
        echo smarty_lang(array('code' => "loading"), $_smarty_tpl);
        ?>
...';
               /* var container = document.querySelector('.the_');
                var msnry = new Masonry( container, {
                    // options

                    itemSelector: '.the-item',
                    stamp : '.ad-box'

                });
    */
    //            less.watch({
    //            poll : 300
    //            });

            // For changing language on Click in footer
            $( 'ul#photos li:visible' ).each( function( i ){
                $( this )[ (1&i) ? 'addClass' : 'removeClass' ]( 'photo-land-no' );
            });

            // Language change select code
            $('#lang_selector').change(function(){
            var optionSelectedValue = $('#lang_selector option:selected').val();
            if(optionSelectedValue)
                {
                    var $currentLocation = window.location.href,
                            matchedElement = $currentLocation.match(/\?/);
                            
                    if(matchedElement == null)
                    {
                        window.location = "?set_site_lang="+optionSelectedValue;    
                    } else {
                        window.location = window.location+"&set_site_lang="+optionSelectedValue;    
                    }
                }
            });
            
            });

        </script>


        <?php 
        echo include_header(array('file' => 'global_header'), $_smarty_tpl);
        ?>


    </head><?php 
    }
ANCHOR($this->getbaseurl() . 'index.php/default/aaa/bbb/ccc', 'Demo of segments');
BR();
ANCHOR($this->getbaseurl() . 'index.php/default?aaa=111&bbb=222', 'Demo of parameters');
BR();
ANCHOR($this->getbaseurl() . 'index.php/default/aaa/bbb/ccc?aaa=111&bbb=222', 'Demo of segments and parameters');
BR();
ANCHOR($this->getbaseurl() . 'index.php/default', 'Default url');
DIV_END();
DIV_END();
DIV_BEGIN('version');
H_BEGIN(1);
echo 'Error message demonstration';
H_END();
ANCHOR($this->getbaseurl() . 'index.php/demoerror', 'Error message');
BR();
ANCHOR($this->getbaseurl() . 'index.php/demowarning', 'Warning message');
BR();
ANCHOR($this->getbaseurl() . 'index.php/demoinfo', 'Info message');
BR();
DIV_END();
$arr = array("első" => 12345, "második" => 23456, 3 => 34567, "data" => "dsjkhsdlkfjhasdklfjhsadlkfjsad sdafkjasdf dsakjfasdf asdkfljasd fsadáűí", "data1" => "dsjkhsdlkfjhasdklfjhsadlkfjsad sdafkjasdf dsakjfasdf asdkfljasd fsadáűí", "data2" => "éáűőúöüóí!{}().");
$this->geteasysession()->set('data', $arr);
$this->geteasysession()->write();
$var = $_SESSION['easyuserdata'];
if ($this->geteasysession()->isencoded()) {
    $dec = $this->geteasysecurity()->decodestring($var, $this->geteasysession()->getencodekey());
} else {
    $dec = $var;
}
var_dump($_SESSION);
var_dump($dec);
    function content_56afda72d421f2_45056170($_smarty_tpl)
    {
        ?>
<!-- Share This <?php 
        echo $_smarty_tpl->tpl_vars['type']->value;
        ?>
 -->
<?php 
        if (isset($_smarty_tpl->tpl_vars['type'])) {
            $_smarty_tpl->tpl_vars['type'] = clone $_smarty_tpl->tpl_vars['type'];
            $_smarty_tpl->tpl_vars['type']->value = $_smarty_tpl->tpl_vars['params']->value['type'];
            $_smarty_tpl->tpl_vars['type']->nocache = null;
            $_smarty_tpl->tpl_vars['type']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['type'] = new Smarty_variable($_smarty_tpl->tpl_vars['params']->value['type'], null, 0);
        }
        ?>
<div id="share_form_div" class="action_box share_form clearfix">
    <?php 
        if ($_smarty_tpl->tpl_vars['params']->value['type'] == 'v' || $_smarty_tpl->tpl_vars['params']->value['type'] == 'video' || $_smarty_tpl->tpl_vars['params']->value['type'] == 'Video') {
            ?>
    <div>



        <?php 
            if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['video_embed'] == 1 && $_smarty_tpl->tpl_vars['vdo']->value['allow_embedding'] == 'yes') {
                ?>

        <div class="form-group">
            <label for="embed_code">
                <?php 
                echo smarty_lang(array('code' => 'embed_code'), $_smarty_tpl);
                ?>

            </label>

            <textarea name="embed_code" id="embed_code" onclick="this.select()"  class="form-control"><?php 
                if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_type'] == 'iframe') {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['cbvid']->value->embed_code($_smarty_tpl->tpl_vars['vdo']->value, 'iframe'));
                } else {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['cbvid']->value->embed_code($_smarty_tpl->tpl_vars['vdo']->value, 'embed_object'));
                }
                ?>
</textarea>

            <input type="hidden" name="alternate_embed_code" id="alternate_embed_code" value="<?php 
                if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_type'] == 'iframe') {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['cbvid']->value->embed_code($_smarty_tpl->tpl_vars['vdo']->value, 'embed_object'));
                } else {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['cbvid']->value->embed_code($_smarty_tpl->tpl_vars['vdo']->value, 'iframe'));
                }
                ?>
" />
        </div>

        <div class="form-group">
            <label><?php 
                echo lang('Player size');
                ?>
</label>
            <div></div>

            <label class="radio-inline">
                <input type="radio" name="player_size" value="default" id="player_size_0" checked="checked"
                       onclick="<?php 
                echo $_smarty_tpl->tpl_vars['updateEmbedCode']->value;
                ?>
('<?php 
                echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_player_width'];
                ?>
'
                    ,'<?php 
                echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_player_height'];
                ?>
',autoPlayEmbed)"/>
                <?php 
                echo lang('Default');
                ?>
 (<?php 
                echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_player_width'];
                ?>
x<?php 
                echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_player_height'];
                ?>
)
            </label>

            <label class="radio-inline">
                <input type="radio" name="player_size" value="small" id="player_size_1" onclick="<?php 
                echo $_smarty_tpl->tpl_vars['updateEmbedCode']->value;
                ?>
('440','272',autoPlayEmbed)" />
                <?php 
                echo lang('Small');
                ?>
 (440x272)
            </label>

            <label class="radio-inline">
                <input type="radio" name="player_size" value="medium" id="player_size_2"  onclick="<?php 
                echo $_smarty_tpl->tpl_vars['updateEmbedCode']->value;
                ?>
('540','334',autoPlayEmbed)"/>
                <?php 
                echo lang('Medium');
                ?>
 (540x334)
            </label>

            <label class="radio-inline">
                <input type="radio" name="player_size" value="large" id="player_size_3"  onclick="<?php 
                echo $_smarty_tpl->tpl_vars['updateEmbedCode']->value;
                ?>
('600','370',autoPlayEmbed)"/>
                <?php 
                echo lang('Large');
                ?>
 (600x370)
            </label>


        </div>

        <?php 
                if ($_smarty_tpl->tpl_vars['pakplayer']->value == 'yes') {
                    ?>
        <div>Autoplay video : <label><input type="radio" name="autoplay" value="yes" onclick="<?php 
                    echo $_smarty_tpl->tpl_vars['updateEmbedCode']->value;
                    ?>
(embedPlayerWidth,embedPlayerHeight,'yes')" <?php 
                    if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['autoplay_embed'] == 'yes') {
                        ?>
 checked<?php 
                    }
                    ?>
 />Yes</label>
            <label><input type="radio" name="autoplay" value="no"  onclick="<?php 
                    echo $_smarty_tpl->tpl_vars['updateEmbedCode']->value;
                    ?>
(embedPlayerWidth,embedPlayerHeight,'no')" <?php 
                    if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['autoplay_embed'] != 'yes') {
                        ?>
 checked<?php 
                    }
                    ?>
/>No</label></div>
        <?php 
                }
                ?>

        <div class="form-group">
            <label><?php 
                echo lang('Embed type');
                ?>
</label>
            <div></div>
            <label class="radio-inline">
                <input type="radio" name="embed_type" value="iframe" onclick="switchEmbedCode('iframe')" <?php 
                if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_type'] == 'iframe') {
                    ?>
 checked<?php 
                }
                ?>
 />Iframe
            </label>
            <label class="radio-inline">
                <input type="radio" name="embed_type" value="iframe"  onclick="switchEmbedCode('embed_object')" <?php 
                if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_type'] == 'embed_object') {
                    ?>
 checked<?php 
                }
                ?>
/>Embed Object
            </label>
        </div>

        <?php 
            }
            ?>



    </div>

    <div class="action_box_title"></div>
    <div class="form-group">
        <label for="link_video"><?php 
            echo smarty_lang(array('code' => 'link_this_video'), $_smarty_tpl);
            ?>
</label>
        <input type="text" name="link_video" id="link_video"  value="<?php 
            echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['vdo']->value), $_smarty_tpl);
            ?>
"  onclick="this.select()"  class="form-control" />
    </div>

    <div class="action_box_title"></div>
    <?php 
        }
        ?>


    <div class="form_container">
        <div id="share_form_results" class="form_result" style="display:none"></div>
        <form id="cb_share_item" name="share_form" method="post" action="">
            <div class="form-group">
                <label for="ShareUsers">
                    <?php 
        echo sprintf(lang('share_this_type'), $_smarty_tpl->tpl_vars['type']->value);
        ?>

                </label>

                <input name="users" type="text" class="form-control" id="ShareUsers" placeholder="<?php 
        echo smarty_lang(array('code' => 'seperate_usernames_with_comma'), $_smarty_tpl);
        ?>
"/>
            </div>
            <div class="form-group">
                <label for="message"><?php 
        echo lang('Message');
        ?>
 <span class="example"><?php 
        echo lang('optional');
        ?>
</span></label>
                <textarea name="message" id="message"  rows="5" class="form-control"></textarea>
                <input name="objectid" id="objectid" type="hidden" value="<?php 
        echo $_smarty_tpl->tpl_vars['params']->value['id'];
        ?>
" />
                <div align="right" class="mtm">
                    <input type="submit" name="send_content" value="Send" class="btn btn-primary" />
                </div>
            </div>

        </form>
    </div>


    <?php 
        echo ANCHOR(array('place' => "video_sharing_options", 'data' => $_smarty_tpl->tpl_vars['vdo']->value), $_smarty_tpl);
        ?>

</div>
<!-- Share This <?php 
        echo $_smarty_tpl->tpl_vars['type']->value;
        ?>
 -->

<script>
    $(document).ready(function(){
        $('body').on('submit','#cb_share_item',function(e){
            e.preventDefault();
            _cb.submit_share_form('share_form','<?php 
        echo $_smarty_tpl->tpl_vars['params']->value['type'];
        ?>
');return false;
        })
    })
</script><?php 
    }
    function content_55e44441c21315_45821929($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_replace')) {
            include '/var/www/includes/smartyv3/plugins/modifier.replace.php';
        }
        ?>
<script>
var baseurl = '<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
';
var imageurl = '<?php 
        echo $_smarty_tpl->tpl_vars['imageurl']->value;
        ?>
';
</script>

<script type="text/javascript">
var embedPlayerWidth 	=	'<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_player_width'];
        ?>
';
var embedPlayerHeight 	=	'<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_player_height'];
        ?>
';
var autoPlayEmbed 		=	'<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['autoplay_embed'];
        ?>
';
var embed_type 			=	'<?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['embed_type'];
        ?>
';



function updateEmbed(width,height,autoplay)
{
	$('#embed_code').val( $('#embed_code').val().replace(/width=\"([0-9]+)\"/g,'width="'+width+'"') );
	$('#embed_code').val( $('#embed_code').val().replace(/height=\"([0-9]+)\"/g,'height="'+height+'"') );
	$('#embed_code').val( $('#embed_code').val().replace(/width=([0-9]+)/g,'width='+width) );
	$('#embed_code').val( $('#embed_code').val().replace(/height=([0-9]+)/g,'height='+height+'') );
}

function switchEmbedCode(type)
{
	if(embed_type==type)
		return false;
	else
	{
		embed_type = type;
		
		var alt_embed =$('#alternate_embed_code').val();
		$('#alternate_embed_code').val($('#embed_code').val());
		$('#embed_code').val(alt_embed);
		
	}
}



</script>


<!-- Including JS Files-->
<?php 
        $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['type']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->JSArray;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['type']->key => $_smarty_tpl->tpl_vars['type']->value) {
            $_smarty_tpl->tpl_vars['type']->_loop = true;
            ?>
 <?php 
            $_smarty_tpl->tpl_vars['scope'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['scope']->_loop = false;
            $_smarty_tpl->tpl_vars['file'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['type']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['scope']->key => $_smarty_tpl->tpl_vars['scope']->value) {
                $_smarty_tpl->tpl_vars['scope']->_loop = true;
                $_smarty_tpl->tpl_vars['file']->value = $_smarty_tpl->tpl_vars['scope']->key;
                ?>
  <?php 
                echo include_js(array('type' => $_smarty_tpl->tpl_vars['scope']->value, 'file' => $_smarty_tpl->tpl_vars['file']->value), $_smarty_tpl);
                ?>

 <?php 
            }
        }
        ?>
<!-- Including JS Files-->
<script type="text/javascript">
	callURLParser();
</script>
<!-- Including Plugin Headers -->
<?php 
        $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['type']->_loop = false;
        $_smarty_tpl->tpl_vars['file'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->header_files;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['type']->key => $_smarty_tpl->tpl_vars['type']->value) {
            $_smarty_tpl->tpl_vars['type']->_loop = true;
            $_smarty_tpl->tpl_vars['file']->value = $_smarty_tpl->tpl_vars['type']->key;
            ?>
	<?php 
            echo include_header(array('file' => $_smarty_tpl->tpl_vars['file']->value, 'type' => $_smarty_tpl->tpl_vars['type']->value), $_smarty_tpl);
            ?>

<?php 
        }
        ?>
<!-- Ending Plugin Headers -->



<?php 
        if (@constant('THIS_PAGE') == 'upload') {
            ?>

<link href="<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
/uploadify/swfobject.js"></script>
<script type="text/javascript" src="<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
/uploadify/jquery.uploadify.v2.1.4.js"></script>

<script type="text/javascript">
var jsURL = '<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
';
var uploadError = false;
var file_name = '<?php 
            echo $_smarty_tpl->tpl_vars['file_name']->value;
            ?>
';
var lang = new Array();
lang['saveData'] = '<?php 
            echo smarty_lang(array('code' => 'save_data'), $_smarty_tpl);
            ?>
';
lang['savingData'] = '<?php 
            echo smarty_lang(array('code' => 'saving'), $_smarty_tpl);
            ?>
';
lang['remoteUploadFile'] = '<?php 
            echo smarty_lang(array('code' => "remote_upload_file"), $_smarty_tpl);
            ?>
';
lang['upload_video_button'] = '<?php 
            echo smarty_lang(array('code' => "upload_video_button"), $_smarty_tpl);
            ?>
';
var fileExt = '<?php 
            echo smarty_modifier_replace($_smarty_tpl->tpl_vars['Cbucket']->value->list_extensions(), ",", ";");
            ?>
';

var uploadSwfPath = '<?php 
            echo $_smarty_tpl->tpl_vars['uploaderDetails']->value['uploadSwfPath'];
            ?>
';
var uploadScriptPath = '<?php 
            echo $_smarty_tpl->tpl_vars['uploaderDetails']->value['uploadScriptPath'];
            ?>
';

var time_stamp = <?php 
            echo time();
            ?>
;



  function show_error(msg,ID,fade)
  { $('#file_uploads'+ID+' .percentage')
  	.after('<div class=\"uploadErrorDiv\"><div class=\"uploadErrorMsg\">'+msg+'<\/div><\/div>'); 
	if(fade){$('.uploadSuccessDiv').delay(3000).fadeOut('slow');}
  }
  
  function show_message(msg,ID,fade)
  { $('#uploadForm'+ID)
  	.prepend('<div class=\"uploadSuccessDiv\"><div class=\"uploadSuccessMsg\">'+msg+'<\/div><\/div>');
  if(fade){$('.uploadSuccessDiv').delay(3000).fadeOut('slow');}
  }


function doUpdateVideo(formId,ID)
{
	var formObjectData = $(formId).serialize();
	//alert(serializedData);
	
	$('#updateVideoDataLoading').html('<img src="'+imageurl+'/ajax-loader.gif" />');
	$('#cbSubmitUpload'+ID)
	.attr('disabled','disabled')
	.attr("value",lang.savingData)
	.attr("onClick","return false;");
	
	$.post(
	baseurl+'/actions/file_uploader.php',formObjectData,function(data)
	{
		if(data.msg)
		show_message(data.msg,ID,true);
		if(data.error)
		show_error(data.error,ID,true);
		$('#updateVideoDataLoading').empty();
		$('#cbSubmitUpload'+ID)
		.removeAttr("disabled")
		.attr("value",lang.saveData)
		.attr("onClick","doUpdateVideo('#uploadForm"+ID+"','"+ID+"')")
	},"json"
	)
}

$(document).ready(function()
{
  

  var instanceNumber = 0;
  function showUploadify(object)
  {
  $(object).uploadify({
    'uploader'  : uploadSwfPath,
	'scriptAccess' : 'always',
    'script'    : uploadScriptPath,
    'cancelImg' : imageurl+'/cancel_upload.png',
    'auto'      : true,
	'removeCompleted' : false,
	'displayData' : 'both',
	'fileExt'     : fileExt,
	'multi'		  : true,
	'fileDesc'    : 'Video Files',
	'buttonText' : lang.upload_video_button,
	'queueID' : 'fileUploadQueue',
	'queueLimit' : 2,
	'onOpen'	 : function(event,ID,fileObj) {
		
		uploadError = false;
		filename = new Date().getTime() + Math.round((99977 - 10016) * Math.random() + 1) ;
		$.ajax({
			  url: baseurl+'/actions/file_uploader.php',
			  type: "POST",
			  data:({"getForm":"get_form","title":fileObj.name,"objId":ID}),
			  dataType: "text",
			  success: function(data)
			  {
			    if(!uploadError)
				{
					$('#file_uploads'+ID).append(data);
				}
			  }
			});
			
			return true;
	},
	'onComplete' : function(event, ID, fileObj, response, data)
	{
		var resObj = eval('(' + response + ')');
		var vid  = "";
		if(resObj.success=='yes')
		{
			var file_name = resObj.file_name;
			$.ajax({
				  url: baseurl+'/actions/file_uploader.php',
				  type: "POST",
				  data:({"insertVideo":"yes","title":fileObj.name,"file_name":file_name,'time_stamp' : time_stamp}),
				  dataType: "text",
				  success: function(data)
				  {

				  	if(data.error)
				  	{
				  		show_error(data.error,ID,true);
				  	}else
				  	{


						vid = data.videoid;
						$("#uploadForm"+ID+" #title").after('<input type="hidden" name="videoid" value="'+vid+'" id="videoid" />')
						.after('<input type="hidden" name="updateVideo" value="yes" id="updateVideo" />');
						$('#cbSubmitUpload'+ID)
						.before('<span id="updateVideoDataLoading" style="margin-right:5px"></span>')
						.removeAttr("disabled")
						.attr("value",lang.saveData)
						.attr("onClick","doUpdateVideo('#uploadForm"+ID+"','"+ID+"')");
						
						doUpdateVideo('#uploadForm'+ID,ID);
					}
				  }
				});
		}else
		{
			$("#upload_form"+ID).empty().remove();
			show_error(resObj.error,ID,false);	
			uploadError = true;
			return false;
		}
    }
  });
  }
  
  
  showUploadify('#file_uploads');
});


</script>


<?php 
        } else {
            ?>
<script type="text/javascript">

window.onload = function() {
	<?php 
            if ($_smarty_tpl->tpl_vars['total_quicklist']->value) {
                ?>
		load_quicklist_box();
	<?php 
            }
            ?>
	ini_cookies();
}

</script>
<?php 
        }
        ?>

<?php 
        if (@constant('THIS_PAGE') == 'photo_upload') {
            ?>
<link href="<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
/uploadify/swfobject.js"></script>
<script type="text/javascript" src="<?php 
            echo $_smarty_tpl->tpl_vars['js']->value;
            ?>
/uploadify/jquery.uploadify.v2.1.4.js"></script>

<script type="text/javascript" language="javascript">
	fileExt = '<?php 
            echo $_smarty_tpl->tpl_vars['cbphoto']->value->extensions();
            ?>
',
	lang = new Array(),
	pData = new Array(),
	ajaxImage = '<img src="'+imageurl+'/ajax-loader.gif" style="vertical-align:middle;" /> ',
	uploadError = false;
<?php 
            if ($_GET['collection']) {
                ?>
	<?php 
                if (isset($_smarty_tpl->tpl_vars['cid'])) {
                    $_smarty_tpl->tpl_vars['cid'] = clone $_smarty_tpl->tpl_vars['cid'];
                    $_smarty_tpl->tpl_vars['cid']->value = $_smarty_tpl->tpl_vars['cbphoto']->value->decode_key($_GET['collection']);
                    $_smarty_tpl->tpl_vars['cid']->nocache = null;
                    $_smarty_tpl->tpl_vars['cid']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['cid'] = new Smarty_variable($_smarty_tpl->tpl_vars['cbphoto']->value->decode_key($_GET['collection']), null, 0);
                }
                ?>
	<?php 
                if ($_smarty_tpl->tpl_vars['cbphoto']->value->is_addable($_smarty_tpl->tpl_vars['cid']->value)) {
                    ?>
	collectionID = '<?php 
                    echo $_smarty_tpl->tpl_vars['cid']->value;
                    ?>
';
	<?php 
                }
            }
            ?>
	
lang['browsePhrase'] = '<?php 
            echo smarty_lang(array('code' => "browse_photos"), $_smarty_tpl);
            ?>
';
lang['saveData'] = "<?php 
            echo smarty_lang(array('code' => 'save_data'), $_smarty_tpl);
            ?>
";
lang['savingData'] = "<?php 
            echo smarty_lang(array('code' => 'saving'), $_smarty_tpl);
            ?>
";
lang['upPhoto'] = "<?php 
            echo smarty_lang(array('code' => 'update_photo'), $_smarty_tpl);
            ?>
";
var uploadSwfPath = '<?php 
            echo $_smarty_tpl->tpl_vars['photoUploaderDetails']->value['uploadSwfPath'];
            ?>
';
var uploadScriptPath = '<?php 
            echo $_smarty_tpl->tpl_vars['photoUploaderDetails']->value['uploadScriptPath'];
            ?>
';



function photoMessage(message,ID,fade)
{
	if(document.getElementById(ID+"Message"))
		$("#"+ID+"Message").children(":first-child").html(message).end().fadeIn('slow');
	else
	{
		$("#Form"+ID).before('<div id=\"'+ID+'Message\" class=\"uploadSuccessDiv\"><div class=\"uploadSuccessMsg\">'+message+'<\/div><\/div>');	
	}
	
	if(fade)
		$("#"+ID+"Message").delay(300).fadeOut('slow');
}

function photoError(message,ID,fade)
{
	if(document.getElementById(ID+"Error"))
		$("#"+ID+"Error").children(":first-child").html(message).end().fadeIn('slow');
	else
	{
		$("#Form"+ID)
		.before('<div id=\"'+ID+'Error\" class=\"uploadErrorDiv\"><div class=\"uploadErrorMsg\">'+message+'<\/div><\/div>');
	}
	
	if(fade)
		$("#"+ID+"Error").delay(3000).fadeOut('slow');
}

function QueueLimitError(message,fade)
{
	$("#photoUploadQueue")
	.before('<div id=\"QueueError\" style=\"margin-top:6px;\" class=\"uploadErrorDiv\"><div class=\"uploadErrorMsg\">'+message+'<\/div><\/div>');
	if(fade)
		$("#QueueError").delay(5000).fadeOut('slow');	
}

function insertAjaxPhoto(ID,filename,extension,server_url,folder)
{

	var photoFields = $("#Form"+ID).serialize();
	$.ajax({
		url : baseurl+'/actions/photo_uploader.php',
		type : 'POST',
		dataType : 'json',
		data : photoFields+"&filename="+filename+"&ext="+extension+"&insertPhoto=yes&server_url="+server_url+
		"&folder="+folder,
		beforeSend : function()
		{
			$("#cbSubmitUpload"+ID).html(ajaxImage+lang.savingData).attr('disabled','disabled');	
		},
		success : function(data)
		{
			if(data.error)
			{
				photoError(data.error,ID,true);
				$("#cbSubmitUpload"+ID).html("Save Photo")
				.removeAttr('disabled').attr('onClick','insertAjaxPhoto("'+ID+'","'+filename+'","'+extension+'");');	
			}
			
			if(data.success)
			{
				photoMessage(data.success,ID,true);
				showPhotoPreview(ID,data.photoPreview);
				
				$("<input />").attr({
					'id' : 'photo_id',
					'name' : 'photo_id',
					'value' : data.photoID,
					'type' : 'hidden'	
				}).prependTo('#Form'+ID);
				
				$("#cbSubmitUpload"+ID).html(lang.upPhoto)
				.removeAttr('disabled').attr('onClick','updateAjaxPhoto("'+ID+'");');	
			}
		}
	})
}

function updateAjaxPhoto(ID)
{
	var updateFields = $("#Form"+ID).serialize();
	$.ajax({
		url : baseurl+'/actions/photo_uploader.php',
		type : 'POST',
		dataType : 'json',
		data : updateFields+"&updatePhoto=yes",
		beforeSend : function()
		{
			$("#cbSubmitUpload"+ID).html(ajaxImage+lang.upPhoto).attr('disabled','disabled');
		},
		success : function(data)
		{
			if(data.error)
			{
				photoError(data.error,ID,true);
				$("#cbSubmitUpload"+ID).removeAttr('disabled').html(lang.upPhoto);	
			}
			
			if(data.success)
			{
				photoMessage(data.success,ID,true);
				$("#Form"+ID).hide();
				$("#cbSubmitUpload"+ID).removeAttr('disabled').html(lang.upPhoto);
				if(!document.getElementById("toggle"+ID))
				{	
					$("<a></a>")
					.addClass('reUpdateButton')
					.attr({
						"id" : "toggle"+ID,
						"href" : "#reUpdate",
						"onClick" : "$('#Form"+ID+"').toggle(); return false;",
						"title" : "Toggle Photo Form"	
					}).html('Re-'+lang.upPhoto).appendTo("#photo_uploads"+ID+" .percentage").fadeIn(350);
				}
			}
		}
	})
}

function showPhotoPreview(ID,preview)
{
	var object = $("#"+ID+"Preview"), parentObj = object.parent();
	var FinalPreview = new Image();
	FinalPreview.src = preview;
	$(FinalPreview).load(function()
	{
		object.hide();
		$("<img />")
		.addClass(object.attr('class'))
		.attr({ "id" : "FinalPreview"+ID, "src" : preview }).appendTo(parentObj).fadeIn('normal');	
	});
}

function update_collection_selection(obj)
{
	if($("#CollectionResult").css('display') == 'block')
		$("#CollectionResult").slideUp('fast');
		
	var This = $(obj), thisObj = obj;
	This.attr('disabled','disabled');
	This.after(ajaxImage);
	collectionID = thisObj.value;
	
	setTimeout(function(){
		This.next().remove();
		$("#CollectionResult").html("<div class='msg'>Collection Selected</div>").slideDown(350);
		This.removeAttr('disabled');	
	},1000);
}
	
$(document).ready(function() {
	
	function photoUploadify(object)
	{
		$(object).uploadify(
		{
			'uploader'  : uploadSwfPath,
			'script'    : uploadScriptPath,
			'scriptAccess' : 'always',
			'fileDataName' : 'photoUpload',
			'cancelImg' : imageurl+'/cancel_upload.png',
			'auto'      : true,
			'removeCompleted' : false,
			'displayData' : 'both',
			'fileExt'     : fileExt,
			'multi'		  : true,
			'queueSizeLimit':  '<?php 
            echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['photo_multi_upload'];
            ?>
', 
			'fileDesc'    : 'Photo Files',
			'buttonText' : lang.browsePhrase,
			'queueID' : 'photoUploadQueue',
			'sizeLimit' : '<?php 
            echo $_smarty_tpl->tpl_vars['cbphoto']->value->max_file_size;
            ?>
',
			'onSelect' : function(event,ID,fileObj)
			{
				uploadError = false;
				$.ajax({
					url : baseurl+'/actions/photo_uploader.php',
					dataType : 'json',
					type : 'POST',
					data : ({ "photoForm":"yes" , "objID":ID , "name":fileObj.name , "collection":collectionID }),
					success : function(data)
					{
						if(!uploadError)
							$("#photo_uploads"+ID).append(data['form']);
					}
				});
			},
			'onComplete' : function(event,ID,fileObj,response,data)
			{
			
				var resObj = $.parseJSON(response);
				if(resObj.success == "yes")
				{
					insertAjaxPhoto(ID,resObj.filename,resObj.extension,resObj.server_url,resObj.folder);	
				}
				
			},
			'onQueueFull' : function(event,queueSizeLimit)
			{
				QueueError = "I'm stuffed, "+queueSizeLimit+" is my limit. Thanks.";
				QueueLimitError(QueueError,true);
				return false;
			},
			'onError' : function(event,ID,fileObj,errorObj)
			{
				uploadError = true;	
			}
		});
	}
		 
	photoUploadify('#photo_uploads'); 
});	

</script>
<?php 
        }
        ?>

<?php 
        if (@constant('THIS_PAGE') == 'view_item') {
            ?>
<script type="text/javascript">
	var Seo = '<?php 
            echo $_smarty_tpl->tpl_vars['Cbucket']->value->configs['seo'];
            ?>
';
	onReload_item();
</script>
<?php 
        }
        ?>

<?php 
        if (@constant('THIS_PAGE') == 'watch_video' || $_smarty_tpl->tpl_vars['object']->value['videoid']) {
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['object']->value['videoid']) {
                if (isset($_smarty_tpl->tpl_vars['vdo'])) {
                    $_smarty_tpl->tpl_vars['vdo'] = clone $_smarty_tpl->tpl_vars['vdo'];
                    $_smarty_tpl->tpl_vars['vdo']->value = $_smarty_tpl->tpl_vars['object']->value;
                    $_smarty_tpl->tpl_vars['vdo']->nocache = null;
                    $_smarty_tpl->tpl_vars['vdo']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['vdo'] = new Smarty_variable($_smarty_tpl->tpl_vars['object']->value, null, 0);
                }
                ?>
 <?php 
            }
            ?>
    <meta property="og:title" content="<?php 
            echo $_smarty_tpl->tpl_vars['vdo']->value['title'];
            ?>
" />
    <meta property="og:description" content="<?php 
            echo preg_replace('!<[^>]*?>!', ' ', description($_smarty_tpl->tpl_vars['vdo']->value['description']));
            ?>
" />
    <meta property="og:image" content="<?php 
            echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['vdo']->value), $_smarty_tpl);
            ?>
" />
    
    <?php 
            if ($_smarty_tpl->tpl_vars['Cbucket']->value->configs['facebook_embed'] == 'yes') {
                ?>
        <meta property="og:type" content="video">
        <meta property="og:video" content='<?php 
                echo fb_embed_video(array('video' => $_smarty_tpl->tpl_vars['vdo']->value), $_smarty_tpl);
                ?>
'>
        <meta property="og:video:height" content="259" />
        <meta property="og:video:width" content="398" />
        <meta property="og:video:type" content="application/x-shockwave-flash">
    <?php 
            }
            ?>
        <meta property='og:url' content='<?php 
            echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['vdo']->value), $_smarty_tpl);
            ?>
'/>
        <meta property='og:site_name' content='<?php 
            echo $_smarty_tpl->tpl_vars['website_title']->value;
            ?>
'/>
    
<?php 
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['object']->value['photo_id']) {
            ?>
<meta property="og:title" content="<?php 
            echo $_smarty_tpl->tpl_vars['object']->value['photo_title'];
            ?>
" />
<meta property="og:description" content="<?php 
            echo description($_smarty_tpl->tpl_vars['object']->value['photo_description']);
            ?>
" />
<meta property="og:image" content="<?php 
            echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['object']->value, 'size' => 'm', 'output' => 'non_html', 'alt' => $_smarty_tpl->tpl_vars['object']->value['photo_title']), $_smarty_tpl);
            ?>
" />
<meta name="medium" content="image" />
<?php 
        }
        ?>

<?php 
        if (@constant('THIS_PAGE') == 'view_channel') {
            ?>
<meta property="og:title" content="<?php 
            echo $_smarty_tpl->tpl_vars['user']->value['username'];
            ?>
" />

<?php 
        }
        ?>


<?php 
        if (@constant('THIS_PAGE') == 'videos') {
            ?>
<meta property="og:description" content="this is a videos page of ClipBucket"/>

<?php 
        }
        ?>


<script>
$(function() {

	/*$( ".date_field" ).datepicker({ 
		dateFormat: 'yy-mm-dd',
		changeMonth: true,
		changeYear: true,
		yearRange : "1901 : c"
		});*/
});

</script>



<?php 
        echo ANCHOR(array('place' => 'cb_head'), $_smarty_tpl);
        ?>


<!-- ClipBucket version <?php 
        echo $_smarty_tpl->tpl_vars['Cbucket']->value->cbinfo['version'];
        ?>
 --><?php 
    }
Example #9
0
 /**
  * This will become a Smarty function.
  * I am writting this to eliminate the possiblitles
  * of distort pictures
  */
 function getFileSmarty($p)
 {
     global $Cbucket;
     $details = $p['details'];
     $output = $p['output'];
     if (empty($details)) {
         return $this->default_thumb($size, $output);
     } else {
         //Calling Custom Functions
         if (count($Cbucket->custom_get_photo_funcs) > 0) {
             foreach ($Cbucket->custom_get_photo_funcs as $funcs) {
                 if (function_exists($funcs)) {
                     $func_returned = $funcs($p);
                     if ($func_returned) {
                         return $func_returned;
                     }
                 }
             }
         }
         if ($p['size'] != 't' && $p['size'] != 'm' && $p['size'] != 'l' && $p['size'] != 'o' || empty($p['size'])) {
             $p['size'] = 't';
         }
         if ($p['with_path'] === FALSE) {
             $p['with_path'] = FALSE;
         } else {
             $p['with_path'] = TRUE;
         }
         $with_path = $p['with_path'];
         $with_orig = $p['with_orig'] ? $p['with_orig'] : FALSE;
         if (!is_array($details)) {
             $photo = $this->get_photo($details);
         } else {
             $photo = $details;
         }
         if (empty($photo['photo_id']) || empty($photo['photo_key'])) {
             return $this->default_thumb($size, $output);
         } else {
             if (!empty($photo['filename']) && !empty($photo['ext'])) {
                 $files = glob(PHOTOS_DIR . "/" . $photo['filename'] . "*." . $photo['ext']);
                 if (!empty($files) && is_array($files)) {
                     foreach ($files as $file) {
                         $file_parts = explode("/", $file);
                         $thumb_name = $file_parts[count($file_parts) - 1];
                         $type = $this->get_image_type($thumb_name);
                         if ($with_orig) {
                             if ($with_path) {
                                 $thumbs[] = PHOTOS_URL . "/" . $thumb_name;
                             } else {
                                 $thumbs[] = $thumb_name;
                             }
                         } elseif (!empty($type)) {
                             if ($with_path) {
                                 $thumbs[] = PHOTOS_URL . "/" . $thumb_name;
                             } else {
                                 $thumbs[] = $thumb_name;
                             }
                         }
                     }
                     if (empty($p['output']) || $p['output'] == 'non_html') {
                         if ($p['assign'] && $p['multi']) {
                             assign($p['assign'], $thumbs);
                         } elseif (!$p['assign'] && $p['multi']) {
                             return $thumbs;
                         } else {
                             $size = "_" . $p['size'];
                             $return_thumb = array_find($photo['filename'] . $size, $thumbs);
                             if (empty($return_thumb)) {
                                 $this->default_thumb($size, $output);
                             } else {
                                 if ($p['assign'] != NULL) {
                                     assign($p['assign'], $return_thumb);
                                 } else {
                                     return $return_thumb;
                                 }
                             }
                         }
                     }
                     if ($p['output'] == 'html') {
                         $size = "_" . $p['size'];
                         $src = array_find($photo['filename'] . $size, $thumbs);
                         if (empty($src)) {
                             $src = $this->default_thumb($size);
                         } else {
                             $src = $src;
                         }
                         if (phpversion < '5.2.0') {
                             global $json;
                         }
                         $js = $json;
                         if (!empty($js)) {
                             $imgDetails = $js->json_decode($photo['photo_details'], true);
                         } else {
                             $imgDetails = json_decode($photo['photo_details'], true);
                         }
                         if (empty($imgDetails) || empty($imgDetails[$p['size']])) {
                             $dem = getimagesize(str_replace(PHOTOS_URL, PHOTOS_DIR, $src));
                             $width = $dem[0];
                             $height = $dem[1];
                             /* UPDATEING IMAGE DETAILS */
                             $this->update_image_details($details);
                         } else {
                             $width = $imgDetails[$p['size']]['width'];
                             $height = $imgDetails[$p['size']]['height'];
                         }
                         $img = "<img ";
                         $img .= "src = '" . $src . "'";
                         if ($p['id']) {
                             $img .= " id = '" . mysql_clean($p['id']) . "_" . $photo['photo_id'] . "'";
                         }
                         if ($p['class']) {
                             $img .= " class = '" . mysql_clean($p['class']) . "'";
                         }
                         if ($p['align']) {
                             $img .= " align = '" . $p['align'] . "'";
                         }
                         if ($p['width'] && is_numeric($p['width']) && ($p['height'] && is_numeric($p['height']))) {
                             $height = $p['height'];
                             $width = $p['width'];
                         } elseif ($p['width'] && is_numeric($p['width'])) {
                             $height = round($p['width'] / $width * $height);
                             $width = $p['width'];
                         } elseif ($p['height'] && is_numeric($p['height'])) {
                             $width = round($p['height'] * $width / $height);
                             $height = $p['height'];
                         }
                         $img .= " width = '" . $width . "'";
                         $img .= " height = '" . $height . "'";
                         if ($p['title']) {
                             $img .= " title = '" . mysql_clean($p['title']) . "'";
                         } else {
                             $img .= " title = '" . $photo['photo_title'] . "'";
                         }
                         if ($p['alt']) {
                             $img .= " alt = '" . mysql_clean($p['alt']) . "'";
                         } else {
                             $img .= " alt = '" . $photo['photo_title'] . "'";
                         }
                         if ($p['anchor']) {
                             $anchor_p = array("place" => $p['anchor'], "data" => $photo);
                             ANCHOR($anchor_p);
                         }
                         if ($p['style']) {
                             $img .= " style = '" . $p['style'] . "'";
                         }
                         if ($p['extra']) {
                             $img .= $p['extra'];
                         }
                         $img .= " />";
                         if ($p['assign']) {
                             assign($p['assign'], $img);
                         } else {
                             return $img;
                         }
                     }
                 } else {
                     return $this->default_thumb($size, $output);
                 }
             }
         }
     }
 }
Example #10
0
<?php

DIV_BEGIN('', 'topmenu');
DIV_BEGIN('', 'topmenubutton');
ANCHOR($this->getbaseurl() . 'index.php', 'Home');
DIV_END();
DIV_END();
Example #11
0
/**
 * Updated version of getting photo file. In this function
 * we dont use glob() function to first get all thumbs and
 * then extract one thumb, instead now we only construct
 * the url of given code/size, checks if file_exists, if yes return
 * thumb else return default thumb.
 */
function get_image_file($params)
{
    global $cbphoto, $Cbucket;
    $details = $params['details'];
    $output = $params['output'];
    $sizes = $params['size'] ? $params['size'] : ($params['code'] ? $params['code'] : 't');
    if (empty($details)) {
        return $cbphoto->default_thumb($size, $output);
    } else {
        // Make sure photo exists
        if (!is_array($details)) {
            $photo = $cbphoto->get_photo($details, true);
        } else {
            $photo = $details;
        }
        if (empty($photo['photo_id']) or empty($photo['photo_key'])) {
            return $cbphoto->default_thumb($size, $output);
        } else {
            if (empty($photo['filename']) or empty($photo['ext'])) {
                return $cbphoto->default_thumb($size, $output);
            } else {
                $params['photo'] = $photo;
                // Call custom functions
                if (count($Cbucket->custom_get_photo_funcs) > 0) {
                    foreach ($Cbucket->custom_get_photo_funcs as $funcs) {
                        if (function_exists($funcs)) {
                            $func_returned = $funcs($params);
                            if ($func_returned) {
                                return $func_returned;
                            }
                        }
                    }
                }
                if ($details['is_mature'] == 'yes' && !userid()) {
                    return get_mature_thumb($details, $size, $output);
                }
                $dir = PHOTOS_DIR;
                $file_directory = get_photo_date_folder($photo);
                $with_path = $params['with_path'] = $params['with_path'] === false ? false : true;
                if ($file_directory) {
                    $file_directory .= '/';
                }
                $path = $dir . '/' . $file_directory;
                $file_name = $photo['filename'] . '%s.' . $photo['ext'];
                $sizes = explode(",", $sizes);
                if ($sizes[0] == 'all' and count($sizes) == 1) {
                    $sizes = get_photo_dimensions(true);
                    $sizes = array_keys($sizes);
                }
                $sizes = array_map("trim", $sizes);
                if (phpversion < '5.2.0') {
                    global $json;
                    $js = $json;
                }
                if (!empty($js)) {
                    $image_details = $js->json_decode($photo['photo_details'], true);
                } else {
                    $image_details = json_decode($photo['photo_details'], true);
                }
                foreach ($sizes as $size) {
                    $filename = sprintf($file_name, "_" . $size);
                    $full_path = $path . $filename;
                    if (file_exists($full_path)) {
                        if ($with_path) {
                            $thumbs[] = PHOTOS_URL . '/' . $file_directory . $filename;
                        } else {
                            $thumbs[] = $filename;
                        }
                    }
                }
                if ($params['with_orig'] === true) {
                    if ($with_path) {
                        $thumbs[] = PHOTOS_URL . '/' . $file_directory . sprintf($file_name, "");
                    } else {
                        $thumbs[] = sprintf($file_name, "");
                    }
                }
                //pr ( $thumbs, true );
                if (!$thumbs or count($thumbs) <= 0) {
                    $thumbs = _recheck_photo_code($params);
                    if (!$thumbs or !is_array($thumbs)) {
                        return $cbphoto->default_thumb($size, $output);
                    }
                }
                if (empty($params['output']) or $params['output'] == 'non_html') {
                    if ($params['assign']) {
                        assign($params['assign'], $thumbs);
                    } else {
                        if ($params['multi']) {
                            return $thumbs;
                        } else {
                            return $thumbs[0];
                        }
                    }
                } else {
                    $attrs = array();
                    $src = $thumbs[0];
                    $size = $cbphoto->get_image_type($src);
                    if (!file_exists(str_replace(PHOTOS_URL, PHOTOS_DIR, $src))) {
                        $src = $cbphoto->default_thumb($size);
                    }
                    if (empty($image_details) or !isset($image_details[$size])) {
                        $dem = getimagesize(str_replace(PHOTOS_URL, PHOTOS_DIR, $src));
                        $width = $dem[0];
                        $height = $dem[1];
                        /* UPDATEING IMAGE DETAILS */
                        $cbphoto->update_image_details($photo);
                    } else {
                        $width = $image_details[$size]['width'];
                        $height = $image_details[$size]['height'];
                    }
                    if ($params['width'] and is_numeric($params['width']) and ($params['height'] and is_numeric($height))) {
                        $width = $params['width'];
                        $height = $params['height'];
                    } else {
                        if ($params['width'] and is_numeric($params['width'])) {
                            $height = round($params['width'] / $width * $height);
                            $width = $params['width'];
                        } else {
                            if ($params['height'] and is_numeric($height)) {
                                $width = round($params['height'] * $width / $height);
                                $height = $p['height'];
                            }
                        }
                    }
                    $attrs['width'] = $width;
                    $attrs['height'] = $height;
                    if ($params['id']) {
                        $id = mysql_clean($params['id']) . "_" . $photo['photo_id'];
                    } else {
                        $id = "photo_" . $photo['photo_id'];
                    }
                    $attrs['id'] = $id;
                    if ($params['class']) {
                        $attrs['class'] = mysql_clean($params['class']);
                    }
                    if ($params['align']) {
                        $attrs['align'] = mysql_clean($params['align']);
                    }
                    $title = $params['title'] ? $params['title'] : $photo['photo_title'];
                    $attrs['title'] = mysql_clean($title);
                    $alt = $params['alt'] ? TITLE . ' - ' . $params['alt'] : TITLE . ' - ' . $photo['photo_title'];
                    $attrs['alt'] = mysql_clean($alt);
                    if (add_tagging_attribute($photo)) {
                        $attrs['cb-tagger-photo'] = 'yes';
                    }
                    $anchor_p = array("place" => 'photo_thumb', "data" => $photo);
                    $params['extra'] = ANCHOR($anchor_p);
                    if ($params['style']) {
                        $attrs['style'] = $params['style'];
                    }
                    if ($params['extra']) {
                        $attrs['extra'] = $params['extra'];
                    }
                    $image = cb_output_img_tag($src, $attrs);
                    if ($params['assign']) {
                        assign($params['assign'], $image);
                    } else {
                        return $image;
                    }
                }
            }
        }
    }
}
Example #12
0
 function get_server_img($params)
 {
     global $__resize_thumbs;
     if (!$__resize_thumbs) {
         return;
     }
     $w = DEFAULT_WIDTH;
     $h = DEFAULT_HEIGHT;
     global $baseurl;
     $timthumb_path = CB_SERVER_THUMB_URL . '/timthumb.php?src=';
     //var_dump($params);
     $details = $params['details'];
     $output = $params['output'];
     $size = $params['size'];
     $default = array('t', 'm', 'l', 'o');
     $thumbs = array();
     if (!$details) {
         //var_dump("get default 1");
         return get_photo_default_thumb($size, $output);
     }
     if (!is_array($details)) {
         $photo = $cbphoto->get_photo($details, true);
     } else {
         $photo = $details;
     }
     if (empty($photo['photo_id']) or empty($photo['photo_key'])) {
         return get_photo_default_thumb($size, $output);
     }
     if (empty($photo['filename']) or empty($photo['ext'])) {
         return get_photo_default_thumb($size, $output);
     }
     $params['photo'] = $photo;
     $path = PHOTOS_DIR;
     $directory = get_photo_date_folder($photo);
     $with_path = $params['with_path'] = $params['with_path'] === false ? false : true;
     $with_original = $params['with_orig'];
     $size = (!in_array($size, $default) or !$size) ? 't' : $size;
     if ($size == 'l') {
         $w = 320;
         $h = 250;
     } else {
         if ($size == 'm') {
             $w = 160;
             $h = 90;
         } else {
             if ($size == 't') {
                 $w = 120;
                 $h = 60;
             }
         }
     }
     list($width, $height) = explode('x', $params['size']);
     if (isset($width) && is_numeric($width) && isset($height) && is_numeric($height)) {
         $w = $width;
         $h = $height;
     }
     $tim_postfix = '&type=photos&h=' . $h . '&w=' . $w . '&zc=1';
     if ($directory) {
         $directory .= '/';
     }
     $path .= '/' . $directory;
     $filename = $photo['filename'] . '%s.' . $photo['ext'];
     $files = glob($path . sprintf($filename, '*'));
     global $cbphoto;
     if (!empty($files)) {
         foreach ($files as $file) {
             $thumb_name = explode("/", $file);
             $thumb_name = end($thumb_name);
             $thumb_type = $cbphoto->get_image_type($thumb_name);
             if ($with_original) {
                 //$thumbs[] = ( ( $with_path ) ? PHOTOS_URL.'/' : '' ) . $directory . $thumb_name;
                 $thumbs[] = $timthumb_path . $thumb_name . '&directory=photos/' . $directory . $tim_postfix;
             } else {
                 if (!empty($thumb_type)) {
                     //$thumbs[] = ( ( $with_path ) ? PHOTOS_URL.'/' : '' ) . $directory . $thumb_name;
                     $thumbs[] = $timthumb_path . $thumb_name . '&directory=photos/' . $directory . $tim_postfix;
                 }
             }
         }
         if (empty($output) or $output == 'non_html') {
             if ($params['assign'] and $params['multi']) {
                 assign($params['assign'], $thumbs);
             } else {
                 if ($params['multi']) {
                     return $thumbs;
                 } else {
                     $search_name = sprintf($filename, "_" . $size);
                     $return_thumb = array_find($search_name, $thumbs);
                     if (empty($return_thumb)) {
                         return get_photo_default_thumb($size, $output);
                     } else {
                         if ($params['assign']) {
                             assign($params['assign'], $return_thumb);
                         } else {
                             return $return_thumb;
                         }
                     }
                 }
             }
         }
         if ($output == 'html') {
             $search_name = sprintf($filename, "_" . $size);
             $src = array_find($search_name, $thumbs);
             $src = empty($src) ? get_photo_default_thumb($size) : $src;
             $attrs = array('src' => $src);
             if (phpversion < '5.2.0') {
                 global $json;
             }
             if ($json) {
                 $image_details = $json->json_decode($photo['photo_details'], true);
             } else {
                 $image_details = json_decode($photo['photo_details'], true);
             }
             if (empty($image_details) or empty($image_details[$size])) {
                 $dem = getimagesize(str_replace(PHOTOS_URL, PHOTOS_DIR, $src));
                 $width = $dem[0];
                 $height = $dem[1];
                 /* UPDATEING IMAGE DETAILS */
                 $cbphoto->update_image_details($photo);
             } else {
                 $width = $image_details[$size]['width'];
                 $height = $image_details[$size]['height'];
             }
             if ($params['width'] and is_numeric($params['width']) and ($params['height'] and is_numeric($height))) {
                 $width = $params['width'];
                 $height = $params['height'];
             } else {
                 if ($params['width'] and is_numeric($params['width'])) {
                     $height = round($params['width'] / $width * $height);
                     $width = $params['width'];
                 } else {
                     if ($params['height'] and is_numeric($height)) {
                         $width = round($params['height'] * $width / $height);
                         $height = $params['height'];
                     }
                 }
             }
             //$attrs[ 'width' ] = $width;
             //$attrs[ 'height' ] = $height;
             $attrs['id'] = ($params['id'] ? $params['id'] . '_' : 'photo_') . $photo['photo_id'];
             if ($params['class']) {
                 $attrs['class'] = mysql_clean($params['class']);
             }
             if ($params['align']) {
                 $attrs['align'] = mysql_clean($params['align']);
             }
             $attrs['title'] = $photo['photo_title'];
             if (isset($params['title']) and $params['title'] == '') {
                 unset($attrs['title']);
             }
             $attrs['alt'] = TITLE . ' - ' . $photo['photo_title'];
             $anchor_p = array("place" => 'photo_thumb', "data" => $photo);
             $params['extra'] = ANCHOR($anchor_p);
             if ($params['style']) {
                 $attrs['style'] = $params['style'];
             }
             if ($params['extra']) {
                 $attrs['extra'] = $params['extra'];
             }
             $image = cb_create_html_tag('img', true, $attrs);
             if ($params['assign']) {
                 assign($params['assign'], $image);
             } else {
                 return $image;
             }
         }
     } else {
         return get_photo_default_thumb($size, $output);
     }
 }
Example #13
0
<?php

$this->includeeasyview('easydemo/begin');
$this->includeeasyview('easydemo/header');
UL_BEGIN('', 'default_menu');
LI_BEGIN();
ANCHOR($this->getbaseurl() . 'index.php/modulesinfo', 'Versions of components');
LI_END();
LI_BEGIN();
ANCHOR($this->getbaseurl() . 'index.php/valuesbyurl', 'Values by URL');
LI_END();
LI_BEGIN();
ANCHOR('#', 'Error message demonstration');
LI_END();
UL_END();
$this->includeeasyview('easydemo/footer');
$this->includeeasyview('easydemo/end');
    function content_56afda72e12f03_17643218($_smarty_tpl)
    {
        ?>
<div class="row add-comments clearfix" id="add_comment">
    <?php 
        if ($_smarty_tpl->tpl_vars['userquery']->value->login_check('', true) || $_smarty_tpl->tpl_vars['Cbucket']->value->configs['anonym_comments'] == 'yes') {
            ?>
    <form name="comment_form" method="post" action="" id="comment_form" onsubmit="return false;">
        <div class="col-lg-12">
                <span id="comment_err_output" class="alert alert-danger comment_err_output pull-left" style="display:none;width:100%"></span>
                <span id="comment_msg_output" class="alert alert-success comment_msg_output pull-left" style="display:none;"></span>
                <input type="hidden" name="reply_to" id="reply_to" value="0">
                <input type="hidden" name="obj_id" id="obj_id" value="<?php 
            echo $_smarty_tpl->tpl_vars['id']->value;
            ?>
">
                <input type="hidden" name="type" value="<?php 
            echo $_smarty_tpl->tpl_vars['type']->value;
            ?>
" />
                <?php 
            if (!$_smarty_tpl->tpl_vars['userquery']->value->login_check('', true) && $_smarty_tpl->tpl_vars['Cbucket']->value->configs['anonym_comments'] == 'yes') {
                ?>
                <div class="clearfix"></div>    
                    <label for="name" class="Label"><?php 
                echo smarty_lang(array('code' => 'name'), $_smarty_tpl);
                ?>
</label>
                    <input type="text" name="name" id="name" class="form-control" placeholder="Your Name">
                <div class="clearfix"></div>    
                <br>
                <div class="clearfix"></div>    
                    <label for="email" class="Label"><?php 
                echo smarty_lang(array('code' => 'email_wont_display'), $_smarty_tpl);
                ?>
</label>
                    <input type="text" name="email" id="email" class="form-control" placeholder="Your Email">
                <div class="clearfix"></div>
                <br>                   
                <?php 
            } else {
                ?>
                <div class="clearfix"></div>    
                    <label class="Label"><?php 
                echo smarty_lang(array('code' => "name"), $_smarty_tpl);
                ?>
</label>
                    <span class="vAlignMiddle Cantarell sizeBigger capitalize">
                            <?php 
                if ($_smarty_tpl->tpl_vars['userquery']->value->udetails['fullname']) {
                    ?>
                            <?php 
                    echo $_smarty_tpl->tpl_vars['userquery']->value->udetails['fullname'];
                    ?>

                            <?php 
                } else {
                    ?>
                            <?php 
                    echo $_smarty_tpl->tpl_vars['userquery']->value->username;
                    ?>

                        <?php 
                }
                ?>
                    </span>
                <div class="clearfix"></div>    
                <?php 
            }
            ?>
                <?php 
            if (config('comments_captcha') == 'all' || config('comments_captcha') == 'guests' && !$_smarty_tpl->tpl_vars['userquery']->value->login_check('', true)) {
                ?>
                <?php 
                if (isset($_smarty_tpl->tpl_vars['captcha'])) {
                    $_smarty_tpl->tpl_vars['captcha'] = clone $_smarty_tpl->tpl_vars['captcha'];
                    $_smarty_tpl->tpl_vars['captcha']->value = get_captcha();
                    $_smarty_tpl->tpl_vars['captcha']->nocache = null;
                    $_smarty_tpl->tpl_vars['captcha']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['captcha'] = new Smarty_variable(get_captcha(), null, 0);
                }
                ?>
                <?php 
                if ($_smarty_tpl->tpl_vars['captcha']->value) {
                    ?>
 
                    <div class="clearfix"></div>    
                        <?php 
                    if ($_smarty_tpl->tpl_vars['captcha']->value['show_field']) {
                        ?>
                                <label class="Label" for="captcha">Verification Code</label>
                                <div class="ADfieldInputs"><?php 
                        echo load_captcha(array('captcha' => $_smarty_tpl->tpl_vars['captcha']->value, 'load' => 'field', 'field_params' => ' id="captcha" class="TextField"'), $_smarty_tpl);
                        ?>
</div>
                        <?php 
                    }
                    ?>
                        <?php 
                    echo load_captcha(array('captcha' => $_smarty_tpl->tpl_vars['captcha']->value, 'load' => 'function'), $_smarty_tpl);
                    ?>

                    <div class="clearfix"></div>    
                <?php 
                }
                ?>
                <?php 
            }
            ?>
 
                <?php 
            echo ANCHOR(array('place' => 'before_compose_box'), $_smarty_tpl);
            ?>

                <div class="clearfix"></div>    
                <textarea name="comment" id="comment_box" class="form-control" placeholder="Please type something in a comment box"></textarea>
        </div>
        <div class="col-lg-12" style="margin:15px 0 15px 0;">
           <input type="button" name="add_comment" id="add_comment_button" class="btn btn-primary btn-block"  value='Add Comment'>
        </div>
        <div class="col-lg-10 col-md-9 col-sm-9 col-xs-9" id="msg_container"></div>
    </form>
    <?php 
        } else {
            ?>
        <span class="sizeSmall bold error"></span>
        <div class="col-lg-10 col-md-9 col-sm-9 col-xs-9">
        <span class="alert-warning alert msg-display"><?php 
            echo smarty_lang(array('code' => 'please_login_to_comment'), $_smarty_tpl);
            ?>
</span>
        </div>
    <?php 
        }
        ?>

</div>

<script type="text/javascript">
    $(document).ready(function(){
        var form_selector = 'comment_form';
        var type = '<?php 
        echo $_smarty_tpl->tpl_vars['type']->value;
        ?>
';
        var video_id = '<?php 
        echo $_smarty_tpl->tpl_vars['vdo']->value['video_id'];
        ?>
';
        $('body').on("click","#add_comment_button",function(){
            add_comment_js(form_selector,type,video_id);
        });
        $('#comment_box').keypress(function(e){
            if(e.keyCode == 13 && !e.shiftKey)
            {
                e.preventDefault();
                add_comment_js(form_selector,type,video_id);
            }
            });
        });
    
</script><?php 
    }
Example #15
0
 /**
  * This will become a Smarty function.
  * I am writting this to eliminate the possiblitles
  * of distort pictures
  */
 function getFileSmarty($p)
 {
     global $Cbucket;
     $details = $p['details'];
     $output = $p['output'];
     if (empty($details)) {
         return $this->default_thumb($size, $output);
     } else {
         //Calling Custom Functions
         if (count($Cbucket->custom_get_photo_funcs) > 0) {
             foreach ($Cbucket->custom_get_photo_funcs as $funcs) {
                 if (function_exists($funcs)) {
                     $func_returned = $funcs($p);
                     if ($func_returned) {
                         return $func_returned;
                     }
                 }
             }
         }
         if (empty($p['size'])) {
             $p['size'] = 't';
         }
         if (!empty($p['code'])) {
             $p['size'] = $p['code'];
         }
         if ($details['is_mature'] == 'yes' && !userid()) {
             return get_mature_thumb($details, $size, $output);
         }
         if ($p['with_path'] === FALSE) {
             $p['with_path'] = FALSE;
         } else {
             $p['with_path'] = TRUE;
         }
         $with_path = $p['with_path'];
         $with_orig = $p['with_orig'] ? $p['with_orig'] : FALSE;
         if (!is_array($details)) {
             $photo = $this->get_photo($details);
         } else {
             $photo = $details;
         }
         if (empty($photo['photo_id']) || empty($photo['photo_key'])) {
             return $this->default_thumb($size, $output);
         } else {
             if (!empty($photo['filename']) && !empty($photo['ext'])) {
                 /* Enhacing the code to work with date folder structure */
                 $date_dir = get_photo_date_folder($photo);
                 if ($date_dir) {
                     $date_dir .= '/';
                 }
                 $files = glob(PHOTOS_DIR . "/" . $date_dir . $photo['filename'] . "*." . $photo['ext']);
                 if (!empty($files) && is_array($files)) {
                     foreach ($files as $file) {
                         $file_parts = explode("/", $file);
                         $thumb_name = $file_parts[count($file_parts) - 1];
                         $type = $this->get_image_type($thumb_name);
                         if ($with_orig) {
                             if ($with_path) {
                                 $thumbs[] = PHOTOS_URL . "/" . $date_dir . $thumb_name;
                             } else {
                                 $thumbs[] = $thumb_name;
                             }
                         } elseif (!empty($type)) {
                             if ($with_path) {
                                 $thumbs[] = PHOTOS_URL . "/" . $date_dir . $thumb_name;
                             } else {
                                 $thumbs[] = $thumb_name;
                             }
                         }
                     }
                     if (!$thumbs) {
                         return $this->default_thumb($size, $output);
                     }
                     if (empty($p['output']) || $p['output'] == 'non_html') {
                         if ($p['assign'] && $p['multi']) {
                             assign($p['assign'], $thumbs);
                         } elseif (!$p['assign'] && $p['multi']) {
                             return $thumbs;
                         } else {
                             $size = "_" . $p['size'];
                             $return_thumb = array_find($photo['filename'] . $size, $thumbs);
                             if (empty($return_thumb)) {
                                 $this->default_thumb($size, $output);
                             } else {
                                 if ($p['assign'] != NULL) {
                                     assign($p['assign'], $return_thumb);
                                 } else {
                                     return $return_thumb;
                                 }
                             }
                         }
                     }
                     if ($p['output'] == 'html') {
                         /* Creating output here is dropped. Now we'll create an array of
                          * attributes and pass to cb_output_img_tag, that function will
                          *  create the actual HTML IMG tag
                          */
                         $size = "_" . $p['size'];
                         $src = array_find($photo['filename'] . $size, $thumbs);
                         $attrs = array();
                         if (empty($src)) {
                             return $this->default_thumb($size, $output);
                         } else {
                             $src = $src;
                         }
                         if (phpversion < '5.2.0') {
                             global $json;
                             $js = $json;
                         }
                         if (!empty($js)) {
                             $imgDetails = $js->json_decode($photo['photo_details'], true);
                         } else {
                             $imgDetails = json_decode($photo['photo_details'], true);
                         }
                         if (empty($imgDetails) || empty($imgDetails[$p['size']])) {
                             $dem = getimagesize(str_replace(PHOTOS_URL, PHOTOS_DIR, $src));
                             $width = $dem[0];
                             $height = $dem[1];
                             /* UPDATEING IMAGE DETAILS */
                             $this->update_image_details($details);
                         } else {
                             $width = $imgDetails[$p['size']]['width'];
                             $height = $imgDetails[$p['size']]['height'];
                         }
                         if (USE_PHOTO_TAGGING && THIS_PAGE == 'view_item') {
                             $id = $this->get_selector_id() . "_" . $photo['photo_id'];
                         } else {
                             if ($p['id']) {
                                 $id = mysql_clean($p['id']) . "_" . $photo['photo_id'];
                             } else {
                                 $id = $this->get_selector_id() . "_" . $photo['photo_id'];
                             }
                         }
                         $attrs['id'] = $id;
                         if ($p['class']) {
                             $attrs['class'] = mysql_clean($p['class']);
                         }
                         if ($p['align']) {
                             $attrs['align'] = $p['align'];
                         }
                         if ($p['width'] && is_numeric($p['width']) && ($p['height'] && is_numeric($p['height']))) {
                             $height = $p['height'];
                             $width = $p['width'];
                         } elseif ($p['width'] && is_numeric($p['width'])) {
                             $height = round($p['width'] / $width * $height);
                             $width = $p['width'];
                         } elseif ($p['height'] && is_numeric($p['height'])) {
                             $width = round($p['height'] * $width / $height);
                             $height = $p['height'];
                         }
                         $attrs['width'] = $width;
                         $attrs['height'] = $height;
                         if ($p['title']) {
                             $title = mysql_clean($p['title']);
                         } else {
                             $title = $photo['photo_title'];
                         }
                         $attrs['title'] = $title;
                         if ($p['alt']) {
                             $alt = mysql_clean($p['alt']);
                         } else {
                             $alt = mysql_clean(TITLE . ' - ' . $photo['photo_title']);
                         }
                         $attrs['alt'] = $alt;
                         $anchor_p = array("place" => 'photo_thumb', "data" => $photo);
                         ANCHOR($anchor_p);
                         if ($p['style']) {
                             $attrs['style'] = $p['style'];
                         }
                         if ($p['extra']) {
                             $attrs['extra'] = $p['extra'];
                         }
                         $img = cb_output_img_tag($src, $attrs);
                         if ($p['assign']) {
                             assign($p['assign'], $img);
                         } else {
                             return $img;
                         }
                     }
                 } else {
                     return $this->default_thumb($size, $output);
                 }
             }
         }
     }
 }
    function content_56afd78d1fea15_55283541($_smarty_tpl)
    {
        ?>
	<?php 
        if ($_smarty_tpl->tpl_vars['userquery']->value->udetails['soclid'] != '') {
            ?>
		<?php 
            if (isset($_smarty_tpl->tpl_vars["usr_head_thumb"])) {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = clone $_smarty_tpl->tpl_vars["usr_head_thumb"];
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->value = (string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', '', userid());
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->nocache = null;
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', '', userid()), null, 0);
            }
            ?>
		<?php 
        } else {
            ?>
		<?php 
            if (isset($_smarty_tpl->tpl_vars["usr_head_thumb"])) {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = clone $_smarty_tpl->tpl_vars["usr_head_thumb"];
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->value = (string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', 'small', userid());
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->nocache = null;
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', 'small', userid()), null, 0);
            }
            ?>
	<?php 
        }
        ?>
	<div id="quick_container">
		<div id="quicklist_box">
		</div>
	</div>
<?php 
        if (isset($_smarty_tpl->tpl_vars['logged_in_user'])) {
            $_smarty_tpl->tpl_vars['logged_in_user'] = clone $_smarty_tpl->tpl_vars['logged_in_user'];
            $_smarty_tpl->tpl_vars['logged_in_user']->value = $_smarty_tpl->tpl_vars['userquery']->value->get_user_details(userid());
            $_smarty_tpl->tpl_vars['logged_in_user']->nocache = null;
            $_smarty_tpl->tpl_vars['logged_in_user']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['logged_in_user'] = new Smarty_variable($_smarty_tpl->tpl_vars['userquery']->value->get_user_details(userid()), null, 0);
        }
        if (isset($_smarty_tpl->tpl_vars['searchPage'])) {
            $_smarty_tpl->tpl_vars['searchPage'] = clone $_smarty_tpl->tpl_vars['searchPage'];
            $_smarty_tpl->tpl_vars['searchPage']->value = $_GET['query'];
            $_smarty_tpl->tpl_vars['searchPage']->nocache = null;
            $_smarty_tpl->tpl_vars['searchPage']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['searchPage'] = new Smarty_variable($_GET['query'], null, 0);
        }
        ?>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
	<div class="navbar-container clearfix">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle navig-resp-bg" data-toggle="collapse" data-target="#khulja-sim-sim">
				<!--<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span> -->
			</button>
			<button type="button" class="navbar-toggle nav-toggle search-resp-bg" data-toggle="collapse" data-target="#navbar-search-collapse">
				<!--  <span class="glyphicon glyphicon-search"></span> -->
			</button>
			<a class="navbar-brand cb-logo" href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
"><?php 
        echo $_smarty_tpl->tpl_vars['website_title']->value;
        ?>
</a>
		</div>
		<?php 
        echo ANCHOR(array('place' => 'mature_content'), $_smarty_tpl);
        ?>
 

		<?php 
        if (isset($_smarty_tpl->tpl_vars['head_menu'])) {
            $_smarty_tpl->tpl_vars['head_menu'] = clone $_smarty_tpl->tpl_vars['head_menu'];
            $_smarty_tpl->tpl_vars['head_menu']->value = cb_menu();
            $_smarty_tpl->tpl_vars['head_menu']->nocache = null;
            $_smarty_tpl->tpl_vars['head_menu']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['head_menu'] = new Smarty_variable(cb_menu(), null, 0);
        }
        ?>

		<div class="responsive-search collapse" id="navbar-search-collapse">
			<!--<form class="" role="search" action="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
">-->
			<form class="navbar-form navbar-left no-border" role="search" action="<?php 
        echo cblink(array('name' => 'search_result'), $_smarty_tpl);
        ?>
">
				<div class="input-group cbsearchtype">
					<input type="text" class="form-control" name="query" placeholder="search keyword here" value="<?php 
        echo get_form_val('query', true);
        ?>
" id="query">
					<div class="input-group-btn">
						<input type="hidden" name="type" class="type" value="<?php 
        if (isset($_GET['type'])) {
            echo $_GET['type'];
        } else {
            ?>
videos<?php 
        }
        ?>
" id="type">
						<button tabindex="-1" data-toggle="dropdown" class="btn btn-default dropdown-toggle search-drop-btn" type="button">
							<span class="search-type"><?php 
        if ($_GET['type']) {
            echo $_GET['type'];
        } else {
            ?>
Videos<?php 
        }
        ?>
</span>
							<span class="caret"></span>
							<span class="sr-only">Toggle Dropdown</span>
						</button>
						<ul class="dropdown-menu" role="menu">
							<?php 
        if (isset($_smarty_tpl->tpl_vars['counter'])) {
            $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
            $_smarty_tpl->tpl_vars['counter']->value = 1;
            $_smarty_tpl->tpl_vars['counter']->nocache = null;
            $_smarty_tpl->tpl_vars['counter']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);
        }
        ?>
							<?php 
        $_smarty_tpl->tpl_vars['t'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['t']->_loop = false;
        $_smarty_tpl->tpl_vars['stypes'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->search_types;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['t']->key => $_smarty_tpl->tpl_vars['t']->value) {
            $_smarty_tpl->tpl_vars['t']->_loop = true;
            $_smarty_tpl->tpl_vars['stypes']->value = $_smarty_tpl->tpl_vars['t']->key;
            ?>
							<?php 
            if ($_smarty_tpl->tpl_vars['counter']->value == 3) {
                ?>
							<li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value || $_GET['type'] == '') {
                    ?>
  class="active"  <?php 
                }
                ?>
>
								<a  class="s-types" href="#"><?php 
                echo ucfirst($_smarty_tpl->tpl_vars['stypes']->value);
                ?>
</a>
							</li>
							<?php 
            } else {
                ?>
							<li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value) {
                    ?>
  class="active" <?php 
                }
                ?>
>
								<a  class="s-types" href="#"><?php 
                echo ucfirst($_smarty_tpl->tpl_vars['stypes']->value);
                ?>
</a>
							</li>
							<?php 
            }
            ?>
							<?php 
            if (isset($_smarty_tpl->tpl_vars['counter'])) {
                $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
                $_smarty_tpl->tpl_vars['counter']->value = $_smarty_tpl->tpl_vars['counter']->value + 1;
                $_smarty_tpl->tpl_vars['counter']->nocache = null;
                $_smarty_tpl->tpl_vars['counter']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable($_smarty_tpl->tpl_vars['counter']->value + 1, null, 0);
            }
            ?>
							<?php 
        }
        ?>
						</ul>
						<input tabindex="-1" type="submit" name="cbsearch" id="cbsearch" value="<?php 
        echo smarty_lang(array('code' => 'Go'), $_smarty_tpl);
        ?>
" class="btn btn-default minus-marginLeft" />
					</div>
				</div>
			</form>
		</div>

		<ul class="nav navbar-nav main-nav navbar-collapse collapse manual-height left-margin-xero pad-left-xero" id="khulja-sim-sim">
			<li class="dropdown hidden-xs mega-dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bars"></i>&nbsp;Menu <span class="caret"></span></a>
				<ul class="dropdown-menu clearfix mega-dropdown-menu noclose">
					<li class="col col-lg-3 col-md-3 col-sm-4 col-xs-12">
						<div id="menCollection" class="carousel slide clearfix" data-ride="carousel">
							<div class="carousel-inner">
							<?php 
        if (isset($_smarty_tpl->tpl_vars['videos'])) {
            $_smarty_tpl->tpl_vars['videos'] = clone $_smarty_tpl->tpl_vars['videos'];
            $_smarty_tpl->tpl_vars['videos']->value = get_videos(array("order" => "date_added DESC", "limit" => 4, "featured" => "yes"));
            $_smarty_tpl->tpl_vars['videos']->nocache = null;
            $_smarty_tpl->tpl_vars['videos']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['videos'] = new Smarty_variable(get_videos(array("order" => "date_added DESC", "limit" => 4, "featured" => "yes")), null, 0);
        }
        ?>
							<?php 
        if ($_smarty_tpl->tpl_vars['videos']->value) {
            ?>
				        	<?php 
            $_smarty_tpl->tpl_vars['video'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['video']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['videos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['video']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['video']->key => $_smarty_tpl->tpl_vars['video']->value) {
                $_smarty_tpl->tpl_vars['video']->_loop = true;
                $_smarty_tpl->tpl_vars['video']->iteration++;
                ?>
				        	<?php 
                if ($_smarty_tpl->tpl_vars['video']->iteration == 1) {
                    ?>
				        	<div class="item active">
				        	<?php 
                } else {
                    ?>
				        	<div class="item">
				        	<?php 
                }
                ?>
				  
								<?php 
                echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/videos/video_head.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
                ?>

							</div>
				        	<?php 
            }
            ?>
							                              
							</div><!-- End Carousel Inner -->
						  	<!-- Controls -->
							<a class="left carousel-control" href="#menCollection" role="button" data-slide="prev">
								<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
								<span class="sr-only">Previous</span>
							</a>
							<a class="right carousel-control" href="#menCollection" role="button" data-slide="next">
								<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
								<span class="sr-only">Next</span>
							</a>
						</div><!-- /.carousel -->
						<?php 
        } else {
            ?>
						<span class="well well-info btn-block">
						No Featured Video Added !
						</span>
						<?php 
        }
        ?>
 
					</li>
					<li class="col col-lg-9 col-md-9 col-sm-8 clearfix col-xs-12">
						<div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
							<h2><i class="fa fa-video-camera"></i>&nbsp;Videos</h2>
							<?php 
        if (isset($_smarty_tpl->tpl_vars['sorting_links'])) {
            $_smarty_tpl->tpl_vars['sorting_links'] = clone $_smarty_tpl->tpl_vars['sorting_links'];
            $_smarty_tpl->tpl_vars['sorting_links']->value = sorting_links();
            $_smarty_tpl->tpl_vars['sorting_links']->nocache = null;
            $_smarty_tpl->tpl_vars['sorting_links']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['sorting_links'] = new Smarty_variable(sorting_links(), null, 0);
        }
        ?>
     
                            <?php 
        $_smarty_tpl->tpl_vars['name'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['name']->_loop = false;
        $_smarty_tpl->tpl_vars['sort'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sorting_links']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['name']->key => $_smarty_tpl->tpl_vars['name']->value) {
            $_smarty_tpl->tpl_vars['name']->_loop = true;
            $_smarty_tpl->tpl_vars['sort']->value = $_smarty_tpl->tpl_vars['name']->key;
            ?>
                            <ul>
                                <li class="head_sort_link">
                                	<a class="" href="<?php 
            echo cblink(array('name' => 'sort', 'sort' => $_smarty_tpl->tpl_vars['sort']->value, 'type' => 'videos'), $_smarty_tpl);
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['name']->value;
            ?>
</a>
                                </li>
                            </ul>  
                            <?php 
        }
        ?>
						</div>
						<div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
							<h2><i class="fa fa-camera"></i>&nbsp;Photos</h2>
							<?php 
        if (isset($_smarty_tpl->tpl_vars['sorting_links'])) {
            $_smarty_tpl->tpl_vars['sorting_links'] = clone $_smarty_tpl->tpl_vars['sorting_links'];
            $_smarty_tpl->tpl_vars['sorting_links']->value = sorting_links();
            $_smarty_tpl->tpl_vars['sorting_links']->nocache = null;
            $_smarty_tpl->tpl_vars['sorting_links']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['sorting_links'] = new Smarty_variable(sorting_links(), null, 0);
        }
        ?>
     
                            <?php 
        $_smarty_tpl->tpl_vars['name'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['name']->_loop = false;
        $_smarty_tpl->tpl_vars['sort'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sorting_links']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['name']->key => $_smarty_tpl->tpl_vars['name']->value) {
            $_smarty_tpl->tpl_vars['name']->_loop = true;
            $_smarty_tpl->tpl_vars['sort']->value = $_smarty_tpl->tpl_vars['name']->key;
            ?>
                            <ul>
                                <li class="head_sort_link">
                                	<a class="" href="<?php 
            echo cblink(array('name' => 'sort', 'sort' => $_smarty_tpl->tpl_vars['sort']->value, 'type' => 'photos'), $_smarty_tpl);
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['name']->value;
            ?>
</a>
                                </li>
                            </ul>  
                            <?php 
        }
        ?>
						</div>
						<div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
							<h2><i class="fa fa-desktop"></i>&nbsp;Channels</h2>
							<?php 
        if (isset($_smarty_tpl->tpl_vars['sorting_links'])) {
            $_smarty_tpl->tpl_vars['sorting_links'] = clone $_smarty_tpl->tpl_vars['sorting_links'];
            $_smarty_tpl->tpl_vars['sorting_links']->value = sorting_links();
            $_smarty_tpl->tpl_vars['sorting_links']->nocache = null;
            $_smarty_tpl->tpl_vars['sorting_links']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['sorting_links'] = new Smarty_variable(sorting_links(), null, 0);
        }
        ?>
     
                            <?php 
        $_smarty_tpl->tpl_vars['name'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['name']->_loop = false;
        $_smarty_tpl->tpl_vars['sort'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sorting_links']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['name']->key => $_smarty_tpl->tpl_vars['name']->value) {
            $_smarty_tpl->tpl_vars['name']->_loop = true;
            $_smarty_tpl->tpl_vars['sort']->value = $_smarty_tpl->tpl_vars['name']->key;
            ?>
                            <ul>
                                <li class="head_sort_link">
                                	<a class="" href="<?php 
            echo cblink(array('name' => 'sort', 'sort' => $_smarty_tpl->tpl_vars['sort']->value, 'type' => 'channels'), $_smarty_tpl);
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['name']->value;
            ?>
</a>
                                </li>
                            </ul>  
                            <?php 
        }
        ?>
						</div>
						<div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
							<h2><i class="fa fa-th-large"></i>&nbsp;Collections</h2>
							<?php 
        if (isset($_smarty_tpl->tpl_vars['sorting_links'])) {
            $_smarty_tpl->tpl_vars['sorting_links'] = clone $_smarty_tpl->tpl_vars['sorting_links'];
            $_smarty_tpl->tpl_vars['sorting_links']->value = sorting_links();
            $_smarty_tpl->tpl_vars['sorting_links']->nocache = null;
            $_smarty_tpl->tpl_vars['sorting_links']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['sorting_links'] = new Smarty_variable(sorting_links(), null, 0);
        }
        ?>
     
                            <?php 
        $_smarty_tpl->tpl_vars['name'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['name']->_loop = false;
        $_smarty_tpl->tpl_vars['sort'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sorting_links']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['name']->key => $_smarty_tpl->tpl_vars['name']->value) {
            $_smarty_tpl->tpl_vars['name']->_loop = true;
            $_smarty_tpl->tpl_vars['sort']->value = $_smarty_tpl->tpl_vars['name']->key;
            ?>
                            <ul>
                                <li class="head_sort_link">
                                	<a class="" href="<?php 
            echo cblink(array('name' => 'sort', 'sort' => $_smarty_tpl->tpl_vars['sort']->value, 'type' => 'collections'), $_smarty_tpl);
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['name']->value;
            ?>
</a>
                                </li>
                            </ul>  
                            <?php 
        }
        ?>
						</div>
						<div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
							<h2><i class="fa fa-users"></i>&nbsp;Groups</h2>
							<?php 
        if (isset($_smarty_tpl->tpl_vars['sorting_links'])) {
            $_smarty_tpl->tpl_vars['sorting_links'] = clone $_smarty_tpl->tpl_vars['sorting_links'];
            $_smarty_tpl->tpl_vars['sorting_links']->value = sorting_links();
            $_smarty_tpl->tpl_vars['sorting_links']->nocache = null;
            $_smarty_tpl->tpl_vars['sorting_links']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['sorting_links'] = new Smarty_variable(sorting_links(), null, 0);
        }
        ?>
     
                            <?php 
        $_smarty_tpl->tpl_vars['name'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['name']->_loop = false;
        $_smarty_tpl->tpl_vars['sort'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sorting_links']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['name']->key => $_smarty_tpl->tpl_vars['name']->value) {
            $_smarty_tpl->tpl_vars['name']->_loop = true;
            $_smarty_tpl->tpl_vars['sort']->value = $_smarty_tpl->tpl_vars['name']->key;
            ?>
                            <ul>
                                <li class="head_sort_link">
                                	<a class="" href="<?php 
            echo cblink(array('name' => 'sort', 'sort' => $_smarty_tpl->tpl_vars['sort']->value, 'type' => 'groups'), $_smarty_tpl);
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['name']->value;
            ?>
</a>
                                </li>
                            </ul>  
                            <?php 
        }
        ?>
						</div>
					</li>
				</ul>				
			</li>
			
			<?php 
        $_smarty_tpl->tpl_vars['menu'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['menu']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['head_menu']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['menu']->iteration = 0;
        foreach ($_from as $_smarty_tpl->tpl_vars['menu']->key => $_smarty_tpl->tpl_vars['menu']->value) {
            $_smarty_tpl->tpl_vars['menu']->_loop = true;
            $_smarty_tpl->tpl_vars['menu']->iteration++;
            ?>
			<li class="visible-xs"><a href="<?php 
            echo $_smarty_tpl->tpl_vars['menu']->value['link'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['menu']->value['icon'];
            ?>
 <?php 
            echo $_smarty_tpl->tpl_vars['menu']->value['name'];
            ?>
</a></li>
			<?php 
        }
        ?>

			<?php 
        if (userid()) {
            ?>
			<li class="dropdown hvr myaccount-dd hidden-lg hidden-md hidden-sm">
				<span class="dropdown-toggle theme_color col-md-12" data-toggle="dropdown">Setting<b class="caret"></b></span>
				<ul class="dropdown-menu no-padding">
					<li>
						<div class="adminthumb">
						<a href="<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['logged_in_user']->value);
            ?>
">
							<img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
"/>
							<h4><?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
</h4> 
						</a>    
						</div>
					</li>
					<?php 
            if (has_access('admin_access')) {
                ?>
					<li><a href="<?php 
                echo $_smarty_tpl->tpl_vars['admin_baseurl']->value;
                ?>
"><i class="fa fa-cogs"></i>&nbsp;<?php 
                echo smarty_lang(array('code' => "Admin area"), $_smarty_tpl);
                ?>
</a></li>
					<?php 
            }
            ?>
					<li><a href="<?php 
            echo cblink(array('name' => 'my_account'), $_smarty_tpl);
            echo userid(array(), $_smarty_tpl);
            ?>
"><i class="fa fa-user"></i></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "my_account"), $_smarty_tpl);
            ?>
</a></li>
					<?php 
            echo ANCHOR(array('place' => 'premium_button_link'), $_smarty_tpl);
            ?>

					<li><a href="<?php 
            echo cblink(array('name' => 'my_videos'), $_smarty_tpl);
            ?>
"><i class="fa fa-video-camera"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "Manage Videos"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'channels'), $_smarty_tpl);
            ?>
"><i class="fa fa-eye"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "View Channels"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo $_smarty_tpl->tpl_vars['baseurl']->value;
            ?>
/view_channel.php?user=<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
"><i class="fa fa-desktop"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "My Channel"), $_smarty_tpl);
            ?>
</a></li>
				</ul>
			</li>

			<li class="dropdown hidden-lg hidden-md hidden-sm ">
				<a href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
" class="dropdown-toggle" data-toggle="dropdown"><?php 
            echo smarty_lang(array('code' => "Uploads"), $_smarty_tpl);
            ?>
 <b class="caret"></b></a>
				<ul role="menu" class="dropdown-menu">
					<li><a href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Video"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'photo_upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Photo"), $_smarty_tpl);
            ?>
</a></li>
				</ul>
			</li>
			<li class="navbar-sm-login-links"><a href="<?php 
            echo cblink(array('name' => 'logout'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => 'logout'), $_smarty_tpl);
            ?>
</a></li>
			<?php 
        } else {
            ?>
			
			<!-- Shown to small devices only Start  @todo : Add condition for logged in user -->

			<li class="navbar-sm-login-links"><a href="#" data-toggle="modal" data-target="#login-modal"><?php 
            echo smarty_lang(array('code' => 'login'), $_smarty_tpl);
            ?>
</a></li>
			<li class="navbar-sm-login-links"><a href="<?php 
            echo cblink(array('name' => "signup"), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => 'Create new account'), $_smarty_tpl);
            ?>
</a></li>
			<!-- Ends -->
			<?php 
        }
        ?>
			<?php 
        if (count($_smarty_tpl->tpl_vars['head_menu']->value) > 4) {
            ?>
			<li class="dropdown">
				<a href="#" class="dropdown-toggle visible-xs" data-toggle="dropdown">More <b class="caret"></b></a>
				<ul class="dropdown-menu">

					<?php 
            $_smarty_tpl->tpl_vars['menu'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['menu']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['head_menu']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['menu']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['menu']->key => $_smarty_tpl->tpl_vars['menu']->value) {
                $_smarty_tpl->tpl_vars['menu']->_loop = true;
                $_smarty_tpl->tpl_vars['menu']->iteration++;
                ?>
					<?php 
                if ($_smarty_tpl->tpl_vars['menu']->iteration > 4) {
                    ?>
					<li <?php 
                    if ($_GET['type'] == mb_strtolower($_smarty_tpl->tpl_vars['menu']->value['name'], 'UTF-8')) {
                        ?>
 class="active"
					<?php 
                    } elseif (!$_GET['type']) {
                        ?>
					<?php 
                        if ($_smarty_tpl->tpl_vars['menu']->value['active']) {
                            ?>
 class="active"<?php 
                        }
                        ?>
					<?php 
                    }
                    ?>
><a href="<?php 
                    echo $_smarty_tpl->tpl_vars['menu']->value['link'];
                    ?>
"><?php 
                    echo $_smarty_tpl->tpl_vars['menu']->value['icon'];
                    ?>
 <?php 
                    echo $_smarty_tpl->tpl_vars['menu']->value['name'];
                    ?>
</a></li>
					<?php 
                }
                ?>
					<?php 
            }
            ?>
				</ul>
			</li>
			<?php 
        }
        ?>
		</ul>

		<!-- Shown to small devices only Start-->
		<form id="search" class="navbar-form navbar-search navbar-left" name="search" method="get" role="search" action="<?php 
        echo cblink(array('name' => 'search_result'), $_smarty_tpl);
        ?>
">
			<div class="input-group mtxs cbsearchtype">
				<input type="text" class="form-control" name="query" placeholder="search keyword here"  value="<?php 
        echo get_form_val('query', true);
        ?>
" id="query">
				<div class="input-group-btn">
					<input type="hidden" name="type" class="type" value="<?php 
        if (isset($_GET['type'])) {
            echo $_GET['type'];
        } else {
            ?>
videos<?php 
        }
        ?>
" id="type">
					<button tabindex="-1" data-toggle="dropdown" class="btn btn-default dropdown-toggle search-drop-btn" type="button">
						<span class="search-type"><?php 
        if ($_GET['type']) {
            echo $_GET['type'];
        } else {
            ?>
Videos<?php 
        }
        ?>
</span>
						<span class="caret"></span>
						<span class="sr-only">Toggle Dropdown</span>
					</button>
					<ul class="dropdown-menu" role="menu">
						<?php 
        if (isset($_smarty_tpl->tpl_vars['counter'])) {
            $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
            $_smarty_tpl->tpl_vars['counter']->value = 1;
            $_smarty_tpl->tpl_vars['counter']->nocache = null;
            $_smarty_tpl->tpl_vars['counter']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);
        }
        ?>
						<?php 
        $_smarty_tpl->tpl_vars['t'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['t']->_loop = false;
        $_smarty_tpl->tpl_vars['stypes'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->search_types;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['t']->key => $_smarty_tpl->tpl_vars['t']->value) {
            $_smarty_tpl->tpl_vars['t']->_loop = true;
            $_smarty_tpl->tpl_vars['stypes']->value = $_smarty_tpl->tpl_vars['t']->key;
            ?>
						<?php 
            if ($_smarty_tpl->tpl_vars['counter']->value == 3) {
                ?>
						<li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value || $_GET['type'] == '') {
                    ?>
  class="active"  <?php 
                }
                ?>
>
							<a  class="s-types" href="#"><?php 
                echo ucfirst($_smarty_tpl->tpl_vars['stypes']->value);
                ?>
</a>
						</li>
						<?php 
            } else {
                ?>
						<li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value) {
                    ?>
  class="active" <?php 
                }
                ?>
>
							<a  class="s-types" href="#"><?php 
                echo ucfirst($_smarty_tpl->tpl_vars['stypes']->value);
                ?>
</a>
						</li>
						<?php 
            }
            ?>
						<?php 
            if (isset($_smarty_tpl->tpl_vars['counter'])) {
                $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
                $_smarty_tpl->tpl_vars['counter']->value = $_smarty_tpl->tpl_vars['counter']->value + 1;
                $_smarty_tpl->tpl_vars['counter']->nocache = null;
                $_smarty_tpl->tpl_vars['counter']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable($_smarty_tpl->tpl_vars['counter']->value + 1, null, 0);
            }
            ?>
						<?php 
        }
        ?>
					</ul>
					<input tabindex="-1" type="submit" name="cbsearch" id="cbsearch" value="<?php 
        echo smarty_lang(array('code' => 'Go'), $_smarty_tpl);
        ?>
" class="btn btn-default minus-marginLeft" />
				</div>
			</div>
		</form>
		<!-- Ends -->

		<!-- Shown to Large displays only Start -->
		<ul class="nav navbar-nav navbar-right nav-login-btns">
			<?php 
        if (userid()) {
            ?>
			<li class="dropdown hvr myaccount-dd">
				<span class="dropdown-toggle theme_color col-md-12" data-toggle="dropdown"> <img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
" style="width: 40px; height: 40px;"/> <b class="caret"></b></span>
				<ul class="dropdown-menu no-padding">
					<li>
						<div class="adminthumb">
							 <a href="<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['logged_in_user']->value);
            ?>
">
							<img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
"/>
							<h4><?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
</h4>
							</a>     
						</div>
					</li>
					<?php 
            if (has_access('admin_access')) {
                ?>
					<li><a href="<?php 
                echo $_smarty_tpl->tpl_vars['admin_baseurl']->value;
                ?>
"><i class="fa fa-cogs"></i>&nbsp;<?php 
                echo smarty_lang(array('code' => "Admin area"), $_smarty_tpl);
                ?>
</a></li>
					<?php 
            }
            ?>
					<li><a href="<?php 
            echo cblink(array('name' => 'my_account'), $_smarty_tpl);
            echo userid(array(), $_smarty_tpl);
            ?>
"><i class="fa fa-user"></i></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "my_account"), $_smarty_tpl);
            ?>
</a></li>
					<?php 
            echo ANCHOR(array('place' => 'premium_button_link'), $_smarty_tpl);
            ?>

					<li><a href="<?php 
            echo cblink(array('name' => 'my_videos'), $_smarty_tpl);
            ?>
"><i class="fa fa-video-camera"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "Manage Videos"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'channels'), $_smarty_tpl);
            ?>
"><i class="fa fa-eye"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "View Channels"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo $_smarty_tpl->tpl_vars['baseurl']->value;
            ?>
/view_channel.php?user=<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
"><i class="fa fa-desktop"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "My Channel"), $_smarty_tpl);
            ?>
</a></li>
					<li class="divider"></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'logout'), $_smarty_tpl);
            ?>
"><i class="fa fa-sign-out"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "Logout"), $_smarty_tpl);
            ?>
</a></li>
				</ul>
			</li>
			<?php 
        } else {
            ?>
			<li>
				<div class="mrl">
					<a href="<?php 
            echo cblink(array('name' => 'signup'), $_smarty_tpl);
            ?>
" class="btn btn-primary btn-success btn-sm"><?php 
            echo smarty_lang(array('code' => "Create Account"), $_smarty_tpl);
            ?>
</a>
					<a href="#" data-toggle="modal" data-target="#login-modal" class="btn btn-primary btn-sm"><?php 
            echo smarty_lang(array('code' => "Login"), $_smarty_tpl);
            ?>
</a>
				</div>
			</li>
			<?php 
        }
        ?>
		</ul>
		<!-- Ends -->

		<!-- Shown to Large displays only Start -->
		<?php 
        if (userid()) {
            ?>
		<div class="upload-dropdown-btn-d hidden-xs ">
			<div class="btn-group">
				<button title="Upload" class="btn btn-primary" type="button">
					<a class="upload-vid-photo-icon" href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
">Upload</a>
				</button>
				<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" type="button">
					<span class="caret"></span>
					<span class="sr-only">Toggle Dropdown</span>
				</button>
				<ul role="menu" class="dropdown-menu upload-dropdown">
					<li><a href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Video"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'photo_upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Photo"), $_smarty_tpl);
            ?>
</a></li>
				</ul>
			</div>
		</div>
		<?php 
        }
        ?>
		<!-- Ends -->

		<!-- SHown to middle size displays only  @todo : Add condition for logged in user -->
		<ul class="nav navbar-nav navbar-right nav-login-dd">
			<li class="search-form show-small-form pull-left mrxll" >
				<i class="glyphicon glyphicon-search cursor-pointer"></i>
			</li>
			<div class="form-small full-width">                    
				<form action="<?php 
        echo cblink(array('name' => 'search_result'), $_smarty_tpl);
        ?>
" role="search" method="get" name="search_small" id="search_small">
					<div class="input-group cbsearchtype">
						<input type="text" class="form-control" name="query" value="<?php 
        echo get_form_val('query', true);
        ?>
" placeholder="search keyword here" id="query">
						<div class="input-group-btn">
							<input type="hidden" name="type" class="type" value="<?php 
        if (isset($_GET['type'])) {
            echo $_GET['type'];
        } else {
            ?>
videos<?php 
        }
        ?>
" id="type">
							<button tabindex="-1" data-toggle="dropdown" class="btn btn-default dropdown-toggle search-drop-btn" type="button">
								<span class="search-type"><?php 
        if ($_GET['type']) {
            echo $_GET['type'];
        } else {
            ?>
Videos<?php 
        }
        ?>
</span>
								<span class="caret"></span>
								<span class="sr-only">Toggle Dropdown</span>
							</button>
							<ul role="menu" class="dropdown-menu">
								<?php 
        if (isset($_smarty_tpl->tpl_vars['counter'])) {
            $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
            $_smarty_tpl->tpl_vars['counter']->value = 1;
            $_smarty_tpl->tpl_vars['counter']->nocache = null;
            $_smarty_tpl->tpl_vars['counter']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);
        }
        ?>
								<?php 
        $_smarty_tpl->tpl_vars['t'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['t']->_loop = false;
        $_smarty_tpl->tpl_vars['stypes'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->search_types;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['t']->key => $_smarty_tpl->tpl_vars['t']->value) {
            $_smarty_tpl->tpl_vars['t']->_loop = true;
            $_smarty_tpl->tpl_vars['stypes']->value = $_smarty_tpl->tpl_vars['t']->key;
            ?>
								<?php 
            if ($_smarty_tpl->tpl_vars['counter']->value == 3) {
                ?>
								<li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value || $_GET['type'] == '') {
                    ?>
  class="active"  <?php 
                }
                ?>
>
									<a class="s-types" href="#"><?php 
                echo ucfirst($_smarty_tpl->tpl_vars['stypes']->value);
                ?>
</a>
								</li>
								<?php 
            } else {
                ?>
								<li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value) {
                    ?>
  class="active" <?php 
                }
                ?>
>
									<a class="s-types" href="#"><?php 
                echo ucfirst($_smarty_tpl->tpl_vars['stypes']->value);
                ?>
</a>
								</li>
								<?php 
            }
            ?>
								<?php 
            if (isset($_smarty_tpl->tpl_vars['counter'])) {
                $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
                $_smarty_tpl->tpl_vars['counter']->value = $_smarty_tpl->tpl_vars['counter']->value + 1;
                $_smarty_tpl->tpl_vars['counter']->nocache = null;
                $_smarty_tpl->tpl_vars['counter']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable($_smarty_tpl->tpl_vars['counter']->value + 1, null, 0);
            }
            ?>
								<?php 
        }
        ?>
							</ul>
							<input tabindex="-1" type="submit" name="cbsearch" id="cbsearch" value="<?php 
        echo smarty_lang(array('code' => 'Go'), $_smarty_tpl);
        ?>
" class="btn btn-default minus-marginLeft" />
						</div>
					</div>
				</form>
			</div>
			<?php 
        if (userid()) {
            ?>
			<li class="dropdown hvr myaccount-dd">
				<span class="dropdown-toggle theme_color col-md-12" data-toggle="dropdown"><img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
" style="width: 40px; height: 40px;"/><b class="caret"></b></span>
				<ul class="dropdown-menu">
					<li>
						<div class="adminthumb">
							<a href="<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['logged_in_user']->value);
            ?>
">
							<img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
"/>
							<h4><?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
</h4>     
							</a>
		
						</div>
					</li>
					<?php 
            if (has_access('admin_access')) {
                ?>
					<li><a href="<?php 
                echo $_smarty_tpl->tpl_vars['admin_baseurl']->value;
                ?>
"><?php 
                echo smarty_lang(array('code' => "Admin area"), $_smarty_tpl);
                ?>
</a></li>
					<?php 
            }
            ?>
					<li><a href="<?php 
            echo cblink(array('name' => 'my_account'), $_smarty_tpl);
            echo userid(array(), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "my_account"), $_smarty_tpl);
            ?>
</a></li>
					<?php 
            echo ANCHOR(array('place' => 'premium_button_link'), $_smarty_tpl);
            ?>

					<li><a href="<?php 
            echo cblink(array('name' => 'my_videos'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Manage Videos"), $_smarty_tpl);
            ?>
</a></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'channels'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "View Channels"), $_smarty_tpl);
            ?>
</a></li>
					<li class="divider"></li>
					<li><a href="<?php 
            echo cblink(array('name' => 'logout'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Logout"), $_smarty_tpl);
            ?>
</a></li>
				</ul>
			</li>
			<?php 
        } else {
            ?>
			<li>
				<div class=" mlm mrm">
					<a href="#" data-toggle="modal" data-target="#login-modal"><span class="glyphicon glyphicon-user"></span></a>
				</div>
			</li>
			<?php 
        }
        ?>
		</ul>
		
		
	</div>
</nav>

<div class="modal fade" id="login-modal" role="dialog" aria-hidden="true">
	<div class="modal-dialog">
		<form name="login-form" role="form" action="<?php 
        echo cblink(array('name' => 'signup'), $_smarty_tpl);
        ?>
" method="post">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title"><?php 
        echo smarty_lang(array('code' => "Login"), $_smarty_tpl);
        ?>
</h4>
				</div>
				<div class="modal-body">

					<div class="form-group">
						<label for="login_username"><?php 
        echo smarty_lang(array('code' => "Username"), $_smarty_tpl);
        ?>
</label>
						<input type="text" class="form-control" id="login_username"  name="username"  placeholder="Enter username">
					</div>

					<div class="form-group">
						<label for="login_password"><?php 
        echo smarty_lang(array('code' => "Password"), $_smarty_tpl);
        ?>
</label>
						<input type="password" class="form-control" id="login_password" name="password" placeholder="Enter password">
					</div>

					<div class="checkbox">
						<label>
							<input type="checkbox"> <?php 
        echo smarty_lang(array('code' => "Remember me"), $_smarty_tpl);
        ?>

						</label>
					</div>

					<div align="center"><a href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/forgot.php"><?php 
        echo smarty_lang(array('code' => 'user_forgot_password'), $_smarty_tpl);
        ?>
</a> | <a href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/forgot.php?mode=recover_username"><?php 
        echo smarty_lang(array('code' => 'user_forgot_username'), $_smarty_tpl);
        ?>
</a></div>
				</div>
				<div class="modal-footer">
					<a href="<?php 
        echo cblink(array('name' => 'signup'), $_smarty_tpl);
        ?>
" class="btn btn-primary btn-success btn-sm pull-left"><?php 
        echo smarty_lang(array('code' => "Create Account"), $_smarty_tpl);
        ?>
</a>
					<button type="button" class="btn btn-default" data-dismiss="modal"><?php 
        echo smarty_lang(array('code' => "Cancel"), $_smarty_tpl);
        ?>
</button>
					<input type="submit" class="btn btn-primary" value="<?php 
        echo smarty_lang(array('code' => 'Login'), $_smarty_tpl);
        ?>
" name="login">
				</div>
			</div><!-- /.modal-content -->
		</form>
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
function rm_hvr() {
	if ( $(window).width() > 767 )
	{
		$(".dropdown.hvr").on("mouseenter",function(){
			$('.dropdown-menu', this).not('.in .dropdown-menu').stop(true,true).slideDown("400");
		});
		$(".dropdown.hvr").on("mouseleave",function(){
			$('.dropdown-menu', this).not('.in .dropdown-menu').stop(true,true).slideUp("400");
		});
	}
	else
	{
		
	}
}
//header menu-width function
function headerMenuWidth(){
	var headerWidth = $(window).width();
	$(".mega-dropdown-menu .col:nth-child(2)").css("width",headerWidth-350+"px");
}
$(window).resize(function(){
	rm_hvr();
	headerMenuWidth();
});
	$(document).ready(function(){
		rm_hvr();
		headerMenuWidth();
		$(".cbsearchtype a").on({
			click: function(e){
				e.preventDefault();
				var prent_li = $(this).parents();
				$('.type').val($(this).html());
				$('.cbsearchtype li').removeClass('active');
				prent_li.addClass('active');
			}
			});
		
		$('.show-small-form').click(function() {
			$('.form-small').toggleClass('show');   
		});

		$('.s-types').on("click", function(){
			var _this = $(this);
			var text = _this.html();
			$('.search-type').html(text);
		});
	});
</script><?php 
    }
Example #17
0
 /**
  * Function used to call footer
  */
 function footer()
 {
     ANCHOR(array('place' => 'the_footer'));
 }
Example #18
0
echo 'Called method';
H_END();
listitem($this->geteasyurl()->getmethodname(), '&nbsp;');
H_BEGIN(2);
echo 'Called controller';
H_END();
listitem($this->geteasyurl()->getcontrollername(), '&nbsp;');
H_BEGIN(2);
echo 'Called function';
H_END();
listitem($this->geteasyurl()->getfunctionname(), '&nbsp;');
H_BEGIN(2);
echo 'Url segments';
H_END();
segmentlist($this->geteasyurl());
H_BEGIN(2);
echo 'Query parameters';
H_END();
paramlist($this->geteasyurl());
H_BEGIN(2);
echo 'Url demonstrations';
H_END();
DIV_BEGIN('', 'urldemo');
ANCHOR($this->getbaseurl() . 'index.php/valuesbyurl/aaa/bbb/ccc', 'Demo of segments');
ANCHOR($this->getbaseurl() . 'index.php/valuesbyurl?aaa=111&bbb=222', 'Demo of parameters');
ANCHOR($this->getbaseurl() . 'index.php/valuesbyurl/aaa/bbb/ccc?aaa=111&bbb=222', 'Demo of segments and parameters');
ANCHOR($this->getbaseurl() . 'index.php/valuesbyurl', 'Default url');
DIV_END();
DIV_END();
$this->includeeasyview('easydemo/footer');
$this->includeeasyview('easydemo/end');
    function content_55e4485ead5e40_22088703($_smarty_tpl)
    {
        if ($_smarty_tpl->tpl_vars['userquery']->value->login_check('', true) || $_smarty_tpl->tpl_vars['Cbucket']->value->configs['anonym_comments'] == 'yes') {
            ?>
   <div class="add_comment_box" id="add_comment"> </div>
<div class="">
    <div id="comment-add-err"></div>
  <script type="text/javascript">
//Edit the counter/limiter value as your wish
var count = "125";
//Example: var count = "175";
function limiter(){
var tex = document.myform.comment.value;
var len = tex.length;
if(len > count){
tex = tex.substring(0,count);
document.myform.comment.value =tex;
return false;
}
document.myform.limit.value = count-len;
}
</script>
    <form class=""  id="comment_form" name="myform">

        <input type="hidden" name="reply_to" id="reply_to" value="0">
        <input type="hidden" name="obj_id" id="obj_id" value="<?php 
            echo $_smarty_tpl->tpl_vars['id']->value;
            ?>
">
        <?php 
            if (!$_smarty_tpl->tpl_vars['userquery']->value->login_check('', true) && $_smarty_tpl->tpl_vars['Cbucket']->value->configs['anonym_comments'] == 'yes') {
                ?>

        <div class="form-group">
            <label for="comment_name">
                <?php 
                echo smarty_lang(array('code' => 'name'), $_smarty_tpl);
                ?>

            </label>
            <input type="text" name="name" id="comment_name" class="form-control">
        </div>

        <div class="form-group">
            <label for="comment_email">
                <?php 
                echo smarty_lang(array('code' => 'email_wont_display'), $_smarty_tpl);
                ?>

            </label>
            <input type="email" name="email" id="comment_email" class="form-control">
        </div>



        <?php 
            } else {
                ?>
            <strong class="comment-as"><?php 
                echo sprintf(lang('Comment as %s'), $_smarty_tpl->tpl_vars['userquery']->value->username);
                ?>
</strong>
        <?php 
            }
            ?>

        <?php 
            echo ANCHOR(array('place' => 'before_compose_box'), $_smarty_tpl);
            ?>



        <?php 
            if (config('comments_captcha') == 'all' || config('comments_captcha') == 'guests' && !$_smarty_tpl->tpl_vars['userquery']->value->login_check('', true)) {
                ?>

            <div class="form-group">

            <?php 
                if (isset($_smarty_tpl->tpl_vars['captcha'])) {
                    $_smarty_tpl->tpl_vars['captcha'] = clone $_smarty_tpl->tpl_vars['captcha'];
                    $_smarty_tpl->tpl_vars['captcha']->value = get_captcha();
                    $_smarty_tpl->tpl_vars['captcha']->nocache = null;
                    $_smarty_tpl->tpl_vars['captcha']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['captcha'] = new Smarty_variable(get_captcha(), null, 0);
                }
                ?>
            <?php 
                if ($_smarty_tpl->tpl_vars['captcha']->value) {
                    ?>
            <?php 
                    if ($_smarty_tpl->tpl_vars['captcha']->value['show_field']) {
                        ?>
            <label class="label" for="captcha">Verification Code</label>
            <?php 
                        echo load_captcha(array('captcha' => $_smarty_tpl->tpl_vars['captcha']->value, 'load' => 'field', 'field_params' => ' id="captcha" class="input" '), $_smarty_tpl);
                        ?>


            <?php 
                    }
                    ?>
             <?php 
                    echo load_captcha(array('captcha' => $_smarty_tpl->tpl_vars['captcha']->value, 'load' => 'function'), $_smarty_tpl);
                    ?>



            <?php 
                }
                ?>
            </div>
        <?php 
            }
            ?>


        <div class="form-group">
            <?php 
            if (!$_smarty_tpl->tpl_vars['userquery']->value->login_check('', true) && $_smarty_tpl->tpl_vars['Cbucket']->value->configs['anonym_comments'] == 'yes') {
                ?>
            <label for="comment_text">
                <?php 
                echo smarty_lang(array('code' => 'Your comment'), $_smarty_tpl);
                ?>

            </label>
            <?php 
            }
            ?>
  
         
          <script type="text/javascript">
document.write("<input style='float:right;margin-top:-31px' type=text name=limit size=4 readonly value="+count+">");
</script>
<div class="clear"></div>
            <textarea onkeyup="limiter()" name="comment" placeholder="Type your comment here. Make sure it means something.." id="comment_text" class="form-control clearfix comment_text_new"></textarea>
           
           <div id="reply_to_img"><i class="glyphicon glyphicon-share-alt" style="color:#428BCA;"></i></div>
        </div>
        <div class="form-group clearfix">
            <button  data-loading-text="Loading..." type="button" class="hidden-xs hidden-sm  btn btn-primary pull-right" id="addCommentButton"><?php 
            echo lang('Comment');
            ?>
</button>

        </div>


        <script>

        function blink(selector){
        $(selector).fadeOut('slow', function(){
        $(this).fadeIn('slow', function(){
        blink(this);
        });
        });
        }

       
        var ajaxPage = baseurl+'/ajax.php';
        $('#addCommentButton').on('click',function(e){  
                e.preventDefault();
                var btn =$(this);
                btn.button('loading');
        

                $('#comment-add-err').hide();
               
                var data = $(this).parents("form").serialize() + "&type=<?php 
            echo $_smarty_tpl->tpl_vars['type']->value;
            ?>
&mode=add_comment";
                console.log(data);
                $.ajax({
                    url: ajaxPage,
                    type: "post",
                    data: data,
                    dataType : 'json',
                }).success(function(response){
                     
                    //var response = $.parseJSON(response);
                   
                    var cid = parseInt(response.cid);
                    if(cid > 1){
                        $.ajax({
                            url: ajaxPage,
                            type: "post",
                            data: {
                                mode: "get_comment",
                                cid: cid,
                                 
                            },
                        }).success(function(comment){
                            $("#comment_text").val('');
                            $("#userCommentsList").prepend(comment);
                            
                            var count_comments =  $("#comment_counter").val();
                            $("#com_count").html("");
                            $("#com_count").append('Comments '+count_comments);
                             

                            
                        });
                    }else{
                        if(response.msg){
                         $('#comment-add-err').show().html(response.msg);   
                        }
                        else if(response.err)
                        {
                            $('#comment-add-err').show().html(response.err);
                        }
                    }
               
                btn.button('reset');
                });
               
            });
        </script>

        <div class="hidden-lg hidden-md mbxl">
            <button type="submit" class="btn btn-primary" onclick="add_comment_js('comment_form','<?php 
            echo $_smarty_tpl->tpl_vars['type']->value;
            ?>
')<?php 
            echo ANCHOR(array('place' => 'onClickAddComment'), $_smarty_tpl);
            ?>
"><?php 
            echo lang('Comment');
            ?>
</button>
        </div>
    </form>
   


<div id="add_comment_result" class="add_comment_result mtm mbm" style="display:none"></div>

<?php 
        } else {
            ?>
    <?php 
            echo smarty_lang(array('code' => 'please_login_to_comment'), $_smarty_tpl);
            ?>

<?php 
        }
        ?>
</div>

<style>
#reply_to_img{

position:absolute;
 margin-left:686px;
 margin-top:-65px;
 display:none;

}



</style>
<!-- Script by hscripts.com -->
<?php 
    }
    function content_55e5e4ce90b655_79574654($_smarty_tpl)
    {
        ?>
    <?php 
        if ($_smarty_tpl->tpl_vars['userquery']->value->udetails['soclid'] != '') {
            ?>
        <?php 
            if (isset($_smarty_tpl->tpl_vars["usr_head_thumb"])) {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = clone $_smarty_tpl->tpl_vars["usr_head_thumb"];
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->value = (string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', '', userid());
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->nocache = null;
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', '', userid()), null, 0);
            }
            ?>
        <?php 
        } else {
            ?>
        <?php 
            if (isset($_smarty_tpl->tpl_vars["usr_head_thumb"])) {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = clone $_smarty_tpl->tpl_vars["usr_head_thumb"];
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->value = (string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', 'small', userid());
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->nocache = null;
                $_smarty_tpl->tpl_vars["usr_head_thumb"]->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars["usr_head_thumb"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb('', 'small', userid()), null, 0);
            }
            ?>
    <?php 
        }
        ?>

<div id="quick_container">
    <div id="quicklist_box">
    </div>
</div>

<?php 
        if (isset($_smarty_tpl->tpl_vars['logged_in_user'])) {
            $_smarty_tpl->tpl_vars['logged_in_user'] = clone $_smarty_tpl->tpl_vars['logged_in_user'];
            $_smarty_tpl->tpl_vars['logged_in_user']->value = $_smarty_tpl->tpl_vars['userquery']->value->get_user_details(userid());
            $_smarty_tpl->tpl_vars['logged_in_user']->nocache = null;
            $_smarty_tpl->tpl_vars['logged_in_user']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['logged_in_user'] = new Smarty_variable($_smarty_tpl->tpl_vars['userquery']->value->get_user_details(userid()), null, 0);
        }
        if (isset($_smarty_tpl->tpl_vars['searchPage'])) {
            $_smarty_tpl->tpl_vars['searchPage'] = clone $_smarty_tpl->tpl_vars['searchPage'];
            $_smarty_tpl->tpl_vars['searchPage']->value = $_GET['query'];
            $_smarty_tpl->tpl_vars['searchPage']->nocache = null;
            $_smarty_tpl->tpl_vars['searchPage']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['searchPage'] = new Smarty_variable($_GET['query'], null, 0);
        }
        ?>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="navbar-container clearfix">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle navig-resp-bg" data-toggle="collapse" data-target="#khulja-sim-sim">
                <!--<span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span> -->
            </button>

            <button type="button" class="navbar-toggle nav-toggle search-resp-bg" data-toggle="collapse" data-target="#navbar-search-collapse">
             <!--  <span class="glyphicon glyphicon-search"></span> -->
         </button>

         <a class="navbar-brand cb-logo" href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
"><?php 
        echo $_smarty_tpl->tpl_vars['website_title']->value;
        ?>
</a>
     </div>
     
    <?php 
        echo ANCHOR(array('place' => 'mature_content'), $_smarty_tpl);
        ?>
 

     <?php 
        echo ANCHOR(array('place' => 'premium_button'), $_smarty_tpl);
        ?>


     <?php 
        if (isset($_smarty_tpl->tpl_vars['head_menu'])) {
            $_smarty_tpl->tpl_vars['head_menu'] = clone $_smarty_tpl->tpl_vars['head_menu'];
            $_smarty_tpl->tpl_vars['head_menu']->value = cb_menu();
            $_smarty_tpl->tpl_vars['head_menu']->nocache = null;
            $_smarty_tpl->tpl_vars['head_menu']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['head_menu'] = new Smarty_variable(cb_menu(), null, 0);
        }
        ?>

     <div class="responsive-search collapse" id="navbar-search-collapse">
        <!--<form class="" role="search" action="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
">-->
        <form class="navbar-form navbar-left no-border" role="search" action="<?php 
        echo cblink(array('name' => 'search_result'), $_smarty_tpl);
        ?>
">
            <div class="input-group cbsearchtype">
                <input type="text" class="form-control" name="query" placeholder="search keyword here" value="<?php 
        echo get_form_val('query', true);
        ?>
" id="query">
                <div class="input-group-btn">
                    <input type="hidden" name="type" class="type" value="<?php 
        if (isset($_GET['type'])) {
            echo $_GET['type'];
        } else {
            ?>
videos<?php 
        }
        ?>
" id="type">
                    <button tabindex="-1" data-toggle="dropdown" class="btn btn-default dropdown-toggle search-drop-btn" type="button">
                        <span class="search-type"><?php 
        if ($_GET['type']) {
            echo $_GET['type'];
        } else {
            ?>
Videos<?php 
        }
        ?>
</span>
                        <span class="caret"></span>
                        <span class="sr-only">Toggle Dropdown</span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                        <?php 
        if (isset($_smarty_tpl->tpl_vars['counter'])) {
            $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
            $_smarty_tpl->tpl_vars['counter']->value = 1;
            $_smarty_tpl->tpl_vars['counter']->nocache = null;
            $_smarty_tpl->tpl_vars['counter']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);
        }
        ?>
                        <?php 
        $_smarty_tpl->tpl_vars['t'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['t']->_loop = false;
        $_smarty_tpl->tpl_vars['stypes'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->search_types;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['t']->key => $_smarty_tpl->tpl_vars['t']->value) {
            $_smarty_tpl->tpl_vars['t']->_loop = true;
            $_smarty_tpl->tpl_vars['stypes']->value = $_smarty_tpl->tpl_vars['t']->key;
            ?>
                        <?php 
            if ($_smarty_tpl->tpl_vars['counter']->value == 3) {
                ?>
                        <li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value || $_GET['type'] == '') {
                    ?>
  class="active"  <?php 
                }
                ?>
>
                            <a  class="s-types" href="#"><?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
</a>
                        </li>
                        <?php 
            } else {
                ?>
                        <li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value) {
                    ?>
  class="active" <?php 
                }
                ?>
>
                            <a  class="s-types" href="#"><?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
</a>
                        </li>
                        <?php 
            }
            ?>
                        <?php 
            if (isset($_smarty_tpl->tpl_vars['counter'])) {
                $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
                $_smarty_tpl->tpl_vars['counter']->value = $_smarty_tpl->tpl_vars['counter']->value + 1;
                $_smarty_tpl->tpl_vars['counter']->nocache = null;
                $_smarty_tpl->tpl_vars['counter']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable($_smarty_tpl->tpl_vars['counter']->value + 1, null, 0);
            }
            ?>
                        <?php 
        }
        ?>
                    </ul>
                    <input tabindex="-1" type="submit" name="cbsearch" id="cbsearch" value="<?php 
        echo smarty_lang(array('code' => 'Go'), $_smarty_tpl);
        ?>
" class="btn btn-default minus-marginLeft" />
                </div>
                
            </div>

        </form>
    </div>

    <ul class="nav navbar-nav main-nav navbar-collapse collapse manual-height left-margin-xero pad-left-xero" id="khulja-sim-sim">
        <?php 
        $_smarty_tpl->tpl_vars['menu'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['menu']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['head_menu']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['menu']->iteration = 0;
        foreach ($_from as $_smarty_tpl->tpl_vars['menu']->key => $_smarty_tpl->tpl_vars['menu']->value) {
            $_smarty_tpl->tpl_vars['menu']->_loop = true;
            $_smarty_tpl->tpl_vars['menu']->iteration++;
            ?>
        <?php 
            if ($_smarty_tpl->tpl_vars['menu']->iteration < 5) {
                ?>
        <li <?php 
                if ($_GET['type'] == mb_strtolower($_smarty_tpl->tpl_vars['menu']->value['name'], 'UTF-8')) {
                    ?>
class="active"
        <?php 
                } elseif (!$_GET['type']) {
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['menu']->value['active']) {
                        ?>
class="active"<?php 
                    }
                    ?>
        <?php 
                }
                ?>
><a href="<?php 
                echo $_smarty_tpl->tpl_vars['menu']->value['link'];
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['menu']->value['icon'];
                ?>
 <?php 
                echo $_smarty_tpl->tpl_vars['menu']->value['name'];
                ?>
</a></li>
        <?php 
            }
            ?>
        <?php 
        }
        ?>

        <?php 
        if (userid()) {
            ?>
        <li class="dropdown myaccount-dd hidden-lg hidden-md hidden-sm">
            <span class="dropdown-toggle theme_color col-md-12" data-toggle="dropdown">Setting<b class="caret"></b></span>
            <ul class="dropdown-menu no-padding">
                <li>
                    <div class="adminthumb">
                    <a href="<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['logged_in_user']->value);
            ?>
">
                        <img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
"/>
                        <h4><?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
</h4> 
                    </a>    
                    </div> 
                </li>
                <?php 
            if (has_access('admin_access')) {
                ?>
                <li><a href="<?php 
                echo $_smarty_tpl->tpl_vars['admin_baseurl']->value;
                ?>
"><i class="fa fa-cogs"></i>&nbsp;<?php 
                echo smarty_lang(array('code' => "Admin area"), $_smarty_tpl);
                ?>
</a></li>
                <?php 
            }
            ?>
                <li><a href="<?php 
            echo cblink(array('name' => 'my_account'), $_smarty_tpl);
            echo userid(array(), $_smarty_tpl);
            ?>
"><i class="fa fa-user"></i></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "my_account"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'my_videos'), $_smarty_tpl);
            ?>
"><i class="fa fa-video-camera"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "Manage Videos"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'channels'), $_smarty_tpl);
            ?>
"><i class="fa fa-eye"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "View Channels"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo $_smarty_tpl->tpl_vars['baseurl']->value;
            ?>
/view_channel.php?user=<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
"><i class="fa fa-desktop"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "My Channel"), $_smarty_tpl);
            ?>
</a></li>
            </ul>
        </li>

        <li class="dropdown hidden-lg hidden-md hidden-sm ">
            <a href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
" class="dropdown-toggle" data-toggle="dropdown"><?php 
            echo smarty_lang(array('code' => "Uploads"), $_smarty_tpl);
            ?>
 <b class="caret"></b></a>
            <ul role="menu" class="dropdown-menu">
                <li><a href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Video"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'photo_upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Photo"), $_smarty_tpl);
            ?>
</a></li>
            </ul>
        </li>
        <li class="navbar-sm-login-links"><a href="<?php 
            echo cblink(array('name' => 'logout'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => 'logout'), $_smarty_tpl);
            ?>
</a></li>
        <?php 
        } else {
            ?>
        
        <!-- Shown to small devices only Start  @todo : Add condition for logged in user -->

        <li class="navbar-sm-login-links"><a href="#" data-toggle="modal" data-target="#login-modal"><?php 
            echo smarty_lang(array('code' => 'login'), $_smarty_tpl);
            ?>
</a></li>
        <li class="navbar-sm-login-links"><a href="<?php 
            echo cblink(array('name' => "signup"), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => 'Create new account'), $_smarty_tpl);
            ?>
</a></li>
        <!-- Ends -->
        <?php 
        }
        ?>
        <?php 
        if (count($_smarty_tpl->tpl_vars['head_menu']->value) > 4) {
            ?>
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
            <ul class="dropdown-menu">

                <?php 
            $_smarty_tpl->tpl_vars['menu'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['menu']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['head_menu']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['menu']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['menu']->key => $_smarty_tpl->tpl_vars['menu']->value) {
                $_smarty_tpl->tpl_vars['menu']->_loop = true;
                $_smarty_tpl->tpl_vars['menu']->iteration++;
                ?>
                <?php 
                if ($_smarty_tpl->tpl_vars['menu']->iteration > 4) {
                    ?>
                <li <?php 
                    if ($_GET['type'] == mb_strtolower($_smarty_tpl->tpl_vars['menu']->value['name'], 'UTF-8')) {
                        ?>
 class="active"
                <?php 
                    } elseif (!$_GET['type']) {
                        ?>
                <?php 
                        if ($_smarty_tpl->tpl_vars['menu']->value['active']) {
                            ?>
 class="active"<?php 
                        }
                        ?>
                <?php 
                    }
                    ?>
><a href="<?php 
                    echo $_smarty_tpl->tpl_vars['menu']->value['link'];
                    ?>
"><?php 
                    echo $_smarty_tpl->tpl_vars['menu']->value['icon'];
                    ?>
 <?php 
                    echo $_smarty_tpl->tpl_vars['menu']->value['name'];
                    ?>
</a></li>
                <?php 
                }
                ?>
                <?php 
            }
            ?>
            </ul>
        </li>
        <?php 
        }
        ?>
    </ul>


    <!-- Shown to small devices only Start-->
    <form id="search" class="navbar-form navbar-search navbar-left" name="search" method="get" role="search" action="<?php 
        echo cblink(array('name' => 'search_result'), $_smarty_tpl);
        ?>
">

        <div class="input-group mtxs cbsearchtype">
            <input type="text" class="form-control" name="query" placeholder="search keyword here"  value="<?php 
        echo get_form_val('query', true);
        ?>
" id="query">
            <div class="input-group-btn">
                <input type="hidden" name="type" class="type" value="<?php 
        if (isset($_GET['type'])) {
            echo $_GET['type'];
        } else {
            ?>
videos<?php 
        }
        ?>
" id="type">
                <button tabindex="-1" data-toggle="dropdown" class="btn btn-default dropdown-toggle search-drop-btn" type="button">
                    <span class="search-type"><?php 
        if ($_GET['type']) {
            echo $_GET['type'];
        } else {
            ?>
Videos<?php 
        }
        ?>
</span>
                    <span class="caret"></span>
                    <span class="sr-only">Toggle Dropdown</span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <?php 
        if (isset($_smarty_tpl->tpl_vars['counter'])) {
            $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
            $_smarty_tpl->tpl_vars['counter']->value = 1;
            $_smarty_tpl->tpl_vars['counter']->nocache = null;
            $_smarty_tpl->tpl_vars['counter']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);
        }
        ?>
                    <?php 
        $_smarty_tpl->tpl_vars['t'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['t']->_loop = false;
        $_smarty_tpl->tpl_vars['stypes'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->search_types;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['t']->key => $_smarty_tpl->tpl_vars['t']->value) {
            $_smarty_tpl->tpl_vars['t']->_loop = true;
            $_smarty_tpl->tpl_vars['stypes']->value = $_smarty_tpl->tpl_vars['t']->key;
            ?>
                    <?php 
            if ($_smarty_tpl->tpl_vars['counter']->value == 3) {
                ?>
                    <li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value || $_GET['type'] == '') {
                    ?>
  class="active"  <?php 
                }
                ?>
>
                        <a  class="s-types" href="#"><?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
</a>
                    </li>
                    <?php 
            } else {
                ?>
                    <li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value) {
                    ?>
  class="active" <?php 
                }
                ?>
>
                        <a  class="s-types" href="#"><?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
</a>
                    </li>
                    <?php 
            }
            ?>
                    <?php 
            if (isset($_smarty_tpl->tpl_vars['counter'])) {
                $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
                $_smarty_tpl->tpl_vars['counter']->value = $_smarty_tpl->tpl_vars['counter']->value + 1;
                $_smarty_tpl->tpl_vars['counter']->nocache = null;
                $_smarty_tpl->tpl_vars['counter']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable($_smarty_tpl->tpl_vars['counter']->value + 1, null, 0);
            }
            ?>
                    <?php 
        }
        ?>
                </ul>
                <input tabindex="-1" type="submit" name="cbsearch" id="cbsearch" value="<?php 
        echo smarty_lang(array('code' => 'Go'), $_smarty_tpl);
        ?>
" class="btn btn-default minus-marginLeft" />
            </div>
            
        </div>

    </form>
    <!-- Ends -->
    <!-- Shown to Large displays only Start -->
    <ul class="nav navbar-nav navbar-right nav-login-btns">

        <?php 
        if (userid()) {
            ?>
        <li class="dropdown myaccount-dd">
            <span class="dropdown-toggle theme_color col-md-12" data-toggle="dropdown"> <img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
" style="width: 40px; height: 40px;"/> <b class="caret"></b></span>
            <ul class="dropdown-menu no-padding">
                <li>
                    <div class="adminthumb">
                         <a href="<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['logged_in_user']->value);
            ?>
">
                        <img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
"/>
                        <h4><?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
</h4>
                        </a>     
                    </div>
                      
                </li>
                <?php 
            if (has_access('admin_access')) {
                ?>
                <li><a href="<?php 
                echo $_smarty_tpl->tpl_vars['admin_baseurl']->value;
                ?>
"><i class="fa fa-cogs"></i>&nbsp;<?php 
                echo smarty_lang(array('code' => "Admin area"), $_smarty_tpl);
                ?>
</a></li>
                <?php 
            }
            ?>
                <li><a href="<?php 
            echo cblink(array('name' => 'my_account'), $_smarty_tpl);
            echo userid(array(), $_smarty_tpl);
            ?>
"><i class="fa fa-user"></i></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "my_account"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'my_videos'), $_smarty_tpl);
            ?>
"><i class="fa fa-video-camera"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "Manage Videos"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'channels'), $_smarty_tpl);
            ?>
"><i class="fa fa-eye"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "View Channels"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo $_smarty_tpl->tpl_vars['baseurl']->value;
            ?>
/view_channel.php?user=<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
"><i class="fa fa-desktop"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "My Channel"), $_smarty_tpl);
            ?>
</a></li>
                <li class="divider"></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'logout'), $_smarty_tpl);
            ?>
"><i class="fa fa-sign-out"></i>&nbsp;&nbsp;<?php 
            echo smarty_lang(array('code' => "Logout"), $_smarty_tpl);
            ?>
</a></li>
            </ul>
        </li>
        <?php 
        } else {
            ?>
        <li>
            <div class="mrl">
                <a href="<?php 
            echo cblink(array('name' => 'signup'), $_smarty_tpl);
            ?>
" class="btn btn-primary btn-success btn-sm"><?php 
            echo smarty_lang(array('code' => "Create Account"), $_smarty_tpl);
            ?>
</a>
                <a href="#" data-toggle="modal" data-target="#login-modal" class="btn btn-primary btn-sm"><?php 
            echo smarty_lang(array('code' => "Login"), $_smarty_tpl);
            ?>
</a>
            </div>

        </li>
        <?php 
        }
        ?>
    </ul>
    <!-- Ends -->

    <!-- Shown to Large displays only Start -->
    <?php 
        if (userid()) {
            ?>
    <div class="upload-dropdown-btn-d hidden-xs ">
        <div class="btn-group">
            <button title="Upload" class="btn btn-primary" type="button">
                <a class="upload-vid-photo-icon" href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
">Upload</a>
            </button>
            <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" type="button">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul role="menu" class="dropdown-menu upload-dropdown">
                <li><a href="<?php 
            echo cblink(array('name' => 'upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Video"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'photo_upload'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Upload Photo"), $_smarty_tpl);
            ?>
</a></li>
            </ul>
        </div>
    </div>
    <?php 
        }
        ?>
    
    <!-- Ends -->

    



    <!-- SHown to middle size displays only  @todo : Add condition for logged in user -->
    <ul class="nav navbar-nav navbar-right nav-login-dd">

        <li class="search-form show-small-form pull-left mrxll" ><i class="glyphicon glyphicon-search cursor-pointer"></i></li>
        <div class="form-small full-width">                    
            <form action="<?php 
        echo cblink(array('name' => 'search_result'), $_smarty_tpl);
        ?>
" role="search" method="get" name="search_small" id="search_small">
                <div class="input-group cbsearchtype">
                    <input type="text" class="form-control" name="query" value="<?php 
        echo get_form_val('query', true);
        ?>
" placeholder="search keyword here" id="query">
                    <div class="input-group-btn">
                        <input type="hidden" name="type" class="type" value="<?php 
        if (isset($_GET['type'])) {
            echo $_GET['type'];
        } else {
            ?>
videos<?php 
        }
        ?>
" id="type">
                        <button tabindex="-1" data-toggle="dropdown" class="btn btn-default dropdown-toggle search-drop-btn" type="button">
                            <span class="search-type"><?php 
        if ($_GET['type']) {
            echo $_GET['type'];
        } else {
            ?>
Videos<?php 
        }
        ?>
</span>
                            <span class="caret"></span>
                            <span class="sr-only">Toggle Dropdown</span>
                        </button>
                        <ul role="menu" class="dropdown-menu">
                            <?php 
        if (isset($_smarty_tpl->tpl_vars['counter'])) {
            $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
            $_smarty_tpl->tpl_vars['counter']->value = 1;
            $_smarty_tpl->tpl_vars['counter']->nocache = null;
            $_smarty_tpl->tpl_vars['counter']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);
        }
        ?>
                            <?php 
        $_smarty_tpl->tpl_vars['t'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['t']->_loop = false;
        $_smarty_tpl->tpl_vars['stypes'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['Cbucket']->value->search_types;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['t']->key => $_smarty_tpl->tpl_vars['t']->value) {
            $_smarty_tpl->tpl_vars['t']->_loop = true;
            $_smarty_tpl->tpl_vars['stypes']->value = $_smarty_tpl->tpl_vars['t']->key;
            ?>
                            <?php 
            if ($_smarty_tpl->tpl_vars['counter']->value == 3) {
                ?>
                            <li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value || $_GET['type'] == '') {
                    ?>
  class="active"  <?php 
                }
                ?>
>
                                <a class="s-types" href="#"><?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
</a>
                            </li>
                            <?php 
            } else {
                ?>
                            <li value="<?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
" <?php 
                if ($_GET['type'] == $_smarty_tpl->tpl_vars['stypes']->value) {
                    ?>
  class="active" <?php 
                }
                ?>
>
                                <a class="s-types" href="#"><?php 
                echo $_smarty_tpl->tpl_vars['stypes']->value;
                ?>
</a>
                            </li>
                            <?php 
            }
            ?>
                            <?php 
            if (isset($_smarty_tpl->tpl_vars['counter'])) {
                $_smarty_tpl->tpl_vars['counter'] = clone $_smarty_tpl->tpl_vars['counter'];
                $_smarty_tpl->tpl_vars['counter']->value = $_smarty_tpl->tpl_vars['counter']->value + 1;
                $_smarty_tpl->tpl_vars['counter']->nocache = null;
                $_smarty_tpl->tpl_vars['counter']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable($_smarty_tpl->tpl_vars['counter']->value + 1, null, 0);
            }
            ?>
                            <?php 
        }
        ?>
                        </ul>
                        <input tabindex="-1" type="submit" name="cbsearch" id="cbsearch" value="<?php 
        echo smarty_lang(array('code' => 'Go'), $_smarty_tpl);
        ?>
" class="btn btn-default minus-marginLeft" />
                    </div>
                    
                </div>
                
                
            </form>
        </div>
        <?php 
        if (userid()) {
            ?>
        <li class="dropdown myaccount-dd">
            <span class="dropdown-toggle theme_color col-md-12" data-toggle="dropdown"><img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
" style="width: 40px; height: 40px;"/><b class="caret"></b></span>
            <ul class="dropdown-menu">
                <li>
                    <div class="adminthumb">
                        <a href="<?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['logged_in_user']->value);
            ?>
">
                        <img class="img-circle" src="<?php 
            echo $_smarty_tpl->tpl_vars['usr_head_thumb']->value;
            ?>
"/>
                        <h4><?php 
            echo $_smarty_tpl->tpl_vars['userquery']->value->username;
            ?>
</h4>     
                        </a>
    
                    </div>
                      
                </li>
                <?php 
            if (has_access('admin_access')) {
                ?>
                <li><a href="<?php 
                echo $_smarty_tpl->tpl_vars['admin_baseurl']->value;
                ?>
"><?php 
                echo smarty_lang(array('code' => "Admin area"), $_smarty_tpl);
                ?>
</a></li>
                <?php 
            }
            ?>
                <li><a href="<?php 
            echo cblink(array('name' => 'my_account'), $_smarty_tpl);
            echo userid(array(), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "my_account"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'my_videos'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Manage Videos"), $_smarty_tpl);
            ?>
</a></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'channels'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "View Channels"), $_smarty_tpl);
            ?>
</a></li>
                <li class="divider"></li>
                <li><a href="<?php 
            echo cblink(array('name' => 'logout'), $_smarty_tpl);
            ?>
"><?php 
            echo smarty_lang(array('code' => "Logout"), $_smarty_tpl);
            ?>
</a></li>
            </ul>
        </li>
        <?php 
        } else {
            ?>
        <li>
            <div class=" mlm mrm">
                <a href="#" data-toggle="modal" data-target="#login-modal"><span class="glyphicon glyphicon-user"></span></a>
            </div>

        </li>
        <?php 
        }
        ?>
    </ul>
</div>
<!-- Ends -->
</nav>

<div class="modal fade" id="login-modal" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <form name="login-form" role="form" action="<?php 
        echo cblink(array('name' => 'signup'), $_smarty_tpl);
        ?>
" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title"><?php 
        echo smarty_lang(array('code' => "Login"), $_smarty_tpl);
        ?>
</h4>
                </div>
                <div class="modal-body">

                    <div class="form-group">
                        <label for="login_username"><?php 
        echo smarty_lang(array('code' => "Username"), $_smarty_tpl);
        ?>
</label>
                        <input type="text" class="form-control" id="login_username"  name="username"  placeholder="Enter username">
                    </div>

                    <div class="form-group">
                        <label for="login_password"><?php 
        echo smarty_lang(array('code' => "Password"), $_smarty_tpl);
        ?>
</label>
                        <input type="password" class="form-control" id="login_password" name="password" placeholder="Enter password">
                    </div>

                    <div class="checkbox">
                        <label>
                            <input type="checkbox"> <?php 
        echo smarty_lang(array('code' => "Remember me"), $_smarty_tpl);
        ?>

                        </label>
                    </div>

                    <div align="center"><a href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/forgot.php"><?php 
        echo smarty_lang(array('code' => 'user_forgot_password'), $_smarty_tpl);
        ?>
</a> | <a href="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/forgot.php?mode=recover_username"><?php 
        echo smarty_lang(array('code' => 'user_forgot_username'), $_smarty_tpl);
        ?>
</a></div>
                </div>
                <div class="modal-footer">
                    <a href="<?php 
        echo cblink(array('name' => 'signup'), $_smarty_tpl);
        ?>
" class="btn btn-primary btn-success btn-sm pull-left"><?php 
        echo smarty_lang(array('code' => "Create Account"), $_smarty_tpl);
        ?>
</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal"><?php 
        echo smarty_lang(array('code' => "Cancel"), $_smarty_tpl);
        ?>
</button>
                    <input type="submit" class="btn btn-primary" value="<?php 
        echo smarty_lang(array('code' => 'Login'), $_smarty_tpl);
        ?>
" name="login">
                </div>
            </div><!-- /.modal-content -->
        </form>
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
    $(document).ready(function(){
        $(".cbsearchtype a").on({
            click: function(e){
                e.preventDefault();
                var prent_li = $(this).parents();
                $('.type').val($(this).html());
                $('.cbsearchtype li').removeClass('active');
                prent_li.addClass('active');
            }
            });
        
        $('.show-small-form').click(function() {
            $('.form-small').toggleClass('show');   
        });

        $('.s-types').on("click", function(){
            var _this = $(this);
            var text = _this.html();
            $('.search-type').html(text);
        });

    });

</script><?php 
    }
Example #21
0
<?php

DIV_BEGIN('', 'footer');
ANCHOR('https://github.com/vajayattila/easyphpframe/wiki', 'Home on GitHub', '_blank');
DIV_END();
Example #22
0
function get_image_file($params)
{
    global $cbphoto, $Cbucket;
    //var_dump($params);
    $details = $params['details'];
    $output = $params['output'];
    $size = $params['size'];
    $default = array('t', 'm', 'l', 'o');
    $thumbs = array();
    if (!$details) {
        //var_dump("get default 1");
        return get_photo_default_thumb($size, $output);
    }
    if (!is_array($details)) {
        $photo = $cbphoto->get_photo($details, true);
    } else {
        $photo = $details;
    }
    if (empty($photo['photo_id']) or empty($photo['photo_key'])) {
        //var_dump("get default 2");
        return get_photo_default_thumb($size, $output);
    }
    if (empty($photo['filename']) or empty($photo['ext'])) {
        //var_dump("get default 3");
        return get_photo_default_thumb($size, $output);
    }
    $params['photo'] = $photo;
    if (count($Cbucket->custom_get_photo_funcs) > 0) {
        $functions = $Cbucket->custom_get_photo_funcs;
        foreach ($functions as $func) {
            if (function_exists($func)) {
                $func_data = $func($params);
                if ($func_data) {
                    return $func_data;
                }
            }
        }
    }
    $path = PHOTOS_DIR;
    $directory = get_photo_date_folder($photo);
    $with_path = $params['with_path'] = $params['with_path'] === false ? false : true;
    $with_original = $params['with_orig'];
    $size = (!in_array($size, $default) or !$size) ? 't' : $size;
    if ($directory) {
        $directory .= '/';
    }
    $path .= '/' . $directory;
    $filename = $photo['filename'] . '%s.' . $photo['ext'];
    $files = glob($path . sprintf($filename, '*'));
    if (!empty($files)) {
        foreach ($files as $file) {
            $splitted = explode("/", $file);
            $thumb_name = end($splitted);
            $thumb_type = $cbphoto->get_image_type($thumb_name);
            if ($with_original) {
                $thumbs[] = ($with_path ? PHOTOS_URL . '/' : '') . $directory . $thumb_name;
            } else {
                if (!empty($thumb_type)) {
                    $thumbs[] = ($with_path ? PHOTOS_URL . '/' : '') . $directory . $thumb_name;
                }
            }
        }
        if (empty($output) or $output == 'non_html') {
            if ($params['assign'] and $params['multi']) {
                assign($params['assign'], $thumbs);
            } else {
                if ($params['multi']) {
                    return $thumbs;
                } else {
                    $search_name = sprintf($filename, "_" . $size);
                    $return_thumb = array_find($search_name, $thumbs);
                    if (empty($return_thumb)) {
                        return get_photo_default_thumb($size, $output);
                    } else {
                        if ($params['assign']) {
                            assign($params['assign'], $return_thumb);
                        } else {
                            return $return_thumb;
                        }
                    }
                }
            }
        }
        if ($output == 'html') {
            $search_name = sprintf($filename, "_" . $size);
            $src = array_find($search_name, $thumbs);
            $src = empty($src) ? get_photo_default_thumb($size) : $src;
            $attrs = array('src' => $src);
            if (phpversion < '5.2.0') {
                global $json;
            }
            if ($json) {
                $image_details = $json->json_decode($photo['photo_details'], true);
            } else {
                $image_details = json_decode($photo['photo_details'], true);
            }
            if (empty($image_details) or empty($image_details[$size])) {
                $dem = getimagesize(str_replace(PHOTOS_URL, PHOTOS_DIR, $src));
                $width = $dem[0];
                $height = $dem[1];
                /* UPDATEING IMAGE DETAILS */
                $cbphoto->update_image_details($photo);
            } else {
                $width = $image_details[$size]['width'];
                $height = $image_details[$size]['height'];
            }
            if ($params['width'] and is_numeric($params['width']) and ($params['height'] and is_numeric($height))) {
                $width = $params['width'];
                $height = $params['height'];
            } else {
                if ($params['width'] and is_numeric($params['width'])) {
                    $height = round($params['width'] / $width * $height);
                    $width = $params['width'];
                } else {
                    if ($params['height'] and is_numeric($height)) {
                        $width = round($params['height'] * $width / $height);
                        $height = $params['height'];
                    }
                }
            }
            //$attrs[ 'width' ] = $width;
            //$attrs[ 'height' ] = $height;
            $attrs['id'] = ($params['id'] ? $params['id'] . '_' : 'photo_') . $photo['photo_id'];
            if ($params['class']) {
                $attrs['class'] = mysql_clean($params['class']);
            }
            if ($params['align']) {
                $attrs['align'] = mysql_clean($params['align']);
            }
            $attrs['title'] = $photo['photo_title'];
            if (isset($params['title']) and $params['title'] == '') {
                unset($attrs['title']);
            }
            $attrs['alt'] = TITLE . ' - ' . $photo['photo_title'];
            $anchor_p = array("place" => 'photo_thumb', "data" => $photo);
            $params['extra'] = ANCHOR($anchor_p);
            if ($params['style']) {
                $attrs['style'] = $params['style'];
            }
            if ($params['extra']) {
                $attrs['extra'] = $params['extra'];
            }
            $image = cb_create_html_tag('img', true, $attrs);
            if ($params['assign']) {
                assign($params['assign'], $image);
            } else {
                return $image;
            }
        }
    } else {
        return get_photo_default_thumb($size, $output);
    }
}