• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] How to place header in sidebar

Started by shtefcs,

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

shtefcsTopic starter

I tried to move header content to left sidebar but I ran to a problem because I don't know much about php. It is not working if I move just pure div codes, for example if I wanna move just logo like this:

<div class="span2 logo-wrapper nomargin">';

			if(com() !== video) {

	$nav .= '<a id="show-sidebar" class="tipN visible-phone visible-tablet hidden-desktop" href="javascript:void(0)" title="'._lang('Show sidebar').'"><i class="icon-reorder"></i></a>';

    }

		$nav .= '	<a href="'.site_url().'" title="" class="logo hidden-phone visible-tablet visible-desktop">'.show_logo().'</a>

			<a href="'.site_url().'" title="" class="logo visible-phone hidden-tablet hidden-desktop">'._html(get_option('site-logo-mobi')).'</a>

		<br style="clear:both;"/>

		</div>


I would really appreciate if someone could help me with this. What codes I have to include into left sidebar to make everything work like in header without errors?
  •  

PHPVibe A.

I'm not sure what you are trying to do, move the logo to the sidebar? Sounds bit weird for me.
Can you explain better?

You should leave out the outer divs like "spanx" cause they will break the grid.

shtefcsTopic starter

I like design where there is no header so that is why I want to move all header content to the left sidebar. Including logo, search form, user dropdown and language. I don't know how to move the whole header content because i don't know which php codes i have to include and which one I don't. I am using 3.5 version.

So, what I tried is next.

Copying this whole function from tpl.globals.php


