• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] How to show upload menu to guests?

Started by x5000x,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

x5000xTopic starter

Alex,

How to show upload menu to guests?

Please let me know.
Thanks!
  •  

PHPVibe A.

Remove the ifs from tpl.globals.php around the upload menu(s)

x5000xTopic starter

How code should look like, i always get syntax error whatever i try.
  •  

PHPVibe A.

There is an else which comes from is_user which has to be taken off, and his closing.
} else {
if((get_option('upmenu') == 1) ||  is_moderator()) {


changed to

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



and ends here

}
		
		$nav .= lang_menu().'


which should become

$nav .= lang_menu().'

x5000xTopic starter

Alex,

That does the truck but now shows user menu (the menu when users log in) with following error:

Notice: Undefined index: name in public_html/lib/functions.user.php on line 9

Notice: Undefined index: avatar in public_html/lib/functions.user.php on line 18

Notice: Undefined index: user_id in public_html/lib/functions.user.php on line 6

Notice: Undefined index: name in public_html/lib/functions.user.php on line 9


These errors are probably from that. Is there a workaround to hide user menu unless user is logged in?
  •  

PHPVibe A.

You did something wrong, you opened up the user menu as well.

x5000xTopic starter

Alex,

Is this how it supposed to be:

           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>
		
		';
		
		}
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;
}
  •  

PHPVibe A.

Should look like this, the user check for user menu should be added:
  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>
		
		';
		
		}
		
	$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>';
if(is_user()) {
$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;
}

x5000xTopic starter

That worked, final questions regarding this where to switch this cloud icon to be red default instead of gray and be gray on hover?
  •  

PHPVibe A.

The easiest way to find css definition are the browser inspect tools.

identicalmedia

after adding the codes i et these error when i try to upload a youtube video

Notice: Undefined index: title in /home/tubora/public_html/com/com_share.php on line 56

Notice: Undefined index: duration in /home/tubora/public_html/com/com_share.php on line 92

Notice: Undefined index: description in /home/tubora/public_html/com/com_share.php on line 100
  •  

PHPVibe A.

It has no connection at all.
Looks like Youtube is restricting you.

identicalmedia

I DONT THINK SO , WEN I REMOVE THE CODES  THE YOUTUBE UPLOAD WORKS
  •  

PHPVibe A.

Weird, maybe your doing the edits wrong.
But, it should not have any connection.

Similar topics (7)