Related Topics


[Video CMS v4]How to show upload menu to guests?  (Read 566 times) Print

1 B


x5000x  April 05, 2014, 02:05:57 AM

Alex,

How to show upload menu to guests?

Please let me know.
Thanks!

Logged


Alexander  April 05, 2014, 04:14:42 PM

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

Logged

x5000x  April 05, 2014, 07:30:23 PM

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

Logged


Alexander  April 06, 2014, 01:20:51 AM

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

changed to

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


and ends here

Code
}

$nav .= lang_menu().'

which should become

Code
	
$nav .= lang_menu().'

Logged

x5000x  April 06, 2014, 07:33:32 AM

Alex,

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

Code
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?

Logged


Alexander  April 07, 2014, 09:55:42 PM

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

Logged

x5000x  April 07, 2014, 10:57:46 PM

Alex,

Is this how it supposed to be:

Code
           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;
}

Logged


Alexander  April 07, 2014, 11:04:22 PM

Should look like this, the user check for user menu should be added:
Code
  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;
}

Logged

x5000x  April 07, 2014, 11:30:46 PM

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

Logged


Alexander  April 08, 2014, 12:50:47 AM

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

Logged

identicalmedia  April 11, 2014, 12:43:40 AM

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

Logged


Alexander  April 11, 2014, 05:56:18 PM

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

Logged

identicalmedia  April 12, 2014, 01:12:33 AM

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

Logged


Alexander  April 12, 2014, 02:32:21 AM

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

Logged