Profile Picture

This commit is contained in:
dignajar 2015-11-16 01:20:58 -03:00
parent c1cebcd185
commit dd5c410162
7 changed files with 63 additions and 19 deletions

View File

@ -23,6 +23,7 @@ define('PATH_ROOT', __DIR__.DS);
define('PATH_CONTENT', PATH_ROOT.'content'.DS); define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.DS); define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS); define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS); define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS); define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS); define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS);
@ -30,10 +31,20 @@ define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS); define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS); define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS); define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
define('DOMAIN', getenv('HTTP_HOST')); define('DOMAIN', $_SERVER['HTTP_HOST']);
// HTML PATHs // HTML PATHs
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/'; $base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$base = dirname($base);
if($base!=DS) {
$base = $base.'/';
}
else {
// Workaround for Windows Web Servers
$base = '/';
}
define('HTML_PATH_ROOT', $base); define('HTML_PATH_ROOT', $base);
// Log separator // Log separator
@ -220,6 +231,12 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0); error_log($errorText, 0);
} }
if(!mkdir(PATH_PAGES.'about', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'about';
error_log($errorText, 0);
}
if(!mkdir(PATH_PLUGINS_DATABASES.'pages', $dirpermissions, true)) if(!mkdir(PATH_PLUGINS_DATABASES.'pages', $dirpermissions, true))
{ {
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'pages'; $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'pages';
@ -238,9 +255,15 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0); error_log($errorText, 0);
} }
if(!mkdir(PATH_UPLOADS, $dirpermissions, true)) if(!mkdir(PATH_PLUGINS_DATABASES.'about', $dirpermissions, true))
{ {
$errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS; $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'about';
error_log($errorText, 0);
}
if(!mkdir(PATH_UPLOADS_PROFILES, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_PROFILES;
error_log($errorText, 0); error_log($errorText, 0);
} }
@ -279,10 +302,10 @@ function install($adminPassword, $email, $timezoneOffset)
// File site.php // File site.php
$data = array( $data = array(
'title'=>'Bludit', 'title'=>'BLUDIT',
'slogan'=>'cms', 'slogan'=>'CMS',
'description'=>'', 'description'=>'',
'footer'=>Date::current('Y'), 'footer'=>'Copyright © '.Date::current('Y'),
'language'=>$Language->getCurrentLocale(), 'language'=>$Language->getCurrentLocale(),
'locale'=>$Language->getCurrentLocale(), 'locale'=>$Language->getCurrentLocale(),
'timezone'=>$timezone, 'timezone'=>$timezone,
@ -306,7 +329,7 @@ function install($adminPassword, $email, $timezoneOffset)
$data = array( $data = array(
'admin'=>array( 'admin'=>array(
'firstName'=>'', 'firstName'=>$Language->get('Administrator'),
'lastName'=>'', 'lastName'=>'',
'twitter'=>'', 'twitter'=>'',
'role'=>'admin', 'role'=>'admin',
@ -364,6 +387,19 @@ function install($adminPassword, $email, $timezoneOffset)
LOCK_EX LOCK_EX
); );
// File plugins/about/db.php
file_put_contents(
PATH_PLUGINS_DATABASES.'about'.DS.'db.php',
$dataHead.json_encode(
array(
'position'=>0,
'label'=>$Language->get('About'),
'text'=>$Language->get('this-is-a-brief-description-of-yourself-our-your-blog')
),
JSON_PRETTY_PRINT),
LOCK_EX
);
// File plugins/simplemde/db.php // File plugins/simplemde/db.php
file_put_contents( file_put_contents(
PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php', PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php',
@ -395,15 +431,20 @@ function install($adminPassword, $email, $timezoneOffset)
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX); file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
// File index.txt for about page
$data = 'Title: '.$Language->get('About').'
Content: ';
file_put_contents(PATH_PAGES.'about'.DS.'index.txt', $data, LOCK_EX);
// File index.txt for welcome post // File index.txt for welcome post
$data = 'Title: '.$Language->get('First post').' $data = 'Title: '.$Language->get('First post').'
Content: Content:
## '.$Language->get('Congratulations you have successfully installed your Bludit').' ## '.$Language->get('Whats next').'
### '.$Language->get('Whats next').'
- '.$Language->get('Manage your Bludit from the admin panel').' - '.$Language->get('Manage your Bludit from the admin panel').'
- '.$Language->get('Follow Bludit on').' [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/bluditcms) / [Google+](https://plus.google.com/+Bluditcms) - '.$Language->get('Follow Bludit on').' [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/bluditcms) / [Google+](https://plus.google.com/+Bluditcms)
- '.$Language->get('Chat with developers and users on Gitter').'
- '.$Language->get('Visit the support forum').' - '.$Language->get('Visit the support forum').'
- '.$Language->get('Read the documentation for more information').' - '.$Language->get('Read the documentation for more information').'
- '.$Language->get('Share with your friends and enjoy'); - '.$Language->get('Share with your friends and enjoy');

View File

@ -98,7 +98,7 @@ $(document).ready(function() {
<div class="uk-navbar-flip uk-hidden-small"> <div class="uk-navbar-flip uk-hidden-small">
<ul class="uk-navbar-nav"> <ul class="uk-navbar-nav">
<li class="uk-parent" data-uk-dropdown> <li class="uk-parent" data-uk-dropdown>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><i class="uk-icon-user"></i> <?php echo $Login->username() ?> ▾</a> <a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><img class="uk-border-circle" width="28px" src="<?php echo HTML_PATH_UPLOADS_PROFILES.$Login->username() ?>.jpg" alt=""> <?php echo $Login->username() ?> ▾</a>
<div class="uk-dropdown uk-dropdown-navbar"> <div class="uk-dropdown uk-dropdown-navbar">
<ul class="uk-nav uk-nav-navbar"> <ul class="uk-nav uk-nav-navbar">
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><?php $L->p('Profile') ?></a></li> <li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><?php $L->p('Profile') ?></a></li>

View File

@ -217,7 +217,7 @@ class HTML {
</div> </div>
<div id="upload-drop" class="uk-placeholder uk-text-center"> <div id="upload-drop" class="uk-placeholder uk-text-center">
<a class="uk-form-file"><i class="uk-icon-cloud-upload uk-margin-small-right"></i>'.$L->g('Upload Image').'<input id="upload-select" type="file"></a> <i class="uk-icon-cloud-upload uk-margin-small-right"></i>'.$L->g('Upload Image').'<br><a class="uk-form-file">'.$L->g('Drag and drop or click here').'<input id="upload-select" type="file"></a>
</div> </div>
'; ';

View File

@ -3,7 +3,7 @@
HTML::title(array('title'=>$L->g('Edit user'), 'icon'=>'user')); HTML::title(array('title'=>$L->g('Edit user'), 'icon'=>'user'));
echo '<div class="uk-grid">'; echo '<div class="uk-grid">';
echo '<div class="uk-width-8-10">'; echo '<div class="uk-width-7-10">';
HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal')); HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal'));
@ -96,8 +96,8 @@ if( ($Login->role()==='admin') && ($_user['username']!='admin') ) {
HTML::formClose(); HTML::formClose();
echo '</div>'; echo '</div>';
echo '<div class="uk-width-2-10" style="margin-top: 50px;">'; echo '<div class="uk-width-3-10" style="margin-top: 50px; text-align: center;">';
echo '<img id="jsprofilePicture" class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$_user['username'].'.jpg" alt="profile picture">'; echo '<img id="jsprofilePicture" class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$_user['username'].'.jpg" alt="'.$L->g('Profile picture').'">';
HTML::profileUploader($_user['username']); HTML::profileUploader($_user['username']);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -206,5 +206,8 @@
"insert-image": "Insert image", "insert-image": "Insert image",
"supported-image-file-types": "Supported image file types", "supported-image-file-types": "Supported image file types",
"date-format": "Date format", "date-format": "Date format",
"time-format": "Time format" "time-format": "Time format",
"chat-with-developers-and-users-on-gitter":"Chat with developers and users on [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-blog":"This is a brief description of yourself or your blog, to change this text go to the admin panel, settings, plugins, and configure the plugin about.",
"profile-picture": "Profile picture"
} }

View File

@ -22,7 +22,7 @@
<?php <?php
echo $Language->get('Posted By').' '; echo $Language->get('Posted By').' ';
if( Text::isNotEmpty($Post->authorFirstName()) && Text::isNotEmpty($Post->authorLastName()) ) { if( Text::isNotEmpty($Post->authorFirstName()) || Text::isNotEmpty($Post->authorLastName()) ) {
echo $Post->authorFirstName().' '.$Post->authorLastName(); echo $Post->authorFirstName().' '.$Post->authorLastName();
} }
else { else {

View File

@ -20,7 +20,7 @@
<?php <?php
echo $Language->get('Posted By').' '; echo $Language->get('Posted By').' ';
if( Text::isNotEmpty($Post->authorFirstName()) && Text::isNotEmpty($Post->authorLastName()) ) { if( Text::isNotEmpty($Post->authorFirstName()) || Text::isNotEmpty($Post->authorLastName()) ) {
echo $Post->authorFirstName().' '.$Post->authorLastName(); echo $Post->authorFirstName().' '.$Post->authorLastName();
} }
else { else {