diff --git a/acp/acp.php b/acp/acp.php
index 35c240e3..e352703a 100644
--- a/acp/acp.php
+++ b/acp/acp.php
@@ -8,11 +8,11 @@
require '../lib/Spyc/Spyc.php';
require '../config.php';
-if(is_file('../'.FC_CONTENT_DIR.'/config.php')) {
- include '../'.FC_CONTENT_DIR.'/config.php';
+if(is_file(FC_CONTENT_DIR.'/config.php')) {
+ include FC_CONTENT_DIR.'/config.php';
}
-if(is_file('../'.FC_CONTENT_DIR.'/config_smtp.php')) {
- include '../'.FC_CONTENT_DIR.'/config_smtp.php';
+if(is_file(FC_CONTENT_DIR.'/config_smtp.php')) {
+ include FC_CONTENT_DIR.'/config_smtp.php';
}
@@ -50,10 +50,10 @@
}
- define("CONTENT_DB", "../$fc_db_content");
- define("USER_DB", "../$fc_db_user");
- define("STATS_DB", "../$fc_db_stats");
- define("POSTS_DB", "../$fc_db_posts");
+ define("CONTENT_DB", "$fc_db_content");
+ define("USER_DB", "$fc_db_user");
+ define("STATS_DB", "$fc_db_stats");
+ define("POSTS_DB", "$fc_db_posts");
$db_content = new Medoo([
'database_type' => 'sqlite',
@@ -77,7 +77,7 @@
}
-define("INDEX_DB", "../$fc_db_index");
+define("INDEX_DB", "$fc_db_index");
define("FC_ROOT", str_replace("/acp","",FC_INC_DIR));
define("IMAGES_FOLDER", "$img_path");
define("FILES_FOLDER", "$files_path");
@@ -238,7 +238,7 @@
var ace_theme = 'chrome';
var tinymce_skin = 'oxide';
var acptheme = "";
- if(acptheme === 'dark') {
+ if(acptheme === 'dark' || acptheme === 'dark_mono') {
var ace_theme = 'twilight';
var tinymce_skin = 'oxide-dark';
}
@@ -289,38 +289,78 @@
timeZone: 'UTC',
format: 'YYYY-MM-DD HH:mm'
});
+
+ function addTax(price,addition,tax) {
+ addition = parseInt(addition);
+ tax = parseInt(tax);
+ price = price*(addition+100)/100;
+ price = price*(tax+100)/100;
+ return price;
+ }
+
+ function removeTax(price,addition,tax) {
+ addition = parseInt(addition);
+ tax = parseInt(tax);
+ price = price*100/(addition+100);
+ price = price*100/(tax+100);
+ return price;
+ }
if($("#price").val()) {
- get_netto = $("#price").val();
-
+ get_price_net = $("#price").val();
var e = document.getElementById("tax");
var get_tax = e.options[e.selectedIndex].text;
get_tax = parseInt(get_tax);
- get_netto_calc = get_netto.replace(/\./g, '');
- get_netto_calc = get_netto_calc.replace(",",".");
- current_brutto = get_netto_calc*(get_tax+100)/100;
- current_brutto = accounting.formatNumber(current_brutto,4,".",",");
- $('#price_total').val(current_brutto);
+ get_price_addition = $("#price_addition").val();
+ get_net_calc = get_price_net.replace(/\./g, '');
+ get_net_calc = get_net_calc.replace(",",".");
+ current_gross = addTax(get_net_calc,get_price_addition,get_tax);
+ current_gross = accounting.formatNumber(current_gross,4,".",",");
+ $('#price_total').val(current_gross);
+
+ calculated_net = addTax(get_net_calc,get_price_addition,0);
+ calculated_net = accounting.formatNumber(calculated_net,4,".",",");
+ $('#calculated_net').html(calculated_net);
+
+ $('.show_price_tax').html(get_tax);
+ $('.show_price_addition').html(get_price_addition);
$('#price').keyup(function(){
- get_netto = $('#price').val();
- //get_tax = parseInt($('#tax').val());
- get_netto_calc = get_netto.replace(/\./g, '');
- get_netto_calc = get_netto_calc.replace(",",".");
- current_brutto = get_netto_calc*(get_tax+100)/100;
- current_brutto = accounting.formatNumber(current_brutto,4,".",",");
- $('#price_total').val(current_brutto);
- });
+ get_price_net = $('#price').val();
+ get_price_addition = $("#price_addition").val();
+ get_net_calc = get_price_net.replace(/\./g, '');
+ get_net_calc = get_net_calc.replace(",",".");
+ current_gross = addTax(get_net_calc,get_price_addition,get_tax);
+ current_gross = accounting.formatNumber(current_gross,4,".",",");
+ $('#price_total').val(current_gross);
+
+ calculated_net = addTax(get_net_calc,get_price_addition,0);
+ calculated_net = accounting.formatNumber(calculated_net,4,".",",");
+ $('#calculated_net').html(calculated_net);
+
+ });
$('#price_total').keyup(function(){
get_brutto = $('#price_total').val();
- //get_tax = parseInt($('#tax').val());
- get_brutto_calc = get_brutto.replace(/\./g, '');
- get_brutto_calc = get_brutto_calc.replace(",",".");
- current_netto = get_brutto_calc*100/(get_tax+100);
- current_netto = accounting.formatNumber(current_netto,4,".",",");
- $('#price').val(current_netto);
+ get_price_addition = $("#price_addition").val();
+ get_gross_calc = get_brutto.replace(/\./g, '');
+ get_gross_calc = get_gross_calc.replace(",",".");
+ current_net = removeTax(get_gross_calc,get_price_addition,get_tax);
+ current_net = accounting.formatNumber(current_net,4,".",",");
+ $('#price').val(current_net);
+ $('#calculated_net').html(current_net);
+ });
+
+ $('#price_addition').keyup(function(){
+ get_price_net = $('#price').val();
+ get_price_addition = $("#price_addition").val();
+
+ get_net_calc = get_price_net.replace(/\./g, '');
+ get_net_calc = get_net_calc.replace(",",".");
+ current_gross = addTax(get_net_calc,get_price_addition,get_tax);
+ current_gross = accounting.formatNumber(current_gross,4,".",",");
+ $('#price_total').val(current_gross);
});
$('#tax').bind("change keyup", function(){
@@ -329,19 +369,100 @@
var get_tax = e.options[e.selectedIndex].text;
get_tax = parseInt(get_tax);
- get_netto = $('#price').val();
- get_netto_calc = get_netto.replace(",",".");
-
- current_brutto = get_netto_calc*(get_tax+100)/100;
- current_brutto = accounting.formatNumber(current_brutto,4,".",",");
+ get_price_addition = $('#price_addition').val();
+ get_price_net = $('#price').val();
+ get_net_calc = get_price_net.replace(",",".");
- get_brutto_calc = current_brutto.replace(",",".");
- current_netto = get_brutto_calc*100/(get_tax+100);
- current_netto = accounting.formatNumber(current_netto,4,".",",");
+ current_gross = addTax(get_net_calc,get_price_addition,get_tax);
+ current_gross = accounting.formatNumber(current_gross,4,".",",");
- $('#price_total').val(current_brutto);
- $('#price').val(current_netto);
+ $('#price_total').val(current_gross);
+ });
+
+
+ get_price_net_s1 = $('#price_s1').val();
+ price_s1 = showScaledPrices(get_price_net_s1,get_price_addition,get_tax);
+ $('#calculated_net_s1').html(price_s1['net']);
+ $('#calculated_gross_s1').html(price_s1['gross']);
+
+ $('#price_s1').keyup(function(){
+ get_price_net_s1 = $('#price_s1').val();
+ price = showScaledPrices(get_price_net_s1,get_price_addition,get_tax);
+ $('#calculated_net_s1').html(price['net']);
+ $('#calculated_gross_s1').html(price['gross']);
+ });
+
+ get_price_net_s2 = $('#price_s2').val();
+ price_s2 = showScaledPrices(get_price_net_s2,get_price_addition,get_tax);
+ $('#calculated_net_s2').html(price_s2['net']);
+ $('#calculated_gross_s2').html(price_s2['gross']);
+
+ $('#price_s2').keyup(function(){
+ get_price_net_s2 = $('#price_s2').val();
+ price = showScaledPrices(get_price_net_s2,get_price_addition,get_tax);
+ $('#calculated_net_s2').html(price['net']);
+ $('#calculated_gross_s2').html(price['gross']);
+ });
+
+ get_price_net_s3 = $('#price_s3').val();
+ price_s3 = showScaledPrices(get_price_net_s3,get_price_addition,get_tax);
+ $('#calculated_net_s3').html(price_s3['net']);
+ $('#calculated_gross_s3').html(price_s3['gross']);
+
+ $('#price_s3').keyup(function(){
+ get_price_net_s3 = $('#price_s3').val();
+ price = showScaledPrices(get_price_net_s3,get_price_addition,get_tax);
+ $('#calculated_net_s3').html(price['net']);
+ $('#calculated_gross_s3').html(price['gross']);
+ });
+
+ get_price_net_s4 = $('#price_s4').val();
+ price_s4 = showScaledPrices(get_price_net_s4,get_price_addition,get_tax);
+ $('#calculated_net_s4').html(price_s4['net']);
+ $('#calculated_gross_s4').html(price_s4['gross']);
+
+ $('#price_s4').keyup(function(){
+ get_price_net_s4 = $('#price_s4').val();
+ price = showScaledPrices(get_price_net_s4,get_price_addition,get_tax);
+ $('#calculated_net_s4').html(price['net']);
+ $('#calculated_gross_s4').html(price['gross']);
+ });
+
+ get_price_net_s5 = $('#price_s5').val();
+ price_s5 = showScaledPrices(get_price_net_s5,get_price_addition,get_tax);
+ $('#calculated_net_s5').html(price_s5['net']);
+ $('#calculated_gross_s5').html(price_s5['gross']);
+
+ $('#price_s5').keyup(function(){
+ get_price_net_s5 = $('#price_s5').val();
+ price = showScaledPrices(get_price_net_s5,get_price_addition,get_tax);
+ $('#calculated_net_s5').html(price['net']);
+ $('#calculated_gross_s5').html(price['gross']);
});
+
+
+
+ function showScaledPrices(price,addition,tax) {
+ addition = parseInt(addition);
+ tax = parseInt(tax);
+
+ price = price.replace(/\./g, '');
+ price = price.replace(",",".");
+
+ price_net = price*(addition+100)/100;
+ price_gross = price_net*(tax+100)/100;
+
+ price_net = accounting.formatNumber(price_net,4,".",",");
+ price_gross = accounting.formatNumber(price_gross,4,".",",");
+
+ var prices = new Object();
+ prices['net'] = price_net;
+ prices['gross'] = price_gross;
+
+
+ return prices;
+ }
+
}
diff --git a/acp/core/ajax.media.php b/acp/core/ajax.media.php
index f526d86c..adf5458d 100644
--- a/acp/core/ajax.media.php
+++ b/acp/core/ajax.media.php
@@ -41,7 +41,7 @@
}
- define("CONTENT_DB", "../../$fc_db_content");
+ define("CONTENT_DB", "$fc_db_content");
$db_content = new Medoo([
'database_type' => 'sqlite',
diff --git a/acp/core/dashboard.checks.php b/acp/core/dashboard.checks.php
index 511c6a65..0e881ec8 100644
--- a/acp/core/dashboard.checks.php
+++ b/acp/core/dashboard.checks.php
@@ -8,28 +8,28 @@
echo '
'.$lang['alert_no_htaccess'].'
';
}
-if(!is_dir('../'.FC_CONTENT_DIR.'/cache/cache/')) {
- mkdir('../'.FC_CONTENT_DIR.'/cache/cache/', 0777);
+if(!is_dir(FC_CONTENT_DIR.'/cache/cache/')) {
+ mkdir(FC_CONTENT_DIR.'/cache/cache/', 0777);
}
-if(!is_dir('../'.FC_CONTENT_DIR.'/cache/templates_c/')) {
- mkdir('../'.FC_CONTENT_DIR.'/cache/templates_c/', 0777);
+if(!is_dir(FC_CONTENT_DIR.'/cache/templates_c/')) {
+ mkdir(FC_CONTENT_DIR.'/cache/templates_c/', 0777);
}
$writable_items = array(
'../sitemap.xml',
- '../'.FC_CONTENT_DIR.'/',
- '../'.FC_CONTENT_DIR.'/avatars/',
- '../'.FC_CONTENT_DIR.'/cache/',
- '../'.FC_CONTENT_DIR.'/cache/cache/',
- '../'.FC_CONTENT_DIR.'/cache/templates_c/',
- '../'.FC_CONTENT_DIR.'/files/',
- '../'.FC_CONTENT_DIR.'/images/',
- '../'.FC_CONTENT_DIR.'/SQLite/',
- '../'.FC_CONTENT_DIR.'/SQLite/content.sqlite3',
- '../'.FC_CONTENT_DIR.'/SQLite/flatTracker.sqlite3',
- '../'.FC_CONTENT_DIR.'/SQLite/user.sqlite3',
- '../'.FC_CONTENT_DIR.'/SQLite/index.sqlite3'
+ ''.FC_CONTENT_DIR.'/',
+ ''.FC_CONTENT_DIR.'/avatars/',
+ ''.FC_CONTENT_DIR.'/cache/',
+ ''.FC_CONTENT_DIR.'/cache/cache/',
+ ''.FC_CONTENT_DIR.'/cache/templates_c/',
+ ''.FC_CONTENT_DIR.'/files/',
+ ''.FC_CONTENT_DIR.'/images/',
+ ''.FC_CONTENT_DIR.'/SQLite/',
+ ''.FC_CONTENT_DIR.'/SQLite/content.sqlite3',
+ ''.FC_CONTENT_DIR.'/SQLite/flatTracker.sqlite3',
+ ''.FC_CONTENT_DIR.'/SQLite/user.sqlite3',
+ ''.FC_CONTENT_DIR.'/SQLite/index.sqlite3'
);
foreach($writable_items as $f) {
@@ -39,13 +39,13 @@
}
if($db_type !== 'sqlite') {
- if($f == '../'.FC_CONTENT_DIR.'/SQLite/content.sqlite3') {
+ if($f == ''.FC_CONTENT_DIR.'/SQLite/content.sqlite3') {
continue;
}
- if($f == '../'.FC_CONTENT_DIR.'/SQLite/flatTracker.sqlite3') {
+ if($f == ''.FC_CONTENT_DIR.'/SQLite/flatTracker.sqlite3') {
continue;
}
- if($f == '../'.FC_CONTENT_DIR.'/SQLite/user.sqlite3') {
+ if($f == ''.FC_CONTENT_DIR.'/SQLite/user.sqlite3') {
continue;
}
}
diff --git a/acp/core/dashboard.system.php b/acp/core/dashboard.system.php
index 369f762f..5825b12b 100644
--- a/acp/core/dashboard.system.php
+++ b/acp/core/dashboard.system.php
@@ -15,7 +15,7 @@
echo '';
$user_avatar = '
';
-$user_avatar_path = '../'. FC_CONTENT_DIR . '/avatars/' . md5($_SESSION['user_nick']) . '.png';
+$user_avatar_path = '../content/avatars/' . md5($_SESSION['user_nick']) . '.png';
if(is_file("$user_avatar_path")) {
$user_avatar = '
';
}
diff --git a/acp/core/download.php b/acp/core/download.php
index f516aac8..c22dfd23 100644
--- a/acp/core/download.php
+++ b/acp/core/download.php
@@ -13,7 +13,7 @@
$filename = basename($_GET['dl']);
- $download = '../../' . FC_CONTENT_DIR . '/SQLite/'.$filename;
+ $download = FC_CONTENT_DIR . '/SQLite/'.$filename;
if(is_file("$download")) {
diff --git a/acp/core/files.upload-script.php b/acp/core/files.upload-script.php
index cdb4f1a6..887709c8 100644
--- a/acp/core/files.upload-script.php
+++ b/acp/core/files.upload-script.php
@@ -48,7 +48,7 @@
}
- define("CONTENT_DB", "../../$fc_db_content");
+ define("CONTENT_DB", "$fc_db_content");
$db_content = new Medoo([
'database_type' => 'sqlite',
diff --git a/acp/core/functions.php b/acp/core/functions.php
index c6853c81..05898064 100644
--- a/acp/core/functions.php
+++ b/acp/core/functions.php
@@ -135,10 +135,10 @@ function get_preferences() {
* - dashboard_listed_all_addons
*/
-function fc_get_hook($posion,$data) {
+function fc_get_hook($position,$data) {
global $all_mods;
- $hook = basename($posion);
+ $hook = basename($position);
foreach($all_mods as $mod) {
diff --git a/acp/core/functions_addons.php b/acp/core/functions_addons.php
index e35553f0..776455e1 100644
--- a/acp/core/functions_addons.php
+++ b/acp/core/functions_addons.php
@@ -14,16 +14,17 @@
function get_all_plugins() {
- $dir = "../content/";
$plugins = array();
- $scanned_directory = array_diff(scandir('../'.FC_CONTENT_DIR.'/plugins/'), array('..', '.','.DS_Store'));
+ $scanned_directory = array_diff(scandir(FC_CONTENT_DIR.'/plugins/'), array('..', '.','.DS_Store'));
foreach($scanned_directory as $p) {
$path_parts = pathinfo($p);
- if($path_parts['extension'] != 'php') {
- continue;
- } else {
+ if($path_parts['extension'] == 'php') {
$plugins[] = $p;
+ } else {
+ if((is_dir(FC_CONTENT_DIR.'/plugins/'.$p)) && (is_file(FC_CONTENT_DIR.'/plugins/'.$p.'/index.php'))) {
+ $plugins[] = $p;
+ }
}
}
@@ -79,6 +80,54 @@ function fc_get_addons($t='module') {
}
+/**
+ * delete addon and its contents
+ */
+
+function fc_delete_addon($addon,$type) {
+
+ if($type == 'm') {
+ $dir = '../modules';
+ } else if($type == 'p') {
+ $dir = FC_CONTENT_DIR.'/plugins';
+ } else if($type == 't') {
+ $dir = '../styles';
+ }
+
+ $remove_dir = $dir.'/'.$addon;
+ fc_reomove_addon_files($remove_dir);
+ $record_msg = 'removed addon:
'.$addon.' ('.$type.')';
+ record_log($_SESSION['user_nick'],$record_msg,"8");
+}
+
+/**
+ * remove addon contents
+ * folders (recursive) and/or files
+ */
+
+ function fc_reomove_addon_files($item) {
+ if(is_dir($item)){
+ $objects = scandir($item);
+ foreach ($objects as $object) {
+ if ($object != "." && $object != "..") {
+ if(filetype($item."/".$object) == "dir") {
+ fc_reomove_addon_files($item."/".$object);
+ } else {
+ unlink($item."/".$object);
+ }
+ }
+ }
+ reset($objects);
+ rmdir($item);
+ }
+
+ if(is_file($item)) {
+ unlink($item);
+ }
+
+ }
+
+
/**
* show all installed templates
@@ -171,7 +220,7 @@ function mods_check_in() {
$str = "";
- $file = "../" . FC_CONTENT_DIR . "/cache/active_mods.php";
+ $file = FC_CONTENT_DIR . "/cache/active_mods.php";
file_put_contents($file, $str, LOCK_EX);
}
diff --git a/acp/core/functions_cache.php b/acp/core/functions_cache.php
index 3a867bd4..8abb87bb 100644
--- a/acp/core/functions_cache.php
+++ b/acp/core/functions_cache.php
@@ -55,7 +55,7 @@ function cache_lastedit($num = 5) {
$string .= "?>";
- $file = "../" . FC_CONTENT_DIR . "/cache/cache_lastedit.php";
+ $file = FC_CONTENT_DIR . "/cache/cache_lastedit.php";
file_put_contents($file, $string, LOCK_EX);
}
@@ -110,7 +110,7 @@ function cache_keywords() {
} // eol foreach
- $file = "../" . FC_CONTENT_DIR . "/cache/cache_keywords.html";
+ $file = FC_CONTENT_DIR . "/cache/cache_keywords.html";
file_put_contents($file, $page_keywords, LOCK_EX);
}
@@ -122,7 +122,7 @@ function cache_keywords() {
function delete_cache_file($file='cache_mostclicked') {
- $fp = "../" . FC_CONTENT_DIR . "/cache";
+ $fp = FC_CONTENT_DIR . "/cache";
$file = basename($file) . ".php";
if(is_file("$fp/$file")) {
@@ -141,8 +141,8 @@ function fc_delete_smarty_cache($cache_id) {
require_once '../lib/Smarty/Smarty.class.php';
$smarty = new Smarty;
- $smarty->cache_dir = '../'.FC_CONTENT_DIR.'/cache/cache/';
- $smarty->compile_dir = '../'.FC_CONTENT_DIR.'/cache/templates_c/';
+ $smarty->cache_dir = FC_CONTENT_DIR.'/cache/cache/';
+ $smarty->compile_dir = FC_CONTENT_DIR.'/cache/templates_c/';
if($cache_id == 'all') {
$smarty->clearAllCache();
@@ -181,7 +181,7 @@ function cache_url_paths() {
}
$str = "";
- $file = "../" . FC_CONTENT_DIR . "/cache/active_urls.php";
+ $file = FC_CONTENT_DIR . "/cache/active_urls.php";
file_put_contents($file, $str, LOCK_EX);
}
diff --git a/acp/core/functions_index.php b/acp/core/functions_index.php
index fb64a21f..82df107a 100644
--- a/acp/core/functions_index.php
+++ b/acp/core/functions_index.php
@@ -483,6 +483,18 @@ function fc_add_url($url) {
}
+/**
+ * delete page by id from pages table
+ */
+
+function fc_remove_page_from_index($id) {
+ $dbh = new PDO("sqlite:".INDEX_DB);
+ $sql = "DELETE FROM pages WHERE page_id = :id";
+ $sth = $dbh->prepare($sql);
+ $sth->bindParam(':id', $id, PDO::PARAM_STR);
+ $cnt_changes = $sth->execute();
+ $dbh = null;
+}
/**
* delete URL from pages table
diff --git a/acp/core/icons.php b/acp/core/icons.php
index e56f7367..ccfb49a3 100644
--- a/acp/core/icons.php
+++ b/acp/core/icons.php
@@ -24,6 +24,7 @@
$icon['bars'] = '
';
$icon['bookmark'] = '
';
+$icon['calendar_check'] = '
';
$icon['check'] = '
';
$icon['circle_alt'] = '
';
$icon['check_circle'] = '
';
@@ -102,6 +103,8 @@
$icon['th'] = '
';
$icon['th_large'] = '
';
$icon['th_list'] = '
';
+$icon['thumbs_up'] = '
';
+$icon['thumbs_down'] = '
';
$icon['trash_alt'] = '
';
$icon['times_circle'] = '
';
$icon['tools'] = '
';
diff --git a/acp/core/inc.addons.php b/acp/core/inc.addons.php
index 7f45807b..1404b7c4 100644
--- a/acp/core/inc.addons.php
+++ b/acp/core/inc.addons.php
@@ -3,13 +3,22 @@
//prohibit unauthorized access
require 'core/access.php';
+
+/* delete addon */
+
+if(isset($_POST['delete_addon'])) {
+ fc_delete_addon($_POST['addon'],$_POST['type']);
+ $all_mods = get_all_moduls();
+ $all_plugins = get_all_plugins();
+}
+
+
/**
* list and access module
* list plugins
* list and access themes
*/
-
$addon_mode = 'list_modules';
$active_modules = 'active';
$active_plugins = '';
diff --git a/acp/core/inc.comments.php b/acp/core/inc.comments.php
deleted file mode 100644
index 421ecbd3..00000000
--- a/acp/core/inc.comments.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
\ No newline at end of file
diff --git a/acp/core/inc.reactions.php b/acp/core/inc.reactions.php
new file mode 100644
index 00000000..2a34c28c
--- /dev/null
+++ b/acp/core/inc.reactions.php
@@ -0,0 +1,28 @@
+
\ No newline at end of file
diff --git a/acp/core/list.addons.php b/acp/core/list.addons.php
index cdccf0e6..687d8bfe 100644
--- a/acp/core/list.addons.php
+++ b/acp/core/list.addons.php
@@ -54,7 +54,7 @@
$bnt_check_in_out = '
'.$lang['btn_mod_disable'].'';
}
}
-
+
include '../modules/'.$modFolder.'/info.inc.php';
$listlinks = '
';
@@ -104,6 +104,12 @@
echo $modal;
}
+ $btn_delete_addon = '
';
$tpl = $template_file;
@@ -116,6 +122,7 @@
$tpl = str_replace("{\$MOD_LIVECODE}", "$mod_livecode","$tpl");
$tpl = str_replace("{\$MOD_CHECK_IN_OUT}", "$bnt_check_in_out","$tpl");
$tpl = str_replace("{\$MOD_README}", "$btn_help_text","$tpl");
+ $tpl = str_replace("{\$MOD_DELETE}", "$btn_delete_addon","$tpl");
$tpl = str_replace("{\$MOD_NAV}", "$listlinks","$tpl");
diff --git a/acp/core/list.plugins.php b/acp/core/list.plugins.php
index 44a1c8ef..584fe09d 100644
--- a/acp/core/list.plugins.php
+++ b/acp/core/list.plugins.php
@@ -12,27 +12,30 @@
foreach($all_plugins as $plugin) {
- $pathinfo = pathinfo('/content/plugins/'.$plugin);
- if($pathinfo['extension'] != 'php') {
- continue;
- }
-
$id = md5($plugin);
- $plugin_src = file_get_contents('../'.FC_CONTENT_DIR.'/plugins/'.$plugin);
- $comment = getfirstcommentblock($plugin_src);
- $plugin_info = get_include_contents('../'.FC_CONTENT_DIR.'/plugins/'.$plugin);
- $tpl_icon = "images/plugin-icon.png";
- $edit_btn = '
Source';
+ $pathinfo = pathinfo('/content/plugins/'.$plugin);
- /* show the first comment block */
- $help_btn = '';
- if($comment != '') {
- echo '
';
- $help_btn = '
'.$icon['question'].'';
+ if($pathinfo['extension'] == 'php') {
+ $plugin_src = file_get_contents(FC_CONTENT_DIR.'/plugins/'.$plugin);
+ $plugin_info = get_include_contents(FC_CONTENT_DIR.'/plugins/'.$plugin);
+ } else {
+ if((is_dir(FC_CONTENT_DIR.'/plugins/'.$plugin)) && (is_file(FC_CONTENT_DIR.'/plugins/'.$plugin.'/index.php'))) {
+ $plugin_src = file_get_contents(FC_CONTENT_DIR.'/plugins/'.$plugin.'/index.php');
+ $plugin_info = get_include_contents(FC_CONTENT_DIR.'/plugins/'.$plugin.'/index.php');
+ }
}
- $btn_group = '
'.$edit_btn.$help_btn.'
';
+ $btn_delete_addon = '
';
+
+ $tpl_icon = "images/plugin-icon.png";
+ $source_btn = '
Source';
+ $btn_group = '
'.$source_btn.$btn_delete_addon.'
';
/* shorten the filename if needed */
$plugin_name = basename($plugin,'.php');
@@ -51,7 +54,7 @@
$plugin_version .= '
Author: '.$plugin_info['author'].'';
}
$plugin_version .= '';
-
+
$tpl = $template_file;
$tpl = str_replace("{\$PLUGIN_NAME}", "$plugin_name","$template_file");
@@ -68,7 +71,7 @@
echo '
';
echo '';
echo '
';
echo '
'.htmlentities($plugin_src,ENT_QUOTES,"UTF-8").'
';
@@ -83,8 +86,6 @@
}
}
-
-
function get_include_contents($filename) {
if (is_file($filename)) {
ob_start();
@@ -94,16 +95,4 @@ function get_include_contents($filename) {
}
return false;
}
-
-function getfirstcommentblock($str) {
- $comments = array_filter(
- token_get_all($str),function($entry) {
- return $entry[0] == T_DOC_COMMENT;
- }
- );
- $comment = array_shift($comments);
- return $comment[1];
-}
-
-
?>
\ No newline at end of file
diff --git a/acp/core/list.themes.php b/acp/core/list.themes.php
index 96ea9e85..e16128b4 100644
--- a/acp/core/list.themes.php
+++ b/acp/core/list.themes.php
@@ -252,6 +252,13 @@
echo '';
echo '
';
+ $btn_delete_addon = '
';
+ echo $btn_delete_addon;
echo '
';
echo '
';
diff --git a/acp/core/nav.comments.php b/acp/core/nav.comments.php
deleted file mode 100644
index e3587e9d..00000000
--- a/acp/core/nav.comments.php
+++ /dev/null
@@ -1,15 +0,0 @@
-';
-
-echo '
';
-
-echo '';
-
-?>
\ No newline at end of file
diff --git a/acp/core/nav.reactions.php b/acp/core/nav.reactions.php
new file mode 100644
index 00000000..75340638
--- /dev/null
+++ b/acp/core/nav.reactions.php
@@ -0,0 +1,17 @@
+';
+
+echo '
';
+echo '
';
+echo '
';
+
+echo '';
+
+?>
\ No newline at end of file
diff --git a/acp/core/pages.edit.php b/acp/core/pages.edit.php
index 4ddcfb05..4749a522 100755
--- a/acp/core/pages.edit.php
+++ b/acp/core/pages.edit.php
@@ -475,7 +475,7 @@
"page_sort" => "$page_sort",
"page_language" => "$page_language",
"page_linkname" => "$page_linkname",
- "page_permalink" => "$page_language",
+ "page_permalink" => "$page_permalink",
"page_permalink_short" => "$page_permalink_short",
"page_target" => "$page_target",
"page_classes" => "$page_classes",
@@ -542,7 +542,7 @@
"page_sort" => "$page_sort",
"page_language" => "$page_language",
"page_linkname" => "$page_linkname",
- "page_permalink" => "$page_language",
+ "page_permalink" => "$page_permalink",
"page_permalink_short" => "$page_permalink_short",
"page_target" => "$page_target",
"page_classes" => "$page_classes",
diff --git a/acp/core/pages.edit_form.php b/acp/core/pages.edit_form.php
index 19b42783..544182cc 100644
--- a/acp/core/pages.edit_form.php
+++ b/acp/core/pages.edit_form.php
@@ -662,11 +662,14 @@
-/* tab_info */
+/* tab shortcodes */
echo'
';
+
+
+
echo '
';
-echo '
';
+echo '
';
echo '
Shortcodes
';
$shortcodes = fc_get_shortcodes();
@@ -680,7 +683,7 @@
echo '';
echo '
';
-echo '
';
+echo '
';
echo '
'.$lang['snippets'].'
';
$snippets = $db_content->select("fc_textlib","textlib_name", [
@@ -699,49 +702,8 @@
}
echo '';
-echo '
';
-echo '
';
-echo '
'.$lang['files'].'
';
-
-$get_all_files = fc_get_all_media_data('application');
-
-foreach($get_all_files as $file) {
- $file_names[] = $file['media_file'];
-}
-$file_names = array_unique($file_names);
-echo '
';
-
-echo '
';
-echo '
';
-echo '
'.$lang['images'].'
';
-
-$get_all_images = fc_get_all_media_data('image');
-
-foreach($get_all_images as $img) {
- $img_names[] = $img['media_file'];
-}
-$img_names = array_unique($img_names);
-
-
-echo '
';
-
-echo '
';
-
echo '
';
diff --git a/acp/core/pages.index.php b/acp/core/pages.index.php
index 2d47bd14..646fe58e 100644
--- a/acp/core/pages.index.php
+++ b/acp/core/pages.index.php
@@ -62,6 +62,10 @@
fc_crawler_bulk();
}
+if(isset($_GET['a']) && $_GET['a'] == 'remove') {
+ $fc_upi = fc_remove_page_from_index($_GET['id']);
+}
+
@@ -312,6 +316,7 @@
$tpl = str_replace("{btn_update_info}", $icon['sync_alt'], $tpl);
$tpl = str_replace("{btn_start_index}", $icon['sitemap'], $tpl);
+ $tpl = str_replace("{btn_remove}", $icon['trash_alt'], $tpl);
$tpl = str_replace("{title_update_page_index}", $lang['btn_update_page_index'], $tpl);
$tpl = str_replace("{title_update_page_content}", $lang['btn_update_page_content'], $tpl);
diff --git a/acp/core/pages.snippets.php b/acp/core/pages.snippets.php
index 401497b3..fa5d0ef9 100644
--- a/acp/core/pages.snippets.php
+++ b/acp/core/pages.snippets.php
@@ -1,11 +1,27 @@
update("fc_textlib", [
+ "textlib_type" => "snippet_core"
+], [
+ "textlib_name" => $system_snippets
+]);
+
+/* update missing textlib_type for user generated snippets */
+$upd_core_snippets = $db_content->update("fc_textlib", [
+ "textlib_type" => "snippet"
+], [
+ "OR" => [
+ "textlib_type" => null,
+ "textlib_type" => ""
+ ]
+]);
+
if(isset($_REQUEST['suggest_name'])) {
$textlib_name = clean_filename($_REQUEST['suggest_name']);
@@ -49,7 +65,6 @@
}
print_sysmsg("$sys_message");
-
}
@@ -64,8 +79,7 @@
$snippet_theme = $snippet_themes[0];
$snippet_template = $snippet_themes[1];
- if(count($_POST['picker1_images']) > 1) {
-
+ if(count($_POST['picker1_images']) > 1) {
$snippet_thumbnail = implode("<->", array_unique($_POST['picker1_images']));
} else {
$st = $_POST['picker1_images'];
@@ -116,10 +130,10 @@
} else {
-
$data = $db_content->insert("fc_textlib", [
"textlib_content" => $_POST['textlib_content'],
"textlib_name" => $snippet_name,
+ "textlib_type" => 'snippet',
"textlib_lang" => $_POST['sel_language'],
"textlib_notes" => $_POST['textlib_notes'],
"textlib_groups" => $_POST['snippet_groups'],
@@ -210,19 +224,15 @@
}
$snippet_label_filter = substr("$snippet_label_filter", 0, -3); // cut the last ' OR'
-$filter_string = "WHERE textlib_id IS NOT NULL AND textlib_type NOT IN('shortcode')";
if($_SESSION['type'] == 'all') {
- $filter_type = '';
+ $filter_string = "WHERE (textlib_type = 'snippet' OR textlib_type = 'snippet_core')";
} else if($_SESSION['type'] == 'system') {
- $filter_type = "textlib_name IN($system_snippets_str)";
+ $filter_string = "WHERE textlib_type = 'snippet_core'";
} else if($_SESSION['type'] == 'own') {
- $filter_type = "textlib_name NOT IN($system_snippets_str)";
+ $filter_string = "WHERE textlib_type = 'snippet'";
}
-if($filter_type != "") {
- $filter_string .= " AND ($filter_type) ";
-}
if($set_snippet_keyword_filter != "") {
$filter_string .= " AND $set_snippet_keyword_filter";
@@ -239,8 +249,8 @@
$sql_cnt = "SELECT count(*) AS 'cnt_all_snippets',
(SELECT count(*) FROM fc_textlib WHERE textlib_type NOT IN('shortcode') ) AS 'cnt_snippets',
-(SELECT count(*) FROM fc_textlib WHERE textlib_name IN($system_snippets_str) ) AS 'cnt_system_snippets',
-(SELECT count(*) FROM fc_textlib WHERE textlib_name NOT IN($system_snippets_str) AND (textlib_type NOT IN('shortcode')) ) AS 'cnt_custom_snippets',
+(SELECT count(*) FROM fc_textlib WHERE textlib_type = 'snippet_core' ) AS 'cnt_system_snippets',
+(SELECT count(*) FROM fc_textlib WHERE textlib_type = 'snippet' ) AS 'cnt_custom_snippets',
(SELECT count(*) FROM fc_textlib $filter_string ) AS 'cnt_filter_snippets'
FROM fc_textlib";
@@ -280,38 +290,40 @@
}
$snippets_list = $db_content->query($sql)->fetchAll(PDO::FETCH_ASSOC);
-
$cnt_pages = ceil($cnt['cnt_filter_snippets']/$files_per_page);
$cnt_snippets = count($snippets_list);
-$pag_backlink = '
'.$icon['angle_double_left'].'';
-$pag_forwardlink = '
'.$icon['angle_double_right'].'';
+$pag_backlink = '
'.$icon['angle_double_left'].'';
+$pag_forwardlink = '
'.$icon['angle_double_right'].'';
unset($pag_string);
for($x=0;$x<$cnt_pages;$x++) {
- $aclass = "btn btn-fc";
+ $aclass = "page-link";
$page_start = $x*$files_per_page;
$page_nbr = $x+1;
if($page_start == $start) {
- $aclass = "btn btn-fc active";
+ $aclass = "page-link active";
$pag_start = $x-($show_numbers/2);
if($pag_start < 0) {
$pag_start = 0;
}
- $pag_end = $pag_start+$show_numbers;
+ $pag_end = $pag_start+$show_numbers;
if($pag_end > $cnt_pages) {
$pag_end = $cnt_pages;
}
+
+ $a_pag_string[] = '
'.$page_nbr.'';
+ } else {
+ $a_pag_string[] = '
'.$page_nbr.'';
}
- $a_pag_string[] = "
$page_nbr ";
-
+
}
/**
@@ -326,7 +338,6 @@
/* list snippets */
-
echo '
';
echo '
';
@@ -449,7 +460,7 @@
echo '
';
echo '';
echo ' | ';
echo '';
@@ -459,13 +470,15 @@
echo '';
- echo '
';
- echo $pag_backlink .' ';
+ echo '
';
+ echo '
'; //EOL PAGINATION
+ echo $pag_forwardlink;
+ echo '';
+ echo '
';
echo '
';
@@ -491,6 +504,11 @@
echo '
';
echo '';
+ if($btn_remove_keyword != '') {
+ echo '
'.$btn_remove_keyword.'
';
+ }
+
+
echo '
';
echo '
';
-
-
+
echo '
';
-
echo ''; // .app-container
diff --git a/acp/core/posts.edit.php b/acp/core/posts.edit.php
index a8aee0c3..98a83208 100644
--- a/acp/core/posts.edit.php
+++ b/acp/core/posts.edit.php
@@ -302,7 +302,7 @@
/* comments yes/no */
-if($post_comments == 1) {
+if($post_data['post_comments'] == 1) {
$sel_comments_yes = 'selected';
$sel_comments_no = '';
} else {
@@ -310,12 +310,36 @@
$sel_comments_yes = '';
}
-
$select_comments = '';
+/* votings/reactions no, yes for registered users, yes for all */
+
+if($post_data['post_votings'] == '') {
+ $post_data['post_votings'] = $prefs_posts_default_votings;
+}
+
+if($post_data['post_votings'] == 1 OR $post_data['post_votings'] == '') {
+ $sel_votings_1 = 'selected';
+ $sel_votings_2 = '';
+ $sel_votings_3 = '';
+} else if($post_data['post_votings'] == 2) {
+ $sel_votings_1 = '';
+ $sel_votings_2 = 'selected';
+ $sel_votings_3 = '';
+} else {
+ $sel_votings_1 = '';
+ $sel_votings_2 = '';
+ $sel_votings_3 = 'selected';
+}
+
+$select_votings = '';
/* autor */
@@ -378,6 +402,15 @@
$post_product_currency = $fc_preferences['prefs_posts_products_default_currency'];
}
+if($post_data['post_product_price_addition'] == '') {
+ $post_data['post_product_price_addition'] = 0;
+}
+
+$post_product_price_net_purchasing = $post_data['post_product_price_net_purchasing'];
+if($post_product_price_net_purchasing == '') {
+ $post_product_price_net_purchasing = '0,00';
+}
+
/* add text snippet to prices */
@@ -390,7 +423,7 @@
foreach($snippets_price_list as $snippet) {
$selected = "";
- if($snippet['textlib_name'] == $post_data['product_textlib_price']) {
+ if($snippet['textlib_name'] == $post_data['post_product_textlib_price']) {
$selected = 'selected';
}
$snippet_select_pricelist .= '';
@@ -419,7 +452,7 @@
$select_file = '