From d728309c722ed8997a312b45547dfc26c325c9b6 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Sat, 19 Sep 2009 17:36:36 +0000 Subject: [PATCH] SiteInfo renamed and e_shortcode added. Also support for plugin.xml added for menu only installations. --- e107_plugins/siteinfo/compliance_menu.php | 11 +++ e107_plugins/siteinfo/counter_menu.php | 83 ++++++++++++++++ e107_plugins/siteinfo/e_shortcode.php | 89 ++++++++++++++++++ .../siteinfo/images/valid-xhtml11.png | Bin 0 -> 1916 bytes e107_plugins/siteinfo/images/vcss.png | Bin 0 -> 1134 bytes e107_plugins/siteinfo/languages/English.php | 26 +++++ e107_plugins/siteinfo/plugin.xml | 6 ++ e107_plugins/siteinfo/powered_by_menu.php | 34 +++++++ e107_plugins/siteinfo/sitebutton_menu.php | 22 +++++ 9 files changed, 271 insertions(+) create mode 100644 e107_plugins/siteinfo/compliance_menu.php create mode 100644 e107_plugins/siteinfo/counter_menu.php create mode 100644 e107_plugins/siteinfo/e_shortcode.php create mode 100644 e107_plugins/siteinfo/images/valid-xhtml11.png create mode 100644 e107_plugins/siteinfo/images/vcss.png create mode 100644 e107_plugins/siteinfo/languages/English.php create mode 100644 e107_plugins/siteinfo/plugin.xml create mode 100644 e107_plugins/siteinfo/powered_by_menu.php create mode 100644 e107_plugins/siteinfo/sitebutton_menu.php diff --git a/e107_plugins/siteinfo/compliance_menu.php b/e107_plugins/siteinfo/compliance_menu.php new file mode 100644 index 000000000..160b4cec1 --- /dev/null +++ b/e107_plugins/siteinfo/compliance_menu.php @@ -0,0 +1,11 @@ + + Valid XHTML 1.1!
+ Valid CSS! + "; +$caption = (file_exists(THEME."images/compliance_menu.png") ? " ".COMPLIANCE_L1 : COMPLIANCE_L1); +$ns->tablerender($caption, $text, 'compliance'); +?> \ No newline at end of file diff --git a/e107_plugins/siteinfo/counter_menu.php b/e107_plugins/siteinfo/counter_menu.php new file mode 100644 index 000000000..abe0e2893 --- /dev/null +++ b/e107_plugins/siteinfo/counter_menu.php @@ -0,0 +1,83 @@ + db_Select("logstats", "*", "log_id='statTotal' OR log_id='statUnique' OR log_id='pageTotal'")) + { + while($row = $sql -> db_Fetch()) + { + if($row['log_id'] == "statTotal") + { + $siteTotal += $row['log_data']; + } + else if($row['log_id'] == "statUnique") + { + $siteUnique += $row['log_data']; + } + else + { + $dbPageInfo = unserialize($row['log_data']); + $totalPageEver = ($dbPageInfo[$pageName]['ttlv'] ? $dbPageInfo[$pageName]['ttlv'] : 0); + $uniquePageEver = ($dbPageInfo[$pageName]['unqv'] ? $dbPageInfo[$pageName]['unqv'] : 0); + } + } + } + $total = ($pageInfo[$pageName]['ttl'] ? $pageInfo[$pageName]['ttl'] : 0); + $unique = ($pageInfo[$pageName]['unq'] ? $pageInfo[$pageName]['unq'] : 0); + $totalever = ($pageInfo[$pageName]['ttlv'] ? $pageInfo[$pageName]['ttlv'] : 0) + $totalPageEver + $total; + $uniqueever = ($pageInfo[$pageName]['unqv'] ? $pageInfo[$pageName]['unqv'] : 0) + $uniquePageEver + $unique; + } + $text .= "".COUNTER_L2."
".COUNTER_L3.": $total
".COUNTER_L5.": $unique

+ ".COUNTER_L4."
".COUNTER_L3.": $totalever
".COUNTER_L5.": $uniqueever

