'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 = ''.$navigation.''; $slogan = ''.$slogan.''; $copyright = ''.$copyright.''; if (!$content[0]) $content[0] = '

'.$lang['create_page2'].'

'.$lang['add'].' '.$lang['add_to_menu'].'

'; // 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['down_new_version'].'
  • '; } } else { $lstatus = ''.$lang['login'].''; if (!$content[0]) { $content[0] = '

    '.$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] = '

    '.$lang['login'].'

    '.(($password==md5(md5($salt).md5('admin')) or ($password==md5('admin')))?('('.$lang['pass_default'].' '.$lang['change'].'?)'):'').'

    '.$msg.'

    '.$lang['pass_change'].'

    '.$lang['pass_change2'].'

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

    '.$lang['web_settings'].'


    '.$lang['support'].'

    PayPal: Donate
    Creative Commons License
    '; } } if (GET('edit') == 'on') { // EDIT PAGE if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { $file_name = preg_replace('#[^a-zA-Z0-9-_]#i', '', POST('id')); $file_name = substr($file_name, 0, 25); $content = rtrim(stripslashes(POST('value'))); if(!$content) $content = 'Please enter content...'; if ($file_name > 0 && $file_name < 6) $fname = 'attachment'.$file_name; else if ($file_name > 5 && $file_name < 10) $fname = 'attachment'.$file_name.'_'.$page; else $fname = $file_name; $file = @fopen($directory.'/'.$fname.$type_files, 'w'); if (!$file) { echo $lang['error_open']; exit; } //fwrite($file, iconv('windows-1251', 'utf-8', $content)); // Cyrillic does not work? fwrite($file, $content); fclose($file); echo $content; } else { echo $lang['pass_access']; exit; } } else if (GET('img') == 'on') { // IMAGE RESIZE"(BETA) if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { #SimpleImage - Author: Simon Jarvis #Copyright: 2006 Simon Jarvis class SimpleImage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) { $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) { $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) { $this->image = imagecreatefrompng($filename); } } function save($filename, $image_type=IMAGETYPE_JPEG, $compression=80, $permissions=null) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image,$filename,$compression); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image,$filename); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image,$filename); } if($permissions != null) {chmod($filename,$permissions);} } function output($image_type=IMAGETYPE_JPEG) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image); } } function getWidth() {return imagesx($this->image);} function getHeight() {return imagesy($this->image);} function resizeToHeight($height) { $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); } function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getheight() * $ratio; $this->resize($width,$height); } function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } } $image = new SimpleImage(); $image->load($upload_folder.POST('src')); if (POST('width') != '' and POST('height') == '') {$image->resizeToWidth(POST('width'));} if (POST('height') != '' and POST('width') == '') {$image->resizeToHeight(POST('height'));} if (POST('height') != '' and POST('width') != '') {$image->resize(POST('width'),POST('height'));} $image->save($upload_folder.POST('src')); } } else if (GET('qqfile') != '') { // UPLOAD FILE if ((COOKIE($cookie) == $password) and (in_array($ip_user,explode(',',$range_ip)))) { if ($_FILES['uploadfile']['size'] < $upload_max_size*1000) { $file = $upload_folder . basename($_FILES['uploadfile']['name']); if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) { echo 'success'; } else {echo 'error';} } else {echo 'error';} } else { echo $lang['pass_access']; exit; } } else { // VIEW TEMPLATE $string = file_get_contents($directory_template.'/'.$template.'.tpl'); if ((strpos($string, '>Einplac')) or (strpos($string, '/button80x15.png" />'))) { require($directory_template.'/'.$template.'.tpl'); } else { echo 'Creative Commons License!
    Please write to file "'.$directory_template.'/'.$template.'.tpl":
    - Text: "Powered by:<a href="http://www.myworld.lv/einplaccms.html">Einplac CMS</a>".
    - '.$lang['or'].' Image: "<a href="http://www.myworld.lv/einplaccms.html"><img alt="button 80x15" src="./images/button80x15.png" /></a>".

    '.$lang['support2'].':
    - Skype: renat2985
    - E-mail: info@myworld.lv';} } ?>