Skip to content

Commit f1b09a1

Browse files
author
Diego
committed
Languages updated
1 parent 72c944d commit f1b09a1

File tree

10 files changed

+657
-67
lines changed

10 files changed

+657
-67
lines changed

admin/boot/feed.bit

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require_once('rules/2-objects.bit');
77
require_once('rules/3-variables.bit');
88
require_once('rules/4-blacklist.bit');
99
require_once('rules/5-regional.bit');
10+
require_once('rules/5-url.bit');
1011

1112
require_once('rules/8-posts_pages_feed.bit');
1213

admin/boot/rules/8-posts_pages_feed.bit

+19-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,26 @@ foreach($pages as $key=>$value)
3131
// =====================================================================
3232
// POSTS
3333
// =====================================================================
34-
$posts = $_DB_POST->get_list_by_page( array('page'=>0, 'amount'=>$settings['items_rss']) );
34+
$posts = array();
3535

36+
// ---- POSTS FILTER BY CATEGORY
37+
if($url['category']!==null)
38+
{
39+
// Get the category ID
40+
$category = $_DB_CATEGORIES->get_by_slug( array('slug'=>$url['category']) );
41+
42+
if($category!==false)
43+
{
44+
// Posts by category
45+
$posts = $_DB_POST->get_list_by_category( array('page'=>0, 'amount'=>$settings['items_rss'], 'id_cat'=>$category['id']) );
46+
}
47+
}
48+
else
49+
{
50+
$posts = $_DB_POST->get_list_by_page( array('page'=>0, 'amount'=>$settings['items_rss']) );
51+
}
52+
53+
// Recondition Posts
3654
foreach($posts as $key=>$value)
3755
{
3856
$post = $posts[$key];

admin/boot/rules/98-constants.bit

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// =====================================================================
1414
// SYSTEM INFORMATION
1515
// =====================================================================
16-
define('NIBBLEBLOG_VERSION', '4.0.1');
16+
define('NIBBLEBLOG_VERSION', '4.0.3');
1717
define('NIBBLEBLOG_NAME', 'Coffee');
1818
define('NIBBLEBLOG_RELEASE_DATE', '14/02/2014');
1919
define('NIBBLEBLOG_BUILD', 2392406951);

admin/views/page/includes/nb_media.bit

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ $(document).ready(function() {
7777
$("#media_url_button").click(
7878
function() {
7979
var url = $("#media_url_input").val();
80-
var img = '<img class="nb-align-left" src="'+url+'" alt="'+nb_media_alt.val()+'">';
80+
var img = '<img src="'+url+'" alt="'+nb_media_alt.val()+'">';
8181
insert_content(img);
8282
$("#media_url_input").val('http://');
8383
$('#nb_media').trigger('reveal:close');
@@ -90,7 +90,7 @@ $(document).ready(function() {
9090
$("#mm_files").on("click", "img",
9191
function() {
9292
var src = $(this).attr("data-original");
93-
var img = '<img class="nb-align-left" src="'+src+'" alt="'+nb_media_alt.val()+'">';
93+
var img = '<img src="'+src+'" alt="'+nb_media_alt.val()+'">';
9494
insert_content(img);
9595
$('#nb_media').trigger('reveal:close');
9696
});
@@ -123,7 +123,7 @@ $(document).ready(function() {
123123
$('#nb_media').trigger('reveal:close');
124124

125125
// Insert on textarea
126-
var img = '<img class="nb-align-left" src="'+json.original+'" alt="'+nb_media_alt.val()+'">';
126+
var img = '<img src="'+json.original+'" alt="'+nb_media_alt.val()+'">';
127127
insert_content(img);
128128

129129
// Insert on preview files

admin/views/post/includes/nb_media.bit

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ $(document).ready(function() {
7777
$("#media_url_button").click(
7878
function() {
7979
var url = $("#media_url_input").val();
80-
var img = '<img class="nb-align-left" src="'+url+'" alt="'+nb_media_alt.val()+'">';
80+
var img = '<img src="'+url+'" alt="'+nb_media_alt.val()+'">';
8181
insert_content(img);
8282
$("#media_url_input").val('http://');
8383
$('#nb_media').trigger('reveal:close');
@@ -90,7 +90,7 @@ $(document).ready(function() {
9090
$("#mm_files").on("click", "img",
9191
function() {
9292
var src = $(this).attr("data-original");
93-
var img = '<img class="nb-align-left" src="'+src+'" alt="'+nb_media_alt.val()+'">';
93+
var img = '<img src="'+src+'" alt="'+nb_media_alt.val()+'">';
9494
insert_content(img);
9595
$('#nb_media').trigger('reveal:close');
9696
});
@@ -123,7 +123,7 @@ $(document).ready(function() {
123123
$('#nb_media').trigger('reveal:close');
124124

125125
// Insert on textarea
126-
var img = '<img class="nb-align-left" src="'+json.original+'" alt="'+nb_media_alt.val()+'">';
126+
var img = '<img src="'+json.original+'" alt="'+nb_media_alt.val()+'">';
127127
insert_content(img);
128128

129129
// Insert on preview files

feed.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
require('admin/boot/feed.bit');
55

66
// Get the last update (the date of the last published post)
7-
$last_post = $posts[0];
8-
$updated = Date::atom($last_post['pub_date_unix']);
7+
$updated = Date::atom(time());
8+
if(isset($posts[0]))
9+
{
10+
$last_post = $posts[0];
11+
$updated = Date::atom($last_post['pub_date_unix']);
12+
}
913

1014
// Get the domain name
1115
$domain = parse_url($settings['url']);

install.php

+30-43
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/*
1313
* For 1-Click Setup
14-
* What you need to install Nibbleblog without the default form.
14+
* This are the POST variables to install Nibbleblog without the default form.
1515
* You can delete/replace this file, is independent from the blog, it only for install.
1616
*
1717
* $_POST = array('name', 'slogan', 'url', 'path', 'email', 'username', 'password')
@@ -26,47 +26,6 @@
2626
*
2727
*/
2828

29-
// =====================================================================
30-
// VARIABLES
31-
// =====================================================================
32-
$permissions_dir = 0755;
33-
34-
$php_modules = array();
35-
36-
$installation_complete = false;
37-
38-
$dependencies = true;
39-
40-
$domain = getenv('HTTP_HOST');
41-
42-
$base_path = dirname(getenv('SCRIPT_NAME'));
43-
if($base_path!='/')
44-
$base_path .='/';
45-
46-
$blog_address = 'http://'.$domain.$base_path;
47-
48-
$languages = array(
49-
'ar_MA'=>'العربية',
50-
'cs_CZ'=>'čeština',
51-
'de_DE'=>'Deutsch',
52-
'en_US'=>'English',
53-
'es_ES'=>'Español',
54-
'fr_FR'=>'Français',
55-
'fr_IR'=>'فارسی-فارسی',
56-
'hu_HU'=>'Magyar',
57-
'it_IT'=>'Italiano',
58-
'pl_PL'=>'Polski',
59-
'pt_PT'=>'Português',
60-
'ru_RU'=>'Pyccĸий',
61-
'tr_TR'=>'Tϋrkçe',
62-
'vi_VI'=>'Tiếng Việt',
63-
'zh_TW'=>'繁體中文'
64-
);
65-
66-
$languages_html = array();
67-
foreach($languages as $raw=>$lang)
68-
$languages_html[$raw] = $lang;
69-
7029
// =====================================================================
7130
// FILES
7231
// =====================================================================
@@ -92,6 +51,34 @@
9251
require(PATH_HELPERS . 'text.class.php');
9352
require(PATH_HELPERS . 'validation.class.php');
9453

54+
// =====================================================================
55+
// VARIABLES
56+
// =====================================================================
57+
$permissions_dir = 0755;
58+
59+
$php_modules = array();
60+
61+
$installation_complete = false;
62+
63+
$dependencies = true;
64+
65+
$domain = getenv('HTTP_HOST');
66+
67+
$base_path = dirname(getenv('SCRIPT_NAME'));
68+
if($base_path!='/')
69+
$base_path .='/';
70+
71+
$blog_address = 'http://'.$domain.$base_path;
72+
73+
$languages = array();
74+
$files = Filesystem::ls(PATH_LANGUAGES, '*', 'bit', false, false, false);
75+
foreach($files as $file)
76+
{
77+
include(PATH_LANGUAGES.$file);
78+
$iso = basename($file, '.bit');
79+
$languages[$iso] = $_LANG_CONFIG['DATA']['native'];
80+
}
81+
9582
// ============================================================================
9683
// SYSTEM
9784
// ============================================================================
@@ -611,7 +598,7 @@
611598

612599
// LANGUAGE
613600
echo Html::label( array('content'=>$_LANG['LANGUAGE'], 'class'=>'blocked') );
614-
echo Html::select( array('id'=>'js_language', 'name'=>'language'), $languages_html, isset($_GET['language'])?$_GET['language']:'en_US');
601+
echo Html::select( array('id'=>'js_language', 'name'=>'language'), $languages, isset($_GET['language'])?$_GET['language']:'en_US');
615602

616603
echo Html::label( array('content'=>$_LANG['BLOG_TITLE']) );
617604
echo Html::input( array('id'=>'js_name', 'name'=>'name', 'type'=>'text', 'autocomplete'=>'off', 'maxlength'=>'254', 'value'=>'') );

0 commit comments

Comments
 (0)