+ ".COUNTER_L6."
".COUNTER_L3.": $siteTotal
".COUNTER_L5.": $siteUnique"; + $ns->tablerender(COUNTER_L7, $text, 'counter'); + unset($dbPageInfo); +} +else +{ + if(ADMIN) + { + $text .= "".COUNTER_L8.""; + $ns->tablerender(COUNTER_L7, $text, 'counter'); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/siteinfo/e_shortcode.php b/e107_plugins/siteinfo/e_shortcode.php new file mode 100644 index 000000000..51e4e2426 --- /dev/null +++ b/e107_plugins/siteinfo/e_shortcode.php @@ -0,0 +1,89 @@ +tp->replaceConstants($_POST['sitebutton']) : (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON); + //TODO use CSS class? + return ''.SITENAME.''; + } + + function sc_sitedisclaimer() + { + $e107 = e107::getInstance(); + return $e107->tp->toHtml(SITEDISCLAIMER, true, 'constants defs'); + } + + function sc_sitename($parm) + { + return ($parm == 'link') ? "".SITENAME."" : SITENAME; + } + + function sc_sitedescription() + { + global $pref; + return SITEDESCRIPTION.(defined('THEME_DESCRIPTION') && $pref['displaythemeinfo'] ? THEME_DESCRIPTION : ''); + } + + function sc_sitetag() + { + return SITETAG; + } + + function sc_logo($parm) + { + parse_str($parm); // Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url} + // Paths to image file, link are relative to site base + + if (isset($file) && $file && is_readable($file)) + { + $logo = e_HTTP.$file; // HTML path + $path = e_BASE.$file; // PHP path + } + else if (is_readable(THEME.'images/e_logo.png')) + { + $logo = THEME_ABS.'images/e_logo.png'; // HTML path + $path = THEME.'images/e_logo.png'; // PHP path + } + else + { + $logo = e_IMAGE_ABS.'logo.png'; // HTML path + $path = e_IMAGE.'logo.png'; // PHP path + } + + $dimensions = getimagesize($path); + + $image = "\n"; + + if (isset($link) && $link) + { + if ($link == 'index') + { + $image = "".$image.""; + } + else + { + $image = "".$image.""; + } + } + + return $image; + } + + function sc_theme_disclaimer($parm) + { + global $pref; + return (defined('THEME_DISCLAIMER') && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : ''); + } + +} +?> \ No newline at end of file diff --git a/e107_plugins/siteinfo/images/valid-xhtml11.png b/e107_plugins/siteinfo/images/valid-xhtml11.png new file mode 100644 index 0000000000000000000000000000000000000000..6d305e7dffef621c85ba83fabd07f80b88a5c4f3 GIT binary patch literal 1916 zcmW-hc~leE9><3*M8y(ZAZ|b?+bBmERCFFFW@K}$m^YxnfK(j>=_pSbMR@`BV3bHl z5jxPPGwE)Cj1tF64!N&iD8Get-Aed;hxU9+t(& zPM$b(A^-rBSH?wQHcz&dm(ao16Wu@d*~~FZx>^bV&83q*Z*&3x`{lB45~HnuW3gH- z7Mm<)o5r!2%oeMeGMG#Tli6ybbSAUGV9*)NRs*Run5;U|s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V^j~fOR7y9Y4vMEa%#*m(ft?K8ib23ypt;376^<|mo&3<^*lh$1oubcyF>K%#{ zqmlFH|2Oj5w5sN_dy?1QJ+iLnpWM^@0Eb7?hxD5%Yl_aM4!};G*LIkE|1@^#ce&8j z`D5I5Lgtap2X*t-j@uvY=cSI^OPKM;h@Zz&rO&~WzCOWe6&<&ns;hojVOLOgWT9kx zaHF{7=KY>GKm8t>TRtfLvMFR#uwz$KLEbT<%|~2O^y$pQaItglvkP z^<;PCofFLurYl}$87tpXA?@L%V2c{TH1dDXpLFu#9`RB}sijwo$ycs-W)$MW_1 z*EcO}ZQIC~9|o+9 Lj*q&4Y$*CaVjPI+ literal 0 HcmV?d00001 diff --git a/e107_plugins/siteinfo/images/vcss.png b/e107_plugins/siteinfo/images/vcss.png new file mode 100644 index 0000000000000000000000000000000000000000..9b2f596e016533327216d98a0a927738fe17384f GIT binary patch literal 1134 zcmeAS@N?(olHy`uVBq!ia0vp^5kM@@!3-or#C~03U|`e?@Ck7Ra+Q_kdEDnlhI%!W zMb4c&_g;@{HxGAjZ*NM+!7cOCYk@#Y{Pps{+}zwx_wR4FlUu4N92*~!s#T`6W<+- zt4%e$w+9&~i2E*D*W)T9Bhx(p?A&_0|7X(X^Ya7IW>?MPDaUzu zczTO0wr<^e|Jf%QG42CClNSR6E4d`dFZlmw6q^`8Jh0FrC=HPY3SEXN1j@jH0f@DT z;lF?am<8g&3^agg*jyz(n}LC8qNj^vNX4zUQ)`1SI|v-Rel?4G(T!h0t6h3r9Tx_% z{GPN=z+e1GN8qGw>eHn5|8FmNua|o1m5;W_zoO+QbMz<2znfQG#(ynM{=I#{0V!X> zqF)tO-~TK+p#QH~U+~Uxw*7OC?@4lzU=MuwAfY=*I-PyJf}6|jF4ry6#nK@bObtKJ z{jpr)a7XQvK=_v<_kY&OUtDf7N2Y`!=sAP5DASo0{WX7G;uf&=`Gs|Enroa;cP#bwBZgT0Vk8}Ij!pi@+JzOex~wA_|LQI>iZ4KOPMZj@RJmq z{=ckJgo`sg=^ee+rLf!@|1r#|1Qou-tz zozY_28jcOAqH_ZHT>9G+6r2tD{%tx^c*pF4-nNSOH_A#)UvDaE^>6pwzeB^b1utmshBn2mW1YZ#q&(r+Ne9lLHSPV z;lJMu*6nF1eX&Vu#au@n)2h{;1^hB;>x|=8`0r4N5Dq`3W>NpNuIHfS-r}72x2dtZ z|1vypS3P_!s?6%3q3f=mrP_V^@twUAXY`EwoTZxX&st-k^Kye`&fdVV(2iA`qSwCa zO3SD?y)^LM2F^-1=1_^hVN1d%c)e7=87<81^0{cK;`g>k^UAjGxu$SW%#%-OqR3cMOS7CD$Nw90jSF7TjZ+3b%7?`))PKP%lew!LZ} z9@4ntXMQ2~DY0cQL^+Gz9jsW~FI2w%Uw?1i^C{7@K5}j{esbPgg&e IbxsLQ074N#oB#j- literal 0 HcmV?d00001 diff --git a/e107_plugins/siteinfo/languages/English.php b/e107_plugins/siteinfo/languages/English.php new file mode 100644 index 000000000..d6853194e --- /dev/null +++ b/e107_plugins/siteinfo/languages/English.php @@ -0,0 +1,26 @@ +Stat logging is disabled.
To activate, you need to install the Statistic Logging plugin from your plugin manager, then activate it from the configuration screen."); + +?> \ No newline at end of file diff --git a/e107_plugins/siteinfo/plugin.xml b/e107_plugins/siteinfo/plugin.xml new file mode 100644 index 000000000..c6071f3ee --- /dev/null +++ b/e107_plugins/siteinfo/plugin.xml @@ -0,0 +1,6 @@ + + + + siteinfo + menu + \ No newline at end of file diff --git a/e107_plugins/siteinfo/powered_by_menu.php b/e107_plugins/siteinfo/powered_by_menu.php new file mode 100644 index 000000000..d85ee4c4a --- /dev/null +++ b/e107_plugins/siteinfo/powered_by_menu.php @@ -0,0 +1,34 @@ + +
+e107 +
+
+PHP +
+
+MySQL +
+"; +$ns -> tablerender(POWEREDBY_L1, $text, 'powered_by'); +?> \ No newline at end of file diff --git a/e107_plugins/siteinfo/sitebutton_menu.php b/e107_plugins/siteinfo/sitebutton_menu.php new file mode 100644 index 000000000..ed5e80b68 --- /dev/null +++ b/e107_plugins/siteinfo/sitebutton_menu.php @@ -0,0 +1,22 @@ +tablerender(SITEBUTTON_MENU_L1, "
\n".SITEBUTTON_MENU_L1."\n
", 'sitebutton'); +?> \ No newline at end of file