• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] Channels on Left sidebar

Started by ipeci,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ipeciTopic starter

Hello

Wich code i net to put on sidebar.php to have all channel results at left sidebar

Thanks
  •  

PHPVibe A.

It's not an easy change. Look at 3.3 if you want, but better wait for us to finish 3.5 and I will write a step by step tutorial.

ipeciTopic starter

Okay
thanks for info.

Can you plz tell me wan comes a 3.5v


regards
  •  

PHPVibe A.

I would lie to you, I have no clue since Mario took over what is the progress.

x5000x

  •  

PHPVibe A.

The version from misterdevil.com (to speed things up) :

lib/functions.php:

function the_sidenav() {
global $db, $cachedb;
include_once( INC.'/class.tree.php' );
$tree = new Tree;
$nav = '<div class="CNav"> ';                 
$nav .=' <a href="'.canonical().'#!/#back" class="CNav-back hide tipN" title="'._lang("Back one level").'" id="CNav-back"><i class="icon-double-angle-left"></i></a>';
$nav .='<div class="CNav-body"><div class="CNav-wrapper" id="CNav">';
$categories = $cachedb->get_results("SELECT cat_id as id, child_of as ch, cat_name as name, picture FROM  ".DB_PREFIX."channels limit 0,10000");
if($categories) {	
foreach ($categories as $cat) {
if($cat->ch < 1) {$cat->ch = null;}
		$label = '<a href="'.channel_url($cat->id, $cat->name).'" title="'. stripslashes($cat->name).'"><img src="'.thumb_fix($cat->picture, true, 23, 23).'" class="cat-menu-img"/>'. stripslashes($cat->name).'</a>';
		$li_attr = '';		
		$tree->add_row($cat->id, $cat->ch, $li_attr, $label);
	}
$nav .=$tree->generate_list();	
}
$nav .='</div></div></div>';				
return apply_filters('the_navigation' , $nav);
}


tpl/main/sidebar.php:

echo the_sidenav();


between php bracelets if case.

tpl/main/js/phpvibe_app.js (very bottom of file):
var CNav = {
    o: {
        element: '',
        hideStep: 199,
        duration: 200,        
        backBtn: 'a#CNav-back',
        lastId: 0,
        lastelm: 0,
        currentStep: 0,
        ul_heights: {},
        running: false
    },
    option: {},
    init: function (customOption) {
        var self = this;
        self.option = $.extend({}, self.o, customOption);
        self.initCNav();
        self.observerClick()
    },
    initCNav: function () {
	var pathname = window.location.pathname;
        var self = this,
            el = self.option.element,
            $el = $(el),
            $first = $el.first();
        $el.css("height", $(self.option.element + " ul").first().height() + 20);
        $(self.option.element).scrollLeft(0);
        $first.find('ul').addClass('pos--1');
        $first.find('li').each(function (ii) {
            var $this = $(this),
                $firstUl = $this.find("ul").first();
            $firstUl.addClass("poz-" + ii);
            if ($firstUl.size() > 0) {
			var a_href =  $this.find('a').first().attr('href');
			var a_name = $this.find('a').first().text();
			var a_image = $this.find('img').attr("src");
                $this.find('a').first().append('<i class="icon-chevron-down"></i>').attr('href', pathname + '#!/' + $this.find('a').first().text()).addClass('haveSubItem');
                $this.find('a').first().next('ul').css('opacity', 0).css('visibility', 'hidden').prepend('<li><a href="' + a_href + '" title="' + a_name + '"><img src="'+ a_image +'"/><strong>' + a_name + '</strong></a></li>');
            }
        })
    },
    moveMenu: function ($this, direction) {
        var self = this;
        if (!self.option.running) {
            self.option.running = true;
            if (direction == 'next') {
                self.option.currentStep = parseInt($(self.option.element).scrollLeft()) + self.option.hideStep;
                $(self.option.element).animate({
                    height: $this.next('ul').height()
                }, self.option.duration);
                self.option.lastId = $this.parents('ul').attr('class');
                self.option.lastElm = $this.next('ul');
                $this.next('ul').css('visibility', 'visible').animate({
                    opacity: 1
                })
            } else {
                self.option.currentStep = parseInt($(self.option.element).scrollLeft()) - self.option.hideStep;
                $(self.option.element).animate({
                    height: self.option.lastElm.parent('li').parent('ul').height()
                }, self.option.duration, function () {
                    self.option.lastElm.animate({
                        opacity: 0
                    }, self.option.duration / 2).css('visibility', 'hidden');
                    self.option.lastElm = self.option.lastElm.parent('li').parent('ul');
                    self.option.lastId = $(this).attr('class')
                })
            }
            $(self.option.element).animate({
                scrollLeft: self.option.currentStep
            }, self.option.duration, function () {
                if ($(self.option.element).scrollLeft() > 0) {
                    $(self.option.backBtn).animate({
                        left: '-18px'
                    }, self.option.duration, function () {
                        $(this).css('z-index', 1);
						$(this).removeClass('hide');
                        self.option.running = false
                    });
                    $(self.option.backBtn).click(function () {
                        self.moveMenu($(this), 'prev')
                    })
                } else if (self.option.currentStep <= 0) {
                    $(self.option.backBtn).css('z-index', -1).animate({
                        left: '-14px'
                    }, self.option.duration, function () {
                        self.option.running = false;
						$(this).addClass('hide');
                    })
                }
            })
        }
    },
    observerClick: function () {
        var self = this;
        $(self.option.element + " ul a.haveSubItem").click(function () {
		    self.moveMenu($(this), 'next')
        })
    }
};