function top_nav(){

$nav = '';

$nav .= '

		<div class="fixed-top">

		<div class="container">

		<div class="row-fluid block" style="position:relative;">



		<div class="span2 logo-wrapper nomargin">';

			if(com() !== video) {

	$nav .= '<a id="show-sidebar" class="tipN visible-phone visible-tablet hidden-desktop" href="javascript:void(0)" title="'._lang('Show sidebar').'"><i class="icon-reorder"></i></a>';

    }

		$nav .= '	<a href="'.site_url().'" title="" class="logo hidden-phone visible-tablet visible-desktop">'.show_logo().'</a>

			<a href="'.site_url().'" title="" class="logo visible-phone hidden-tablet hidden-desktop">'._html(get_option('site-logo-mobi')).'</a>

		<br style="clear:both;"/>

		</div>		

		<div class="span10 nomargin">

		<div class="searchWidget hidden-phone visible-tablet visible-desktop">

            <form action="" method="get" id="searchform" onsubmit="location.href=\''.site_url().show.'/\' + encodeURIComponent(this.tag.value).replace(/%20/g, \'+\'); return false;">

                <input type="text" name="tag" id="suggest-videos" value="'._lang("Search videos").'" onfocus="if (this.value == \''._lang("Search videos").'\') {this.value = \'\';}" onblur="if (this.value == \'\') {this.value = \''._lang("Search videos").'\';}" />

             <button type="submit" class="btn btn-primary pull-right"><i class="icon-search"></i></button>

			 </form>       

		</div>

		

		';

	

		if(!is_user()) {

		$nav .= '	<div class="user-quick">						

					<a class="dropdown-toggle" data-toggle="dropdown" original-title="Login">					

					<span class="username">'._lang("Visitor").'</span>		<img src="'.thumb_fix("uploads/def-avatar.jpg", true, 25, 25).'" alt="">			

					</a>

					

					<ul class="dropdown-menu enhanced userx pull-left">

          <div class="triangle"></div>';

					if(get_option('allowfb') == 1 ) {

                    $nav .= '<li ><a  href="'.site_url().'index.php?action=login&type=facebook" title="'._lang('Facebook login').'"><i class="icon-facebook-sign"></i><span>'._lang('Facebook').'</a></span></li>';

                    }

					if(get_option('allowtw') == 1 ) {

					$nav .= '<li><a href="'.site_url().'index.php?action=login&type=twitter" title="'._lang('Twitter login').'"><i class="icon-twitter"></i><span>'._lang('Twitter').'</span></a></li>';

                    }

					if(get_option('allowg') == 1 ) {

					$nav .= '  <li ><a href="'.site_url().'index.php?action=login&type=google" title="'._lang('Google login').'"><i class="icon-google-plus-sign"></i><span>'._lang('Google').'</span></a></li>';

				    }

				$nav .= '<li><a  href="'.site_url().'login/" title="'._lang('Login').'"><i class="icon-user"></i><span>'._lang('User & pass').'</span></a></li>                        

               <li><a  href="'.site_url().'login/&do=forgot" title="'._lang('Forgot password').'"><i class="icon-envelope"></i><span>'._lang('Recover').'</span></a></li>                        



				 ';

           if(get_option('allowlocalreg') == 1 ) {

           $nav .= ' <li><a href="'.site_url().'register/" class="login-more"><i class="icon-double-angle-right"></i><span>'._lang('Classic registration').'</span>  </a></li>';

          }

		 $nav .= ' </ul>

		 </div>

		

		';

		

		} else {

if((get_option('upmenu') == 1) ||  is_moderator()) {		

	$nav .= '

<div class="user-quick"><a class="dropdown-toggle " title="'._lang('Upload video').'" data-toggle="dropdown">	

	<span class="username">'._lang('Upload').'</span><i class="icon-cloud-upload uqi"></i>

	

	</a>			

	<ul class="dropdown-menu enhanced userx pull-left">

<div class="triangle"></div>';

if((get_option('sharingrule') == 1) ||  is_moderator()) {

$nav .= '<li><a href="'.site_url().share.'"><i class="icon-youtube"></i>'._lang('Web video').'</a></li>';

}

if((get_option('mp3rule') == 1) ||  is_moderator()) {

$nav .= '<li><a href="'.site_url().upmusic.'"><i class="icon-music"></i>'._lang('Music').'</a></li>';

}

if((get_option('imgrule') == 1) ||  is_moderator()) {

$nav .= '<li><a href="'.site_url().upimage.'"><i class="icon-picture"></i>'._lang("Picture").'</a></li>';

}

if((get_option('uploadrule') == 1) ||  is_moderator()) {

$nav .= '<li><a href="'.site_url().add.'"><i class="icon-cloud-upload"></i> '. _lang('Upload video').'</a> </li>';

}

$nav .= '</ul>	

</div>';

}

$nav .= '	<div class="user-quick"><a class="dropdown-toggle " title="'.user_name().'" data-toggle="dropdown">	

	<span class="username">'.user_name().'</span><img src="'.user_avatar().'" />

	

	</a>			

	<ul class="dropdown-menu enhanced userx pull-left">

<div class="triangle"></div>

<li><a href="'.site_url().me.'"><i class="icon-check"></i> '. _lang('My Media').'</a> </li>

<li><a href="'.site_url().me.'&sk=likes"><i class="icon-thumbs-up"></i> '. _lang('Likes').'</a> </li>

<li><a href="'.site_url().buzz.'" title="'._lang('Notifications').'"><i class="icon-bell"></i>'._lang('Notifications').'</a></li>

<li><a href="'.site_url().me.'&sk=new-playlist"><i class="icon-plus"></i> '. _lang('New Playlist').'</a> </li>

<li><a href="'.site_url().me.'&sk=playlists"><i class="icon-edit"></i> '. _lang('Playlists').'</a> </li>

<li><a href="'.site_url().'index.php?action=logout"><i class="icon-off"></i>'._lang("Logout").'</a></li>

<li><a href="'.profile_url(user_id(), user_name()).'"><i class="icon-cog"></i>'._lang("My Profile").'</a></li>

</ul>	

</div>';

		

		}

		

		$nav .= lang_menu().'

		</div>

		</div>

		</div>

	</div>



	';

return $nav;

}




to the sidebar.php page here http://screencast.com/t/idwOveP6uq and what i got is this http://screencast.com/t/X9IQct96a783 . And every time I try to include or exlude some new code in order to make it work it happens the same because i don't have knowledge in php language. If there is some way to help me achieve this I would be really thankful.
  •  

PHPVibe A.

weren't you working with a designer?

simply add top_nav() to sidebar.php

example:
<div id="sidebar-wrapper" class="span2 left-sidebar top10 hidden-phone hidden-tablet">
<div id="sidebar"> 
<?php echo top_nav(); ?>
<div class="close-me visible-phone visible-tablet hidden-desktop">


and in tpl.globals.php

remove the divs from top_nav()

$nav .= '
		<div class="fixed-top">
		<div class="container">
		<div class="row-fluid block" style="position:relative;">

		';


and also where they close:
</div>
		</div>
	</div>


remove span2 and any span from this function.
and remove:

'.top_nav().'


from :

function header_add(){


This will get you close to what you need, but you will still have to make a lot of css changes.

shtefcsTopic starter

Thanks! That worked perfectly. :) I know with css, I just didn't knew how to move content from header. And yes, Shtefcs is working with a designer and that is me. I am his girlfriend, writting from his profile. Thanks again. :)
  •  

Marius P.

Alex thinks he's a designer so he forgets a designers do not have to mandatorily know php :)
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!
  •  

Similar topics (7)