diff --git a/digg-digg/include/dd-class.php b/digg-digg/include/dd-class.php index b20c901..390c1b7 100644 --- a/digg-digg/include/dd-class.php +++ b/digg-digg/include/dd-class.php @@ -2119,4 +2119,75 @@ public function DD_Serpd() { parent::BaseDD(self::NAME, self::URL_WEBSITE, self::URL_API, self::BASEURL); } } +/****************************************************************************************** + * + * http://www.karmacracy.com + * + */ +class DD_Karmacracy extends BaseDD{ + + const NAME = "Karmacracy"; + const URL_WEBSITE = "http://www.karmacracy.com"; + const URL_API = "http://karmacracy.com/sections/widget/button/button.php"; + const BASEURL = "
"; + + const OPTION_APPEND_TYPE = "dd_karmacracy_appendType"; + const OPTION_BUTTON_DESIGN = "dd_karmacracy_buttonDesign"; + const OPTION_BUTTON_WEIGHT = "dd_karmacracy_button_weight"; + const OPTION_AJAX_LEFT_FLOAT = "dd_karmacracy_ajax_left_float"; + const OPTION_LAZY_LOAD = "dd_karmacracy_lazy_load"; + + const DEFAULT_BUTTON_WEIGHT = "80"; + + var $islazyLoadAvailable = false; + var $isEncodeRequired = true; + + var $buttonLayout = array( + "Normal" => "over", + "Compact" => "right" + ); + + const BUTTON_TYPE_TAG="#TYPE#"; + const BUTTON_ID="#ID#"; + const BUTTON_SHOW_TOOLTIP="#SHOW_TOOLTIP#"; + const BUTTON_CADS="#CADSID#"; + + public function DD_Karmacracy() { + + $this->option_append_type = self::OPTION_APPEND_TYPE; + $this->option_button_design = self::OPTION_BUTTON_DESIGN; + $this->option_button_weight = self::OPTION_BUTTON_WEIGHT; + $this->option_ajax_left_float = self::OPTION_AJAX_LEFT_FLOAT; + $this->option_lazy_load = self::OPTION_LAZY_LOAD; + + $this->button_weight_value = self::DEFAULT_BUTTON_WEIGHT; + + parent::BaseDD(self::NAME, self::URL_WEBSITE, self::URL_API, self::BASEURL); + } + public function constructURL($url, $title,$button, $postId, $lazy, $globalcfg = ''){ + + + $rnd=rand(1,999999); + $result = str_replace(self::BUTTON_TYPE_TAG,$this->getButtonDesign($button),$this->baseURL); + $result = str_replace(self::BUTTON_ID,$rnd,$result); + + if($globalcfg!=''){ + $cads = $globalcfg[DD_GLOBAL_KARMACRACY_OPTION][DD_GLOBAL_KARMACRACY_OPTION_CADS]; + $showtooltip=$globalcfg[DD_GLOBAL_KARMACRACY_OPTION][DD_GLOBAL_KARMACRACY_OPTION_TOOLTIP]; + + } + if ($cads) { + $result = str_replace(self::BUTTON_CADS,"&medio-id=".$cads,$result); + } else { + $result = str_replace(self::BUTTON_CADS,"",$result); + } + if ($showtooltip) { + $result=str_replace(self::BUTTON_SHOW_TOOLTIP,"1",$result); + } else { + $result=str_replace(self::BUTTON_SHOW_TOOLTIP,"0",$result); + } + + $this->finalURL = $result; + } +} ?> \ No newline at end of file diff --git a/digg-digg/include/dd-global-variable.php b/digg-digg/include/dd-global-variable.php index 498489d..8fa6575 100644 --- a/digg-digg/include/dd-global-variable.php +++ b/digg-digg/include/dd-global-variable.php @@ -148,6 +148,11 @@ define('DD_GLOBAL_FLATTR_OPTION','dd_global_flattr_option'); define('DD_GLOBAL_FLATTR_OPTION_UID','dd_global_flattr_option_uid'); +define('DD_GLOBAL_KARMACRACY_OPTION','dd_global_karmacracy_option'); +define('DD_GLOBAL_KARMACRACY_OPTION_TOOLTIP','dd_global_karmacracy_option_tooltip'); +define('DD_GLOBAL_KARMACRACY_OPTION_CADS','dd_global_karmacracy_option_cadsid'); + + global $ddGlobalConfig; $ddGlobalConfig = array( DD_GLOBAL_TWITTER_OPTION => array( @@ -174,7 +179,11 @@ ), DD_GLOBAL_FLATTR_OPTION => array( DD_GLOBAL_FLATTR_OPTION_UID => DD_EMPTY_VALUE - ) + ), + DD_GLOBAL_KARMACRACY_OPTION => array( + DD_GLOBAL_KARMACRACY_OPTION_TOOLTIP =>DD_CHECK_BOX_ON, + DD_GLOBAL_KARMACRACY_OPTION_CADS =>DD_EMPTY_VALUE + ), ); /******* * Digg Digg Global Display (End) @@ -233,7 +242,8 @@ DD_BUTTON_GOOGLE1 => new DD_Google1(), DD_BUTTON_BUFFER => new DD_Buffer(), DD_BUTTON_PINTEREST => new DD_Pinterest(), - DD_BUTTON_FLATTR => new DD_Flattr() + DD_BUTTON_FLATTR => new DD_Flattr(), + DD_BUTTON_KARMACRACY=>new DD_Karmacracy() ), DD_NORMAL_BUTTON_FINAL => array() ); @@ -327,7 +337,8 @@ DD_BUTTON_GOOGLE1 => new DD_Google1(), DD_BUTTON_BUFFER => new DD_Buffer(), DD_BUTTON_PINTEREST => new DD_Pinterest(), - DD_BUTTON_FLATTR => new DD_Flattr() + DD_BUTTON_FLATTR => new DD_Flattr(), + DD_BUTTON_KARMACRACY => new DD_Karmacracy() ), DD_FLOAT_BUTTON_FINAL => array() ); diff --git a/digg-digg/include/template/dd-template-global.php b/digg-digg/include/template/dd-template-global.php index f5a6cbe..626916a 100644 --- a/digg-digg/include/template/dd-template-global.php +++ b/digg-digg/include/template/dd-template-global.php @@ -256,10 +256,38 @@ function dd_print_global_form($ddGlobalConfig){ + +7.1 Show community tooltip | ++ > + | +
---|---|
7.2 cAds certificate media ID | +
+
+ Enter your cAds media id if you are a cAds certificate site. + |
+
Reset all "Global Configuration" settings to their default values.
@@ -272,7 +300,7 @@ function dd_print_global_form($ddGlobalConfig){Reset all settings (everything) to their default values.