tpl/main/css/vibe.style.css (very bottom of file):

/* Continous Nav */

.CNav {
    display:block;
	position: relative;
	clear:both;
}

.CNav .CNav-body {
	width: 100%; 
	padding-bottom:20px;
	display:block;
	position: relative;
}
.CNav ul {
	top:0;
	left:0;
	position:absolute;
	display: block;
	width: 100%; 
	text-align: left;
	margin: 15px 0px;
	list-style: none;
	list-style-position: inside;
}
.CNav .CNav-wrapper {
	position: relative;
	width: 100%; 
	overflow:hidden;
	margin:0;
	padding-bottom: 10px;
}
.CNav ul  li {
	display: block;
	margin: 0;
	padding: 5px 0px 0px;
	overflow:hidden;
}
.CNav ul  img {
margin-right: 5px;
border: 1px solid #666;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.CNav ul  li i{float:right; margin-right:4px; margin-top:4px;}

.CNav ul  li:last-child {
	border-bottom: 0px;
}
.CNav ul  li a {
	text-decoration: none;
	text-transform:capitalize;
	display:block;
}

.CNav .CNav-back{
	position:absolute;
	top:16px;
	left: -14px;
	z-index:-1;
	color:#555;
}
.CNav-back a, .CNav .CNav-back i  {font-size:24px; color:#555;}
/* hide elements */
.CNav ul ul {
	width: 100%; 
	display:block;
	top:0;
	left: 200px;
	position:absolute;
	margin-top: 0px;
}


}



Is this what you guys want?

ipeciTopic starter

Hi,
Thanks for your efforts, but it does not work for me! - [

  •  

Marius P.

Hi! What's the actual issue you are experiencing? The code is correct (I know cause I've built it) but it was not tested on 3.4
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

PHPVibe A.


ipeciTopic starter

I have the whole back away, he had no fault but since it also reallocated nothing, it were see no changes!
  •  

ipeciTopic starter

Quote from: @Mario on
Hi! What's the actual issue you are experiencing? The code is correct (I know cause I've built it) but it was not tested on 3.4

Hi mario ,nice to see you active.

I have 3.4 at moment.

regards
  •  

ipeciTopic starter

Quote from: Alexander on
Link? Errors?
I tryed to install again but i happens nothing.No errors nothing,just like befor.
I put the link to my homepage after my profile photo, plz check!

thanks
  •  

Marius P.


Thanks   :)

Show me the code in tpl/main/sidebar.php where you've placed
echo the_sidenav();
before and after this line, including it.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ipeciTopic starter

Quote from: @Mario on
Thanks   :)

Show me the code in tpl/main/sidebar.php where you've placed
echo the_sidenav();
before and after this line, including it.

Hi mario,
Here i send you a complett sidebar.php as .txt

thnx :D
  •  

PHPVibe A.

Find in lib/functions.php

include( INC.'/class.tree.php' );


and replace it with:

include_once( INC.'/class.tree.php' );


Should be once more in the menu function.

ipeciTopic starter

Hi Alex,

I Have Done, but nothing Happening :-(
  •  

PHPVibe A.


x5000x

Alex,
On my side no categories shows either. When you check his site if you get it to work please post here the changes so we can apply it to.
Thanks!
  •  

PHPVibe A.

You need to place

echo the_sidenav();


right before:

if (is_user()) {


and for Ipeci I had to do a css fix (height problem), added this to tpl/main/css/vibe.style.css

.CNav, .CNav-body ,.CNav-wrapper{
	min-height:240px;
	display:block;
}


But he had some css modifications on sidebar.

ipeciTopic starter

Thank You Alex ,

Now its work for me Perfect  ::)


Regards
  •  

x5000x

Alex,

It works for me as well.
But can you post us code how to have boarders and tables between and around categories same like it is done on "Browse" "Most Viewed" "Featured" "Most Liked"

We would be thankful and it would look much better.

Thanks in advance,
  •  

ipeciTopic starter

Hi there,

How to make that the ( child channels ) show after (mothercategory ) to dropdown,
like by misterdevils homepage ... ( More Porn )

Thanks
  •  

PHPVibe A.

You just have to attach some childs to that category.

@x5000x It's not easy to style that menu. I honestly never tried.

ipeciTopic starter

Hi,

i have maked a childs but not see them as dropdown in meny :-(
  •  

ipeciTopic starter

Plz, look at my homepage , by Tv Live are lot of childs , but if i click Tv live dont show in menu the childs only on right side :(

If you can plz.fix it i just cant fix that, you have ftp
regards
  •  

Similar topics (7)