Permalink
Browse files

Some style changes, more code cleanup, copyright headers updated

  • Loading branch information...
1 parent 0578853 commit 43fdf12f26cd4b6867879b965e5cfcd1c3da93e0 @silvercircle committed Mar 20, 2015
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
- * @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
+ * @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
@@ -13,7 +13,7 @@
*
* activity stream main module
*/
-if (!defined('SMF'))
+if (!defined('EOSA'))
die('No access');
@require_once($sourcedir . '/lib/Subs-Ratings.php');
View
@@ -640,12 +640,15 @@ public static function putCache($key, $value, $ttl = 120)
* general should try to be independent of this function. At
* this point, only xcache and the file cache support this feature.
*
- * @param string $key
+ * @param string $key
+ * @return bool result (true if operation is supported)
*/
public static function clearCacheByPrefix($key)
{
+ $result = false;
+
if(-1 == self::$API)
- return;
+ return result;
$key = self::$basekey . strtr($key, ':', '-');
@@ -678,15 +681,18 @@ public static function clearCacheByPrefix($key)
case 2:
xcache_unset_by_prefix($key);
+ $result = true;
break;
case 0:
// Glob using the prefix and unlink all hits.
+ $result = true;
foreach(glob(self::$cachedir . '/data_' . $key . '*.php') as $filename) {
@unlink($filename);
}
break;
}
+ return $result;
}
}
@@ -772,7 +778,8 @@ class Mobile_Detect {
/**
* Construct and init this instance.
*/
- function __construct(){
+ function __construct()
+ {
// Merge all rules together.
$this->detectionRules = array_merge(
@@ -823,7 +830,6 @@ public function getRules()
*/
public function __call($name, $arguments)
{
-
$key = substr($name, 2);
return $this->_detect($key);
@@ -836,7 +842,6 @@ public function __call($name, $arguments)
*/
private function _detect($key='')
{
-
if(empty($key)){
// Begin general search.
@@ -910,7 +915,8 @@ class Topiclist {
private $users_to_load = array();
private $topic_ids = array();
- function __construct($request, $total_items, $not_profile = false) {
+ function __construct($request, $total_items, $not_profile = false)
+ {
global $context, $txt, $user_info, $scripturl, $options, $memberContext, $modSettings;
@@ -1030,20 +1036,26 @@ function __construct($request, $total_items, $not_profile = false) {
}
}
- public function &getResult() {
+ public function &getResult()
+ {
return $this->topiclist;
}
}
/**
* base class for a EoS Alpha plugin.
- */
+ * All plugins must inherit from this class and re-implement functions accordingly.
+ */
class EoS_Plugin
{
protected $plugindir;
protected $installError = 'OK';
+ protected $productShortName = '';
+ protected $installableHooks = array();
+ protected $_product = array();
- public function __construct() {
+ public function __construct()
+ {
$this->plugindir = HookAPI::getAddonsDir() . $this->productShortName;
}
@@ -1116,5 +1128,7 @@ public function __get($property)
public function test()
{
echo $this->productShortName;
+
+
}
}
@@ -43,6 +43,7 @@ public static function init($debug = false)
self::$_is_Debug = $debug;
+ // todo: Installer must check template cache directory for write access!
$compiledir = rtrim($boarddir, '/') . '/template_cache/themeid_' . $settings['theme_id']; // TODO: make this customizable
@require_once($sourcedir . '/lib/Smarty/Smarty.class.php');
@@ -3084,6 +3084,7 @@ span.member.offline {
display:block;
}
+
@media print {
#headerarea {
display: none;
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
- * @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
+ * @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
@@ -12,6 +12,15 @@
* @version 1.0pre
*/
+/**
+ * theme_support.php allows to customize a theme with additional functions that are
+ * available in the templates.
+ *
+ * This implementation serves as base and all its methods *must* always exist. If you
+ * write your own theme_support.php you *must* therefore inherit from the
+ * EoS_Smarty_Template_Support class
+ */
+
global $settings;
$settings['theme_variants'] = array('default');
@@ -30,13 +39,20 @@
'_default' => 'override_default',
);
+/**
+ * This is a mandatory function a theme_support.php must always have. It must instantiate and return
+ * a class that inherits from EoS_Smarty_Template_Support and pass $smarty_instance to its CTOR.
+ *
+ * @param $smarty_instance The Smarty Class instance
+ * @return DefaultTheme
+ */
function theme_support_autoload($smarty_instance)
{
return new DefaultTheme($smarty_instance);
}
/**
- * your class MUST inherit from _EoS_Smarty_Template_Support
+ * your class MUST inherit from EoS_Smarty_Template_Support
*/
class DefaultTheme extends EoS_Smarty_Template_Support
{
@@ -182,4 +198,3 @@ public function template_control_verification($verify_id, $display_type = 'all',
return true;
}
}
-?>

0 comments on commit 43fdf12

Please sign in to comment.