From 072a5fa490374d14f79e57fe5d5efe6290525ffd Mon Sep 17 00:00:00 2001 From: udo Date: Sat, 18 Apr 2026 16:29:22 +0000 Subject: [PATCH] refactor: update pricing table and improve UI component references --- components/example/pricing-table.php | 14 +++++++------- components/gauges/needlegauge.php | 2 +- config/settings.php | 2 +- js/site.js | 2 +- js/tooltip.css | 0 js/tooltip.js | 0 js/u-wsconnection.js | 2 +- lib/db.class.php | 7 ++++--- lib/filebase.class.php | 5 ++++- lib/odt.class.php | 5 +++-- lib/profiler.class.php | 2 +- views/account/login.php | 2 +- views/account/profile.php | 2 +- views/dark-demo.php | 11 ++++------- 14 files changed, 29 insertions(+), 27 deletions(-) delete mode 100755 js/tooltip.css delete mode 100755 js/tooltip.js diff --git a/components/example/pricing-table.php b/components/example/pricing-table.php index 4b355db..d2d6248 100755 --- a/components/example/pricing-table.php +++ b/components/example/pricing-table.php @@ -7,10 +7,10 @@ 'period' => '', 'description' => 'Perfect for small projects and learning', 'features' => [ - 'Fuckall', - 'A warm handshake', - 'A pat on the back', - 'A cup of coffee' + 'Up to 3 projects', + 'Community support', + 'Core components', + 'Basic documentation' ], 'cta' => 'Get Started', 'popular' => false @@ -28,7 +28,7 @@ 'Custom themes', 'Analytics dashboard' ], - 'cta' => 'Start Not Quite Free Trial', + 'cta' => 'Start Free Trial', 'popular' => true ], [ @@ -44,7 +44,7 @@ 'Advanced security', 'White-label options' ], - 'cta' => 'Contact Desperate Sales Person', + 'cta' => 'Contact Sales', 'popular' => false ] ]; @@ -54,7 +54,7 @@

Choose Your Plan

-

Start building fucking amazing applications today with our quite inflexible pricing options

+

Start building great applications today with our flexible pricing options

$plan): ?> diff --git a/components/gauges/needlegauge.php b/components/gauges/needlegauge.php index 276ca0d..80ad178 100755 --- a/components/gauges/needlegauge.php +++ b/components/gauges/needlegauge.php @@ -38,7 +38,7 @@ return [ $prop['img_height'] = first($prop['img_height'] ?? false, $prop['size'] * max(cos(first($prop['scale']['angle_start'], -pi())), cos(first($prop['scale']['angle_end'], 0)))); ?> -
+

diff --git a/config/settings.php b/config/settings.php index 7f624dc..a1de44a 100755 --- a/config/settings.php +++ b/config/settings.php @@ -35,7 +35,7 @@ define('ONE_HOUR', 60*60); define('ONE_DAY', 60*60*24); define('ONE_MONTH', 60*60*24*30); - define('ONE_YEAR', 60*60*24*30*365); + define('ONE_YEAR', 60*60*24*365); $GLOBALS['config'] = array( 'debug' => array( diff --git a/js/site.js b/js/site.js index f2e90ae..2c311c4 100755 --- a/js/site.js +++ b/js/site.js @@ -1,6 +1,6 @@ var enable_debug = true; -UI = { +var UI = { smoothScrollToNamedAnchors: function() { $('a[href^="#"]').each(anchor => { diff --git a/js/tooltip.css b/js/tooltip.css deleted file mode 100755 index e69de29..0000000 diff --git a/js/tooltip.js b/js/tooltip.js deleted file mode 100755 index e69de29..0000000 diff --git a/js/u-wsconnection.js b/js/u-wsconnection.js index e39f733..9c3b40f 100755 --- a/js/u-wsconnection.js +++ b/js/u-wsconnection.js @@ -8,7 +8,7 @@ } }(typeof self !== 'undefined' ? self : this, function () { -Connection = { +var Connection = { auto_reconnect : false, established : false, diff --git a/lib/db.class.php b/lib/db.class.php index aff8c7a..f12d80d 100755 --- a/lib/db.class.php +++ b/lib/db.class.php @@ -168,7 +168,7 @@ class DB static function GetRowsMatch($table, $matchOptions, $fillIfEmpty = true) { - self::$writeOps++; + self::$readOps++; $where = array('1'); foreach($matchOptions as $k => $v) $where[] = '('.$k.'="'.DB::Safe($v).'")'; @@ -200,8 +200,10 @@ class DB $cache_entry = $tablename.':'.$keyname.':'.$keyvalue; if(isset(self::$dataCache[$cache_entry])) return(self::$dataCache[$cache_entry]); - $query = 'SELECT '.$fields.' FROM '.$tablename.' '.$options['join'].' WHERE '.$keyname.'="'.DB::Safe($keyvalue).'";'; + $join = isset($options['join']) ? ' '.$options['join'] : ''; + $query = 'SELECT '.$fields.' FROM '.$tablename.$join.' WHERE '.$keyname.'="'.DB::Safe($keyvalue).'";'; $queryResult = mysqli_query(self::$link, $query) or critical(mysqli_error(self::$link).' { Query: "'.$query.'" }'); + self::$readOps++; if ($line = @mysqli_fetch_array($queryResult, MYSQLI_ASSOC)) { @@ -214,7 +216,6 @@ class DB $result = array(); Profiler::Log('DB::GetRow('.$tablename.', '.$keyvalue.') #fail'); - self::$readOps++; return($result); } diff --git a/lib/filebase.class.php b/lib/filebase.class.php index a45e1a4..298e6a6 100644 --- a/lib/filebase.class.php +++ b/lib/filebase.class.php @@ -193,7 +193,10 @@ class Filebase static function truncate_log($from_file, $lines = 128) { $lines = intval($lines); - return(shell_exec('tail -n '.$lines.' '.escapeshellarg($from_file).' > /tmp/trunc ; cp /tmp/trunc '.escapeshellarg($from_file))); + $tmp = tempnam(sys_get_temp_dir(), 'trunc_'); + shell_exec('tail -n '.$lines.' '.escapeshellarg($from_file).' > '.escapeshellarg($tmp).' && cp '.escapeshellarg($tmp).' '.escapeshellarg($from_file)); + @unlink($tmp); + return true; } static function json_lines($lines) diff --git a/lib/odt.class.php b/lib/odt.class.php index aff8028..69112c0 100755 --- a/lib/odt.class.php +++ b/lib/odt.class.php @@ -421,7 +421,8 @@ class ODT $this->debug_output = trim( shell_exec('cd '.escapeshellarg($this->temp_dir).' ; zip -r ../tmp.odt * 2>&1')); - if(!file_exists('/tmp/tmp.odt')) + $zip_output = dirname($this->temp_dir).'/tmp.odt'; + if(!file_exists($zip_output)) { $this->error_msg = 'Failed to create tmp ODT file (shell "'.$this->debug_output.'")'; return false; @@ -429,7 +430,7 @@ class ODT if(file_exists($out_filename)) { unlink($out_filename); } - shell_exec('mv /tmp/tmp.odt '.escapeshellarg($out_filename)); + shell_exec('mv '.escapeshellarg($zip_output).' '.escapeshellarg($out_filename)); if (!file_exists($out_filename)) { $this->error_msg = 'Failed to create ODT file "'.$out_filename.'"'; diff --git a/lib/profiler.class.php b/lib/profiler.class.php index 735c120..f4f1937 100755 --- a/lib/profiler.class.php +++ b/lib/profiler.class.php @@ -23,7 +23,7 @@ class Profiler number_format(1000*($thistime - self::$last), 3).'ms | '. ceil(memory_get_usage()/1024).' kB | '.self::$indent_str.$text; if($indent_delta > 0) // if greater than zero, update indent after logging - self::$indent_str = str_repeat(' ', 2*max(0, strlen(self::$indent_str) + $indent_delta)); + self::$indent_str = str_repeat(' ', self::$indent_level * 2); self::$last = $thistime; self::$current = $absoluteMS; return($thistime); diff --git a/views/account/login.php b/views/account/login.php index 582db37..5d32d40 100644 --- a/views/account/login.php +++ b/views/account/login.php @@ -27,6 +27,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-

Register

+

Register

diff --git a/views/account/profile.php b/views/account/profile.php index aa341ab..f0c6269 100644 --- a/views/account/profile.php +++ b/views/account/profile.php @@ -1,6 +1,6 @@ 'Dark Theme Demo', 'subtitle' => 'Experience our beautiful dark mode with enhanced readability and modern aesthetics.', 'cta_text' => 'Explore Features', 'cta_link' => '#features' ]) ?> - [ [ 'icon' => '🌙', @@ -25,7 +25,7 @@ ] ]) ?> - [ [ 'name' => 'Dark Starter', @@ -90,10 +90,7 @@
- ] -]) ?> - - +