Merge branch 'master' into responsiveadmin

This commit is contained in:
franciscoarocas 2021-02-08 15:37:07 +01:00
commit 8e2fc93d8a
133 changed files with 7224 additions and 3704 deletions

View File

@ -1,3 +1,44 @@
# In beta testing: FlatPress 1.2 "Legato"
[Release info and download](https://github.com/flatpressblog/flatpress/releases/tag/1.2.beta1)
## General
- FlatPress now runs smoothly with PHP 7.4 and PHP 8
- Performance: Lazy loading for images
- GDPR compatibility: Data of commenters are not stored in cookies any more
- SEO: Added XML sitemap for search engines ([details](https://forum.flatpress.org/viewtopic.php?f=4&t=126))
- Leggero v2 is default theme (see [#57](https://github.com/flatpressblog/flatpress/issues/57))
- Leggero v1 is now responsive
- Updated Smarty to release 2.6.31
- Added [CONTRIBUTORS.md](https://github.com/flatpressblog/flatpress/blob/master/CONTRIBUTORS.md)
## Plugins
- BBCode plugin:
- Added image attribute "loading", default is "lazy"
- Enhanced \[video\] element accepts video URLs for YouTube, Vimeo and Facebook
- Added "mail" tag (replaces the Protected Mail Links plugin)
- Selectboxes of attachments and images in the editor toolbar are sorted by name
- jQuery plugin: Updated jQuery and jQuery UI to their current versions
- CommentCenter plugin is part of the FP standard distribution
- PrettyUrls and Comment Center are activated by default, LastComments and LastCommentsAdmin are not
- Protected Mail Links plugin removed
## Security
- Overhauled v0.812.2 fix for local file inclusion vulnerability ([more details](http://www.guanting.com/security/exploit/information/27269.html))
- Comments are sanitized properly (see [#62](https://github.com/flatpressblog/flatpress/issues/62))
- Uploader checks for forbidden files more carefully
- User password isn't hashed with MD5 any more (see [#59](https://github.com/flatpressblog/flatpress/issues/59))
## Bugfixes
- Mail adresses are accepted in a broader range (see [#48](https://github.com/flatpressblog/flatpress/issues/48))
- HTTPS URLs in the contact form are now handled correctly (see [#55](https://github.com/flatpressblog/flatpress/issues/55))
- Fixed redirects after login
- Fixed "syntax error, unexpected '\['" bug, reported [here](https://forum.flatpress.org/viewtopic.php?f=2&t=131)
- Setup sets date and FP version for the freshly created static pages
- Annoying translation error in German language pack fixed
## Translations
- Added French language pack by Marc Thibeault and Dimitri Soufflet, reworked by Gee
- Added Japanese Language Pack by [NORTH HILL WORK STUDIO](https://nhws.localinfo.jp/)
- Added Brazilian Portuguese language pack by randy
- Added Italian language pack by Giacomo Margarito
- Added Spansh language pack by karelv
- Reworked German language pack by Detlef
# 2019-02-22: [FlatPress 1.1 "Da capo"](https://github.com/flatpressblog/flatpress/releases/tag/1.1)
## General
- Languages added: Greek, German, Czech (feel free to send in *your* language packs!)
@ -11,7 +52,7 @@
- Footnotes plugin: Usage how-to added
- Lightbox plugin: Slimbox version updated, broken overlay fixed
## Security
- Security fix: Possible CSFR attack prevented (see [details](https://www.exploit-db.com/exploits/39870 "exploit-db.com/exploits/39870"))
- Security fix: Possible CSRF attack prevented (see [details](https://www.exploit-db.com/exploits/39870 "exploit-db.com/exploits/39870"))
## Bugfixes
- Correct handling of special characters in URLs (see [PR11](https://github.com/flatpressblog/flatpress/pull/11 "Pull request #11"))
- HTTPS allowed in comment URLs

View File

@ -4,18 +4,34 @@ FlatPress wouldn't be the great blogging system it is without the help of many v
If you think someone's missing here, please let us know.
## The team
FlatPress was initially developed by [Edoardo Vacchi (NoWhereMan)](http://www.nowhereland.it "nowhereland.it"). Edoardo was supported by [Hydra](http://hydra.clans.it/ "hydra.clans.it"), [drudo](https://drudotec.wordpress.com/ "drudotec.wordpress.com"), giulio, [alcor](http://alcor.altervista.org/ "alcor.altervista.org"), and [Tychondriax](http://tychondriax.altervista.org/blog/ "tychondriax.altervista.org").<br>
FlatPress was initially developed by [Edoardo Vacchi (NoWhereMan)](https://github.com/evacchi "github.com/evacchi"). Edoardo was supported by [Hydra](http://hydra.clans.it/ "hydra.clans.it"), [drudo](https://drudotec.wordpress.com/ "drudotec.wordpress.com"), giulio, [alcor](http://alcor.altervista.org/ "alcor.altervista.org"), and [Tychondriax](http://tychondriax.altervista.org/blog/ "tychondriax.altervista.org").<br>
<br>
Since 2018, FlatPress is taken care of by [Arvid Zimmermann](https://arvidzimmermann.de "arvidzimmermann.de").
## Coding
- [Julian Rademacher](https://moortaube.de/) filed some useful pull requests (and donated his Twitter account [@FlatPress](https://twitter.com/FlatPress)).
- [Matthias Mauch](http://www.aadmm.org/)'s [FP-Patch](http://www.aadmm.org/fp-patch/) initially brought FlatPress to PHP 7.
- Piero VDFN introduced the plugins Comment Center, jQuery, and LightBox2.
- [Fabrix.xm](https://kirgroup.com/) contributed the Media Manager and Last Comments Admin.
- The SEO Meta Tag Info plugin was built by Don Prince.
- [Matthias Mauch](http://www.aadmm.org/)'s [FP-Patch](http://www.aadmm.org/fp-patch/) initially brought FlatPress to PHP 7. Also, he regularly tests FlatPress against new PHP versions.
- The XML sitemap for search engines was [initially introduced](https://www.igorkromin.net/index.php/2013/02/18/adding-a-google-compatible-sitemap-to-flatpress/) by [Igor Kromin](https://www.igorkromin.net/).
## Translation
- Brazilian Portuguese: randy
- Czech: [Lubomír Ludvík](http://flatpress.cz/)
- French: [Marc Thibeault](https://github.com/MarcThibeault) and Dimitri Soufflet, fixed by Gee
- German: [Matthias Mauch (laborix)](http://www.aadmm.org/)
- French: [Marc Thibeault](https://github.com/MarcThibeault) and Dimitri Soufflet, reworked by Gee
- German: [Matthias Mauch (laborix)](http://www.aadmm.org/), reworked by Detlef
- Greek: An unknown, since deleted GitHub user :(
- Italian: Giacomo Margarito
- Japanese: [NORTH HILL WORK STUDIO](https://nhws.localinfo.jp/)
- Spanish: karelv
## Libraries
FlatPress utilizes the following free frameworks and libraries. Thanks to their authors!
- [jQuery](https://jquery.com/)
- [jQuery UI](https://jqueryui.com/)
- [Smarty Template Engine](https://www.smarty.net/) by Monte Ohrt and Uwe Tews
- [BBCode Parser](http://christian-seiler.de/projekte/php/bbcode/) by Christian Seiler
- [SlimBox2](https://www.digitalia.be/software/slimbox2/) by Christophe Beyls
## Other contributions
- [Julian Rademacher](https://moortaube.de/) generously donated his Twitter account [@FlatPress](https://twitter.com/FlatPress). Also thanks for your useful pull requests!

View File

@ -5,7 +5,7 @@
FlatPress is a lightweight, easy-to-set-up blogging engine. Plain and simple, just PHP. No database needed!
## Getting started
Installing and running FlatPress is really easy!
Installing and running FlatPress is really easy:
- [Download FlatPress](https://www.flatpress.org/download), unzip, upload
- Browse to your web server, run FlatPress installer
- Enjoy blogging with FlatPress!

7
admin/main.tpl Executable file → Normal file
View File

@ -1,5 +1,8 @@
<div id="admin-content">
{include file=$admin_resource|default:"admin:$panel/$action"}
{if isset($action)}
{include file=$admin_resource|default:"admin:$panel/$action"}
{else}
{include file=$admin_resource|default:"admin:$panel"}
{/if}
</div>

0
admin/panels/config/admin.config.tpl Executable file → Normal file
View File

0
admin/panels/entry/admin.entry.cats.tpl Executable file → Normal file
View File

0
admin/panels/entry/admin.entry.list.tpl Executable file → Normal file
View File

0
admin/panels/entry/admin.entry.write.tpl Executable file → Normal file
View File

View File

@ -50,4 +50,4 @@
</div>
</div>
</div>
</div>
</div>

0
admin/panels/static/admin.static.write.tpl Executable file → Normal file
View File

View File

@ -19,7 +19,7 @@ class admin_uploader extends AdminPanel {
var $actions = array(
'default' => true
);
}
class admin_uploader_default extends AdminPanelAction {
@ -35,73 +35,208 @@ class admin_uploader_default extends AdminPanelAction {
function onupload() {
$success = false;
/*
* first check if user is logged in
* to prevent remote admin.uploader.php script execution
*
* By testing the admin/main.php made the redirect job
* By direct URL call PHP throw a visible error -> AdminPanel class not found!
*
* 2019-11-23 - laborix
*/
if (!user_loggedin()) {
utils_redirect("login.php");
die();
}
if (!file_exists(IMAGES_DIR))
fs_mkdir(IMAGES_DIR);
if (!file_exists(ATTACHS_DIR))
fs_mkdir(ATTACHS_DIR);
/*
* Blacklist entries from OWASP and
* https://stackoverflow.com/questions/4166762/php-image-upload-security-check-list
*
* 2019-11-23 - laborix
*/
$blacklist_extensions = array(
'htaccess',
'phtml',
'php',
'php3',
'php4',
'php5',
'php6',
'php7',
'phps',
'cgi',
'exe',
'pl',
'asp',
'aspx',
'shtml',
'shtm',
'fcgi',
'fpl',
'jsp',
'htm',
'html',
'wml'
);
$imgs = array(
'.jpg',
'.gif',
'.png',
'.jpeg'
);
$forbidden = array(
'.php',
'.php3',
'.php4',
'.php5',
'.php7',
'.phtml'
);
// intentionally
// I've not put BMPs
$uploaded_files = array();
foreach ($_FILES ["upload"] ["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES ["upload"] ["tmp_name"] [$key];
$name = $_FILES ["upload"] ["name"] [$key];
$dir = ATTACHS_DIR;
$ext = strtolower(strrchr($name, '.'));
if (in_array($ext, $forbidden)) {
$success = false;
continue;
/*
* second check extension list
* https://stackoverflow.com/questions/4166762/php-image-upload-security-check-list
*
* 2019-11-24 - laborix
*/
$uploadfilename = strtolower($tmp_name);
$isForbidden = false;
$deeptest = array();
$extcount = 0;
$deeptest = explode('.', $uploadfilename);
$extcount = count($deeptest);
if ($extcount == 1) {
/*
* none extension like .jpg or something else
*
* possible filename = simple-file-without-extension - linux like ok
*/
$isForbidden = false;
} elseif ($extcount == 2) {
/*
* Only one possible extension
*
* possible filename = 1.jpg
* possible filename = admin.uploader.php
* possible filename = .htaccess
* and so on...
*/
$check_ext1 = "";
$check_ext1 = trim($deeptest [1], "\x00..\x1F");
if (in_array($check_ext1, $blacklist_extensions)) {
$isForbidden = true;
} else {
$isForbidden = false;
}
} elseif ($extcount > 2) {
/*
* Chekc only the last two possible extensions
*
* Hint: OWASP - Unrestricted File Upload
*
* In Apache, a php file might be executed using the
* double extension technique such as "file.php.jpg"
* when ".jpg" is allowed.
*
* possible filename = 1.PhP.jpg
* possible filename = admin.uploader.php.JPg
* and so on...
*/
$check_ext1 = "";
$check_ext2 = "";
$check_ext1 = trim($deeptest [$extcount - 1], "\x00..\x1F");
if (in_array($check_ext1, $blacklist_extensions)) {
$isForbidden = true;
} else {
$isForbidden = false;
}
/* Test only if first extension check are not in the blacklist */
if (!$isForbidden) {
$check_ext2 = trim($deeptest [$extcount - 2], "\x00..\x1F");
if (in_array($check_ext2, $blacklist_extensions)) {
$isForbidden = true;
} else {
$isForbidden = false;
}
}
}
/*
* If one blacklisted extension found then
* return with -1 = An error occurred while trying to upload.
*/
if ($isForbidden) {
$this->smarty->assign('success', $success ? 1 : -1);
sess_add('admin_uploader_files', $uploaded_files);
return -1;
}
/*
* third check extension
* if someone upload a .php file as .gif, .jpg or .txt
* if someone upload a .html file as .gif, .jpg or .txt
*
* 2019-11-24 - laborix
*/
if (version_compare(PHP_VERSION, '5.3.0') < 0)
return -1;
if (!function_exists('finfo_open'))
return -1;
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $tmp_name);
finfo_close($finfo);
if (($mime == "text/x-php") || ($mime == "text/html")) {
$this->smarty->assign('success', $success ? 1 : -1);
sess_add('admin_uploader_files', $uploaded_files);
return -1;
}
$ext = strtolower(strrchr($name, '.'));
if (in_array($ext, $imgs)) {
$dir = IMAGES_DIR;
}
$name = sanitize_title(substr($name, 0, -strlen($ext))) . $ext;
$target = "$dir/$name";
@umask(022);
$success = move_uploaded_file($tmp_name, $target);
@chmod($target, 0766);
$uploaded_files [] = $name;
// one failure will make $success == false :)
$success &= $success;
}
}
if ($uploaded_files) {
$this->smarty->assign('success', $success ? 1 : -1);
sess_add('admin_uploader_files', $uploaded_files);
}
return 1;
}
}
?>

0
admin/panels/uploader/admin.uploader.tpl Executable file → Normal file
View File

0
admin/panels/widgets/admin.widgets.default.tpl Executable file → Normal file
View File

View File

@ -143,18 +143,11 @@ function comment_validate() {
$arr ['version'] = system_ver();
$arr ['name'] = $name;
if (!$loggedin)
setcookie('comment_author_' . COOKIEHASH, $arr ['name'], time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
if ($email) {
($arr ['email'] = $email);
if (!$loggedin)
setcookie('comment_author_email_' . COOKIEHASH, $arr ['email'], time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
}
if ($url) {
($arr ['url'] = ($url));
if (!$loggedin)
setcookie('comment_author_url_' . COOKIEHASH, $arr ['url'], time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
}
$arr ['content'] = $content;
@ -241,13 +234,6 @@ function commentform() {
$smarty->assign('values', $_POST);
}
}
// Cookies
$smarty->assign('cookie', array(
'name' => @$_COOKIE ['comment_author_' . COOKIEHASH],
'email' => @$_COOKIE ['comment_author_email_' . COOKIEHASH],
'url' => @$_COOKIE ['comment_author_url_' . COOKIEHASH]
));
}
?>

View File

@ -1,168 +1,159 @@
<?php
// defaults.php
// this file defines standard positions of some important
// dirs or files.
// For security reasons
// these can't be modified in the common settings panels
// but only through this file.
// If you want to change these constants, just change
// the second parameter.
// We suggest not to define here your owns, but instead
// inmplementing them as plugins
// legacy mode; needed with some ill-formed spb files
define('DUMB_MODE_ENABLED', false);
// default file permissions
// change file to 644 and dir to 755 if your webserver "complains"
define('FILE_PERMISSIONS', 0777);
define('DIR_PERMISSIONS', 0777);
// defaults.php
// first some webserver setup...
// here's where your server save session-related stuff.
// If you don't experience any session-related problem, you
// you can leave it blank and it will default to standard webserver config
define('SESSION_PATH', '');
// absolute path to your webserver dir; if you don't experience any problem
// you can leave this as it is
define('ABS_PATH', dirname(__FILE__).'/');
// here was blog root in earlier versions. This has been moved to config_load()
// here are default config files
define('FP_DEFAULTS', 'fp-defaults/');
// all writable directories go here.
define('FP_CONTENT', 'fp-content/'); //must be chmodded to 0777
// blog configurations files
define('CONFIG_DIR', FP_CONTENT . 'config/'); //must be chmodded to 0777
define('CONFIG_FILE', CONFIG_DIR . 'settings.conf.php');
define('HASHSALT_FILE', CONFIG_DIR . 'hashsalt.conf.php');
define('CONFIG_DEFAULT', FP_DEFAULTS. 'settings-defaults.php');
define('USERS_DIR', FP_CONTENT . 'users/');
// here we'll store all your entries, comments, static pages and blocks
// comments are stored automatically in subdirs of the dir CONTENT_DIR
define('CONTENT_DIR', FP_CONTENT . 'content/');
//define('BLOCKS_DIR', CONTENT_DIR . 'blocks/');
// !!! CRITICAL !!!
// all includes file
define('FP_INCLUDES', 'fp-includes/');
// core include scripts
define('INCLUDES_DIR', FP_INCLUDES . 'core/');
// smarty engine
define('SMARTY_DIR', ABS_PATH . FP_INCLUDES . 'smarty/');
define('FP_INTERFACE', 'fp-interface/');
// theme dir
define('THEMES_DIR', FP_INTERFACE . 'themes/');
// language files
define('LANG_DIR', FP_INTERFACE . 'lang/');
// misc forms
define('SHARED_TPLS', ABS_PATH . FP_INTERFACE . 'sharedtpls/');
// here is where all plugins are saved
define('PLUGINS_DIR', 'fp-plugins/');
define('ADMIN_DIR', 'admin/');
// cache file name and path.
define('CACHE_DIR', FP_CONTENT . 'cache/');
define('CACHE_FILE', '%%cached_list.php');
// this file defines standard positions of some important
// dirs or files.
define('INDEX_DIR', FP_CONTENT.'index/');
define('LOCKFILE', FP_CONTENT . '%%setup.lock');
// For security reasons
// these can't be modified in the common settings panels
// but only through this file.
// If you want to change these constants, just change
// the second parameter.
// these will be probably moved soon to plugins
// here is where all the uploaded images will be saved
define('IMAGES_DIR', FP_CONTENT . 'images/');
// here is where all the attachments will be saved
define('ATTACHS_DIR', FP_CONTENT . 'attachs/');
define('LANG_DEFAULT', 'en-us');
define('BPT_SORT', SORT_DESC);
set_include_path(ABS_PATH);
//
// original Flatpress 1.0.3 coding disabled
//
// compatibility with ISS
// if (!isset($_SERVER['REQUEST_URI']))
// $_SERVER['REQUEST_URI'] = 'http://localhost/flatpress/';
// #define('BLOG_ROOT', dirname($_SERVER['PHP_SELF']) . '/');
// define('BLOG_ROOT', ('/'==($v=dirname($_SERVER['SCRIPT_NAME']))? $v : $v.'/') );
// We suggest not to define here your owns, but instead
// inmplementing them as plugins
// define('BLOG_BASEURL', 'http://'.$_SERVER['HTTP_HOST']. BLOG_ROOT);
// legacy mode; needed with some ill-formed spb files
define('DUMB_MODE_ENABLED', false);
// default file permissions
// change file to 644 and dir to 755 if your webserver "complains"
define('FILE_PERMISSIONS', 0777);
define('DIR_PERMISSIONS', 0777);
//
// Adding security and HTTPS support
//
// first some webserver setup...
ini_set('session.cookie_httponly', 1);
ini_set('session.use_only_cookies', 1);
// here's where your server save session-related stuff.
// If you don't experience any session-related problem, you
// you can leave it blank and it will default to standard webserver config
define('SESSION_PATH', '');
// absolute path to your webserver dir; if you don't experience any problem
// you can leave this as it is
define('ABS_PATH', dirname(__FILE__) . '/');
// here was blog root in earlier versions. This has been moved to config_load()
if (isset($_SERVER['HTTPS'])) {
$_SERVER['HTTPS'] = htmlspecialchars($_SERVER['HTTPS'], ENT_QUOTES, "UTF-8");
}
$serverport = "false";
// Unterstützung für Apache und IIS
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == '1' || strtolower($_SERVER['HTTPS'])=='on')) {
$serverport = "https://";
// Uses a secure connection (HTTPS) if possible
ini_set('session.cookie_secure', 1);
} else {
$serverport = "http://";
}
// here are default config files
define('FP_DEFAULTS', 'fp-defaults/');
// compatibility with ISS
$_SERVER["REQUEST_URI"] = htmlspecialchars($_SERVER["REQUEST_URI"], ENT_QUOTES, "UTF-8");
if (!isset($_SERVER['REQUEST_URI']))
$_SERVER['REQUEST_URI'] = $serverport . 'localhost/flatpress/';
#define('BLOG_ROOT', dirname($_SERVER['PHP_SELF']) . '/');
define('BLOG_ROOT', ('/'==($v=dirname($_SERVER['SCRIPT_NAME']))? $v : $v.'/') );
// all writable directories go here.
define('FP_CONTENT', 'fp-content/'); // must be chmodded to 0777
define('BLOG_BASEURL', $serverport . $_SERVER['HTTP_HOST'] . BLOG_ROOT);
// blog configurations files
define('CONFIG_DIR', FP_CONTENT . 'config/'); // must be chmodded to 0777
define('CONFIG_FILE', CONFIG_DIR . 'settings.conf.php');
//
// OWASP - Browser Cache - How can the browser cache be used in attacks?
// https://www.owasp.org/index.php/OWASP_Application_Security_FAQ#How_can_the_browser_cache_be_used_in_attacks.3F
//
// http://stackoverflow.com/questions/13640109/how-to-prevent-browser-cache-for-php-site
//
header('Expires: Sun, 01 Jan 2015 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
//
// http://de.wikipedia.org/wiki/Liste_der_HTTP-Headerfelder
//
header('X-Frame-Options: SAMEORIGIN');
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
/**
*
* @deprecated as of FlatPress 1.2 - still here only to be able to update pre-1.2 credentials
*/
define('HASHSALT_FILE', CONFIG_DIR . 'hashsalt.conf.php');
define('CONFIG_DEFAULT', FP_DEFAULTS . 'settings-defaults.php');
define('USERS_DIR', FP_CONTENT . 'users/');
// here we'll store all your entries, comments, static pages and blocks
// comments are stored automatically in subdirs of the dir CONTENT_DIR
define('CONTENT_DIR', FP_CONTENT . 'content/');
// define('BLOCKS_DIR', CONTENT_DIR . 'blocks/');
// !!! CRITICAL !!!
// all includes file
define('FP_INCLUDES', 'fp-includes/');
// core include scripts
define('INCLUDES_DIR', FP_INCLUDES . 'core/');
// smarty engine
define('SMARTY_DIR', ABS_PATH . FP_INCLUDES . 'smarty/');
define('FP_INTERFACE', 'fp-interface/');
// theme dir
define('THEMES_DIR', FP_INTERFACE . 'themes/');
// language files
define('LANG_DIR', FP_INTERFACE . 'lang/');
// misc forms
define('SHARED_TPLS', ABS_PATH . FP_INTERFACE . 'sharedtpls/');
// here is where all plugins are saved
define('PLUGINS_DIR', 'fp-plugins/');
define('ADMIN_DIR', 'admin/');
// cache file name and path.
define('CACHE_DIR', FP_CONTENT . 'cache/');
define('CACHE_FILE', '%%cached_list.php');
define('INDEX_DIR', FP_CONTENT . 'index/');
define('LOCKFILE', FP_CONTENT . '%%setup.lock');
// these will be probably moved soon to plugins
// here is where all the uploaded images will be saved
define('IMAGES_DIR', FP_CONTENT . 'images/');
// here is where all the attachments will be saved
define('ATTACHS_DIR', FP_CONTENT . 'attachs/');
define('LANG_DEFAULT', 'en-us');
define('BPT_SORT', SORT_DESC);
set_include_path(ABS_PATH);
//
// original Flatpress 1.0.3 coding disabled
//
// compatibility with ISS
// if (!isset($_SERVER['REQUEST_URI']))
// $_SERVER['REQUEST_URI'] = 'http://localhost/flatpress/';
// #define('BLOG_ROOT', dirname($_SERVER['PHP_SELF']) . '/');
// define('BLOG_ROOT', ('/'==($v=dirname($_SERVER['SCRIPT_NAME']))? $v : $v.'/') );
// define('BLOG_BASEURL', 'http://'.$_SERVER['HTTP_HOST']. BLOG_ROOT);
//
// Adding security and HTTPS support
//
ini_set('session.cookie_httponly', 1);
ini_set('session.use_only_cookies', 1);
if (isset($_SERVER ['HTTPS'])) {
$_SERVER ['HTTPS'] = htmlspecialchars($_SERVER ['HTTPS'], ENT_QUOTES, "UTF-8");
}
$serverport = "false";
// Unterstützung für Apache und IIS
if (isset($_SERVER ['HTTPS']) && ($_SERVER ['HTTPS'] == '1' || strtolower($_SERVER ['HTTPS']) == 'on')) {
$serverport = "https://";
// Uses a secure connection (HTTPS) if possible
ini_set('session.cookie_secure', 1);
} else {
$serverport = "http://";
}
// compatibility with ISS
$_SERVER ["REQUEST_URI"] = htmlspecialchars($_SERVER ["REQUEST_URI"], ENT_QUOTES, "UTF-8");
if (!isset($_SERVER ['REQUEST_URI']))
$_SERVER ['REQUEST_URI'] = $serverport . 'localhost/flatpress/';
// define('BLOG_ROOT', dirname($_SERVER['PHP_SELF']) . '/');
define('BLOG_ROOT', ('/' == ($v = dirname($_SERVER ['SCRIPT_NAME'])) ? $v : $v . '/'));
define('BLOG_BASEURL', $serverport . $_SERVER ['HTTP_HOST'] . BLOG_ROOT);
//
// OWASP - Browser Cache - How can the browser cache be used in attacks?
// https://www.owasp.org/index.php/OWASP_Application_Security_FAQ#How_can_the_browser_cache_be_used_in_attacks.3F
//
// http://stackoverflow.com/questions/13640109/how-to-prevent-browser-cache-for-php-site
//
header('Expires: Sun, 01 Jan 2015 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
//
// http://de.wikipedia.org/wiki/Liste_der_HTTP-Headerfelder
//
header('X-Frame-Options: SAMEORIGIN');
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
//
// End of send header
//

View File

@ -1,58 +1,60 @@
<?php
<?php
// fileio.php
// low-level io-handling functions
function io_write_file($filename, $data) {
@umask(0);
$dir = dirname($filename);
if (fs_mkdir($dir)) {
$f = fopen($filename, "w");
if ($f) {
if (!flock($f, LOCK_EX))
return -1;
$length = strlen($data);
$done = fwrite($f, $data);
flock($f, LOCK_UN);
fclose($f);
@chmod($filename, FILE_PERMISSIONS);
//returns true on success
// fileio.php
// low-level io-handling functions
function io_write_file($filename, $data) {
@umask(0);
$dir = dirname($filename);
if (fs_mkdir($dir)) {
$f = fopen($filename, "w");
if ($f) {
return($length == $done);
}
if (!flock($f, LOCK_EX))
return -1;
$length = strlen($data);
$done = fwrite($f, $data);
flock($f, LOCK_UN);
fclose($f);
@chmod($filename, FILE_PERMISSIONS);
// returns true on success
return ($length == $done);
}
return false;
}
function io_load_file($filename) {
if (file_exists($filename)) {
if (function_exists('file_get_contents'))
return file_get_contents($filename);
$f = fopen($filename, "r");
if ($f) {
if (!flock($f, LOCK_SH))
return -1;
$contents = fread($f, filesize($filename));
flock($f, LOCK_UN);
fclose($f);
//returns contents as string on success
return($contents);
}
}
//trigger_error("io_load_file: $filename does not exists", E_USER_ERROR);
return false;
}
function io_load_file($filename) {
if (file_exists($filename)) {
if (function_exists('file_get_contents'))
return file_get_contents($filename);
$f = fopen($filename, "r");
if ($f) {
if (!flock($f, LOCK_SH))
return -1;
$contents = fread($f, filesize($filename));
flock($f, LOCK_UN);
fclose($f);
// returns contents as string on success
return ($contents);
}
}
// trigger_error("io_load_file: $filename does not exists", E_USER_ERROR);
return false;
}
function io_delete_file($filename) {
if (!file_exists($filename)) {
return false;
}
}
return unlink($filename);
}

File diff suppressed because it is too large Load Diff

View File

@ -243,8 +243,7 @@
'title' => $plugin,
'description' => $description,
'author' => $author,
'version' => $version,
'template' => $template[1]
'version' => $version
)
);

View File

@ -68,7 +68,7 @@ function system_hashsalt_save($force = false) {
return true;
}
define('SYSTEM_VER', '1.2.dev');
define('SYSTEM_VER', '1.2.beta1');
function system_ver() {
return 'fp-' . SYSTEM_VER;
@ -216,8 +216,10 @@ function system_geterr($module = '') {
/* delayed print */
function system_dpr($action, $content) {
$p = print_r($content, 1);
$f = create_function('', "echo '<pre style=\'position:absolute\'>$p</pre>';");
add_action($action, $f);
add_action($action, function () use ($p) {
echo "<pre style='position:absolute'>$p</pre>";
});
}
?>

View File

@ -383,7 +383,10 @@ function theme_def_feed_comments_link($str, $feed, $id) {
return BLOG_BASEURL . "?x=entry:$id;comments:1;feed:{$feed}";
}
function theme_comments_feed_link($feed = 'rss2', $id) {
function theme_comments_feed_link($feed, $id) {
if (empty($feed)) {
$feed = 'rss2';
}
return apply_filters('post_comments_feed_link', '', $feed, $id);
}

View File

@ -31,24 +31,39 @@ function user_list() {
}
function user_pwd($userid, $pwd) {
return wp_hash($userid . $pwd);
return password_hash($userid . $pwd, PASSWORD_DEFAULT);
}
function user_login($userid, $pwd, $params = null) {
global $loggedin;
$loggedin = false;
// get user data
$user = user_get($userid);
// user not found? get outta here
if (!isset($user) || !isset($user ['password'])) {
return $loggedin;
}
if (user_pwd($userid, $pwd) == $user ['password']) {
// check the password
if (password_verify($userid . $pwd, $user ['password'])) {
$loggedin = true;
} //
// for FP instances updated from 1.1 to 1.2: check password the old-fashioned way (with wp_hash() which uses md5)
elseif (wp_hash($userid . $pwd) == $user ['password']) {
$loggedin = true;
// re-hash password with current algorithm, ...
$user ['password'] = $pwd;
// ... save in user file ...
user_add($user);
// ... and update user data from re-read user file
$user = user_get($userid);
}
if ($loggedin) {
// session_regenerate_id();
$expire = time() + 31536000;
setcookie(USER_COOKIE, $userid, $expire, COOKIEPATH, COOKIE_DOMAIN);
setcookie(PASS_COOKIE, $user ['password'], $expire, COOKIEPATH, COOKIE_DOMAIN);
}
@ -116,5 +131,3 @@ function user_add($user) {
return system_save(USERS_DIR . $user ['userid'] . ".php", compact('user'));
}
?>

View File

@ -1,174 +1,142 @@
<?php
<?php
/**
* Block-Managing Functions
*/
class widget_indexer extends fs_filelister {
var $_varname = 'fp_widgets';
var $_enabledlist = null;
function __construct() {
if (!file_exists(CONFIG_DIR. 'widgets.conf.php'))
trigger_error('widgets.conf.php not found. Blog may not work as expected, create a widgetlist.conf.php
/**
* Block-Managing Functions
*/
class widget_indexer extends fs_filelister {
var $_varname = 'fp_widgets';
var $_enabledlist = null;
function __construct() {
if (!file_exists(CONFIG_DIR . 'widgets.conf.php'))
trigger_error('widgets.conf.php not found. Blog may not work as expected, create a widgetlist.conf.php
or reinstall completely FlatPress. If you have just installed FlatPress, the package you
downloaded may be corrupted.', E_USER_WARNING);
$this->_enabledlist = CONFIG_DIR . 'widgets.conf.php';
$this->getEnableds();
}
function getEnableds() {
if (!file_exists($this->_enabledlist))
return;
include($this->_enabledlist);
$this->_list = ${$this->_varname};
}
function hasMore($hor) {
return is_array($this->_list[$hor]) && (current($this->_list[$hor]) !== false);
}
function get($hor) {
global $fp_registered_widgets;
do {
$content = array();
$id = array_shift($this->_list[$hor]);
$newid=$id;# @list($newid, $params) = explode(":", $id);
if (@$params) $params = explode(',', $params); else $params = array();
// $var = 'plugin_' . $newid . '_widget';
$var = $fp_registered_widgets[ $newid ]['func'];
if (is_callable($var)) {
$content = call_user_func_array($var, $params);
if (!isset($content['id'])) {
$content['id'] = "widget-$newid";
}
} /*
else $content = array(
'subject' => "Sidebar::Error",
'content' => "<ul class=\"widget-error\"><li>No $var function found for plugin $newid.
Plugin may not have been loaded.
Verify whether it is enabled.</li></ul>",
);
*/
} while(!$content && $id);
return array_change_key_case($content, CASE_LOWER);
}
$this->_enabledlist = CONFIG_DIR . 'widgets.conf.php';
$this->getEnableds();
}
function register_widgetset($widgetset) {
global $fp_registered_widgetsets;
if (!$fp_registered_widgetsets) {
$fp_registered_widgetsets = array();
}
if (!in_array($widgetset, $fp_registered_widgetsets))
$fp_registered_widgetsets[] = $widgetset;
function getEnableds() {
if (!file_exists($this->_enabledlist))
return;
include ($this->_enabledlist);
$this->_list = ${$this->_varname};
}
function get_registered_widgetsets($widgetset) {
global $fp_registered_widgetsets;
if (!$fp_registered_widgetsets) {
$fp_registered_widgetsets = array();
}
return $fp_registered_widgetsets;
function hasMore($hor) {
return array_key_exists($hor, $this->_list) && is_array($this->_list [$hor]) && (current($this->_list [$hor]) !== false);
}
function register_widget(
$widgetid, // widget id
$widgetname, // name to show
$widget_func, // function/method to call
$num_params = 0, // number of eventually needed parameters
// -1 means optional,
// 0 means no parameters
// each N>0 means *at least* N parameters
$limit_params_to=array()// indexed array of arrays, containing
// allowed parameters (not impl.)
) {
function get($hor) {
global $fp_registered_widgets;
if (!$fp_registered_widgets)
$fp_registered_widgets = array();
/* we won't mind about collisions, for now */
$fp_registered_widgets[$widgetid] = array(
'name' => $widgetname,
'func' => $widget_func,
'nparams'=> $num_params,
//'needed'=> $params_needed,
'params'=> $limit_params_to
);
}
function get_registered_widgets($widget=null) {
global $fp_registered_widgets;
if (!$fp_registered_widgets)
$fp_registered_widgets = array();
ksort($fp_registered_widgets);
if ($widget)
return isset($fp_registered_widgets[$widget])?
$fp_registered_widgets[$widget]
:
false;
return $fp_registered_widgets;
do {
$content = array();
$id = array_shift($this->_list [$hor]);
$newid = $id; // @list($newid, $params) = explode(":", $id);
if (@$params)
$params = explode(',', $params);
else
$params = array();
// $var = 'plugin_' . $newid . '_widget';
$var = $fp_registered_widgets [$newid] ['func'];
if (is_callable($var)) {
$content = call_user_func_array($var, $params);
if (!isset($content ['id'])) {
$content ['id'] = "widget-$newid";
}
} /*
* else $content = array(
* 'subject' => "Sidebar::Error",
* 'content' => "<ul class=\"widget-error\"><li>No $var function found for plugin $newid.
* Plugin may not have been loaded.
* Verify whether it is enabled.</li></ul>",
* );
*/
} while (!$content && $id);
return array_change_key_case($content, CASE_LOWER);
}
}
function register_widgetset($widgetset) {
global $fp_registered_widgetsets;
if (!$fp_registered_widgetsets) {
$fp_registered_widgetsets = array();
}
function smarty_block_widgets($params, $content, &$smarty, &$repeat) {
global $fp_widgets;
if($repeat = $fp_widgets->hasMore(($params['pos']))) {
$entry = $fp_widgets->get(($params['pos']));
$smarty->assign($entry);
}
if (!in_array($widgetset, $fp_registered_widgetsets))
$fp_registered_widgetsets [] = $widgetset;
}
return $content;
}
$smarty->register_block('widgets','smarty_block_widgets');
function get_registered_widgetsets($widgetset) {
global $fp_registered_widgetsets;
if (!$fp_registered_widgetsets) {
$fp_registered_widgetsets = array();
}
return $fp_registered_widgetsets;
}
function register_widget($widgetid, // widget id
$widgetname, // name to show
$widget_func, // function/method to call
$num_params = 0, // number of eventually needed parameters
// -1 means optional,
// 0 means no parameters
// each N>0 means *at least* N parameters
$limit_params_to = array()) // indexed array of arrays, containing
// allowed parameters (not impl.)
{
global $fp_registered_widgets;
if (!$fp_registered_widgets)
$fp_registered_widgets = array();
/* we won't mind about collisions, for now */
$fp_registered_widgets [$widgetid] = array(
'name' => $widgetname,
'func' => $widget_func,
'nparams' => $num_params,
// 'needed'=> $params_needed,
'params' => $limit_params_to
);
}
function get_registered_widgets($widget = null) {
global $fp_registered_widgets;
if (!$fp_registered_widgets)
$fp_registered_widgets = array();
ksort($fp_registered_widgets);
if ($widget)
return isset($fp_registered_widgets [$widget]) ? $fp_registered_widgets [$widget] : false;
return $fp_registered_widgets;
}
function smarty_block_widgets($params, $content, &$smarty, &$repeat) {
global $fp_widgets;
if ($repeat = $fp_widgets->hasMore(($params ['pos']))) {
$entry = $fp_widgets->get(($params ['pos']));
$smarty->assign($entry);
}
return $content;
}
$smarty->register_block('widgets', 'smarty_block_widgets');
?>

View File

@ -1,488 +1,500 @@
<?php
/* These functions can be replaced via plugins. They are loaded after
plugins are loaded. */
function _get_nextprev_link($nextprev) {
global $fpdb;
$q =& $fpdb->getQuery();
list($caption, $id) = call_user_func(array(&$q, 'get'.$nextprev));
if (!$id)
return null;
if ($q->single) {
$link = "?entry={$id}";
} else {
if ($_SERVER['QUERY_STRING']){
if ( strpos($_SERVER['QUERY_STRING'], 'paged')!==false ){
$link = '?'.preg_replace(
'{paged=[0-9]+}',
"paged={$id}",
$_SERVER['QUERY_STRING']
);
} else {
$link = '?' . $_SERVER['QUERY_STRING'] . "&paged={$id}";
}
$link = str_replace('&', '&amp;', $link);
} else {
$link = "?paged={$id}";
}
}
return array($caption, BLOG_BASEURL . $link);
}
if (!function_exists('get_nextpage_link')) :
function get_nextpage_link() {
global $fpdb;
$q =& $fpdb->getQuery();
$a = _get_nextprev_link('NextPage');
if ($q->single) {
$a[0] .= ' &raquo; ';
}
return $a;
}
endif;
if (!function_exists('get_prevpage_link')) :
function get_prevpage_link() {
global $fpdb;
$q =& $fpdb->getQuery();
$a = _get_nextprev_link('PrevPage');
if ($q->single) {
$a[0] = ' &laquo; ' . $a[0];
}
return $a;
}
endif;
function wp_filter_kses($str) {
return $str;
}
//----------------------------------------------------------------------------
// WordPress pluggable functions
//----------------------------------------------------------------------------
/*
get_currentuserinfo()
Grabs the information of the current logged in user, if there is one. Essentially a
wrapper for get_userdata(), but it also stores information in global variables.
get_userdata($userid)
Pulls user information for the specified user from the database.
get_userdatabylogin($user_login)
Pulls user information for the specified user from the database.
wp_mail($to, $subject, $message, $headers = '')
A convenient wrapper for PHP's mail function.
wp_login($username, $password, $already_md5 = false)
Returns true if the specified username and password correspond to a registered
user.
auth_redirect()
If a user is not logged in, he or she will be redirected to WordPress' login page before
being allowed to access content on the page from which this function was called.
Upon sucessfully logging in, the user is sent back to the page in question.
wp_redirect($location)
Redirects a browser to the absolute URI specified by the $location parameter.
wp_setcookie($username, $password, $already_md5 = false, $home =
'', $siteurl = '')
Sets the WordPress cookies for a logged in user. See WordPress Cookies.
wp_clearcookie()
Clears the cookies for a logged in user. See WordPress Cookies.
wp_notify_postauthor($comment_id, $comment_type='')
Emails the author of the comment's post the content of the comment specified.
wp_notify_moderator($comment_id)
Informs the administrative email account that the comment specified needs to be
moderated. See General Options SubPanel.
*/
if ( !function_exists('get_currentuserinfo') ) :
function get_currentuserinfo() {
/* global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $user_identity;
// *** retrieving user's data from cookies and db - no spoofing
if (isset($_COOKIE['wordpressuser_' . COOKIEHASH]))
$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
$userdata = get_userdatabylogin($user_login);
$user_level = $userdata->user_level;
$user_ID = $userdata->ID;
$user_nickname = $userdata->user_nickname;
$user_email = $userdata->user_email;
$user_url = $userdata->user_url;
$user_pass_md5 = md5($userdata->user_pass);
$idmode = $userdata->user_idmode;
if ($idmode == 'nickname') $user_identity = $userdata->user_nickname;
if ($idmode == 'login') $user_identity = $userdata->user_login;
if ($idmode == 'firstname') $user_identity = $userdata->user_firstname;
if ($idmode == 'lastname') $user_identity = $userdata->user_lastname;
if ($idmode == 'namefl') $user_identity = $userdata->user_firstname.' '.$userdata->user_lastname;
if ($idmode == 'namelf') $user_identity = $userdata->user_lastname.' '.$userdata->user_firstname;
if (!$idmode) $user_identity = $userdata->user_nickname;
*/
}
endif;
if ( !function_exists('get_userdata') ) :
function get_userdata($userid) {
/* global $wpdb, $cache_userdata;
$userid = (int) $userid;
if ( empty($cache_userdata[$userid]) && $userid != 0) {
$cache_userdata[$userid] = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID = $userid");
$cache_userdata[$cache_userdata[$userid]->user_login] =& $cache_userdata[$userid];
}
return $cache_userdata[$userid];
*/
}
endif;
if ( !function_exists('get_userdatabylogin') ) :
function get_userdatabylogin($user_login) {
/* global $cache_userdata, $wpdb;
if ( !empty($user_login) && empty($cache_userdata[$user_login]) ) {
$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'"); // todo: get rid of this intermediate var
$cache_userdata[$user->ID] = $user;
$cache_userdata[$user_login] =& $cache_userdata[$user->ID];
} else {
$user = $cache_userdata[$user_login];
}
return $user;
*/
}
endif;
if ( !function_exists('wp_mail') ) :
function wp_mail($to, $subject, $message, $headers = '') {
if( $headers == '' ) {
$headers = "MIME-Version: 1.0\n" .
"From: " . get_settings('admin_email') . "\n" .
"Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
}
return @mail($to, $subject, $message, $headers);
}
endif;
if ( !function_exists('wp_login') ) :
function wp_login($username, $password, $already_md5 = false) {
/* global $wpdb, $error;
if ( !$username )
return false;
if ( !$password ) {
$error = __('<strong>Error</strong>: The password field is empty.');
return false;
}
$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
if (!$login) {
$error = __('<strong>Error</strong>: Wrong username.');
return false;
} else {
// If the password is already_md5, it has been double hashed.
// Otherwise, it is plain text.
if ( ($already_md5 && $login->user_login == $username && md5($login->user_pass) == $password) || ($login->user_login == $username && $login->user_pass == md5($password)) ) {
return true;
} else {
$error = __('<strong>Error</strong>: Incorrect password.');
$pwd = '';
return false;
}
}
*/
}
endif;
if ( !function_exists('auth_redirect') ) :
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
/* if ( (!empty($_COOKIE['wordpressuser_' . COOKIEHASH]) &&
!wp_login($_COOKIE['wordpressuser_' . COOKIEHASH], $_COOKIE['wordpresspass_' . COOKIEHASH], true)) ||
(empty($_COOKIE['wordpressuser_' . COOKIEHASH])) ) {
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
exit();
}
*/
}
endif;
// Cookie safe redirect. Works around IIS Set-Cookie bug.
// http://support.microsoft.com/kb/q176113/
if ( !function_exists('wp_redirect') ) :
function wp_redirect($location, $status = 302) {
global $is_IIS;
$location = apply_filters('wp_redirect', $location, $status);
if ( !$location ) // allows the wp_redirect filter to cancel a redirect
return false;
$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
# $location = wp_kses_no_null($location);
$location = preg_replace('/\0+/', '', $location);
$location = preg_replace('/(\\\\0)+/', '', $location);
$strip = array('%0d', '%0a');
$location = str_replace($strip, '', $location);
if ( $is_IIS ) {
header("Refresh: 0;url=$location");
} else {
if ( php_sapi_name() != 'cgi-fcgi' )
utils_status_header($status); // This causes problems on IIS and some FastCGI setups
header("Location: $location");
}
}
endif;
if ( !function_exists('wp_setcookie') ) :
function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') {
if ( !$already_md5 )
$password = md5( md5($password) ); // Double hash the password in the cookie.
if ( empty($home) )
$cookiepath = COOKIEPATH;
else
$cookiepath = preg_replace('|https?://[^/]+|i', '', $home . '/' );
if ( empty($siteurl) ) {
$sitecookiepath = SITECOOKIEPATH;
$cookiehash = COOKIEHASH;
} else {
$sitecookiepath = preg_replace('|https?://[^/]+|i', '', $siteurl . '/' );
$cookiehash = md5($siteurl);
}
setcookie('wordpressuser_'. $cookiehash, $username, time() + 31536000, $cookiepath);
setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $cookiepath);
if ( $cookiepath != $sitecookiepath ) {
setcookie('wordpressuser_'. $cookiehash, $username, time() + 31536000, $sitecookiepath);
setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $sitecookiepath);
}
}
endif;
if ( !function_exists('wp_clearcookie') ) :
function wp_clearcookie() {
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
}
endif;
if ( !function_exists('check_admin_referer') ) :
function check_admin_referer($action = -1) {
$adminurl = BLOG_BASEURL . 'admin.php';
$referer = strtolower(wp_get_referer());
if ( !wp_verify_nonce(@$_REQUEST['_wpnonce'], $action) &&
!(-1 == $action && strstr($referer, $adminurl)) ) {
wp_nonce_ays($action);
die();
}
do_action('check_admin_referer', $action);
}
endif;
if ( !function_exists('wp_verify_nonce') ) :
function wp_verify_nonce($nonce, $action = -1) {
$user = user_get();
$uid = $user['userid'];
$i = ceil(time() / 43200);
//Allow for expanding range, but only do one check if we can
if( substr(wp_hash($i . $action . $uid), -12, 10) == $nonce || substr(wp_hash(($i - 1) . $action . $uid), -12, 10) == $nonce )
return true;
return false;
}
endif;
if ( !function_exists('wp_create_nonce') ) :
function wp_create_nonce($action = -1) {
$user = user_get();
$uid = $user['userid'];
$i = ceil(time() / 43200);
return substr(wp_hash($i . $action . $uid), -12, 10);
}
endif;
if ( !function_exists('wp_salt') ) :
function wp_salt() {
global $fp_config;
static $salt = null;
if (!$salt) {
@include(HASHSALT_FILE);
if (!$fp_hashsalt)
trigger_error('Cannot load hash salt: reinstall FlatPress', E_USER_ERROR);
$salt = $fp_hashsalt;
}
return $salt;
}
endif;
if ( !function_exists('wp_hash') ) :
function wp_hash($data) {
$salt = wp_salt();
return md5($data . $salt);
}
endif;
if ( ! function_exists('wp_notify_postauthor') ) :
function wp_notify_postauthor($comment_id, $comment_type='') {
/* global $wpdb;
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1");
if ('' == $user->user_email) return false; // If there's no email to send the comment to
$comment_author_domain = gethostbyaddr($comment->comment_author_IP);
$blogname = get_settings('blogname');
if ( empty( $comment_type ) ) $comment_type = 'comment';
if ('comment' == $comment_type) {
$notify_message = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
$notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
$notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
$notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= __('You can see all comments on this post here: ') . "\r\n";
$subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
} elseif ('trackback' == $comment_type) {
$notify_message = sprintf( __('New trackback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
$notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
$notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n";
$subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
} elseif ('pingback' == $comment_type) {
$notify_message = sprintf( __('New pingback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
$notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
$notify_message .= __('Excerpt: ') . "\r\n" . sprintf( __('[...] %s [...]'), $comment->comment_content ) . "\r\n\r\n";
$notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n";
$subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
}
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
$notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
if ('' == $comment->comment_author_email || '' == $comment->comment_author) {
$from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>';
} else {
$from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>";
}
$notify_message = apply_filters('comment_notification_text', $notify_message);
$subject = apply_filters('comment_notification_subject', $subject);
$message_headers = apply_filters('comment_notification_headers', $message_headers);
$message_headers = "MIME-Version: 1.0\n"
. "$from\n"
. "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
@wp_mail($user->user_email, $subject, $notify_message, $message_headers);
return true;
*/
}
endif;
/* wp_notify_moderator
notifies the moderator of the blog (usually the admin)
about a new comment that waits for approval
always returns true
/*
* These functions can be replaced via plugins. They are loaded after
* plugins are loaded.
*/
if ( !function_exists('wp_notify_moderator') ) :
function wp_notify_moderator($comment_id) {
/* global $wpdb;
function _get_nextprev_link($nextprev) {
global $fpdb;
$q = & $fpdb->getQuery();
if( get_settings( "moderation_notify" ) == 0 )
return true;
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
list ($caption, $id) = call_user_func(array(
&$q,
'get' . $nextprev
));
$comment_author_domain = gethostbyaddr($comment->comment_author_IP);
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
if (!$id)
return null;
$notify_message = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
$notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
$notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
$notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
$notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= sprintf( __('To approve this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
$notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
$notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";
$notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
if ($q->single) {
$link = "?entry={$id}";
} else {
if ($_SERVER ['QUERY_STRING']) {
$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title );
$admin_email = get_settings("admin_email");
if (strpos($_SERVER ['QUERY_STRING'], 'paged') !== false) {
$link = '?' . preg_replace('{paged=[0-9]+}', "paged={$id}", $_SERVER ['QUERY_STRING']);
} else {
$link = '?' . $_SERVER ['QUERY_STRING'] . "&paged={$id}";
}
$link = str_replace('&', '&amp;', $link);
} else {
$link = "?paged={$id}";
}
}
$notify_message = apply_filters('comment_moderation_text', $notify_message);
$subject = apply_filters('comment_moderation_subject', $subject);
@wp_mail($admin_email, $subject, $notify_message);
return true;
*/
return array(
$caption,
BLOG_BASEURL . $link
);
}
if (!function_exists('get_nextpage_link')) :
function get_nextpage_link() {
global $fpdb;
$q = & $fpdb->getQuery();
$a = _get_nextprev_link('NextPage');
if ($q->single) {
$a [0] .= ' &raquo; ';
}
return $a;
}
endif;
if (!function_exists('get_prevpage_link')) :
function get_prevpage_link() {
global $fpdb;
$q = & $fpdb->getQuery();
$a = _get_nextprev_link('PrevPage');
if ($q->single) {
$a [0] = ' &laquo; ' . $a [0];
}
return $a;
}
endif;
function wp_filter_kses($str) {
return $str;
}
// ----------------------------------------------------------------------------
// WordPress pluggable functions
// ----------------------------------------------------------------------------
/*
* get_currentuserinfo()
* Grabs the information of the current logged in user, if there is one. Essentially a
* wrapper for get_userdata(), but it also stores information in global variables.
* get_userdata($userid)
* Pulls user information for the specified user from the database.
* get_userdatabylogin($user_login)
* Pulls user information for the specified user from the database.
* wp_mail($to, $subject, $message, $headers = '')
* A convenient wrapper for PHP's mail function.
* wp_login($username, $password, $already_md5 = false)
* Returns true if the specified username and password correspond to a registered
* user.
* auth_redirect()
* If a user is not logged in, he or she will be redirected to WordPress' login page before
* being allowed to access content on the page from which this function was called.
* Upon sucessfully logging in, the user is sent back to the page in question.
* wp_redirect($location)
* Redirects a browser to the absolute URI specified by the $location parameter.
* wp_setcookie($username, $password, $already_md5 = false, $home =
* '', $siteurl = '')
* Sets the WordPress cookies for a logged in user. See WordPress Cookies.
* wp_clearcookie()
* Clears the cookies for a logged in user. See WordPress Cookies.
* wp_notify_postauthor($comment_id, $comment_type='')
* Emails the author of the comment's post the content of the comment specified.
* wp_notify_moderator($comment_id)
* Informs the administrative email account that the comment specified needs to be
* moderated. See General Options SubPanel.
*/
if (!function_exists('get_currentuserinfo')) :
function get_currentuserinfo() {
/*
* global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $user_identity;
* // *** retrieving user's data from cookies and db - no spoofing
*
* if (isset($_COOKIE['wordpressuser_' . COOKIEHASH]))
* $user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
* $userdata = get_userdatabylogin($user_login);
* $user_level = $userdata->user_level;
* $user_ID = $userdata->ID;
* $user_nickname = $userdata->user_nickname;
* $user_email = $userdata->user_email;
* $user_url = $userdata->user_url;
* $user_pass_md5 = md5($userdata->user_pass);
*
* $idmode = $userdata->user_idmode;
* if ($idmode == 'nickname') $user_identity = $userdata->user_nickname;
* if ($idmode == 'login') $user_identity = $userdata->user_login;
* if ($idmode == 'firstname') $user_identity = $userdata->user_firstname;
* if ($idmode == 'lastname') $user_identity = $userdata->user_lastname;
* if ($idmode == 'namefl') $user_identity = $userdata->user_firstname.' '.$userdata->user_lastname;
* if ($idmode == 'namelf') $user_identity = $userdata->user_lastname.' '.$userdata->user_firstname;
* if (!$idmode) $user_identity = $userdata->user_nickname;
*/
}
endif;
if (!function_exists('get_userdata')) :
function get_userdata($userid) {
/*
* global $wpdb, $cache_userdata;
* $userid = (int) $userid;
* if ( empty($cache_userdata[$userid]) && $userid != 0) {
* $cache_userdata[$userid] = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID = $userid");
* $cache_userdata[$cache_userdata[$userid]->user_login] =& $cache_userdata[$userid];
* }
*
* return $cache_userdata[$userid];
*/
}
endif;
if (!function_exists('get_userdatabylogin')) :
function get_userdatabylogin($user_login) {
/*
* global $cache_userdata, $wpdb;
* if ( !empty($user_login) && empty($cache_userdata[$user_login]) ) {
* $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'"); // todo: get rid of this intermediate var
* $cache_userdata[$user->ID] = $user;
* $cache_userdata[$user_login] =& $cache_userdata[$user->ID];
* } else {
* $user = $cache_userdata[$user_login];
* }
* return $user;
*/
}
endif;
if (!function_exists('wp_mail')) :
function wp_mail($to, $subject, $message, $headers = '') {
if ($headers == '') {
$headers = "MIME-Version: 1.0\n" . "From: " . get_settings('admin_email') . "\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
}
return @mail($to, $subject, $message, $headers);
}
endif;
if (!function_exists('wp_login')) :
function wp_login($username, $password, $already_md5 = false) {
/*
* global $wpdb, $error;
*
* if ( !$username )
* return false;
*
* if ( !$password ) {
* $error = __('<strong>Error</strong>: The password field is empty.');
* return false;
* }
*
* $login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
*
* if (!$login) {
* $error = __('<strong>Error</strong>: Wrong username.');
* return false;
* } else {
* // If the password is already_md5, it has been double hashed.
* // Otherwise, it is plain text.
* if ( ($already_md5 && $login->user_login == $username && md5($login->user_pass) == $password) || ($login->user_login == $username && $login->user_pass == md5($password)) ) {
* return true;
* } else {
* $error = __('<strong>Error</strong>: Incorrect password.');
* $pwd = '';
* return false;
* }
* }
*/
}
endif;
if (!function_exists('auth_redirect')) :
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
/*
* if ( (!empty($_COOKIE['wordpressuser_' . COOKIEHASH]) &&
* !wp_login($_COOKIE['wordpressuser_' . COOKIEHASH], $_COOKIE['wordpresspass_' . COOKIEHASH], true)) ||
* (empty($_COOKIE['wordpressuser_' . COOKIEHASH])) ) {
* header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
* header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
* header('Cache-Control: no-cache, must-revalidate, max-age=0');
* header('Pragma: no-cache');
*
* header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
* exit();
* }
*/
}
endif;
// Cookie safe redirect. Works around IIS Set-Cookie bug.
// http://support.microsoft.com/kb/q176113/
if (!function_exists('wp_redirect')) :
function wp_redirect($location, $status = 302) {
global $is_IIS;
$location = apply_filters('wp_redirect', $location, $status);
if (!$location) // allows the wp_redirect filter to cancel a redirect
return false;
$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
// $location = wp_kses_no_null($location);
$location = preg_replace('/\0+/', '', $location);
$location = preg_replace('/(\\\\0)+/', '', $location);
$strip = array(
'%0d',
'%0a'
);
$location = str_replace($strip, '', $location);
if ($is_IIS) {
header("Refresh: 0;url=$location");
} else {
if (php_sapi_name() != 'cgi-fcgi')
utils_status_header($status); // This causes problems on IIS and some FastCGI setups
header("Location: $location");
}
}
endif;
if (!function_exists('wp_setcookie')) :
function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') {
if (!$already_md5)
$password = md5(md5($password)); // Double hash the password in the cookie.
if (empty($home))
$cookiepath = COOKIEPATH;
else
$cookiepath = preg_replace('|https?://[^/]+|i', '', $home . '/');
if (empty($siteurl)) {
$sitecookiepath = SITECOOKIEPATH;
$cookiehash = COOKIEHASH;
} else {
$sitecookiepath = preg_replace('|https?://[^/]+|i', '', $siteurl . '/');
$cookiehash = md5($siteurl);
}
setcookie('wordpressuser_' . $cookiehash, $username, time() + 31536000, $cookiepath);
setcookie('wordpresspass_' . $cookiehash, $password, time() + 31536000, $cookiepath);
if ($cookiepath != $sitecookiepath) {
setcookie('wordpressuser_' . $cookiehash, $username, time() + 31536000, $sitecookiepath);
setcookie('wordpresspass_' . $cookiehash, $password, time() + 31536000, $sitecookiepath);
}
}
endif;
if (!function_exists('wp_clearcookie')) :
function wp_clearcookie() {
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
}
endif;
if (!function_exists('check_admin_referer')) :
function check_admin_referer($action = -1) {
$adminurl = BLOG_BASEURL . 'admin.php';
$referer = strtolower(wp_get_referer());
if (!wp_verify_nonce(@$_REQUEST ['_wpnonce'], $action) && !(-1 == $action && strstr($referer, $adminurl))) {
wp_nonce_ays($action);
die();
}
do_action('check_admin_referer', $action);
}
endif;
if (!function_exists('wp_verify_nonce')) :
function wp_verify_nonce($nonce, $action = -1) {
$user = user_get();
$uid = $user ['userid'];
$i = ceil(time() / 43200);
// Allow for expanding range, but only do one check if we can
if (substr(wp_hash($i . $action . $uid), -12, 10) == $nonce || substr(wp_hash(($i - 1) . $action . $uid), -12, 10) == $nonce)
return true;
return false;
}
endif;
if (!function_exists('wp_create_nonce')) :
function wp_create_nonce($action = -1) {
$user = user_get();
$uid = $user ['userid'];
$i = ceil(time() / 43200);
return substr(wp_hash($i . $action . $uid), -12, 10);
}
endif;
if (!function_exists('wp_salt')) :
/**
*
* @return NULL|unknown
* @deprecated as of FlatPress 1.2 - still here only to be able to update pre-1.2 credentials
*/
function wp_salt() {
global $fp_config;
static $salt = null;
if (!$salt) {
@include (HASHSALT_FILE);
if (!$fp_hashsalt)
trigger_error('Cannot load hash salt: reinstall FlatPress', E_USER_ERROR);
$salt = $fp_hashsalt;
}
return $salt;
}
endif;
if (!function_exists('wp_hash')) :
/**
*
* @param unknown $data
* @return string
* @deprecated as of FlatPress 1.2 - still here only to be able to update pre-1.2 credentials
*/
function wp_hash($data) {
$salt = wp_salt();
return md5($data . $salt);
}
endif;
if (!function_exists('wp_notify_postauthor')) :
function wp_notify_postauthor($comment_id, $comment_type = '') {
/*
* global $wpdb;
*
* $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
* $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
* $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1");
*
* if ('' == $user->user_email) return false; // If there's no email to send the comment to
*
* $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
*
* $blogname = get_settings('blogname');
*
* if ( empty( $comment_type ) ) $comment_type = 'comment';
*
* if ('comment' == $comment_type) {
* $notify_message = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
* $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
* $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
* $notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
* $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
* $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
* $notify_message .= __('You can see all comments on this post here: ') . "\r\n";
* $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
* } elseif ('trackback' == $comment_type) {
* $notify_message = sprintf( __('New trackback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
* $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
* $notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
* $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
* $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n";
* $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
* } elseif ('pingback' == $comment_type) {
* $notify_message = sprintf( __('New pingback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
* $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
* $notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
* $notify_message .= __('Excerpt: ') . "\r\n" . sprintf( __('[...] %s [...]'), $comment->comment_content ) . "\r\n\r\n";
* $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n";
* $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
* }
* $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
* $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
*
* if ('' == $comment->comment_author_email || '' == $comment->comment_author) {
* $from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>';
* } else {
* $from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>";
* }
*
* $notify_message = apply_filters('comment_notification_text', $notify_message);
* $subject = apply_filters('comment_notification_subject', $subject);
* $message_headers = apply_filters('comment_notification_headers', $message_headers);
*
* $message_headers = "MIME-Version: 1.0\n"
* . "$from\n"
* . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
*
* @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
*
* return true;
*/
}
endif;
/*
* wp_notify_moderator
* notifies the moderator of the blog (usually the admin)
* about a new comment that waits for approval
* always returns true
*/
if (!function_exists('wp_notify_moderator')) :
function wp_notify_moderator($comment_id) {
/*
* global $wpdb;
*
* if( get_settings( "moderation_notify" ) == 0 )
* return true;
*
* $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
* $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
*
* $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
* $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
*
* $notify_message = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
* $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
* $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
* $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
* $notify_message .= sprintf( __('URI : %s'), $comment->comment_author_url ) . "\r\n";
* $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
* $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
* $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
* $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
* $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";
* $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
*
* $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title );
* $admin_email = get_settings("admin_email");
*
* $notify_message = apply_filters('comment_moderation_text', $notify_message);
* $subject = apply_filters('comment_moderation_subject', $subject);
*
* @wp_mail($admin_email, $subject, $notify_message);
*
* return true;
*/
}
endif;
?>

View File

@ -1,157 +1,155 @@
<?php
/**
* Smarty plugin
* -------------------------------------------------------------
* File: function.list_categories.php
* Type: function
* Name: list_categories
* Purpose: print out the comment form
* File: function.list_categories.php
* Type: function
* Name: list_categories
* Purpose: print out the comment form
*
* @param string after
* @param string before
* -------------------------------------------------------------
* @param
* string after
* @param
* string before
* -------------------------------------------------------------
*/
function smarty_function_list_categories($params) //, &$smarty)
function smarty_function_list_categories($params) // , &$smarty)
{
$cat_params = array(
'ild'=>'<li>','ird'=>"</li>\n",
'old'=>"<ul>\n",'ord'=>"</ul>\n",
'name' => isset($params['name'])? $params['name'] : '',
'selected' => array()
);
'ild' => '<li>',
'ird' => "</li>\n",
'old' => "<ul>\n",
'ord' => "</ul>\n",
'name' => isset($params ['name']) ? $params ['name'] : '',
'selected' => array()
);
$cat_params = array_merge($cat_params, $params);
// makese 'selected' an arr
$cat_params['selected'] = (array)$params['selected'];
$cat_params ['selected'] = array_key_exists('selected', $params) ? (array) $params ['selected'] : array();
// echo "<pre>" . print_r(entry_categories_get()) . "</pre>";
//echo "<pre>" . print_r(entry_categories_get()) . "</pre>";
if (file_exists(CONTENT_DIR . 'categories.txt')) {
$cats = trim(io_load_file(CONTENT_DIR . 'categories.txt'));
$stack=array(0);
$arr=array();
$stack = array(
0
);
$arr = array();
$line36error = explode("\n", $cats);
$line35error = '<ul>'.do_print_categories_list($line36error, $stack, $arr, $cat_params).'</ul>';
$line36error = explode("\n", $cats);
$line35error = '<ul>' . do_print_categories_list($line36error, $stack, $arr, $cat_params) . '</ul>';
return $line35error;
return $line35error;
} else {
global $lang;
$content = '<a href="'.BLOG_BASEURL.'">Unfiled</a>';
if (isset($lang['admin']['entry']['publish']['nocategories']))
$content = $lang['admin']['entry']['publish']['nocategories'];
return '<ul><li>' . $content .'</li></ul>' ;
$content = '<a href="' . BLOG_BASEURL . '">Unfiled</a>';
if (isset($lang ['admin'] ['entry'] ['publish'] ['nocategories']))
$content = $lang ['admin'] ['entry'] ['publish'] ['nocategories'];
return '<ul><li>' . $content . '</li></ul>';
}
//<label><input name="cats[{$catId}]"
//{if (bool)array_intersect(array($catId),$categories) }
//checked="checked"{/if} type="checkbox" /> {$cat} </label><br />
// <label><input name="cats[{$catId}]"
// {if (bool)array_intersect(array($catId),$categories) }
// checked="checked"{/if} type="checkbox" /> {$cat} </label><br />
}
function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
global $smarty, $fpdb;
extract($params);
if (empty($lines)) {
$l = count($indentstack)-1;
if (empty($lines)) {
$l = count($indentstack) - 1;
if ($l > 0)
$arr = array_fill(0, $l, $ord.$ird);
$arr = array_fill(0, $l, $ord . $ird);
else
$arr = array();
$result = array_merge($result, $arr);
return '';
}
$str = '';
$v = reset($lines);
$vt = ltrim($v);
$str = '';
$v = reset($lines);
$vt = ltrim($v);
$indent = utils_countdashes($vt, $text);
$indent_old = end($indentstack);
$indent = utils_countdashes($vt, $text);
$indent_old = end($indentstack);
$val = explode(':', $text);
$vt = $val[0];
$vid = trim($val[1]);
$catname = $params['name'];
if ($indent > $indent_old) {
array_push($indentstack, $indent);
array_pop($result);
array_push($result, $old);
//array_push($result, $ild);
do_print_categories_list($lines, $indentstack, $result, $params);
}elseif($indent < $indent_old) {
array_pop($indentstack);
array_push($result, $ord);
$vt = $val [0];
$vid = trim($val [1]);
$catname = $params ['name'];
if ($indent > $indent_old) {
array_push($indentstack, $indent);
array_pop($result);
array_push($result, $old);
// array_push($result, $ild);
do_print_categories_list($lines, $indentstack, $result, $params);
} elseif ($indent < $indent_old) {
array_pop($indentstack);
array_push($result, $ord);
array_push($result, $ird);
do_print_categories_list($lines, $indentstack, $result, $params);
}else{
array_push($result, $ild);
$cat_entry = $params['selected'];
if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check')) {
$string = '<label><input name="'.$catname.'cats['.$vid.']" ';
if ((bool) array_intersect(array($vid), $cat_entry))
do_print_categories_list($lines, $indentstack, $result, $params);
} else {
array_push($result, $ild);
$cat_entry = $params ['selected'];
if (isset($params ['type']) && ($params ['type'] == 'form' || $params ['type'] == 'check')) {
$string = '<label><input name="' . $catname . 'cats[' . $vid . ']" ';
if ((bool) array_intersect(array(
$vid
), $cat_entry))
$string .= 'checked="checked" ';
$string .= 'type="checkbox" />';
$string .= 'type="checkbox" />';
$before = $string;
}elseif (isset($params['type']) && $params['type']=='radio') {
$string = '<label><input name="'.$catname.'cats" type="radio" value="'.$vid.'"';
if ((bool) array_intersect(array($vid), $cat_entry))
} elseif (isset($params ['type']) && $params ['type'] == 'radio') {
$string = '<label><input name="' . $catname . 'cats" type="radio" value="' . $vid . '"';
if ((bool) array_intersect(array(
$vid
), $cat_entry))
$string .= 'checked="checked" ';
$string .= ' />';
$before = $string;
}elseif(isset($params['type']) && $params['type']=='linked'){
$before = '<a href="'.get_category_link($vid).'">';
} elseif (isset($params ['type']) && $params ['type'] == 'linked') {
$before = '<a href="' . get_category_link($vid) . '">';
}
array_push($result, $before);
array_push($result, $vt);
if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check' || $params['type']=='radio')) {
array_push($result, $vt);
if (isset($params ['type']) && ($params ['type'] == 'form' || $params ['type'] == 'check' || $params ['type'] == 'radio')) {
$string = '</label>';
$after = $string;
}elseif(isset($params['type']) && $params['type']=='linked'){
$after='</a>';
if (isset($params['count']) && $params['count']) {
$index =& $fpdb->get_index($vid);
$count = ($index)? $index->length() : 0;
$after = " ($count) ". $after;
} elseif (isset($params ['type']) && $params ['type'] == 'linked') {
$after = '</a>';
if (isset($params ['count']) && $params ['count']) {
$index = & $fpdb->get_index($vid);
$count = ($index) ? $index->length() : 0;
$after = " ($count) " . $after;
}
}
array_push($result, $after);
array_push($result, $ird);
array_shift($lines);
do_print_categories_list($lines, $indentstack, $result, $params);
}
return implode($result);
array_push($result, $ird);
array_shift($lines);
do_print_categories_list($lines, $indentstack, $result, $params);
}
return implode($result);
}

View File

@ -60,7 +60,7 @@
1 => 'Beitrag wurde erfolgreich gespeichert',
-1 => 'Ein Fehler ist beim Speichern des Beitrags aufgetreten',
2 => 'Beitrag wurde erfolgreich gelöscht',
-2 => 'Ein Fehler ist beim löschen des Beitrags aufgetreten',
-2 => 'Ein Fehler ist beim löschen des Beitrags aufgetreten',
);
@ -75,7 +75,7 @@
-2 => 'Ein Fehler ist aufgetreten: Der Beitrag wurde nicht gespeichert; eventuell ist der Index beschädigt',
-3 => 'Ein Fehler ist aufgetreten: Der Beitrag wurde zur Sicherheit als Entwurf abgelegt',
-4 => 'Ein Fehler ist aufgetreten: Der Beitrag wurde zur Sicherheit als Entwurf abgelegt; möglicherweise ist der Index beschädigt worden',
'draft'=> 'Du bearbeitest gerade einen Beitrag im <strong>Entwurfs</strong> Modus'
'draft'=> 'Du bearbeitest gerade einen Beitrag im <strong>Entwurfs</strong>-Modus'
);
/* comments */
@ -83,7 +83,7 @@
$lang['admin']['entry']['commentlist'] =
array(
'head' => "Kommentare für den Beitrag: ",
'descr' => 'Bitte Kommentar auswählen, das gelöscht werden soll',
'descr' => 'Bitte Kommentar auswählen, der gelöscht werden soll',
'sel' => 'Sel',
'content' => 'Inhalt',
'date' => 'Datum',
@ -93,7 +93,7 @@
'actions' => 'Aktion',
'act_edit' => 'Bearbeiten',
'act_del' => 'Löschen',
'act_del_confirm' => 'Willst du dieses Kommentar wirklich löschen?',
'act_del_confirm' => 'Willst du diesen Kommentar wirklich löschen?',
'nocomments' => 'Dieser Beitrag enthält zur Zeit keine Kommentare.',
@ -108,7 +108,7 @@
$lang['admin']['entry']['commedit'] =
array(
'head' => "Bearbeite das Kommentar für Beitrag",
'head' => "Bearbeite den Kommentar für Beitrag",
'content' => 'Kommentarinhalt',
'date' => 'Datum',
'author' => 'Autor',
@ -123,7 +123,7 @@
$lang['admin']['entry']['commedit']['msgs'] =
array(
1 => 'Das Kommentar wurde geändert',
1 => 'Der Kommentar wurde geändert',
-1 => 'Ein Fehler ist beim Ändern des Kommentars aufgetreten',
);
@ -147,7 +147,7 @@
$lang['admin']['entry']['cats'] =
array(
'head' => 'Kategorien verwalten',
'descr' => '<p>Jede Kategorie sollte im Schema "Kategorie Name: <em>id_nummer</em>" angelegt werden. Die "<em>id_nummer</em>" ist <strong>eindeutig</strong> den Beiträgen zugeordnet, darf <strong>nicht</strong> mehr verändert werden und muss größer <strong>0</strong> sein. Der Kategorie Name hingegen kann auch später noch umbenannt werden.</p><p>Ein späteres Umstellen der Kategorienreihenfolge ist zu jeder Zeit möglich. Mit Bindestriche kann man Unterkategorien anlegen.</p>
'descr' => '<p>Jede Kategorie sollte im Schema "Kategorie Name <em>:id_nummer</em>" angelegt werden. Die "<em>id_nummer</em>" ist <strong>eindeutig</strong> den Beiträgen zugeordnet, darf <strong>nicht</strong> mehr verändert werden und muss größer <strong>0</strong> sein. Der Kategoriename hingegen kann auch später noch geändert werden.</p><p>Ein späteres Umstellen der Kategorienreihenfolge ist zu jeder Zeit möglich. Mit Bindestrichen kann man Unterkategorien anlegen.</p>
<p>Beispiel:</p>
<pre>

View File

@ -13,7 +13,7 @@
'disable' => 'Deaktivieren',
'descr' => 'Diese Verwaltung ermöglicht es <a class="hint" href="http://wiki.flatpress.org/doc:plugins" title="Was ist ein Plugin?">Plugins</a> zu aktivieren oder deaktivieren, die die Funktionalität von Flatpress sehr flexibel gestalten.</p>'.
'<p>Um ein neues Plugin in Flatpress zu integrieren, muss dieses Plugin in das Verzeichnis <code>fp-plugins/</code> '.
'hochgeladen werden. Ist ein Name und eine Beschreibung im neuen Plugin an entsprechender Stelle vorhanden, dann werden diese Texte hier mit angezeigt.',
'geladen werden. Ist ein Name und eine Beschreibung im neuen Plugin an entsprechender Stelle vorhanden, dann werden diese Texte hier mit angezeigt.',
'name' => 'Name',
'description'=>'Beschreibung',
'author' => 'Autor',
@ -23,7 +23,7 @@
$lang['admin']['plugin']['default']['msgs'] = array(
1 => 'Konfiguration gespeichert',
-1 => 'Ein Fehler ist beim speichern aufgetreten. Eventuell stimmt die Syntax des Plugins nicht.',
-1 => 'Ein Fehler ist beim Speichern aufgetreten. Eventuell stimmt die Syntax des Plugins nicht.',
);
/* system errors */

View File

@ -27,9 +27,9 @@
$lang['admin']['static']['list']['msgs'] = array(
1 => 'Statische Seite erfolgreich gespeichert',
-1 => 'Ein Fehler ist beim speichern der Seite aufgetreten',
-1 => 'Ein Fehler ist beim Speichern der Seite aufgetreten',
2 => 'Seite wurde erfolgreich gelöscht',
-2 => 'Ein Fehler ist beim löschen der Seite aufgetreten',
-2 => 'Ein Fehler ist beim Löschen der Seite aufgetreten',
);
/* write panel */
@ -37,7 +37,7 @@
$lang['admin']['static']['write'] =
array(
'head' => 'Statische Seite erstellen',
'descr' => 'Bearbeiten der Parameter um diese Seite zu erstellen',
'descr' => 'Bearbeiten der Parameter, um diese Seite zu erstellen',
'fieldset1' => 'Bearbeiten',
'subject' => 'Titel (*):',
'content' => 'Inhalt (*):',

View File

@ -19,7 +19,7 @@
$lang['admin']['uploader']['browse'] = array(
'head' => 'Durchsuchen',
'descr' => 'Datei(en) auswählen zum hochladen.',
'descr' => 'Datei(en) auswählen zum Hochladen.',
'fset1' => 'Durchsuchen',
'submit' => 'Hochladen',

View File

@ -6,9 +6,9 @@
/* default action */
$lang['admin']['widgets']['default'] = array(
'head' => 'Verwaltung Widgets (<em>experimentell</em>)',
'head' => 'Widget-Verwaltung',
'descr' => 'Flatpress hat verschiedene Widgets mit an Bord, wie zum Beispiel die Login- oder die Suchefunktion. Ein <a class="hint" '.
'descr' => 'Flatpress hat verschiedene Widgets mit an Bord, wie zum Beispiel die Login- oder die Suchfunktion. Ein <a class="hint" '.
'href="http://wiki.flatpress.org/doc:plugins" title="What is a Widget?">'.
'Widget</a> ist ein dynamisches Steuerelement eines <a class="hint" '.
'href="http://wiki.flatpress.org/doc:plugins" title="What is a plugin?">'.
@ -25,14 +25,14 @@
'themewdgsdescr' => 'In diesem Theme stehen folgende Widgets zur Verfügung',
'oldwdgs' => 'Andere Widget Sets',
'oldwdgsdescr' =>'Das folgende Widget Set scheint zu keinem der oben gelisteten '.
'Widget Sets zu gehören. Eventuell ist war es ein Teil eines anderen Themes.',
'Widget Sets zu gehören. Eventuell ist es Teil eines anderen Themes.',
'submit' => 'Änderungen speichern',
);
$lang['admin']['widgets']['default']['stdsets'] = array(
'top' => 'Top Leiste',
'top' => 'Kopfleiste',
'bottom' => 'Fussleiste',
'left' => 'Linke Leiste',
'right' => 'Rechte Leiste',

View File

@ -3,7 +3,7 @@
$lang['comments']['mail'] = <<<MAIL
Hallo %toname%,
"%fromname%" %frommail% hat ein Kommentar zu dem Thema "%entrytitle%" geschrieben.
"%fromname%" %frommail% hat einen Kommentar zu dem Thema "%entrytitle%" geschrieben.
Der Link zum diesem Kommentar:
%commentlink%

View File

@ -41,7 +41,7 @@
'fset3' => 'In Kategorien suchen',
'catdescr' => 'Es muss mindestens eine Kategorie angegeben werden.',
'fset4' => 'Suche starten',
'fset4' => 'Suche starten',
'submit' => 'Suche starten',
'headres' => 'Suchergebnisse',
@ -64,7 +64,7 @@
$lang['entry']['flags'] = array();
$lang['entry']['flags']['long'] = array(
'draft' => '<strong>Beitrag als Entwurf speichern</strong>: wird erst sichtbar nachdem er veröffentlicht wurde.',
'draft' => '<strong>Beitrag als Entwurf speichern</strong>: wird erst sichtbar, wenn er veröffentlicht wird.',
//'static' => '<strong>Static entry</strong>: normally hidden, to reach the entry put ?page=title-of-the-entry in url (experimental)',
'commslock' => '<strong>Kommentare sperren</strong>: Keine Kommentare für diesen Beitrag zulassen.'
);
@ -116,7 +116,7 @@
'email' => 'E-Mail Adresse (wird nicht veröffentlicht):',
'www' => 'Website (optional):',
'cookie' => 'Daten für das nächste Mal merken',
'fieldset2' => 'Ein Kommentar schreiben',
'fieldset2' => 'Einen Kommentar schreiben',
'comment' => 'Kommentar:',
'fieldset3' => 'Senden',
'submit' => 'Abschicken',
@ -130,7 +130,7 @@
'name' => 'Bitte einen Namen eingeben',
'email' => 'Bitte eine gültige E-Mail Adresse eingeben',
'www' => 'Bitte eine gültige URL eingeben',
'comment' => 'Bitte ein Kommentar schreiben',
'comment' => 'Bitte einen Kommentar schreiben',
);
$lang['date']['month'] = array(

View File

@ -6,7 +6,7 @@
/* default action */
$lang['admin']['widgets']['default'] = array(
'head' => 'Manage Widgets (<em>experimental</em>)',
'head' => 'Manage Widgets',
'descr' => 'A <a class="hint" '.
'href="http://wiki.flatpress.org/doc:widgets" title="What is a Widget?">'.

View File

@ -0,0 +1,72 @@
<?php
$lang['admin']['config']['default'] =
array(
'head' => 'Opciones',
'descr' => 'Personalice y configure su instalación de
FlatPress.',
'submit' => 'Guardar Cambios',
'sysfset' => 'Información general del sistema',
'syswarning' => '<big>¡Advertencia!</big> Estas informaciones son críticas y deben ser correctas,
o FlatPress (probablemente) se negará a funcionar correctamente.',
'blog_root' => '<strong>Path absoluto a flatpress</strong>. Nota:
generalmente no tendrá que editar esto, de todos modos tenga cuidado, porque no podemos
verificar si es correcto o no.',
'www' =>'<strong>Blog root</strong>. URL hacia su blog, completo con
subdirectorios. <br />
e.g.: http://www.mydomain.com/flatpress/ (trailing slash needed)',
// ------
'gensetts' => 'Configuración general',
'blogtitle' => 'Título del Blog',
'blogsubtitle' => 'Subtítulo del Blog',
'blogfooter' => 'Pie de página del Blog',
'blogauthor' => 'Autor del Blog',
'startpage' => 'La página de inicio de este sitio web es',
'stdstartpage' => 'Mi blog (predeterminado)',
'blogurl' => 'URL del Blog',
'blogemail' => 'Email del Blog',
'notifications' => 'Notificaciones',
'mailnotify' => 'Habilitar notificación por correo electrónico de los comentarios',
'blogmaxentries' => 'Número de publicaciones por página',
'langchoice' => 'Idioma',
'intsetts' => 'Configuración internacional',
'utctime' => '<acronym title="Hora Universal Coordinado">UTC</acronym> la hora es',
'timeoffset' => 'La diferencia de hora es',
'hours' => 'hours',
'timeformat' => 'Formato inicial para la hora',
'dateformat' => 'Formato inicial para la fecha',
'dateformatshort' => 'Formato inicial para la fecha (corto)',
'output' => 'Resulta',
'charset' => 'Conjunto de caracteres',
'charsettip' => 'Conjunto de caracteres en el que usted escribe su blog (UTF-8 is '.
'<a href="http://wiki.flatpress.org/doc:charsets">recomendado</a>)'
);
$lang['admin']['config']['default']['msgs'] =
array(
1 => 'La configuración se ha guardado correctamente.',
-1 => 'Se produjo un error al intentar guardar la configuración.',
);
$lang['admin']['config']['default']['error'] =
array(
'www' => 'El root del blog debe ser un URL válido',
'title' => 'Debe especificar un título',
'email' => 'El correo electrónico debe tener un formato válido',
'maxentries' => 'No ingreso un número válido de entradas',
'timeoffset' => '¡No ingresó una corrección de tiempo válida! '.
'Puedes usar punto flotante (ej. 2h30" => 2.5)',
'timeformat' => 'Debe insertar el formato para la hora',
'dateformat' => 'Debe insertar el formato para la fecha',
'dateformatshort'=> 'Debe insertar el formato para la fecha (corto)',
'charset' => 'Debe insertar un ID de set de caracteres',
'lang' => 'El idioma que eligió no está disponible'
);
?>

View File

@ -0,0 +1,184 @@
<?php
$lang['admin']['entry']['submenu'] =
array (
'list' => 'Administrar entradas',
'write' => 'Escribir entrada',
'cats' => 'Administrar Categorías'
);
/* default action */
$lang['admin']['entry']['list'] =
array(
'head' => 'Administrar entradas',
'descr' => 'Seleccione una entrada para editar o <a href="admin.php?p=entry&amp;action=write">Añadir nueva</a>'.
'<br /><a href="admin.php?p=entry&amp;action=cats">Editar las categorías</a>',
'filter' => 'Filtrar: ',
'nofilter' => 'Mostrar todo',
'filterbtn' => 'Aplicar filtro',
'sel' => 'Sel', // checkbox
'date' => 'Fecha',
'title' => 'Título',
'author' => 'Autor',
'comms' => '#Comms', // comments
'action' => 'Action',
'act_del' => 'Eliminar',
'act_view' => 'Ver',
'act_edit' => 'Editar'
);
/* write action */
$lang['admin']['entry']['write'] =
array(
'head' => 'Escribir entrada',
'descr' => 'Edite el formulario para escribir la entrada',
'uploader' => 'Subir',
'fieldset1' => 'Editar',
'subject' => 'Asunto (*):',
'content' => 'Contenido (*):',
'fieldset2' => 'Enviar',
'submit' => 'Publicar',
'preview' => 'vista previa',
'savecontinue' => 'Guardar&amp;Continuar',
'categories' => 'Categorias',
'nocategories' => 'categorías no establecidas. <a href="admin.php?p=entry&amp;action=cats">Cree sus propias'.
'categorias</a> desde el panel de entrada principal. '.
'<a href="#save">Guarde</a> primero su entrada.',
'saveopts' => 'Guardar opciones',
'success' => 'Su entrada fue publicada correctamente',
'otheropts' => 'Otras opciones',
'commmsg' => 'Administrar comentarios para esta entrada',
'delmsg' => 'Eliminar esta entrada',
//'back' => 'Volver descartando cambios',
);
$lang['admin']['entry']['list']['msgs'] = array(
1 => 'La entrada se ha guardado correctamente',
-1 => 'Se produjo un error al intentar guardar
la entrada',
2 => 'La entrada se eliminó correctamente',
-2 => 'Se produjo un error al intentar eliminar
la entrada',
);
$lang['admin']['entry']['write']['error'] = array(
'subject' => 'No puedes enviar un asunto en blanco',
'content' => 'No puedes publicar una entrada en blanco',
);
$lang['admin']['entry']['write']['msgs'] = array(
1 => 'La entrada se ha guardado correctamente',
-1 => 'Se produjo un error: su entrada no se pudo guardar correctamente',
-2 => 'Se produjo un error: su entrada no se ha guardado; el índice puede estar corrupto',
-3 => 'Se produjo un error: su entrada se ha guardado como borrador',
-4 => 'Se produjo un error: su entrada se ha guardado como borrador; el índice puede estar corrupto',
'draft'=> 'Está editando un <strong>borrador</strong> de entrada'
);
/* comments */
$lang['admin']['entry']['commentlist'] =
array(
'head' => "Comentarios para la entrada ",
'descr' => 'Seleccione un comentario para eliminar',
'sel' => 'Sel',
'content' => 'Contenido',
'date' => 'Fecha',
'author' => 'Autor',
'email' => 'Email',
'ip' => 'IP',
'actions' => 'Acciones',
'act_edit' => 'Editar',
'act_del' => 'Eliminar',
'act_del_confirm' => '¿Realmente quiere eliminar este comentario?',
'nocomments' => 'Esta entrada aún no ha sido comentada.',
);
$lang['admin']['entry']['commentlist']['msgs'] =
array(
1 => 'El comentario se ha eliminado correctamente',
-1 => 'Ocurrió un error al intentar eliminar
el comentario',
);
$lang['admin']['entry']['commedit'] =
array(
'head' => "Editar comentario para entrada",
'content' => 'Contenido',
'date' => 'Fecha',
'author' => 'Autor',
'www' => 'Sitio web',
'email' => 'Email',
'ip' => 'IP',
'loggedin' => 'Usuario registrado',
'submit' => 'Guardar'
);
$lang['admin']['entry']['commedit']['msgs'] =
array(
1 => 'Comment has been edited',
-1 => 'An error occurred while trying to edit the comment',
);
/* delete action */
$lang['admin']['entry']['delete'] =
array(
'head' => 'Eliminar entrada',
'descr' => 'Estás a punto de eliminar la siguiente entrada:',
'preview' => 'Vista previa',
'confirm' => '¿Esta seguro que desea continuar?',
'fset' => 'Eliminar',
'ok' => 'Si, eliminar esta entrada',
'cancel' => 'No, volver al panel',
'err' => 'La entrada especificada no existe',
);
/* category mgmt */
$lang['admin']['entry']['cats'] =
array(
'head' => 'Editar categorias',
'descr' => '<p>Utilice el formulario a continuación para agregar y editar sus categorías. </p><p>Cada elemento de categoría debe tener este formato "nombre de categoría: <em>id_number</em>". Indentar los elementos con guiones para crear jerarquías.</p>
<p>Ejemplo:</p>
<pre>
General :1
News :2
--Announcements :3
--Events :4
----Misc :5
Technology :6
</pre>',
'clear' => 'Eliminar todos los datos de las categorías',
'fset1' => 'Editor',
'fset2' => 'Aplicar cambios',
'submit' => 'Guardar'
);
$lang['admin']['entry']['cats']['msgs'] = array(
1 => 'Categorías guardadas',
-1 => 'Se produjo un error al intentar guardar categorías',
2 => 'Categorías vacías',
-2 => 'Se produjo un error al intentar vaciar categorías',
-3 => 'Los ID de categoría deben ser estrictamente positivos (0 is not allowed)'
);
?>

View File

@ -0,0 +1,23 @@
<?php
$lang['admin']['panel']['main'] = 'Principal';
$lang['admin']['main']['default'] = array(
'head' => '¡Bienvenido al panel de control!',
'descr' => 'Seleccione una acción',
'op1' => 'Nueva entrada',
'op1d' => 'Agregar una nueva entrada',
'op2' => 'Entradas',
'op2d' => 'Mostrar y administrar todas las entradas',
'op3' => 'Widgets',
'op3d' => 'Administrar la barra lateral, barra de abajo y de arriba de los widgets',
'op4' => 'Plugins',
'op4d' => 'Instalar, habilitar, deshabilitar plugins',
'op5' => 'Configuración',
'op5d' => 'Personalice su flatpress',
'op6' => 'Mantención',
'op6d' => 'Limpiar y restablecer flatpress',
);
?>

View File

@ -0,0 +1,46 @@
<?php
$lang['admin']['panel']['maintain'] = 'Mantención';
$lang['admin']['maintain']['default'] = array(
'head' => 'Mantención',
'descr' => 'Consulta esta sección cuando creas que algo se ha estropeado '.
'y quizás encuentres aquí una solución.
Sin embargo, esto podría no funcionar.',
'opt0' => '&laquo; Regresar al menú principal',
'opt1' => 'Reconstruir índice',
'opt2' => 'Vaciar el caché de plantillas y temas',
'opt3' => 'Restaurar permisos de archivos',
'opt4' => 'Mostrar información sobre PHP',
'opt5' => 'Buscar actualizaciones',
'chmod_info' => "Los siguientes permisos de archivo <strong>no pudieron</strong>
ser reiniciados a 0777; probablemente el propietario del archivo no sea el mismo que el
del servidor web. Por lo general, puede ignorar este aviso.",
);
$lang['admin']['maintain']['default']['msgs'] = array(
1 => 'Operación completada'
);
$lang['admin']['maintain']['updates'] = array(
'head' => 'Actualizaciones',
'list' => '<ul>
<li>Usted tiene la versión FlatPress <big>%s</big></li>
<li>La última versión estable de FlatPress es <big><a href="%s">%s</a></big></li>
<li>La última versión inestable de FlatPress es <big><a href="%s">%s</a></big></li>
</ul>',
'notice'=>'Aviso:'
);
$lang['admin']['maintain']['updates']['msgs'] = array(
1 => '¡Hay actualizaciones disponibles!',
2 => 'Su sistema ya está actualizado',
-1 => 'No se encontraron actualizaciones'
);
?>

View File

@ -0,0 +1,34 @@
<?php
$lang['admin']['head'] = 'Area de Administración';
$lang['admin']['panels'] = array(
'main' => 'Principal',
'config' => 'Opciones',
//'users' => 'Usuarios',
'entry' => 'Entradas',
'static' => 'Estáticas',
'uploader' => 'Subir Archivos',
'widgets' => 'Widgets',
//'add' => 'Add',
//'edit' => 'Editar/Eliminar',
'maintain' => 'Mantención',
'plugin' => 'Plugins',
'themes' => 'Temas',
//'updates' => 'Actualizaciones',
);
$lang['admin']['general'] = array(
'id' => 'Id', # for entry ids
'name' => 'Nombre', # for file names
'title' => 'Titulo', # for entry/posts/static titles
'comments' => '#Comms',
'author' => 'Autor',
'actdel' => 'Eliminar',
'actedit' => 'Editar',
'actenable' => 'Habilitar',
'actdisable' => 'Inhabilitar'
);
?>

View File

@ -0,0 +1,40 @@
<?php
$lang['admin']['plugin']['submenu'] = array (
'default' => 'Administrar Plugins'
);
/* main plugin panel */
$lang['admin']['plugin']['default'] = array(
'head' => 'Administrar Plugins',
'enable' => 'Habilitar',
'disable' => 'Inhabilitar',
'descr' => 'A <a class="hint" '.
'href="http://wiki.flatpress.org/doc:plugins" title="Que es un plugin?">'.
'Plugin</a> es un componente que puede ampliar las capacidades de FlatPress.</p>'.
'<p>Puede instalar plugins subiendolos a su <code>fp-plugins/</code> '.
'directorio.</p>'.
'<p>Este panel le permite habilitar y deshabilitar Plugins',
'name' => 'Nombre',
'description' => 'Descripción',
'author' => 'Autor',
'version' => 'Versión',
'action' => 'Acción',
);
$lang['admin']['plugin']['default']['msgs'] = array(
1 => 'Config guardada',
-1 => 'Se produjo un error al intentar guardar. Esto puede suceder por varias razones: tal vez su archivo contenga errores de sintaxis.',
);
/* system errors */
$lang['admin']['plugin']['errors'] = array(
'head' => 'Se encontraron los siguientes errores al cargar Plugin:',
'notfound' => 'No se encontró el Plugin. Omitido.',
'generic' => 'Numero de error %d',
);
?>

View File

@ -0,0 +1,80 @@
<?php
$lang['admin']['static']['submenu'] = array(
'list' => 'Administrar Staticas',
'write' => 'Escribir Statica'
);
/* main panel */
$lang['admin']['static']['list'] = array(
'head' => 'Páginas estáticas',
'descr' => 'Seleccione una página para editar o <a href="admin.php?p=static&amp;action=write">Añadir nueva</a>.',
'sel' => 'Sel', // checkbox
'date' => 'Fecha',
'name' => 'Pagina',
'title' => 'Titulo',
'author' => 'Autor',
'action' => 'Accion',
'act_view' => 'Ver',
'act_del' => 'Eliminar',
'act_edit' => 'Editar'
);
$lang['admin']['static']['list']['msgs'] = array(
1 => 'Página archivada correctamente',
-1 => 'Se produjo un error al intentar archivar
la página',
2 => 'Página eliminada correctamente',
-2 => 'Error al intentar eliminar
la página',
);
/* write panel */
$lang['admin']['static']['write'] =
array(
'head' => 'Publicar la página estatica',
'descr' => 'Editar el formulario para publicar la página',
'fieldset1' => 'Editar',
'subject' => 'Asunto (*):',
'content' => 'Contenido (*):',
'fieldset2' => 'Enviar',
'pagename' => 'Nombre de la página (*):',
'submit' => 'Publicar',
'preview' => 'Vista Previa',
'delfset' => 'Eliminar',
'deletemsg' => 'Eliminar esta pagina',
'del' => 'Eliminar',
'success' => 'Tu página se publicó con éxito',
'otheropts' => 'Otras opciones',
);
$lang['admin']['static']['write']['error'] = array(
'subject' => 'No puedes enviar un asunto en blanco',
'content' => 'No puedes publicar una entrada en blanco',
'id' => 'Debes enviar una identificación válida'
);
/* delete action */
$lang['admin']['static']['delete'] = array(
'head' => "Eliminar Página",
'descr' => 'Estás a punto de eliminar la siguiente página:',
'preview' => 'Vista Previa',
'confirm' => '¿Estas seguro que deseas continuar?',
'fset' => 'Eliminar',
'ok' => 'Si, elimine esta página',
'cancel' => 'No, llévame de vuelta al panel',
'err' => 'La página especificada no existe',
);
?>

View File

@ -0,0 +1,48 @@
<?php
$lang['admin']['themes']['submenu'] = array(
'default' => 'Temas',
'style' => 'Estilos',
);
/* default panel action (change theme) */
$lang['admin']['themes']['default'] = array(
'head1' => 'Tema actual',
'head2' => 'Temas disponibles',
'descr' => 'Seleccione el tema que desee utilizar',
'nodescr' => 'Falta descripción',
'noauthor' => 'Autor desconocido',
);
$lang['admin']['themes']['default']['msgs'] = array(
1 => 'El tema ha cambiado.',
-1 => 'Error al intentar cambiar el tema.',
-2 => 'El tema eligido no existe.'
);
/* select style */
$lang['admin']['themes']['style'] = array(
'head1' => 'Estilo actual',
'head2' => 'Estilos disponibles',
'descr' => 'Seleccione el estilo que desea usar con este tema',
'nodescr' => 'Falta descripción',
'noauthor' => 'Autor desconocido',
);
$lang['admin']['themes']['style']['msgs'] = array(
1 => 'Se ha cambiado el estilo.',
-1 => 'Error al intentar cambiar el estilo.',
-2 => 'El estilo eligido no existe.'
);
?>

View File

@ -0,0 +1,29 @@
<?php
$lang['admin']['uploader']['default'] = array(
'head' => 'Subir Archivos',
'descr' => 'Elija uno o más archivos para subir.',
'fset1' => 'Selector de archivos',
'fset2' => 'Subir',
'submit' => 'Subir',
);
$lang['admin']['uploader']['default']['msgs'] = array(
1 => 'Archivo(s) subido(s)',
-1 => 'Se produjo un error al intentar subir archivo(s).',
);
$lang['admin']['uploader']['browse'] = array(
'head' => 'Navegar',
'descr' => 'Elija uno o más archivos para subir.',
'fset1' => 'Selector de archivos',
'submit' => 'Subir',
);
?>

View File

@ -0,0 +1,88 @@
<?php
$lang['admin']['widgets']['submenu']['default'] = 'Administrar widgets';
$lang['admin']['widgets']['submenu']['raw'] = 'Administrar widgets (raw)';
/* default action */
$lang['admin']['widgets']['default'] = array(
'head' => 'Administrar widgets (<em>experimental</em>)',
'descr' => 'A <a class="hint" '.
'href="http://wiki.flatpress.org/doc:widgets" title="Que es un Widget?">'.
'Widget</a> es un componente dinámico que puede mostrar datos e interactuar con el usuario.
Mientras <strong>Temas</strong> están destinados a cambiar el aspecto de tu blog, Widgets
<strong>Amplían</strong> apariencia y funcionalidades.</p>
<p>Widgets pueden ser puestos en areas especiales de su tema llamado el
<strong>WidgetSets</strong>. El número y el nombre de los WidgetSets pueden variar según el
tema que elija.</p>
<p>FlatPress viene con varios widgets: hay widgets para ayudar con el inicio de sesión, para
mostrar un cuadro de búsqueda, etc.</p>
<p>Cada Widget está definido por un <a class="hint" '.
'href="http://wiki.flatpress.org/doc:plugins" title="What is a Widget?">plugin</a>.',
'availwdgs' => 'Widgets Disponibles',
'trashcan' => 'Mover aquí para borrar',
'themewdgs' => 'Widgetsets para este tema',
'themewdgsdescr' => 'El tema que ha seleccionado le permite tener los siguientes conjuntos de widgets',
'oldwdgs' => 'Otros widgetsets',
'oldwdgsdescr' =>'Los siguientes set de widgets parecen no pertenecer a ninguno de los '.
'widgetsets listados arriba. Pueden ser restantes de otro tema.',
'submit' => 'Guardar Cambios',
);
$lang['admin']['widgets']['default']['stdsets'] = array(
'top' => 'Barra superior',
'bottom' => 'Barra inferior',
'left' => 'Barra izquierda',
'right' => 'Barra derecha',
);
$lang['admin']['widgets']['default']['msgs'] = array(
1 => 'Configuración guardada',
-1 => 'Se produjo un error al intentar guardar. Vuelve a intentarlo.',
);
/* "raw" panel */
$lang['admin']['widgets']['raw'] = array(
'head' => 'Administrar widgets (<em>editor raw</em>)',
'descr' => 'A <a class="hint" '.
'href="http://wiki.flatpress.org/doc:plugins" title="Que es un Widget?">'.
'Widget</a> is a visual element of a <a class="hint" '.
'href="http://wiki.flatpress.org/doc:plugins" title="Que es un plugin?">'.
'Plugin</a> que puede poner en algunas áreas especiales (los <em>widgetsets</em>) en las páginas de su blog. </p>'.
'<p>Este es el editor <strong>raw</strong> ; algunos usuarios avanzados o personas que '.
'no deseen JavaScript tal vez lo prefieran',
'fset1' => 'Editor',
'fset2' => 'Aplicar cambios',
'submit' => 'Aplicar',
);
$lang['admin']['widgets']['raw']['msgs'] = array(
1 => 'Configuración guardada',
-1 => 'Se produjo un error al intentar guardar. Esto puede suceder por varias razones: tal vez su archivo contenga errores de sintaxis.',
);
/* system errors */
$lang['admin']['widgets']['errors'] = array(
'generic' => 'El widget llamado <strong>%s</strong> no está registrado y sera omitido. '.
'Está el plugin habilitado en el <a href="admin.php?p=plugin"> panel de plugin</a>?'
);
?>

View File

@ -0,0 +1,21 @@
<?php
$lang['comments']['mail'] = <<<MAIL
Estimado %toname%,
"%fromname%" %frommail% acaba de publicar un comentario en la entrada titulada "%entrytitle%".
Este es el enlace de comentarios a su entrada:
%commentlink%
Aquí está el comentario que se acaba de publicar:
***************
%content%
***************
Todo lo mejor,
%blogtitle%
MAIL;
?>

View File

@ -0,0 +1,9 @@
<?php
$langconf = array();
$langconf['id'] = 'Español (ES)';
$langconf['locale'] = 'es-es';
$langconf['charsets'][0] = 'utf-8';
$langconf['charsets'][1] = 'iso-8859-15';
?>

View File

@ -0,0 +1,31 @@
<?php
$lang['contact'] = array(
'head' => 'Contáctanos',
'descr' => 'Complete el siguiente formulario para enviarnos sus comentarios. Agregue su correo electrónico si desea ser respondido.',
'fieldset1' => 'Datos del usuario',
'name' => 'Nombre (*)',
'email' => 'Email:',
'www' => 'Web:',
'cookie' => 'Recuérdame',
'fieldset2' => 'Tu mensaje',
'comment' => 'Mensaje (*):',
'fieldset3' => 'Enviar',
'submit' => 'Enviar',
'reset' => 'Reiniciar',
);
$lang['contact']['error'] = array(
'name' => 'Debes ingresar un nombre',
'email' => 'Debes ingresar un correo electrónico válido',
'www' => 'Debes ingresar una URL válida',
'content' => 'Debes ingresar un mensaje',
);
$lang['contact']['msgs'] = array(
1 => 'El mensaje se envió con éxito',
-1 => 'No se pudo enviar el mensaje',
);
?>

View File

@ -0,0 +1,201 @@
<?php
$lang = array();
$lang['main'] = array(
'nextpage' => 'Página Siguiente &raquo;',
'prevpage' => '&laquo; Página anterior',
'entry' => 'Entrada',
'static' => 'Pagina Estatica',
'comment' => 'Comentario',
'preview' => 'Editar/Vista previa',
'filed_under' => 'Archivado bajo ',
'add_entry' => 'Agregar Entrada',
'add_comment' => 'Agregar Comentario',
'add_static' => 'Agregar Pagina Estatica',
'btn_edit' => 'Editar',
'btn_delete' => 'Borrar',
'nocomments' => 'Agregar un Comentario',
'comment' => '1 comentario',
'comments' => 'comentarios',
);
$lang['search'] = array(
'head' => 'Buscar',
'fset1' => 'Insertar criterios de búsqueda',
'keywords' => 'Frase',
'onlytitles' => 'Solo Títulos',
'fulltext' => 'Text Completo',
'fset2' => 'Date',
'datedescr' => 'Puede vincular su búsqueda a una fecha específica. Puede seleccionar un año, un año y un mes o una fecha completa. '.
'Déjelo en blanco para buscar en toda la base de datos.',
'fset3' => 'Buscar en categorías',
'catdescr' => 'No seleccione ninguno para buscar todos',
'fset4' => 'Empezar a buscar',
'submit' => 'Buscar',
'headres' => 'Resultados de la búsqueda',
'descrres' => 'Searching for <strong>%s</strong> returned the following results:',
'descrnores' => 'Buscando <strong>%s</strong> no devolvió ningún resultado.',
'moreopts' => 'Más Opciones',
'searchag' => 'Busca de nuevo',
);
$lang['search']['error'] = array(
'keywords' => 'Debe especificar al menos una palabra clave'
);
$lang['entry'] = array();
$lang['entry']['flags'] = array();
$lang['entry']['flags']['long'] = array(
'draft' => '<strong>Entrada de borrador</strong>: oculto, esperando publicación',
//'static' => '<strong>Entrada estática</strong>: normalmente oculto, para llegar a la entrada poner ?page=title-of-the-entry en url (experimental)',
'commslock' => '<strong>Comentarios bloqueados</strong>: comentarios no permitidos para esta entrada'
);
$lang['entry']['flags']['short'] = array(
'draft' => 'Borrador',
//'static' => 'Estático',
'commslock' => 'Comentarios bloqueados'
);
$lang['404error'] = array(
'subject' => 'No encontrado',
'content' => '<p>Lo sentimos, no pudimos encontrar la página solicitada</p>'
);
// Login
$lang['login'] = array(
'head' => 'Iniciar sesión',
'fieldset1' => 'Inserte su nombre de usuario y contraseña',
'user' => 'Usuario:',
'pass' => 'Contraseña:',
'fieldset2' => 'Inicie sesión',
'submit' => 'Iniciar sesión',
'forgot' => 'Contraseña perdida'
);
$lang['login']['success'] = array(
'success' => 'Ahora está conectado.',
'logout' => 'Ahora está desconectado.',
'redirect' => 'Serás redirigido en 5 segundos.',
'opt1' => 'Volver al índice',
'opt2' => 'Ir al panel de control',
'opt3' => 'Agregar nueva entrada'
);
$lang['login']['error'] = array(
'user' => 'Debes ingresar un nombre de usuario.',
'pass' => 'Debes ingresar una contraseña.',
'match' => 'Contraseña incorrecta.'
);
$lang['comments'] = array(
'head' => 'Agregar comentario',
'descr' => 'Complete el siguiente formulario para agregar sus propios comentarios',
'fieldset1' => 'Datos del usuario',
'name' => 'Nombre (*)',
'email' => 'Email:',
'www' => 'Web:',
'cookie' => 'Recuérdame',
'fieldset2' => 'Añade tu comentario',
'comment' => 'Comentario (*):',
'fieldset3' => 'Enviar',
'submit' => 'Agregar',
'reset' => 'Reiniciar',
'success' => 'Tu comentario fue agregado exitosamente',
'nocomments' => 'Esta entrada aún no ha sido comentada',
'commslock' => 'Los comentarios han sido desactivados para esta entrada.',
);
$lang['comments']['error'] = array(
'name' => 'Debes ingresar un nombre',
'email' => 'Debes ingresar un correo electrónico válido',
'www' => 'Debes ingresar una URL válida',
'comment' => 'Debes ingresar un comentario',
);
$lang['date']['month'] = array(
'Enero',
'Febrero',
'Marzo',
'Abril',
'Mayo',
'Junio',
'Julio',
'Agosto',
'Septiembre',
'Octubre',
'Noviembre',
'Deciembre'
);
$lang['date']['month_abbr'] = array(
'Ene',
'Feb',
'Mar',
'Abr',
'May',
'Jun',
'Jul',
'Ago',
'Sep',
'Oct',
'Nov',
'Dec'
);
$lang['date']['weekday'] = array(
'Domingo',
'Lunes',
'Martes',
'Miércoles',
'Jueves',
'Viernes',
'Sabado',
);
$lang['date']['weekday_abbr'] = array(
'Dom',
'Lun',
'Mar',
'Mie',
'Jue',
'Vie',
'Sab',
);
?>

View File

@ -6,7 +6,7 @@
/* default action */
$lang['admin']['widgets']['default'] = array(
'head' => 'G&eacute;rer les Widgets (<em>exp&eacute;rimental</em>)',
'head' => 'G&eacute;rer les Widgets',
'descr' => 'Un <a class="hint" '.
'href="http://wiki.flatpress.org/doc:widgets" title="C\'est quoi un Widget?">'.

View File

@ -45,7 +45,7 @@
'savecontinue' => 'Salva e continua',
'categories' => 'Categorie',
'nocategories' => 'Nessuna categoria impostata. <a href="admin.php?p=entry&amp;action=cats">Creane una '.
'categories</a> dal pannelo principale degli articoli. '.
'categories</a> dal pannello principale degli articoli. '.
'<a href="#save">Salva</a> prima l\'articolo.',
'saveopts' => 'Opzioni di salvataggio',
'success' => 'L\'articolo è stato pubblicato con successo',
@ -162,7 +162,7 @@ Notizie :2
----Varie :5
Tecnologia :6
</pre>',
'clear' => 'Elimina tutti i dati dele categorie',
'clear' => 'Elimina tutti i dati delle categorie',
'fset1' => 'Editor',
'fset2' => 'Applica le modifiche',

View File

@ -1,6 +1,6 @@
<?php
$lang['admin']['head'] = 'Pannello di amministrazione';
$lang['admin']['head'] = 'Pannello di controllo';
$lang['admin']['panels'] = array(
'main' => 'Principale',

View File

@ -12,7 +12,7 @@
$lang['admin']['uploader']['default']['msgs'] = array(
1 => 'File caricato(i)',
-1 => 'S è verificato un errore durante il caricamento.',
-1 => 'Si è verificato un errore durante il caricamento.',
);

View File

@ -6,19 +6,19 @@
/* default action */
$lang['admin']['widgets']['default'] = array(
'head' => 'Gestione Widget (<em>experimental</em>)',
'head' => 'Gestione Widget',
'descr' => 'Un <a class="hint" '.
'href="http://wiki.flatpress.org/doc:widgets" title="What is a Widget?">'.
'Widget</a> è un componente dinamico che può visualizzare dati e interagire con l\'utente.
Mentre i <strong>Temi</strong> sono fatti per cambiare l\'aspetto del blog, Widgets
<strong>extend</strong> cambiano l\'aspetto e le funzionalità.</p>
Mentre i <strong>Temi</strong> sono fatti per cambiare l\'aspetto del blog, i Widgets
ne <strong>estendono</strong>, cambiano l\'aspetto e le funzionalità.</p>
<p>I Widget possono essere trascinati in aree specifiche del tuo tema chiamate
<strong>WidgetSets</strong>. Il numero e il nome dei WidgetSets possono variare a seconda
de tema che hai scelto.</p>
del tema che hai scelto.</p>
<p>FlatPress viene fornito con parecchi widget: ci sono widget cheaiutano con la connessione, per
<p>FlatPress viene fornito con parecchi widget: ci sono widget che aiutano con la connessione, per
visualizzare una casella di ricerca, ecc.</p>
<p>Ogni Widget è definito da un <a class="hint" '.
@ -30,7 +30,7 @@
'themewdgs' => 'Widgetset per questo tema',
'themewdgsdescr' => 'Il tema che hai attualmente selezionato ti consente di avere i seguenti widgetset',
'oldwdgs' => 'Altri widgetset',
'oldwdgsdescr' =>'I seguenti widgetset sembrano non appartenere ad alcunoo dei '.
'oldwdgsdescr' =>'I seguenti widgetset sembrano non appartenere ad alcuno dei '.
'widgetset elencati qui sopra. Potrebbero essere dei rimasugli di un altro tema.',
'submit' => 'Salva le modifiche',

View File

@ -35,7 +35,7 @@
'fulltext' => 'Testo completo',
'fset2' => 'Data',
'datedescr' => 'Puoi collegare la tua ricerca ad una data specifica. Puoi selezionare un anno, un annno e un mese o una data completa. '.
'datedescr' => 'Puoi collegare la tua ricerca ad una data specifica. Puoi selezionare un anno, un anno e un mese o una data completa. '.
'Lascia in bianco se vuoi cercare nell\'intero database.',
'fset3' => 'Cerca nelle categorie',
@ -89,7 +89,7 @@
$lang['login'] = array(
'head' => 'Login',
'fieldset1' => 'Inserisci nome tuetnte e password',
'fieldset1' => 'Inserisci nome utente e password',
'user' => 'Nome utente:',
'pass' => 'Password:',
'fieldset2' => 'Connettiti',

View File

@ -7,7 +7,7 @@
/* default action */
$lang['admin']['widgets']['default'] = array(
'head' => 'Administre Widgets (<em>experimental</em>)',
'head' => 'Administre Widgets',
'descr' => 'Um <a class="hint" '.
'href="http://wiki.flatpress.org/doc:widgets" title="O que é um Widget?">'.

View File

@ -5,10 +5,10 @@
<subtitle>{$flatpress.subtitle}</subtitle>
<link href="{$smarty.const.BLOG_BASEURL}" />
<link rel="self" href="{'atom'|theme_feed_link}" />
<generator uri="http://www.flatpress.org/" version="{$flatpress.version}">
<generator uri="http://www.flatpress.org/" version="{$smarty.const.SYSTEM_VER}">
FlatPress
</generator>
<rights> {$flatpress.author} {$smarty.now|date_format:'%Y'} </rights>
<rights> {$flatpress.author} {'Y'|date} </rights>
<updated>{$smarty.now|date_rfc3339}</updated>
<author>
<name>{$flatpress.author}</name>
@ -31,14 +31,16 @@
</div>
</content>
{foreach from=$enclosure item=encl}
<link rel="enclosure"
href="{$encl.url}"
title="{$encl.title}"
length="{$encl.length}"
type="{$encl.type}" />
{/foreach}
{if isset($enclosure)}
{foreach from=$enclosure item=encl}
<link rel="enclosure"
href="{$encl.url}"
title="{$encl.title}"
length="{$encl.length}"
type="{$encl.type}" />
{/foreach}
{/if}
</entry>
{/entry}
{/entry_block}

View File

@ -13,23 +13,51 @@
{if not $flatpress.loggedin}
{*<fieldset id="comment-userdata">*}
<div id="comment-userdata">
<p>
<input type="text" {$error.name|notempty:'class="field-error"'} name="name" id="name" value="{$values.name|wp_specialchars:1|default:$cookie.name}" />
{if isset($error) && isset($error.name) && !empty($error.name)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.name) && !empty($values.name)}
{assign var=namevalue value=$values.name}
{else}
{assign var=namevalue value=""}
{/if}
<input type="text" class="{$class}" name="name" id="name" value="{$namevalue|wp_specialchars:1|default:$cookie.name}" />
<label class="textlabel" for="name">{$lang.comments.name}</label>
</p>
<p>
<input type="text" {$error.email|notempty:'class="field-error"'} name="email" id="email" value="{$values.email|wp_specialchars:1|default:$cookie.email}" />
{if isset($error) && isset($error.email) && !empty($error.email)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.email) && !empty($values.email)}
{assign var=emailvalue value=$values.email}
{else}
{assign var=emailvalue value=""}
{/if}
<input type="text" class="{$class}" name="email" id="email" value="{$emailvalue|wp_specialchars:1|default:$cookie.email}" />
<label class="textlabel" for="email">{$lang.comments.email}</label>
</p>
<p>
<input type="text" {$error.url|notempty:'class="field-error"'} name="url" id="url" value="{$values.url|wp_specialchars:1|default:$cookie.url}" />
{if isset($error) && isset($error.url) && !empty($error.url)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.url) && !empty($values.url)}
{assign var=urlvalue value=$values.url}
{else}
{assign var=urlvalue value=""}
{/if}
<input type="text" class="{$class}" name="url" id="url" value="{$urlvalue|wp_specialchars:1|default:$cookie.url}" />
<label class="textlabel" for="url">{$lang.comments.www}</label>
</p>
@ -42,8 +70,18 @@
<div class="comment-content">
<p><textarea name="content" {$error.content|notempty:'class="field-error"'}
id="content" rows="10" cols="74">{$values.content|wp_specialchars:1}</textarea></p>
{if isset($error) && isset($error.content) && !empty($error.content)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.content) && !empty($values.content)}
{assign var=contentvalue value=$values.content}
{else}
{assign var=contentvalue value=""}
{/if}
<p><textarea name="content" class="{$class}"
id="content" rows="10" cols="74">{$contentvalue|wp_specialchars:1}</textarea></p>
{*here will go a plugin hook*}
</div>

View File

@ -13,16 +13,46 @@
<fieldset><legend>{$lang.contact.fieldset1}</legend>
<p><label class="textlabel" for="name">{$lang.contact.name}</label><br />
<input type="text" name="name" id="name" {$error.name|notempty:'class="field-error"'}
value="{$values.name|stripslashes|wp_specialchars:true}" /></p>
{if isset($error) && isset($error.name) && !empty($error.name)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.name) && !empty($values.name)}
{assign var=namevalue value=$values.name}
{else}
{assign var=namevalue value=""}
{/if}
<input type="text" name="name" id="name" class="{$class}"
value="{$namevalue|stripslashes|wp_specialchars:true}" /></p>
<p><label class="textlabel" for="email">{$lang.contact.email}</label><br />
<input type="text" name="email" id="email" {$error.email|notempty:'class="field-error"'}
value="{$values.email|stripslashes|wp_specialchars:true}" /></p>
{if isset($error) && isset($error.email) && !empty($error.email)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.email) && !empty($values.email)}
{assign var=emailvalue value=$values.email}
{else}
{assign var=emailvalue value=""}
{/if}
<input type="text" name="email" id="email" class="{$class}"
value="{$emailvalue|stripslashes|wp_specialchars:true}" /></p>
<p><label class="textlabel" for="url">{$lang.contact.www}</label><br />
<input type="text" name="url" id="url" {$error.url|notempty:'class="field-error"'}
value="{$values.url|stripslashes|wp_specialchars:true}" /></p>
{if isset($error) && isset($error.url) && !empty($error.url)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.url) && !empty($values.url)}
{assign var=urlvalue value=$values.url}
{else}
{assign var=urlvalue value=""}
{/if}
<input type="text" name="url" id="url" class="{$class}"
value="{$urlvalue|stripslashes|wp_specialchars:true}" /></p>
{comment_form}
@ -30,8 +60,18 @@
<fieldset><legend>{$lang.contact.fieldset2}</legend>
<p><label for="content">{$lang.contact.comment}</label><br />
<textarea name="content" id="content" {$error.content|notempty:'class="field-error"'}
rows="10" cols="74">{$values.content|stripslashes|wp_specialchars:true}</textarea></p>
{if isset($error) && isset($error.content) && !empty($error.content)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.content) && !empty($values.content)}
{assign var=contentvalue value=$values.content}
{else}
{assign var=contentvalue value=""}
{/if}
<textarea name="content" id="content" class="{$class}"
rows="10" cols="74">{$contentvalue|stripslashes|wp_specialchars:true}</textarea></p>
</fieldset>

View File

@ -1,5 +1,5 @@
<div id="errorlist">
{if $error}
{if isset($error)}
<ul class="msgs errors">
{foreach from=$error key=field item=msg}
<li>
@ -13,7 +13,7 @@
</ul>
{/if}
{if $warnings}
{if isset($warnings)}
<ul class="msgs warnings">
{foreach from=$warnings key=field item=msg}
<li>
@ -27,7 +27,7 @@
</ul>
{/if}
{if $notifications}
{if isset($notifications)}
<ul class="msgs notifications">
{foreach from=$notifications item=msg}
<li>{$msg}</li>
@ -36,7 +36,7 @@
{/if}
{if $success}
{if isset($success)}
{if $success < 0}
{assign var=class value=errors}
{else}

0
fp-interface/sharedtpls/login.tpl Executable file → Normal file
View File

4
fp-interface/sharedtpls/login_success.tpl Executable file → Normal file
View File

@ -1,6 +1,6 @@
{if $smarty.request.do.logout}
{if isset($smarty.request.do) && $smarty.request.do.logout}
<p>{$lang.login.success.logout}</p>
{if $smarty.request.redirect}
{if isset($smarty.request.redirect)}
<p>{$lang.login.success.redirect} <a href="{$smarty.request.redirect}">{$smarty.request.redirect}</a>
{/if}

View File

@ -4,7 +4,7 @@
<title>{$flatpress.title}</title>
<link>{$flatpress.www}</link>
<description><![CDATA[{$flatpress.subtitle}]]></description>
<copyright>Copyright {$smarty.now|date_format:"$Y"}, {$flatpress.author}</copyright>
<copyright>Copyright {'Y'|date}, {$flatpress.author}</copyright>
{*<managingEditor>{$flatpress.email} ({$flatpress.author})</managingEditor>*}
<language>{$fp_config.locale.lang}</language>
<atom:link rel="self" href="{'rss2'|theme_feed_link}" type="application/rss+xml" />
@ -23,9 +23,11 @@
<pubDate>{'r'|date:$date}</pubDate>
<comments>{$id|link:comments_link}</comments>
{foreach from=$enclosure item=encl}
<enclosure url="{$encl.url}" length="{$encl.length}" type="{$encl.type}" />
{/foreach}
{if isset($enclosure)}
{foreach from=$enclosure item=encl}
<enclosure url="{$encl.url}" length="{$encl.length}" type="{$encl.type}" />
{/foreach}
{/if}
</item>
{/entry}

View File

@ -14,6 +14,7 @@
</fieldset>
<fieldset><legend>{$lang.search.fset3}</legend>
{if !isset($categories)} {assign var=categories value=""} {/if}
{list_categories type="radio" selected=$categories}
<p>{$lang.search.catdescr}</p>
</fieldset>

View File

@ -1,4 +1,4 @@
{if $noresults}
{if isset($noresults)}
<p>{$smarty.request.q|string_format:$lang.search.descrnores}</p>
{else}
<p>{$smarty.request.q|string_format:$lang.search.descrres}</p>

View File

@ -7,6 +7,8 @@
{action hook=admin_head}
</head>
{if !isset($panel)} {assign var=panel value=""} {/if}
{if !isset($action)} {assign var=action value=""} {/if}
<body class="{"admin-$panel-$action"|tag:admin_body_class}">
<div id="body-container">
<div id="outer-container">

View File

@ -7,7 +7,7 @@
<h3 class="title">{$subject}</h3>
<div class="body">
{if $rawcontent} {$content}
{if isset($rawcontent) and $rawcontent} {$content}
{else} {include file=$content}{/if}
</div>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{$fp_config.locale.lang}">
<head>
<title>{$flatpress.title|tag:wp_title:'&laquo;'}</title>
<meta http-equiv="Content-Type" content="text/html; charset={$flatpress.charset}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'/>
{action hook=wp_head}
</head>

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

View File

@ -7,8 +7,11 @@ Ispired by: http://pluxml.org theme default
Name: Leggero
Author: NoWhereMan & drudo
Version: 0.1
Version: 0.2
Module: style.css
last change: 2020-08-08
*/
@ -16,14 +19,17 @@ Module: style.css
/* ===== COLUMN ===== */
#column {
float: right;
width: 195px !important;
width: 180px;
/* width: 195px !important;
width: 180px; */
width: 28%;
font-size: 80% !important;
font-size: 75%;
height:1%;
margin-bottom: 5px;
padding: 10px;
border-left: solid 1px #ccc
margin: 1em;
padding: 0.7em;
/* margin-bottom: 5px;
padding: 10px; */
/* border-left: solid 1px #ccc */
}
#column h4 {

View File

@ -7,8 +7,11 @@ Ispired by: http://pluxml.org theme default
Name: Leggero
Author: NoWhereMan & drudo
Version: 0.1
Version: 0.2
Module: common.css
last change: 2020-08-08
*/
@ -24,9 +27,10 @@ html {
body {
font-size: 100%;
padding: 0;
text-align:center;
/* text-align: center; */
background: white url(../imgs/backshade.png) repeat-x;
color: black;
width: 100%
}
hr { display: none }
@ -35,6 +39,12 @@ p { margin: .5em 0 }
img { border: none }
/* Responsive Design img */
img {
max-width: 100%;
height: auto;
}
blockquote {
width: 90%;
color: #666;
@ -122,7 +132,7 @@ h1 {
/* Title of the blog */
font-size: 2em;
letter-spacing: 2px;
margin: 2em 0 0 0
margin: 2em 0 0 0.5em
}
h2 { } /* see h2.date */
@ -133,7 +143,8 @@ h3 {
font-style: italic;
font-size: 1.5em;
color: #333333;
margin: 0
margin: 0;
padding: 1em 0 1em 0;
}
h4 { font-size: 1.2em; }
@ -143,10 +154,13 @@ h4 { font-size: 1.2em; }
/* ===== DIV CONTAINER ALL ELEMENTS BLOCK ===== */
#body-container {
text-align: left;
width: 760px !important;
/*width: 760px !important;
width: 748px; /* fix for I.E. */
margin: 0 auto 0 auto;
padding: 5px;
width: 85%;
margin: 0 auto;
max-width: 68em;
/* padding: 5px; */
padding: 0.3em;
border: solid 1px #ccc;
background-color: white
}
@ -155,31 +169,40 @@ h4 { font-size: 1.2em; }
/* ===== HEAD ===== */
#head {
clear: both;
font-family: 'book antiqua', georgia, garamond, times, 'times new roman', serif;
padding: 95px 10px 5px 5px;
/* padding: 95px 10px 5px 5px;
margin: 10px;
background: #c37676 url('../imgs/shade.png') repeat-x;
border: #bbb 1px solid
border: #bbb 1px solid */
margin: 1em;
padding: 7em 0.6em 0.5em 0.5em;
border-radius: 1em;
border: 0;
background-image: linear-gradient( #aa4142, #c37576);
/* background: #aa4142 */
}
#head a { color: white; text-decoration: none }
#head a:hover { color: white; text-decoration: underline }
.subtitle {
font-size: 100%;
font-style: oblique;
color: #F1F1F1;
margin: .5em 0 0 0
}
.subtitle {
font-size: 100%;
font-style: oblique;
color: #F1F1F1;
margin: .5em 0 1em 1.2em
}
/* ===== DIV CONTAINER "MAIN" ===== */
#outer-container {
position: relative;
/* position: relative;
height: 1%;
margin: 0px;
padding: 0px;
border-top: 1px solid white; /* problem with I.E. */
width: 100%;
background-color: white
}
@ -189,17 +212,20 @@ h4 { font-size: 1.2em; }
#main h4 { margin: 2em 0 0 0}
#main {
float:left;
position: relative;
float: left;
/* position: relative;
width: 508px !important;
width: 478px;
width: 478px; */
width: 62%;
font-size: 100%;
margin: 12px;
margin: 1em;
}
#main p { line-height: 1.5em; margin-top: 1.2em; }
#main img { margin: .5em }
#main img { margin: 0.5em }
#main img.emoticon { margin: 0; padding: 0 }
/* === List === */
#main ul {
@ -224,7 +250,7 @@ h4 { font-size: 1.2em; }
/* === Class of main block === */
h2.date {
font-size: 0.5em;
font-size: 80%;
color: #aaa;
}
@ -232,7 +258,7 @@ h4 { font-size: 1.2em; }
font-size: 80%;
font-style: oblique;
color: gray;
margin: .2em 0 .8em 0
margin: .2em 0 0 0
}
/* .entry class */
@ -284,6 +310,9 @@ h4 { font-size: 1.2em; }
clear: both;
font-size: 80%;
color: #555;
padding: 5px;
background-color: #dcdcdc;
padding: 1em;
margin: 0 1em 1em 1em;
text-align: center;
border-top: #bbb 1px solid
}

View File

@ -7,8 +7,11 @@ Ispired by: http://pluxml.org theme default
Name: Leggero
Author: NoWhereMan & drudo
Version: 0.1
Version: 0.2
Module: style.css
last change: 2020-08-08
*/
@ -30,5 +33,67 @@ body { margin: 80px 0 0 0 }
#comments li.comment-admin strong.comment-name { font-size:140% }
#widget-searchbox form {
text-align: center;
/* text-align: center; */
}
/* 800er Bildschirme zum Beispiel iPad Hochformat */
@media only screen and (max-width: 768px) {
#outer-container {
margin: 0;
padding: 0;
width: 100%;
}
#main {
width: 100%;
padding: 0.5em;
/* border: 1px solid yellow; */
}
#column {
width: 100%;
font-size: 80%;
margin-bottom: 2em;
padding: 0.5em;
/* border: 1px solid red; */
overflow: auto; /* shit, bei 84% Bildbreite wird es eng! */
}
}
/* Kleinbildschirme */
@media only screen and (max-width: 480px) {
#body-container {
margin: 0;
padding: 0;
width: 98%;
}
#head {
margin: 0;
padding: 0;
width: 100%;
}
#outer-container {
margin: 0;
padding: 0;
width: 100%;
}
#main {
margin: 0;
padding: 0;
width: 100%;
}
#column {
margin: 0;
padding: 0;
width: 100%;
}
}

View File

@ -0,0 +1,15 @@
<?php
$lang['plugin']['accessibleantispam'] = array(
'prefix' => 'Para ayudar a eliminar los ataques de spam automatizados '.
'debemos pedirle que demuestre que es humano. Que es ',
'sum' => '%s más %s ?',
'sub' => '%2$s extraído de %1$s ?',
'prod' => '%s veces %s ?',
'error' => 'Lo siento, diste una respuesta incorrecta. Inténtalo de nuevo.'
);

View File

@ -1,22 +1,20 @@
<?php
/*
Plugin Name: Accessible Antispam
Plugin URI: http://flatpress.nowherland.it/
Description: Antispam asking to answer a simple math question.
Author: NoWhereMan (E.Vacchi)
Version: 3.0
Author URI: http://www.nowhereland.it
*/
* Plugin Name: Accessible Antispam
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Antispam asking to answer a simple math question. Part of the standard distribution.
* Version: 3.0
*/
define('AASPAM_DEBUG', false);
define('AASPAM_LOG', CACHE_DIR . 'aaspamlog.txt');
add_action('comment_validate', 'plugin_aaspam_validate', 5, 2);
add_action('comment_form', 'plugin_aaspam_comment_form');
function plugin_aaspam_validate($bool, $arr) {
// if boolean $bool==false
// the test is forced to fail
if (!$bool)
@ -25,118 +23,116 @@ function plugin_aaspam_validate($bool, $arr) {
// if user is loggedin we ignore the plugin
if (user_loggedin())
return true;
// get the value and reset last saved, so that
// an attacker can't use the old one for multiple posting
$v = sess_remove('aaspam');
// we get the array stored in session:
// if it evaluated to false value (e.g. is null) test fails
if (!$v) {
return false;
}
// we test the result wether match user input
if (!($ret = $_POST['aaspam']==$v)) {
// we test the result wether match user input
if (!($ret = $_POST ['aaspam'] == $v)) {
global $smarty;
$lang = lang_load('plugin:accessibleantispam');
$smarty->append('error', $lang['plugin']['accessibleantispam']['error']);
$smarty->append('error', $lang ['plugin'] ['accessibleantispam'] ['error']);
}
if ( AASPAM_DEBUG && $f=@fopen(AASPAM_LOG, 'a') ) {
$arr['aaspam-q'] = $_POST['aaspam'];
$arr['aaspam-a'] = $v;
$arr['SUCCESS'] = $ret;
$s = date('r'). "|" . session_id().'|'.utils_kimplode($arr)."\r\n";
@fwrite($f, $s);
@fclose($f);
}
if (AASPAM_DEBUG && $f = @fopen(AASPAM_LOG, 'a')) {
$arr ['aaspam-q'] = $_POST ['aaspam'];
$arr ['aaspam-a'] = $v;
$arr ['SUCCESS'] = $ret;
$s = date('r') . "|" . session_id() . '|' . utils_kimplode($arr) . "\r\n";
@fwrite($f, $s);
@fclose($f);
}
return $ret;
}
function plugin_aaspam_comment_form() {
// we get a random arithmetic operation
// between sum, subtraction and multiplication;
// we intentionally left out division because
// it can lead to situations like division by zero
// or floating point numbers
$myop = array_rand($ops = array(
'+',
'-',
'*'
));
$op = $ops [$myop];
$myop = array_rand($ops=array('+','-','*'));
$op=$ops[$myop];
// we get two random integers between 1 and 10
$v1 = mt_rand(1, 10);
// we rand $v2 until it differs from $v1
// (otherwise result for subtractions is zero)
while (($v2 = mt_rand(1, 10))==$v1);
// we rand $v2 until it differs from $v1
// (otherwise result for subtractions is zero)
while (($v2 = mt_rand(1, 10)) == $v1)
;
// if operation is subtraction
// the higher number must always come first
// or you'll get a negative integer
if ($v2>$v1 && $op=='-') {
if ($v2 > $v1 && $op == '-') {
$tmp = $v1;
$v1 = $v2;
$v2 = $tmp;
}
// execute the operation
switch($op) {
case '+' :
$v = $v1+$v2;
switch ($op) {
case '+':
$v = $v1 + $v2;
break;
case '-' :
$v = $v1-$v2;
case '-':
$v = $v1 - $v2;
break;
case '*' :
$v = $v1*$v2;
case '*':
$v = $v1 * $v2;
break;
}
}
sess_add('aaspam', $v);
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:accessibleantispam');
$langstrings =& $lang['plugin']['accessibleantispam'];
$langstrings = & $lang ['plugin'] ['accessibleantispam'];
// get the correct question depending on the operation
switch($op) {
case '+' :
$question = $langstrings['sum'];
switch ($op) {
case '+':
$question = $langstrings ['sum'];
break;
case '-' :
$question = $langstrings['sub'];
case '-':
$question = $langstrings ['sub'];
break;
case '*' :
$question = $langstrings['prod'];
case '*':
$question = $langstrings ['prod'];
break;
}
}
// format the question with numbers at the proper positions
$question = sprintf($question, $v1, $v2);
if ( AASPAM_DEBUG && $f=@fopen(AASPAM_LOG, 'a') ) {
$arr['aaspam-q'] = $v;
@fwrite($f, date('r'). '|'.session_id() .'|'. utils_kimplode($arr)."\r\n");
if (AASPAM_DEBUG && $f = @fopen(AASPAM_LOG, 'a')) {
$arr ['aaspam-q'] = $v;
@fwrite($f, date('r') . '|' . session_id() . '|' . utils_kimplode($arr) . "\r\n");
@fclose($f);
}
// echoes the question and the form part
echo <<<STR
<p><label class="textlabel" for="aaspam">{$lang['plugin']['accessibleantispam']['prefix']} <strong>$question (*)</strong></label><br />
<input type="text" name="aaspam" id="aaspam" /></p>
STR;
<p><label class="textlabel" for="aaspam">{$lang['plugin']['accessibleantispam']['prefix']} <strong>$question (*)</strong></label><br />
<input type="text" name="aaspam" id="aaspam" /></p>
STR;
}
?>

View File

@ -0,0 +1,14 @@
<?php
$lang['plugin']['adminarea'] = array(
'subject' => 'Área de administración',
'welcome' => 'Bienvenido ',
'admin_panel' => 'Panel de administrador',
'add_entry' => 'Añadir entrada',
'add_static' => 'Añadir estática',
'logout' => 'Cerrar sesión'
);
?>

View File

@ -2,11 +2,11 @@
/*
* Plugin Name: AdminArea
* Plugin URI: http://www.nowhereland.it/
* Description: AdminArea plugin. Part of the standard distribution ;)
* Author: NoWhereMan
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: AdminArea plugin. Part of the standard distribution.
* Version: 1.0
* Author URI: http://www.nowhereland.it/
*/
function plugin_adminarea_widget() {

View File

@ -0,0 +1,23 @@
<?php
$lang['plugin']['akismet']['errors'] = array (
-1 => 'No se estableció la clave de API. Abra el Plugin para configurar su clave de API. Registrarse en <a href="http://wordpress.com">Wordpress.com</a> para conseguir uno'
);
$lang['admin']['plugin']['submenu']['akismet'] = 'Configuración de Akismet';
$lang['admin']['plugin']['akismet'] = array(
'head' => 'Configuración de Akismet',
'description'=>'Para muchas personas, <a href="http://akismet.com/">Akismet</a> reducirá en gran medida '
.'o incluso eliminar por completo el spam de comentarios y trackback que recibe en su sitio. '
.'Si aún no tiene una cuenta de WordPress.com, puede obtener una en '.
'<a href="http://wordpress.com/api-keys/">WordPress.com</a>.',
'apikey' => 'WordPress.com API Key',
'whatis' => '(<a href="http://faq.wordpress.com/2005/10/19/api-key/">¿Que es esto?</a>)',
'submit' => 'Guardar clave de API'
);
$lang['admin']['plugin']['akismet']['msgs'] = array(
1 => 'Clave de API guardada',
-1 => 'La clave de API no es válida'
);
?>

View File

@ -1,14 +1,12 @@
<?php
/*
Plugin Name: Akismet
Version: 0.1
Plugin URI: http://flatpress.sf.net
Description: Integration with Akismet powerful Antispam system!
Author: NoWhereMan
Author URI: http://flatpress.sf.net
*/
* Plugin Name: Akismet
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Integration with Akismet powerful Antispam system. Part of the standard distribution.
* Version: 1.0
*/
define('AKISMET_TIMEOUT', 10);
require plugin_getdir('akismet') . '/inc/Akismet.class.php';
@ -16,70 +14,71 @@ require plugin_getdir('akismet') . '/inc/Akismet.class.php';
function plugin_akismet_setup() {
global $fp_config;
if (!plugin_getoptions('akismet','apikey')) {
if (!plugin_getoptions('akismet', 'apikey')) {
return -1;
}
return 1;
return 1;
}
if (plugin_getoptions('akismet','apikey')) {
add_filter('comment_validate','plugin_akismet_validate', 10, 2);
if (plugin_getoptions('akismet', 'apikey')) {
add_filter('comment_validate', 'plugin_akismet_validate', 10, 2);
}
function plugin_akismet_validate($bool, $contents) {
if (!$bool) return false;
global $fp_config;
$akismet = new Akismet($fp_config['general']['www'], plugin_getoptions('akismet','apikey'));
$akismet->setAuthor($contents['name']);
$akismet->setAuthorEmail(isset($contents['email'])? $contents['email'] : '');
$akismet->setAuthorURL(isset($contents['url'])? $contents['url'] : '');
$akismet->setContent($contents['content']);
if ($v= $akismet->isSpam()){
global $smarty;
$smarty->assign('error', array('ERROR: Comment is invalid'));
if (!$bool)
return false;
}
global $fp_config;
$akismet = new Akismet($fp_config ['general'] ['www'], plugin_getoptions('akismet', 'apikey'));
$akismet->setAuthor($contents ['name']);
$akismet->setAuthorEmail(isset($contents ['email']) ? $contents ['email'] : '');
$akismet->setAuthorURL(isset($contents ['url']) ? $contents ['url'] : '');
$akismet->setContent($contents ['content']);
if ($v = $akismet->isSpam()) {
global $smarty;
$smarty->assign('error', array(
'ERROR: Comment is invalid'
));
return false;
}
return true;
}
if (class_exists('AdminPanelAction')){
if (class_exists('AdminPanelAction')) {
class admin_plugin_akismet extends AdminPanelAction {
class admin_plugin_akismet extends AdminPanelAction {
var $langres = 'plugin:akismet';
function setup() {
$this->smarty->assign('admin_resource', "plugin:akismet/admin.plugin.akismet");
}
function main() {
$akismetconf = plugin_getoptions('akismet');
$this->smarty->assign('akismetconf', $akismetconf);
}
function onsubmit() {
global $fp_config;
if ($_POST['wp-apikey']){
plugin_addoption('akismet', 'apikey', $_POST['wp-apikey']);
if ($_POST ['wp-apikey']) {
plugin_addoption('akismet', 'apikey', $_POST ['wp-apikey']);
plugin_saveoptions('akismet');
$this->smarty->assign('success', 1);
} else {
$this->smarty->assign('success', -1);
$this->smarty->assign('success', -1);
}
return 2;
}
}
admin_addpanelaction('plugin', 'akismet', true);
}

View File

@ -0,0 +1,9 @@
<?php
$lang['plugin']['archives'] = array(
'subject' => 'Archivos',
'no_posts' => 'No hay publicaciones',
);
?>

View File

@ -1,86 +1,84 @@
<?php
/*
Plugin Name: Archives
Version: 1.0
Plugin URI: http://flatpress.sf.net
Description: Adds an Archive widget element
Author: NoWhereMan
Author URI: http://flatpress.sf.net
*/
* Plugin Name: Archives
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Adds an Archive widget element. Part of the standard distribution.
* Version: 1.0
*/
class plugin_archives_monthlist extends fs_filelister {
var $_directory = CONTENT_DIR;
var $_list = array();
var $_htmllist = array();
var $_months = array();
var $_year = '';
function _checkFile($directory, $file) {
$f = "$directory/$file";
if (ctype_digit($file)) {
if ($this->_directory === $directory) {
// add year to the list (do not closes li, because
// we may have nested elements)
$this->_year = $file;
$lnk = get_year_link($file);
$this->_htmllist[$this->_year] = "<li class=\"archive-year archive-y20$file\"> <a href=\"$lnk\">20$file</a>";
return 1;
} elseif (is_dir($f)) {
$this->_months[] = $file;
return 0;
}
var $_directory = CONTENT_DIR;
var $_list = array();
var $_htmllist = array();
var $_months = array();
var $_year = '';
function _checkFile($directory, $file) {
$f = "$directory/$file";
if (ctype_digit($file)) {
if ($this->_directory === $directory) {
// add year to the list (do not closes li, because
// we may have nested elements)
$this->_year = $file;
$lnk = get_year_link($file);
$this->_htmllist [$this->_year] = "<li class=\"archive-year archive-y20$file\"> <a href=\"$lnk\">20$file</a>";
return 1;
} elseif (is_dir($f)) {
$this->_months [] = $file;
return 0;
}
}
function _exitingDir($directory = null, $file=null) {
$y = $this->_year;
if ($mos =& $this->_months) {
sort($mos);
$list = '';
$linearlist = array();
foreach($mos as $mth) {
$lnk = get_month_link($y, $mth);
$the_month = theme_date_format( mktime(0, 0, 0, $mth, 1, 0 ), '%B');
$list = "<li class=\"archive-month archive-m$mth\"><a href=\"$lnk\">".
$the_month
.' </a></li>' . $list;
$linearlist["$the_month 20{$this->_year}"] = $lnk;
}
$list = '<ul>' . $list . '</ul>';
}
function _exitingDir($directory = null, $file = null) {
$y = $this->_year;
if ($mos = & $this->_months) {
sort($mos);
$list = '';
$linearlist = array();
foreach ($mos as $mth) {
$lnk = get_month_link($y, $mth);
$the_month = theme_date_format(mktime(0, 0, 0, $mth, 1, 0), '%B');
$list = "<li class=\"archive-month archive-m$mth\"><a href=\"$lnk\">" . $the_month . ' </a></li>' . $list;
$linearlist ["$the_month 20{$this->_year}"] = $lnk;
}
$mos = array();
// we close year's li
$this->_list[$y] = $linearlist;
$this->_htmllist[$y] .= $list . '</li>';
$list = '<ul>' . $list . '</ul>';
}
function getList() {
krsort($this->_list);
return $this->_list;
}
function getHtmlList() {
krsort($this->_htmllist);
return implode($this->_htmllist);
}
$mos = array();
// we close year's li
$this->_list [$y] = $linearlist;
$this->_htmllist [$y] .= $list . '</li>';
}
function getList() {
krsort($this->_list);
return $this->_list;
}
function getHtmlList() {
krsort($this->_htmllist);
return implode($this->_htmllist);
}
}
function plugin_archives_head() {
global $PLUGIN_ARCHIVES_MONTHLIST;
$PLUGIN_ARCHIVES_MONTHLIST = new plugin_archives_monthlist;
$PLUGIN_ARCHIVES_MONTHLIST = new plugin_archives_monthlist();
echo "\n<!-- archives -->\n";
foreach($PLUGIN_ARCHIVES_MONTHLIST->getList() as $y => $months) {
foreach ($PLUGIN_ARCHIVES_MONTHLIST->getList() as $y => $months) {
foreach ($months as $ttl => $link)
echo "<link rel=\"archives\" title=\"{$ttl}\" href=\"{$link}\" />\n";
}
@ -90,19 +88,14 @@ function plugin_archives_head() {
add_filter('wp_head', 'plugin_archives_head');
function plugin_archives_widget() {
lang_load('plugin:archives');
global $lang, $PLUGIN_ARCHIVES_MONTHLIST;
return array(
'subject' => $lang['plugin']['archives']['subject'],
'content' => ($list = $PLUGIN_ARCHIVES_MONTHLIST->getHtmlList()) ?
'<ul>' . $list . '</ul>'
:
"<p>{$lang['plugin']['archives']['no_posts']}</p>"
);
'subject' => $lang ['plugin'] ['archives'] ['subject'],
'content' => ($list = $PLUGIN_ARCHIVES_MONTHLIST->getHtmlList()) ? '<ul>' . $list . '</ul>' : "<p>{$lang['plugin']['archives']['no_posts']}</p>"
);
}
register_widget('archives', 'Archives', 'plugin_archives_widget');

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
<?php
$lang['admin']['plugin']['submenu']['bbcode'] = 'BBCode';
$lang['admin']['plugin']['bbcode'] = array(
'head' => 'Configuración de BBCode',
'desc1' => 'Este Plugin permite usar <a href="http://www.phpbb.com/'.
'phpBB/faq.php?mode=bbcode">BBCode</a> markup y proporciona '.
'integración automática con lightbox (cuando también está habilitado).',
'options' => 'Opciones',
'editing' => 'Edición',
'allow_html' => 'HTML en línea',
'allow_html_long' => 'Habilite el uso de HTML junto con BBCode',
'toolbar' => 'Barra de herramientas',
'toolbar_long' => 'Habilite la barra de herramientas del editor.',
'other' => 'Otras opciones',
'comments' => 'Comments',
'comments_long' => 'Permitir BBCode en los comentarios',
'urlmaxlen' => 'Largo máximo del URL',
'urlmaxlen_long_pre' => 'Acorte los URL más largos de ',
'urlmaxlen_long_post' =>' caracteres.',
'submit' => 'Save configuration',
'msgs' => array(
1 => 'BBCode configuration successful saved.',
-1 => 'Configuración de BBCode no guardada.'
),
'editor' => array(
'formatting' => 'Formateo',
'textarea' => 'Área de texto: ',
'expand' => 'Ampliar',
'expandtitle' => 'Ampliar la altura del área de texto',
'reduce' => 'Reducir',
'reducetitle' => 'Reducir la altura del área de texto',
// note: accesskeys are not internationalized...
// btw. why not :-D
'bold' => 'B',
'boldtitle' => 'Negrita',
'italic' => 'I',
'italictitle' => 'Itálica',
'underline' => 'U',
'underlinetitle' => 'Subrayada',
'quote' => 'Quote',
'quotetitle' => 'Citar',
'code' => 'Code',
'codetitle' => 'Código',
'help' => 'Ayuda de BBCode',
// currently not used
'status' => 'Barra de estado',
'statusbar' => 'Modo normal. presiona &lt;Esc&gt; para cambiar el modo de edición.'
)
);
?>

View File

@ -43,7 +43,7 @@ $lang['admin']['plugin']['bbcode'] = array(
'underline' => 'S',
'underlinetitle' => 'Sottolineato',
'quote' => 'Cita',
'quotetitle' => 'Cita',
'quotetitle' => 'Citazione',
'code' => 'Codice',
'codetitle' => 'Codice',
'help' => 'Guida di BBCode',

View File

@ -1,11 +1,11 @@
<?php
/*
* Plugin Name: BBCode
* Version: 1.5
* Plugin URI: http://flatpress.sf.net
* Description: Allows using <a href="http://www.phpbb.com/phpBB/faq.php?mode=bbcode">BBCode</a> markup; provides automatic integration with lightbox.
* Author: Hydra, NoWhereMan
* Author URI: http://flatpress.sf.net
* Version: 1.6
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Allows using <a href="http://www.phpbb.com/phpBB/faq.php?mode=bbcode">BBCode</a> markup; provides automatic integration with lightbox. Part of the standard distribution.
*/
require (plugin_getdir('bbcode') . '/inc/stringparser_bbcode.class.php');
require (plugin_getdir('bbcode') . '/panels/admin.plugin.panel.bbcode.php');
@ -191,9 +191,11 @@ function do_bbcode_img($action, $attributes, $content, $params, $node_object) {
// tiffs won't be supported
if (is_array($img_info)) {
$iptc = iptcparse($img_info ["APP13"]);
$title = @$iptc ["2#005"] [0] ? wp_specialchars($iptc ["2#005"] [0]) : $title;
$alt = isset($iptc ["2#120"] [0]) ? wp_specialchars($iptc ["2#120"] [0], 1) : $title;
if (isset($img_info ["APP13"])) {
$iptc = iptcparse($img_info ["APP13"]);
$title = @$iptc ["2#005"] [0] ? wp_specialchars($iptc ["2#005"] [0]) : $title;
$alt = isset($iptc ["2#120"] [0]) ? wp_specialchars($iptc ["2#120"] [0], 1) : $title;
}
}
}
}
@ -244,6 +246,17 @@ function do_bbcode_img($action, $attributes, $content, $params, $node_object) {
));
}
// Calculating the "loading" attribute of the image.
// For details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
// -> "lazy" is default (see https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading)
$loadingValue = 'lazy';
// Use img attribute value if explicitly set
if (isset($attributes ['loading'])) {
$loadingValue = $attributes ['loading'];
}
$loading = ' loading="' . $loadingValue . '"';
// JS for popup
if (isset($attributes ['popup']) && ($attributes ['popup'])) {
$pop_width = $orig_w ? $orig_w : 800;
$pop_height = $orig_h ? $orig_h : 600;
@ -251,8 +264,7 @@ function do_bbcode_img($action, $attributes, $content, $params, $node_object) {
// Plugin hook, here lightbox attachs
$popup = apply_filters('bbcode_img_popup', $popup, $absolutepath);
$popup_start = $attributes ['popup'] == 'true' ? '<a title="' . $title . '" href="'. /* BLOG_BASEURL . $actualpath.*/
$absolutepath . '"' . $popup . '>' : '';
$popup_start = $attributes ['popup'] == 'true' ? '<a title="' . $title . '" href="' . $absolutepath . '"' . $popup . '>' : '';
$popup_end = $attributes ['popup'] == 'true' ? '</a>' : '';
}
$img_width = $width ? ' width="' . $width . '"' : '';
@ -260,9 +272,11 @@ function do_bbcode_img($action, $attributes, $content, $params, $node_object) {
if (isset($attributes ['float'])) {
$float = ($attributes ['float'] == 'left' || $attributes ['float'] == 'right') ? ' class="float' . $attributes ['float'] . '"' : ' class="center"';
}
$src = $thumbpath ? (BLOG_BASEURL . $thumbpath) : $absolutepath; // $attributes['default'])
$src = $thumbpath ? (BLOG_BASEURL . $thumbpath) : $absolutepath;
$pop = $popup_start ? '' : ' title="' . $title . '" ';
return $popup_start . '<img src="' . $src . '" alt="' . $alt . '" ' . $pop . $float . $img_width . $img_height . ' />' . $popup_end;
// Finally: Put together the whole img tag with all its attributes and return it
return $popup_start . '<img src="' . $src . '" alt="' . $alt . '" ' . $pop . $float . $img_width . $img_height . $loading . ' />' . $popup_end;
}
/**

View File

@ -66,4 +66,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,26 @@
<?php
$lang['admin']['widgets']['submenu']['blockparser'] = 'Widgets de BlockParser';
$lang['admin']['widgets']['blockparser'] = array(
'head' => 'Widgets de BlockParser',
'description' => 'BlockParser plugin le permite crear un widget desde una página estática. </p><p>
Seleccione una o más páginas estáticas de la lista para que el widget correspondiente esté disponible.</p><p>
Cada <a href="?p=static&amp;action=write">nueva página estática</a> que cree aparecerá aquí.',
'id' => 'Página estática',
'title' => 'Titulo',
'action' => 'Action',
'enable' => 'Habilitar',
'disable' => 'Inhabilitar',
'edit' => 'Editar',
);
$lang['admin']['widgets']['blockparser']['msgs'] = array(
1 => 'Tu nuevo widget está disponible. Agréguelo a su blog desde el <a href="?p=widgets">panel principal</a>',
-1 => 'No se puede crear el widget solicitado',
2 => 'Ha desactivado un widget: no olvide eliminar las referencias del <a href="?p=widgets">panel principal</a>!',
-2 => 'No se puede desactivar el widget'
);
?>

View File

@ -2,12 +2,12 @@
/*
* Plugin Name: BlockParser
* Plugin URI: http://www.nowhereland.it/
* Type: Block
* Description: BlockParser plugin. Part of the standard distribution ;) This allow you to use simple non-plugin custom blocks :)
* Author: NoWhereMan real_nowhereman at user dot sf dot net
* Version: 1.0
* Author URI: http://www.nowhereland.it/
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Allows you to use simple non-plugin custom blocks. Part of the standard distribution.
*/
// define('BLOCKS_DIR', CONTENT_DIR . 'blocks/');

View File

@ -0,0 +1,9 @@
<?php
$lang['plugin']['calendar'] = array(
'subject' => 'Calendario'
);
?>

View File

@ -3,11 +3,11 @@
/*
* Plugin Name: Calendar
* Version: 1.1
* Plugin URI: http://flatpress.sf.net
* Type: Block
* Description: Adds a Calendar block level element
* Author: NoWhereMan
* Author URI: http://flatpress.sf.net
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Adds a calendar widget. Part of the standard distribution.
*/
// PHP Calendar (version 2.3), written by Keith Devens
@ -19,17 +19,17 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3,
// remember that mktime will automatically correct if invalid dates are entered
// for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
// this provides a built in "rounding" feature to generate_calendar()
$day_names = array(); // generate all the day names according to the current locale
for($n = 0, $t = (3 + $first_day) * 86400; $n < 7; $n++, $t += 86400) // January 4, 1970 was a Sunday
$day_names [$n] = ucfirst(date_strformat('%A', $t)); // %A means full textual day name
list ($month, $year, $month_name, $weekday) = explode(',', date_strformat('%m,%Y,%B,%w', $first_of_month));
$weekday = ($weekday + 7 - $first_day) % 7; // adjust for $first_day
$title = htmlentities(ucfirst($month_name)) . '&nbsp;' . $year; // note that some locales don't capitalize month and day names
// Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
// PHP7 compatibility: Since $pn is never passed, we do not need to create "previous" and "next" elements.
$p = '';
$n = '';
@ -37,16 +37,16 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3,
// @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable
// if($p) $p = '<span class="calendar-prev">'.($pl ? '<a href="'.($pl).'">'.$p.'</a>' : $p).'</span>&nbsp;';
// if($n) $n = '&nbsp;<span class="calendar-next">'.($nl ? '<a href="'.($nl).'">'.$n.'</a>' : $n).'</span>';
$calendar = '<table class="calendar">' . "\n" . '<caption class="calendar-month">' . $p . ($month_href ? '<a href="' . ($month_href) . '">' . $title . '</a>' : $title) . $n . "</caption>\n<tr>";
if ($day_name_length) { // if the day names should be shown ($day_name_length > 0)
// if day_name_length is >3, the full name of the day will be printed
foreach ($day_names as $d)
$calendar .= '<th abbr="' . htmlentities($d) . '">' . htmlentities($day_name_length < 4 ? substr($d, 0, $day_name_length) : $d) . '</th>';
$calendar .= "</tr>\n<tr>";
}
if ($weekday > 0)
$calendar .= '<td colspan="' . $weekday . '">&nbsp;</td>'; // initial 'empty' days
for($day = 1, $days_in_month = gmdate('t', $first_of_month); $day <= $days_in_month; $day++, $weekday++) {
@ -64,49 +64,47 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3,
}
if ($weekday != 7)
$calendar .= '<td colspan="' . (7 - $weekday) . '">&nbsp;</td>'; // remaining "empty" days
return $calendar . "</tr>\n</table>\n";
}
function plugin_calendar_widget() {
global $fp_params;
$y = isset($fp_params ['y']) ? $fp_params ['y'] : date('y');
$m = isset($fp_params ['m']) ? $fp_params ['m'] : date('m');
global $fpdb;
$q = new FPDB_Query(array(
'fullparse' => false,
'y' => $y,
'm' => $m,
'count' => -1
), null);
$days = array();
while ($q->hasmore($queryId)) {
list ($id, $entry) = $q->getEntry($queryId);
while ($q->hasmore()) {
list ($id, $entry) = $q->getEntry();
$date = date_from_id($id);
$d = (int) $date ['d'];
$days [$d] = array(
get_day_link($y, $m, str_pad($d, 2, '0', STR_PAD_LEFT)),
'linked-day'
);
$count++;
}
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:calendar');
$widget = array();
$widget ['subject'] = $lang ['plugin'] ['calendar'] ['subject'];
$widget ['content'] = '<ul id="widget_calendar"><li>' . generate_calendar($y, $m, $days) . '</li></ul>';
return $widget;
}

View File

@ -0,0 +1,9 @@
<?php
$lang['plugin']['categories'] = array(
'subject' => 'Categorías'
);
?>

View File

@ -1,34 +1,32 @@
<?php
/*
Plugin Name: Categories
Plugin URI: http://www.nowhereland.it/
Type: Block
Description: Lists your categories in a widget.
Author: NoWhereMan
Version: 1.0
Author URI: http://www.nowhereland.it/
*/
* Plugin Name: Categories
* Type: Block
* Version: 1.0
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Lists your categories in a widget. Part of the standard distribution.
*/
function plugin_categories_widget() {
global $smarty;
// set this to true if you want show the number
// of categories for each category; please notice:
// not cheap on the server, it should be cached
// somewhere else
// default: disabled
$smarty->assign('categories_showcount', false);
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:categories');
$entry['subject'] = $lang['plugin']['categories']['subject'];
$entry['content'] = $smarty->fetch('plugin:categories/widget');
$entry ['subject'] = $lang ['plugin'] ['categories'] ['subject'];
$entry ['content'] = $smarty->fetch('plugin:categories/widget');
return $entry;
}

View File

@ -122,7 +122,7 @@ class admin_entry_commentcenter extends AdminPanelAction {
$smarty->assign('pl_conf', $conf);
$conf=$plugin->getConf();
if($conf['akismet_check']) {
if(isset($conf) && array_key_exists('akismet_check', $conf) && $conf['akismet_check']) {
$akismet=$plugin->akismetLoad();
if(is_numeric($akismet)) {
$error=$lang['admin']['entry']['commentcenter']['akismet_errors'][$akismet];

View File

@ -1,9 +1,9 @@
<?php
$lang['admin']['entry']['submenu']['commentcenter']='Comment Center';
$lang['admin']['entry']['submenu']['commentcenter']='Centro commenti';
$lang['admin']['entry']['commentcenter']=array(
# Header of the panel
'title'=>'Comment Center',
'title'=>'Centro commenti',
'desc1'=>'Questo pannello ti consente di gestire i commenti del tuo blog.',
'desc2'=>'Qui puoi fare numerose cose:',
@ -20,8 +20,8 @@ $lang['admin']['entry']['commentcenter']=array(
'criteria'=>'Criteri',
'behavoir'=>'Comportamento',
'options'=>'Opzioni',
'entry'=>'Post',
'entries'=>'Post',
'entry'=>'Articolo',
'entries'=>'Articoli',
'categories'=>'Categorie',
'nopolicies'=>'Non c\'è nessuna regola.',
'all_entries'=>'Tutti i post',

View File

@ -4,9 +4,9 @@
* Plugin Name: Comment Center
* Version: 1.1.2
* Plugin URI: https://www.flatpress.org
* Description: Manage your blog's comments: Set policies, publish or reject comments.
* Author: FlatPress (credits to Piero VDFN)
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Manage your blog's comments: Set policies, publish or reject comments. Part of the standard distribution.
*/
/**
@ -62,8 +62,8 @@ class plugin_commentcenter {
function lock() {
global $fp_params, $post, $smarty;
$this->loadPolicies();
$cats = is_array($post ['categories']) ? $post ['categories'] : array();
$behavoir = $this->behavoirFromPolicies($fp_params ['entry'], $cats);
$cats = array_key_exists('categories', $post) && is_array($post ['categories']) ? $post ['categories'] : array();
$behavoir = array_key_exists('entry', $fp_params) ? $this->behavoirFromPolicies($fp_params ['entry'], $cats) : 1;
if ($behavoir == -1 && !user_loggedin()) {
$smarty->assign('entry_commslock', true);
}

View File

@ -2,6 +2,9 @@
{html_form}
<h2>{$plang.configure}</h2>
<p>{$plang.desc_conf}</p>
{if !isset($pl_conf)}
{assign var=pl_conf value=""}
{/if}
<dl class="option-set">
<dt><label for="log_all">{$plang.log_all}</label></dt>

View File

@ -1,17 +1,17 @@
<table class="entrylist table">
<thead><tr>
{if !$delete}<th></th>{/if}
{if !isset($delete)}<th></th>{/if}
<th>{$plang.app_date}</th>
<th>{$plang.app_content}</th>
<th>{$plang.app_author}</th>
<th>{$plang.app_email}</th>
<th>{$plang.app_ip}</th>
{if !$delete}<th>{$plang.app_actions}</th>{/if}
{if !isset($delete)}<th>{$plang.app_actions}</th>{/if}
</tr></thead>
<tbody>
{assign var="i" value=0}
{foreach from=$entries key=entryid item=entry}
{if count($entry.$fetch)>0 && !$is_managing}<tr><td colspan="{if $delete}5{else}7{/if}">{$entryid|idToSubject} ({$entryid})</td></tr>
{if count($entry.$fetch)>0 && !$is_managing}<tr><td colspan="{if isset($delete)}5{else}7{/if}">{$entryid|idToSubject} ({$entryid})</td></tr>
{/if}
{foreach from=$entry.$fetch item=comm key=comm_id}
{assign var="i" value=$i+1}
@ -20,15 +20,17 @@
<td>{$comm.date|date_format:"%D, %T"}</td>
<td class="main_cell">
{$comm.content|strip_tags}
{if $delete}<input type="hidden" value="on" name="select[e{$entryid}_c{$comm_id}]" />
{if isset($delete)}<input type="hidden" value="on" name="select[e{$entryid}_c{$comm_id}]" />
{/if}
</td>
<td>{if $comm.url}<a href="{$comm.url|wp_specialchars}">{$comm.name|wp_specialchars}</a>{else}{$comm.name|wp_specialchars}{/if}</td>
<td>{if isset($comm.url)}<a href="{$comm.url|wp_specialchars}">{$comm.name|wp_specialchars}</a>{else}{$comm.name|wp_specialchars}{/if}</td>
<td><a href="mailto:{$comm.email|wp_specialchars}">{$comm.email|wp_specialchars}</a></td>
<td>{$comm.ip-address}</td>
{if !$delete}<td>
{if $is_managing && $use_akismet}
{* a bit hackish: {$comm.ip-adress} would lead to $this->_tpl_vars['comm']['ip']-$this->_tpl_vars['ddress']; *}
{assign var=ipadress value="ip-address"}
<td>{$comm.$ipadress}</td>
{if !isset($delete)}<td>
{if isset($is_managing) && isset($use_akismet)}
<a href="{$action_url|cmd_link:commspam:"e`$entryid`_c`$comm_id`"}" title="{$plang.man_spam}"><img src="{$plugin_url}imgs/spam.png" alt="{$plang.man_spam}" /></a>
{elseif !$is_managing}
<a href="{$action_url|cmd_link:publishcomm:"e`$entryid`_c`$comm.id`"}" title="{$plang.app_publish}"><img src="{$plugin_url}imgs/publish.png" alt="{$plang.app_publish}" /></a>
@ -48,10 +50,10 @@
{/foreach}
{/foreach}
{if $i==0}
<tr><td colspan="{if $delete}5{else}7{/if}">{$plang.app_nocomms}</td></tr>{/if}
<tr><td colspan="{if isset($delete)}5{else}7{/if}">{$plang.app_nocomms}</td></tr>{/if}
</tbody>
</table>
{if !$delete}
{if !isset($delete)}
<div class="commentcenter_select" style="display: none;">
<a href="#" rel="selectAll[td_select_{$fetch}]">{$plang.select_all}</a>
<a href="#" rel="deselectAll[td_select_{$fetch}]">{$plang.deselect_all}</a>

View File

@ -1,10 +1,10 @@
<table id="commencenter-table"class="table">
<thead id="commencenter-table-head">
<tr>
{if !$delete} <th style="width: 10%;">{$plang.select}</th>{/if}
{if !isset($delete)} <th style="width: 10%;">{$plang.select}</th>{/if}
<th class="main-cell">{$plang.criteria}</th>
<th style="width: 20%;">{$plang.behavoir}</th>
{if !$delete} <th style="width: 25%;">{$plang.options}</th>{/if}
{if !isset($delete)} <th style="width: 25%;">{$plang.options}</th>{/if}
</tr>
</thead>
<tbody id="commencenter-table-body">
@ -12,7 +12,7 @@
<tr class="tr_policy{$id}">
{if !$delete} <td class="td_select"><input type="checkbox" class="form-check-input" name="select[{$id}]" /></td>{/if}
<td class="main-cell">
{if $delete}<input type="hidden" name="del_policy[]" value="{$id}" />
{if isset($delete)}<input type="hidden" name="del_policy[]" value="{$id}" />
{/if}
{if $policy.is_all}
{$plang.all_entries}
@ -45,7 +45,7 @@
{elseif $policy.do==-1}
<td>{$plang.block}</td>
{/if}
{if !$delete} <td>
{if !isset($delete)} <td>
<a href="{$action_url|cmd_link:polup:$id}" title="{$plang.up}" rel="polup[{$id}]"><img src="{$plugin_url}imgs/up.png" alt="{$plang.up}" /></a>
<a href="{$action_url|cmd_link:poldown:$id}" title="{$plang.down}" rel="poldown[{$id}]"><img src="{$plugin_url}imgs/down.png" alt="{$plang.down}" /></a>
<a href="{$action_url|cmd_link:poledit:$id}" title="{$plang.edit}"><img src="{$plugin_url}imgs/edit.png" alt="{$plang.edit}" /></a>
@ -54,7 +54,7 @@
</tr>
{foreachelse}
<tr>
<td colspan="{if $delete}2{else}4{/if}">{$plang.nopolicies}</td>
<td colspan="{if isset($delete)}2{else}4{/if}">{$plang.nopolicies}</td>
</tr>
{/foreach}
</tbody>

View File

@ -1,21 +1,20 @@
<?php
/*
Plugin Name: FavIcon
Plugin URI: http://www.flatpress.org/
Description: Adds a favicon to FlatPress
Author: NoWhereMan
Version: 1.0
Author URI: http://www.nowhereland.it/
*/
* Plugin Name: FavIcon
* Version: 1.0
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Adds a favicon to FlatPress. Part of the standard distribution.
*/
function plugin_favicon_head() {
// your file *must* be named favicon.ico
// your file *must* be named favicon.ico
// and be a ICO file (not a renamed png, jpg, gif, etc...)
// or it won't work in IE
echo '<link rel="shortcut icon" href="' .
plugin_geturl('favicon') .'imgs/favicon.ico" />';
echo '<link rel="shortcut icon" href="' . plugin_geturl('favicon') . 'imgs/favicon.ico" />';
}
add_action('wp_head', 'plugin_favicon_head');
?>

View File

@ -1,11 +1,11 @@
<?php
/*
* Plugin Name: FootNotes
* Version: 0.1
* Plugin URI: http://flatpress.nowhereland.it
* Description: footnotes in your entry
* Author: NoWhereMan
* Author URI: http://flatpress.nowhereland.it
* Version: 1.0
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Enables footnotes in your entries. Part of the standard distribution.
*/
define('FOOTNOTES_START', '[footnotes]');

View File

@ -1,28 +1,24 @@
<?php
/*
Plugin Name: jQuery
Version: 2.0.1
Plugin URI: http://www.vdfn.altervista.org/
Description: Provides <a href="http://jquery.com/" title="jQuery">jQuery</a> locally.
Author: Piero VDFN
Author URI: http://www.vdfn.altervista.org/
JQuery and JQueryUI version bump by Arvid Zimmermann
*/
## Original author: NoWhereMan (http://www.nowhereland.it)
* Plugin Name: jQuery
* Version: 2.1
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Provides <a href="http://jquery.com/" title="jQuery">jQuery</a> locally. Part of the standard distribution.
*/
// # Original author: NoWhereMan (http://www.nowhereland.it)
add_action('wp_head', 'plugin_jquery_head', 0);
function plugin_jquery_head() {
$pdir=plugin_geturl('jquery');
$pdir = plugin_geturl('jquery');
echo <<<JSUTILS
<!-- start of jsUtils -->
<script type="text/javascript" src="{$pdir}res/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="{$pdir}res/jqueryui/1.10.3/jquery-ui.min.js"></script>
<!-- end of jsUtils -->
JSUTILS;
<!-- start of jsUtils -->
<script type="text/javascript" src="{$pdir}res/jquery/3.5.1/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="{$pdir}res/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- end of jsUtils -->
JSUTILS;
}
?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More