From dd5c4101622593a39b02f4ee98e2210c765daafa Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 16 Nov 2015 01:20:58 -0300 Subject: [PATCH] Profile Picture --- install.php | 63 ++++++++++++++++++++++----- kernel/admin/themes/default/index.php | 2 +- kernel/admin/themes/default/init.php | 2 +- kernel/admin/views/edit-user.php | 6 +-- languages/en_US.json | 5 ++- themes/pure/php/home.php | 2 +- themes/pure/php/post.php | 2 +- 7 files changed, 63 insertions(+), 19 deletions(-) diff --git a/install.php b/install.php index b08d9e3d..763bee99 100644 --- a/install.php +++ b/install.php @@ -23,6 +23,7 @@ define('PATH_ROOT', __DIR__.DS); define('PATH_CONTENT', PATH_ROOT.'content'.DS); define('PATH_POSTS', PATH_CONTENT.'posts'.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_DATABASES', PATH_CONTENT.'databases'.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_LANGUAGES', PATH_ROOT.'languages'.DS); define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS); -define('DOMAIN', getenv('HTTP_HOST')); +define('DOMAIN', $_SERVER['HTTP_HOST']); // 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); // Log separator @@ -220,6 +231,12 @@ function install($adminPassword, $email, $timezoneOffset) 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)) { $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); } - 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); } @@ -279,10 +302,10 @@ function install($adminPassword, $email, $timezoneOffset) // File site.php $data = array( - 'title'=>'Bludit', - 'slogan'=>'cms', + 'title'=>'BLUDIT', + 'slogan'=>'CMS', 'description'=>'', - 'footer'=>Date::current('Y'), + 'footer'=>'Copyright © '.Date::current('Y'), 'language'=>$Language->getCurrentLocale(), 'locale'=>$Language->getCurrentLocale(), 'timezone'=>$timezone, @@ -306,7 +329,7 @@ function install($adminPassword, $email, $timezoneOffset) $data = array( 'admin'=>array( - 'firstName'=>'', + 'firstName'=>$Language->get('Administrator'), 'lastName'=>'', 'twitter'=>'', 'role'=>'admin', @@ -364,6 +387,19 @@ function install($adminPassword, $email, $timezoneOffset) 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_put_contents( 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 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 $data = 'Title: '.$Language->get('First post').' 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('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('Read the documentation for more information').' - '.$Language->get('Share with your friends and enjoy'); diff --git a/kernel/admin/themes/default/index.php b/kernel/admin/themes/default/index.php index dae2d4d1..c70ea805 100644 --- a/kernel/admin/themes/default/index.php +++ b/kernel/admin/themes/default/index.php @@ -98,7 +98,7 @@ $(document).ready(function() {