'Welcome Einplac CMS!',
'navigation' => 'Double click here to edit your navigation.',
'slogan' => 'Double click here to edit your slogan.',
'copyright' => 'Double click here to edit your copyright.',
'attachment' => 'Double click here to edit your attachment',
'description' => 'Enter your description here.',
'keywords' => 'Enter your keywords, here.',
'create_page' => 'Create new page',
'create_page2' => 'Your page named '.$page.' is created.
Double click here to edit your new created page.',
'down_new_version' => 'Download new version!',
'login' => 'Log In',
'logout' => 'Log Out',
'join' => 'Join',
'password' => 'Password',
'pass_new' => 'New Password',
'pass_default' => 'password: admin',
'pass_error1' => 'Error
Password not correctly.',
'pass_error2' => 'Error, unable to save password
Please make sure read/write permissions are enabled.',
'pass_change' => 'Change your password?',
'pass_change2' => 'Type your old password above, and your new one in the field below.',
'pass_changed' => 'Password changed!
Please login again.',
'pass_access' => 'You must login first before you can use this function!',
'loading' => 'Loading...',
'saving' => 'Saving...',
'save' => 'Save',
'cancel' => 'Cancel',
'click_to_edit' => 'Doubleclick to edit...',
'change' => 'Change',
'web_settings' => 'Web Settings',
'edit_view_text' => 'Edit view text',
'template' => 'Template',
'example' => 'Example',
'or' => 'or',
'lang' => 'Language',
'local' => 'Localization',
'other_opt' => 'Other options',
'other' => 'other',
'show_hide' => 'Click to show/hide',
'upload_files' => 'Upload files',
'add' => 'Add',
'add_to_menu' => 'to list menu?',
'allow' => 'Allow',
'support' => 'Support',
'file_manager' => 'File manager',
'upload' => 'Upload',
'open' => 'Open',
'img_size' => 'Image size',
'support2' => 'If you have any questions, please, apply to',
'info_title' => 'Recommended from 10 to 70 characters.',
'info_description' => 'Recommended from 10 to 160 characters.',
'info_keywords' => 'Recommended write the words after the comma.',
'error_404' => 'ERROR 404
Page not found.',
'error_open' => 'Error, unable to open file.
Please make sure read/write permissions are enabled.'
);
if (file_exists($directory.'/lang.php')) {
include($directory.'/lang.php');
}
// MULTILANGUAGE
if ($multi_lang != 'off') {
$multi_lang_get = preg_replace('#[^a-z]#i', '', GET('lang'));
$multi_lang_get = substr($multi_lang_get, 0, 2); // Lang name max 2 symbol
if (in_array($multi_lang_get,explode(',',$multi_lang))){
$multi_lang=$multi_lang_get;
$type_files='_'.$multi_lang.$type_files;
} else {$multi_lang='';}
} else {$multi_lang= '';}
// FIRST START
$content[0] = @file_get_contents($directory.'/'.$page.$type_files);
$content[1] = @file_get_contents($directory.'/attachment1'.$type_files);
if (!$content[1]) $content[1] = $lang['attachment'].'1.';
$content[2] = @file_get_contents($directory.'/attachment2'.$type_files);
if (!$content[2]) $content[2] = $lang['attachment'].'2.';
$content[3] = @file_get_contents($directory.'/attachment3'.$type_files);
if (!$content[3]) $content[3] = $lang['attachment'].'3.';
$content[4] = @file_get_contents($directory.'/attachment4'.$type_files);
if (!$content[4]) $content[4] = $lang['attachment'].'4.';
$content[5] = @file_get_contents($directory.'/attachment5'.$type_files);
if (!$content[5]) $content[5] = $lang['attachment'].'5.';
$content[6] = @file_get_contents($directory.'/attachment6_'.$page.$type_files);
if (!$content[6]) $content[6] = $lang['attachment'].'6_'.$page.'.';
$content[7] = @file_get_contents($directory.'/attachment7_'.$page.$type_files);
if (!$content[7]) $content[7] = $lang['attachment'].'7_'.$page.'.';
$content[8] = @file_get_contents($directory.'/attachment8_'.$page.$type_files);
if (!$content[8]) $content[8] = $lang['attachment'].'8_'.$page.'.';
$content[9] = @file_get_contents($directory.'/attachment9_'.$page.$type_files);
if (!$content[9]) $content[9] = $lang['attachment'].'9_'.$page.'.';
$title = @file_get_contents($directory.'/title_'.$page.$type_files);
if (!$title) $title = $lang['title'];
$navigation = @file_get_contents($directory.'/navigation'.$type_files);
if (!$navigation) $navigation = $lang['navigation'];
$slogan = @file_get_contents($directory.'/slogan'.$type_files);
if (!$slogan) $slogan = $lang['slogan'];
$description = @file_get_contents($directory.'/description_'.$page.$type_files);
if (!$description) $description = $lang['description'];
$keywords = @file_get_contents($directory.'/keywords_'.$page.$type_files);
if (!$keywords) $keywords = $lang['keywords'];
$copyright = @file_get_contents($directory.'/copyright'.$type_files);
if (!$copyright) $copyright = $lang['copyright'];
$viewtext = @file_get_contents($directory.'/options_viewtext'.$type_files);
if (!$viewtext) $viewtext = 'textarea';
$template = @file_get_contents($directory.'/options_template'.$type_files);
if (!file_exists($directory_template.'/'.$template.'.tpl')) $template = 'default';
$password = @file_get_contents($directory.'/password.php');
$password = str_replace('', '', $password); //fix by last version
if (!$password) { savePassword('admin'); }
if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) {
$lstatus = ''.$lang['logout'].'';
$navigation = '';
$slogan = ''.$slogan.'';
$copyright = ''.$copyright.'';
if (!$content[0]) $content[0] = '
'.$lang['create_page2'].'
'; // UPDATE CMS if (function_exists('curl_init')) { if (COOKIE('updatecms') == '') { $url = 'http://www.myworld.lv/einplaccms.zip'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_HEADER, true); $headers = curl_exec($ch); if(preg_match("#last-modified:\s*(.*)\n#i", $headers, $out)) { $ts = strtotime($out[1]); $upgrade_date = date('Ymd', $ts); $version_date = preg_replace('#[^0-9]#i', '', $version_date); if ($upgrade_date > $version_date) { setcookie('updatecms', 'new', time()+691200); // 7 day } else { setcookie('updatecms', 'ok', time()+691200); // 7 day } } } } if (COOKIE('updatecms') == 'new') { $new_version = ''.$lang['error_404'].'
'; //$title = 'ERROR 404'; }; } if (isset($_REQUEST['login'])) { displayLoginForm(); } if (isset($_REQUEST['logout'])) { setcookie($cookie, '', time()-$cookie_time); // Remove cookie header('Location: ./'); exit; } // FUNCTIONS function loginSubmitted() { global $cookie, $password, $msg, $cookie_time, $lang, $salt, $ip_user, $range_ip; if (((md5(md5($salt).md5(POST('password'))) == $password) or (md5(POST('password')) == $password)) and (in_array($ip_user,explode(',',$range_ip)))){ if (POST('newpassword')) { savePassword(POST('newpassword')); $msg = $lang['pass_changed']; return; } setcookie($cookie, $password, time()+$cookie_time); header('Location: ./'); exit; } else { $msg = $lang['pass_error1']; return; } } function savePassword($password) { global $directory, $lang, $salt; $password = md5(md5($salt).md5($password)); $file = @fopen($directory.'/password.php', 'w'); if (!$file) { echo $lang['pass_error2']; exit; } fwrite($file, ''); fclose($file); } function displayEditLibrary() { global $cookie, $viewtext, $lang, $upload_file, $upload, $multi_lang, $page, $edit_content, $directory, $password, $ip_user, $range_ip; echo ' '; if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { echo ' '; } else { echo ' '; } } function displayMainContent() { global $cookie, $content, $page, $password, $ip_user, $range_ip; if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { echo ''.$content[0].''; } else echo $content[0]; } function displaySectionContent($number) { global $cookie, $content, $password, $ip_user, $range_ip; if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { echo ''.$content[$number].''; } else echo $content[$number]; } function displayLoginForm() { global $content, $msg, $password, $lang, $salt, $cookie; $msg = ''; if (isset($_POST['sub'])) loginSubmitted(); $content[0] = ' '; } function displaySettings() { global $page, $description, $keywords, $title, $slogan, $copyright, $template, $viewtext, $new_version, $lang,$upload_max_size, $cookie, $password, $ip_user, $range_ip; if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { if (!$page) $page = 'home'; echo '