Skip to content

Instantly share code, notes, and snippets.

@mgsolipa
Created October 17, 2014 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgsolipa/36220a37082b78ef89ce to your computer and use it in GitHub Desktop.
Save mgsolipa/36220a37082b78ef89ce to your computer and use it in GitHub Desktop.
b2evolution 4.1.7 - Mystique skin - profile.main.php
<?php
/**
* This skin only uses one single template which includes most of its features.
* It will also rely on default includes for specific dispays (like the comment form).
*
* The main page template is used to display the blog when no specific page template is available
* to handle the request (based on $disp).
*
* b2evolution Mystique skin v2.0.1
*
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
if( version_compare( $app_version, '3.0' ) < 0 )
{
die( 'This skin is designed for b2evolution 3.0 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );
}
// Do inits depending on current $disp:
skin_init( $disp );
// HTML HEADER INCLUDED HERE
skin_include( '_html_header.inc.php' );
global $s, $ReqURI;
load_class( 'regional/model/_country.class.php', 'Country' );
global $Blog, $Session, $Messages, $inc_path, $demo_mode;
global $action, $user_profile_only, $edited_User, $form_action;
$form_action = url_add_param( $Blog->gen_blogurl(), 'disp='.$disp, '&' );
if( ! is_logged_in() )
{ // must be logged in!
echo '<p class="error">'.T_( 'You are not logged in.' ).'</p>';
return;
}
$user_profile_only = true;
// edited_User is always the current_User
$edited_User = $current_User;
$action = param_action();
?>
<div id="page" class="<?php $Skin->body_class() ?>">
<!-- header -->
<div class="page-content header-wrapper">
<div id="header" class="bubbleTrigger">
<div id="site-title" class="clearfix">
<?php
if( $blog_name = $Skin->get_setting('blog_name') )
{
if( preg_match( '~^https?://~', $blog_name, $match ) )
{
$blog_name = '<img src="'.$blog_name.'" alt="'.$Blog->get('name').'" />';
}
echo '<h1 id="logo"><a href="'.$Blog->get( 'url', 'raw' ).'">'.$blog_name.'</a></h1>';
}
if( $Skin->get_setting('blog_tagline') )
{
echo '<p class="headline">'.$Skin->get_setting('blog_tagline').'</p>';
}
?>
</div>
<?php
skin_container( NT_('Page Top'), array(
'block_start' => '',
'block_end' => '',
'block_display_title' => false,
'list_start' => '<ul class="blog-list">',
'list_end' => '</ul>',
'item_start' => '<li>',
'item_end' => '</li>',
) );
?>
<div class="shadow-left">
<div class="shadow-right clearfix">
<p class="nav-extra">
<?php
echo '<a href="'.$Blog->get( 'rss2_url', 'raw' ).'" class="nav-extra" title="'.$Skin->T_('View RSS Feed').'"></a>';
if( $soc_user = $Skin->get_setting('twitter_user') )
{
echo '<a href="http://twitter.com/'.$soc_user.'" target="_blank" class="nav-extra" style="background-position:-64px top" title="'.$Skin->T_('Follow me on Twitter').'"></a>';
}
if( $soc_user = $Skin->get_setting('flickr_user') )
{
echo '<a href="http://www.flickr.com/people/'.$soc_user.'/" target="_blank" class="nav-extra" style="background-position:-128px top" title="'.$Skin->T_('Find me on Flickr').'"></a>';
}
if( $soc_user = $Skin->get_setting('facebook_user') )
{
echo '<a href="http://www.facebook.com/'.$soc_user.'" target="_blank" class="nav-extra" style="background-position:-192px top" title="'.$Skin->T_('Find me on Facebook').'"></a>';
}
if( $soc_user = $Skin->get_setting('myspace_user') )
{
echo '<a href="http://www.myspace.com/'.$soc_user.'" target="_blank" class="nav-extra" style="background-position:-256px top" title="'.$Skin->T_('Find me on MySpace').'"></a>';
}
if( $soc_user = $Skin->get_setting('linkedin_user') )
{
echo '<a href="http://www.linkedin.com/in/'.$soc_user.'" target="_blank" class="nav-extra" style="background-position:-320px top" title="'.$Skin->T_('Follow me on LinkedIn').'"></a>';
}
if( $soc_user = $Skin->get_setting('youtube_user') )
{
echo '<a href="http://www.youtube.com/user/'.$soc_user.'" target="_blank" class="nav-extra" style="background-position:-384px top" title="'.$Skin->T_('Follow me on Youtube').'"></a>';
}
?>
</p>
<!-- main navi -->
<ul id="navigation" class="clearfix">
<?php
// Home page link
echo '<li class="home active"><a class="home fadeThis active" href="'.$Blog->get( 'url', 'raw' ).
'"><span class="title">'.$Skin->T_('Home').'</span></a></li>';
// "Menu" CONTAINER EMBEDDED HERE
ob_start();
skin_container( NT_('Menu'), array(
'block_start' => '',
'block_end' => '',
'block_display_title' => false,
'list_start' => '',
'list_end' => '',
'item_start' => '<li>',
'item_selected_start' => '<li class="active">',
) );
$menu_container = ob_get_clean();
echo preg_replace( '~<li([^>]+)?><a href="'.quotemeta($Blog->get('url')).'">'.T_('Home').'</a></li>~is', '', $menu_container );
?>
</ul>
<!-- /main navi -->
</div>
</div>
</div>
</div>
<!-- /header -->
<!-- left+right bottom shadow -->
<div class="shadow-left page-content main-wrapper">
<div class="shadow-right">
<!-- main content: primary + sidebar(s) -->
<div id="main">
<div id="main-inside" class="clearfix">
<!-- primary content -->
<div id="primary-content">
<div class="blocks">
<?php
if( !empty( $action ) )
{ // some action was submited
if( $demo_mode && ( $current_User->ID <= 3 ) )
{ // we are in demo mode, and in demo mode automatically generated users edit is not permitted
echo '<p class="error">'.sprintf( 'Demo mode: you can\'t edit %s profile!', $current_User->login ).'</p>';
$action = NULL;
}
else
{ // Check that this action request is not a CSRF hacked request:
$Session->assert_received_crumb( 'user' );
}
}
echo '<h2 class="request_title">'.T_('User Profile').'</h2>';
switch( $action )
{
case 'update_avatar':
$file_ID = param( 'file_ID', 'integer', NULL );
$current_User->update_avatar( $file_ID );
$Messages->display();
break;
case 'remove_avatar':
$current_User->remove_avatar();
$Messages->display();
break;
case 'update':
$current_User->update_from_request();
$Messages->display();
break;
case 'upload_avatar':
$current_User->update_avatar_from_upload();
$Messages->display();
break;
}
/*// Display tabs
echo '<div class="tabs">';
$entries = get_user_sub_entries( false, NULL );
foreach( $entries as $entry => $entry_data )
{
if( $entry == $disp )
{
echo '<div class="selected">';
}
else
{
echo '<div class="option">';
}
echo '<a href='.$entry_data['href'].'>'.$entry_data['text'].'</a>';
echo '</div>';
}
echo '</div>';
echo '<div class="clear"></div>';*/
// Display form
switch( $disp )
{
case 'profile':
require $inc_path.'users/views/_user_identity.form.php';
break;
case 'avatar':
require $inc_path.'users/views/_user_avatar.form.php';
break;
case 'pwdchange':
require $inc_path.'users/views/_user_password.form.php';
break;
case 'userprefs':
require $inc_path.'users/views/_user_preferences.form.php';
break;
default:
debug_die( "Unknown user tab" );
}
?>
</div>
</div>
<!-- /primary content -->
<?php if( @preg_match('~-3~', $Skin->get_setting('skin_layout')) ) : ?>
<!-- sidebar2 -->
<div id="sidebar2">
<ul class="blocks">
<?php
// "Sidebar" CONTAINER EMBEDDED HERE
skin_container( NT_('Sidebar 2'), array(
// This will enclose each widget in a block:
'block_start' => '<li class="block $wi_class$"><div class="clearfix">',
'block_end' => '</div></li>',
// This will enclose the title of each widget:
'block_title_start' => '<h3 class="title"><span>',
'block_title_end' => '</span></h3><div class="block-div"></div><div class="block-div-arrow"></div>',
// If a widget displays a list, this will enclose that list:
'list_start' => '<ul>',
'list_end' => '</ul>',
// This will enclose each item in a list:
'item_start' => '<li>',
'item_end' => '</li>',
// This will enclose sub-lists in a list:
'group_start' => '<ul>',
'group_end' => '</ul>',
// This will enclose (foot)notes:
'notes_start' => '<div class="notes">',
'notes_end' => '</div>',
) );
?>
</ul>
</div>
<!-- sidebar2 -->
<?php endif; ?>
<?php if( ! @preg_match('~-1~', $Skin->get_setting('skin_layout')) ) : ?>
<!-- sidebar -->
<div id="sidebar">
<ul class="blocks">
<!-- search form -->
<li class="block">
<div class="search-form">
<form method="get" id="searchform" action="<?php echo $Blog->gen_blogurl() ?>" class="clearfix" name="searchform">
<fieldset>
<div id="searchfield">
<?php
$s_value = $s;
if( empty($s_value) ) $s_value = $Skin->T_('Search');
echo '<input type="text" name="s" class="text clearField" value="'.
$s_value.'" onfocus="if (this.value == \''.$s_value.
'\') {this.value = \'\';}" onblur="if (this.value == \'\')
{this.value = \''.$s_value.'\';}" />';
?>
</div>
<input type="hidden" name="disp" value="search">
<input type="submit" value="" class="submit" />
</fieldset>
</form>
</div>
</li>
<!-- /search form -->
<?php
// Display javascript tabbed widget
$Skin->display_tabbed_widget();
// "Sidebar" CONTAINER EMBEDDED HERE
skin_container( NT_('Sidebar'), array(
// This will enclose each widget in a block:
'block_start' => '<li class="block $wi_class$"><div class="clearfix">',
'block_end' => '</div></li>',
// This will enclose the title of each widget:
'block_title_start' => '<h3 class="title"><span>',
'block_title_end' => '</span></h3><div class="block-div"></div><div class="block-div-arrow"></div>',
// If a widget displays a list, this will enclose that list:
'list_start' => '<ul>',
'list_end' => '</ul>',
// This will enclose each item in a list:
'item_start' => '<li>',
'item_end' => '</li>',
// This will enclose sub-lists in a list:
'group_start' => '<ul>',
'group_end' => '</ul>',
// This will enclose (foot)notes:
'notes_start' => '<div class="notes">',
'notes_end' => '</div>',
) );
// Display twitter widget
$Skin->display_twitter_widget();
?>
</ul>
</div>
<!-- sidebar -->
<?php endif; ?>
</div>
</div>
<!-- /main content -->
<?php
// "After posts" CONTAINER EMBEDDED HERE
skin_container( NT_('After posts'), array(
'block_start' => '<div class="AfterPosts">',
'block_end' => '</div>',
) );
?>
<!-- footer -->
<div id="footer">
<div id="footer-blocks" class="page-content">
<div class="slide-container clear-block">
<ul class="slides">
<li class="slide slide-1 page-content">
<div class="slide-content"><?php $Skin->display_footer_container() ?></div>
</li>
</ul>
</div>
</div>
<div class="page-content"><?php $Skin->display_footer() ?></div>
</div>
<!-- /footer -->
</div>
</div>
<div id="pageControls"></div>
</div>
<?php
// HTML FOOTER INCLUDED HERE
skin_include( '_html_footer.inc.php' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment