From d8d4b48341c999ada6fa814ea45a3dd3741ba321 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 21 Sep 2015 14:52:29 -0700 Subject: [PATCH 01/13] Added alert bbcode. menu-name shortcode for custom menus. And a 'Bootstrap Row' css style in Tinymce4. --- e107_core/bbcodes/bb_alert.php | 60 +++++++++++++++++++ .../shortcodes/batch/page_shortcodes.php | 13 +++- e107_handlers/bbcode_handler.php | 1 + e107_plugins/tinymce4/wysiwyg.php | 1 + 4 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 e107_core/bbcodes/bb_alert.php diff --git a/e107_core/bbcodes/bb_alert.php b/e107_core/bbcodes/bb_alert.php new file mode 100644 index 000000000..04c77a7d6 --- /dev/null +++ b/e107_core/bbcodes/bb_alert.php @@ -0,0 +1,60 @@ +".$code_text.""; + } + + +} + + + + + + + +?> \ No newline at end of file diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index 0002fb9cb..d7628a5ab 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -267,12 +267,14 @@ class cpage_shortcodes extends e_shortcode $buttonText = (empty($this->var['menu_button_text'])) ? LAN_READ_MORE : $this->var['menu_button_text']; $buttonUrl = (empty($this->var['menu_button_url'])) ? $url : $tp->replaceConstants($this->var['menu_button_url']); - + $buttonTarget = (empty($this->var['menu_button_target'])) ? '' : ' target="'.$this->var['menu_button_target'].'" '; //TODO add pref to admin area. + $text = vartrue($options['text'], $buttonText); $size = vartrue($options['size'], ""); + $inc = ($size) ? " btn-".$size : ""; - return ''.$text.''; + return ''.$text.''; } @@ -281,7 +283,12 @@ class cpage_shortcodes extends e_shortcode $tp = e107::getParser(); // return $tp->toHTML($this->var['menu_title'], true, 'TITLE'); - } + } + + function sc_cmenuname($parm='') + { + return $this->var['menu_name']; + } function sc_cmenubody($parm='') diff --git a/e107_handlers/bbcode_handler.php b/e107_handlers/bbcode_handler.php index 7af644aa3..1d5dc426b 100644 --- a/e107_handlers/bbcode_handler.php +++ b/e107_handlers/bbcode_handler.php @@ -37,6 +37,7 @@ class e_bbcode $pref = e107::getPref(); $this->core_bb = array( + 'alert', 'blockquote', 'img', 'i', 'u', 'center', '_br', 'color', 'size', 'code', 'flash', 'link', 'email', diff --git a/e107_plugins/tinymce4/wysiwyg.php b/e107_plugins/tinymce4/wysiwyg.php index d31c4865a..3d02566fe 100644 --- a/e107_plugins/tinymce4/wysiwyg.php +++ b/e107_plugins/tinymce4/wysiwyg.php @@ -450,6 +450,7 @@ class wysiwyg {title: 'Float Clear', block: 'div', classes: 'clearfix'}, {title: 'Lead', block: 'p', classes: 'lead'}, {title: 'Well', block: 'div', classes: 'well'}, + {title: 'Row', block: 'div', classes: 'row'}, {title: '1/4 Width Block', block: 'div', classes: 'col-md-3 col-sm-12'}, {title: '3/4 Width Block', block: 'div', classes: 'col-md-9 col-sm-12'}, {title: '1/3 Width Block', block: 'div', classes: 'col-md-4 col-sm-12'}, From 4cf91d062728d777a418950737b95659a8d8bbd1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 21 Sep 2015 14:59:37 -0700 Subject: [PATCH 02/13] Fix for default alert style. --- e107_core/bbcodes/bb_alert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_core/bbcodes/bb_alert.php b/e107_core/bbcodes/bb_alert.php index 04c77a7d6..56d9b54f6 100644 --- a/e107_core/bbcodes/bb_alert.php +++ b/e107_core/bbcodes/bb_alert.php @@ -42,7 +42,7 @@ class bb_alert extends e_bb_base } else { - $style = "alert alert-default"; + $style = "alert alert-info"; } return "
".$code_text."
"; From 8c47bee60d72b1a5bec60ef8a19a99e120b5122e Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 23 Sep 2015 12:54:07 -0700 Subject: [PATCH 03/13] New Shortcode added to Stats plugin. Use {LOG_PAGECOUNTER} or {LOG_PAGECOUNTER=unique} in any frontend template to show the total hits for that URL/page. --- e107_plugins/log/e_shortcode.php | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 e107_plugins/log/e_shortcode.php diff --git a/e107_plugins/log/e_shortcode.php b/e107_plugins/log/e_shortcode.php new file mode 100644 index 000000000..ea971f114 --- /dev/null +++ b/e107_plugins/log/e_shortcode.php @@ -0,0 +1,91 @@ +select('logstats', 'log_data', "log_id='pageTotal'")) /* get main stat info from database */ + { + $row = $sql->fetch(); + $this->dbPageInfo = unserialize($row['log_data']); + } + else + { + $this->dbPageInfo = array(); + } + + /* temp consolidate today's info (if it exists)... */ + if(is_array($pageInfo)) + { + foreach($pageInfo as $key => $info) + { + $key = preg_replace("/\?.*/", "", $key); + if(array_key_exists($key, $this -> dbPageInfo)) + { + $this -> dbPageInfo[$key]['ttlv'] += $info['ttl']; + $this -> dbPageInfo[$key]['unqv'] += $info['unq']; + } + else + { + $this -> dbPageInfo[$key]['url'] = $info['url']; + $this -> dbPageInfo[$key]['ttlv'] = $info['ttl']; + $this -> dbPageInfo[$key]['unqv'] = $info['unq']; + } + } + } + + + } + + + private function getKey($self) + { + $base = basename($self); + list($url,$qry) = explode(".",$base, 2); + return $url; + } + + + function sc_log_pagecounter($parm) + { + + $id = $this->getKey(e_REQUEST_URL); + + if(isset($this->dbPageInfo[$id]['url']) && ($this->dbPageInfo[$id]['url'] == e_REQUEST_URL)) + { + return ($parm == 'unique') ? number_format($this->dbPageInfo[$id]['unqv']) : number_format($this->dbPageInfo[$id]['ttlv']); + } + + } + +} + + + +?> \ No newline at end of file From 8b8e7b690c4e308de2a3a4bb40ff749ca6333cef Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 23 Sep 2015 18:19:06 -0700 Subject: [PATCH 04/13] Log counter shortcode fix when 'www.' is in the URL. --- e107_plugins/log/e_shortcode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/e_shortcode.php b/e107_plugins/log/e_shortcode.php index ea971f114..84a2151dc 100644 --- a/e107_plugins/log/e_shortcode.php +++ b/e107_plugins/log/e_shortcode.php @@ -74,10 +74,10 @@ class log_shortcodes extends e_shortcode function sc_log_pagecounter($parm) { - + $url = str_replace("www.", "", e_REQUEST_URL); $id = $this->getKey(e_REQUEST_URL); - if(isset($this->dbPageInfo[$id]['url']) && ($this->dbPageInfo[$id]['url'] == e_REQUEST_URL)) + if(isset($this->dbPageInfo[$id]['url']) && ($this->dbPageInfo[$id]['url'] == e_REQUEST_URL || $this->dbPageInfo[$id]['url'] == $url)) { return ($parm == 'unique') ? number_format($this->dbPageInfo[$id]['unqv']) : number_format($this->dbPageInfo[$id]['ttlv']); } From d3d4b349df298d7f3a69f552a6f2de9de402a17a Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 23 Sep 2015 18:19:51 -0700 Subject: [PATCH 05/13] Fix for side-bar toggle in bootstrap3 admin area. --- e107_themes/bootstrap3/admin_style.css | 5 +++-- e107_themes/bootstrap3/admin_template.php | 2 ++ e107_web/js/core/admin.jquery.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/e107_themes/bootstrap3/admin_style.css b/e107_themes/bootstrap3/admin_style.css index 78810ebf6..b3b8a8b96 100644 --- a/e107_themes/bootstrap3/admin_style.css +++ b/e107_themes/bootstrap3/admin_style.css @@ -1106,8 +1106,9 @@ li.rssRow > div { .core-mainpanel-link-icon img { margin-bottom: 5px } -.sidebar-toggle { width: 50px; display: inline-block; position: absolute; margin-left: -20px; } -.sidebar-toggle a {color:#C6C6C6;} +.sidebar-toggle { width: 14px; height:300px; display: block; position: absolute; margin-left: -25px; margin-top:130px } +.sidebar-toggle a {color:#C6C6C6; height:300px; display:block; width:100%; border-right:7px double #77ACD9; opacity: 0; transition:.5s; z-index:5000; outline:0 } +.sidebar-toggle a:hover { opacity: .8; outline:0 } #left-panel.toggled { display: none } diff --git a/e107_themes/bootstrap3/admin_template.php b/e107_themes/bootstrap3/admin_template.php index 4117021bc..13098f8af 100644 --- a/e107_themes/bootstrap3/admin_template.php +++ b/e107_themes/bootstrap3/admin_template.php @@ -268,6 +268,7 @@ $ADMIN_MODAL = '