Changeset 741039
- Timestamp:
- 07/15/2013 01:49:15 PM (13 years ago)
- Location:
- love-button/trunk
- Files:
-
- 4 edited
- 1 moved
-
be/config.php (modified) (8 diffs)
-
fe/love-button-style_custom.css (moved) (moved from love-button/trunk/fe/style_custom.css)
-
love-button.php (modified) (27 diffs)
-
readme.txt (modified) (2 diffs)
-
widgets/suggest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
love-button/trunk/be/config.php
r706403 r741039 27 27 <div class="tabs"> 28 28 <div class="tabMenu"> 29 <div class="entry statistics" title="<? =_e('Statistics', $this->pluginHook);?>"> </div>30 <div class="entry settings" title="<? =_e('Settings', $this->pluginHook);?>"> </div>29 <div class="entry statistics" title="<?php echo _e('Statistics', $this->pluginHook);?>"> </div> 30 <div class="entry settings" title="<?php echo _e('Settings', $this->pluginHook);?>"> </div> 31 31 </div> 32 32 <div class="tabContent"> 33 33 <div class="entry"> 34 <div class="container heading" style="width: 75%;"><? =_e('Statistics', $this->pluginHook);?></div>34 <div class="container heading" style="width: 75%;"><?php echo _e('Statistics', $this->pluginHook);?></div> 35 35 <div class="containerClear"></div> 36 36 <div class="statisticsSettings"> 37 <? =_e('Show', $this->pluginHook);?>38 <select name="<? =($this->optionKey)?>[stats][range]" class="statsRange">39 <option value="" <? =($this->options['stats']['range'] == '' ? 'selected="selected"' : '')?>><?=_e('Total', $this->pluginHook);?></option>40 <option value="today" <? =($this->options['stats']['range'] == 'today' ? 'selected="selected"' : '')?>><?=_e('Today', $this->pluginHook);?></option>41 <option value="yesterday" <? =($this->options['stats']['range'] == 'yesterday' ? 'selected="selected"' : '')?>><?=_e('Yesterday', $this->pluginHook);?></option>42 <option value="currentWeek" <? =($this->options['stats']['range'] == 'currentWeek' ? 'selected="selected"' : '')?>><?=_e('Current week', $this->pluginHook);?></option>43 <option value="lastWeek" <? =($this->options['stats']['range'] == 'lastWeek' ? 'selected="selected"' : '')?>><?=_e('Last Week', $this->pluginHook);?></option>44 <option value="currentMonth" <? =($this->options['stats']['range'] == 'currentMonth' ? 'selected="selected"' : '')?>><?=_e('Current Month', $this->pluginHook);?></option>45 <option value="lastMonth" <? =($this->options['stats']['range'] == 'lastMonth' ? 'selected="selected"' : '')?>><?=_e('Last Month', $this->pluginHook);?></option>46 <option value="currentYear" <? =($this->options['stats']['range'] == 'currentYear' ? 'selected="selected"' : '')?>><?=_e('Current Year', $this->pluginHook);?></option>47 <option value="lastYear" <? =($this->options['stats']['range'] == 'lastYear' ? 'selected="selected"' : '')?>><?=_e('Last Year', $this->pluginHook);?></option>48 </select> 49 <? =_e('From', $this->pluginHook);?>50 <select name="<? =($this->optionKey)?>[stats][from]" class="statsFrom">37 <?php echo _e('Show', $this->pluginHook);?> 38 <select name="<?php echo ($this->optionKey)?>[stats][range]" class="statsRange"> 39 <option value="" <?php echo ($this->options['stats']['range'] == '' ? 'selected="selected"' : '')?>><?php echo _e('Total', $this->pluginHook);?></option> 40 <option value="today" <?php echo ($this->options['stats']['range'] == 'today' ? 'selected="selected"' : '')?>><?php echo _e('Today', $this->pluginHook);?></option> 41 <option value="yesterday" <?php echo ($this->options['stats']['range'] == 'yesterday' ? 'selected="selected"' : '')?>><?php echo _e('Yesterday', $this->pluginHook);?></option> 42 <option value="currentWeek" <?php echo ($this->options['stats']['range'] == 'currentWeek' ? 'selected="selected"' : '')?>><?php echo _e('Current week', $this->pluginHook);?></option> 43 <option value="lastWeek" <?php echo ($this->options['stats']['range'] == 'lastWeek' ? 'selected="selected"' : '')?>><?php echo _e('Last Week', $this->pluginHook);?></option> 44 <option value="currentMonth" <?php echo ($this->options['stats']['range'] == 'currentMonth' ? 'selected="selected"' : '')?>><?php echo _e('Current Month', $this->pluginHook);?></option> 45 <option value="lastMonth" <?php echo ($this->options['stats']['range'] == 'lastMonth' ? 'selected="selected"' : '')?>><?php echo _e('Last Month', $this->pluginHook);?></option> 46 <option value="currentYear" <?php echo ($this->options['stats']['range'] == 'currentYear' ? 'selected="selected"' : '')?>><?php echo _e('Current Year', $this->pluginHook);?></option> 47 <option value="lastYear" <?php echo ($this->options['stats']['range'] == 'lastYear' ? 'selected="selected"' : '')?>><?php echo _e('Last Year', $this->pluginHook);?></option> 48 </select> 49 <?php echo _e('From', $this->pluginHook);?> 50 <select name="<?php echo ($this->optionKey)?>[stats][from]" class="statsFrom"> 51 51 <?php 52 52 echo '<option value="" '.($this->options['stats']['from'] == '' ? 'selected="selected"' : '').'>-</option>'; … … 57 57 ?> 58 58 </select> 59 <? =_e('to', $this->pluginHook);?>60 <select name="<? =($this->optionKey)?>[stats][to]" class="statsTo">59 <?php echo _e('to', $this->pluginHook);?> 60 <select name="<?php echo ($this->optionKey)?>[stats][to]" class="statsTo"> 61 61 <?php 62 62 echo '<option value="" '.($this->options['stats']['to'] == '' ? 'selected="selected"' : '').'>-</option>'; … … 67 67 ?> 68 68 </select> 69 <? =_e('Limit', $this->pluginHook);?> <input size="1" type="text" name="<?=($this->optionKey)?>[stats][limit]" value="<?=($this->options['stats']['limit'])?>" />69 <?php echo _e('Limit', $this->pluginHook);?> <input size="1" type="text" name="<?php echo ($this->optionKey)?>[stats][limit]" value="<?php echo ($this->options['stats']['limit'])?>" /> 70 70 71 71 72 <? =_e('Hide empty', $this->pluginHook);?>73 <input type="checkbox" name="<? =($this->optionKey)?>[stats][hideEmpty]" value="1" <?=($this->options['stats']['hideEmpty'] == '1' ? 'checked="checked"' : '')?>/>72 <?php echo _e('Hide empty', $this->pluginHook);?> 73 <input type="checkbox" name="<?php echo ($this->optionKey)?>[stats][hideEmpty]" value="1" <?php echo ($this->options['stats']['hideEmpty'] == '1' ? 'checked="checked"' : '')?>/> 74 74 <p class="submit top"> 75 75 <input type="submit" class="button-primary" value="<?php _e("Save Options", $this->pluginHook); ?>"/> … … 77 77 </p> 78 78 </div> 79 <div class="chart_heading"><? =_e('Visual Overview', $this->pluginHook);?></div><div id="chart_div" style="width: 600px; height: 350px;"></div>80 <div class="stats_heading"><? =_e('In Numbers', $this->pluginHook);?></div>79 <div class="chart_heading"><?php echo _e('Visual Overview', $this->pluginHook);?></div><div id="chart_div" style="width: 600px; height: 350px;"></div> 80 <div class="stats_heading"><?php echo _e('In Numbers', $this->pluginHook);?></div> 81 81 <table class="statistics"> 82 82 <thead> 83 <th class="url"><? =_e('Page', $this->pluginHook);?></th>83 <th class="url"><?php echo _e('Page', $this->pluginHook);?></th> 84 84 <?php 85 85 foreach($this->availableNetworks as $k => $v){ … … 88 88 } 89 89 ?> 90 <th class="internal"><span class="icon"><? =($this->getStatisticTotal('internal') ? $this->getStatisticTotal('internal') : '0')?></span></th>91 <th class="total"><span class="icon"><? =($this->getStatisticTotal('total') ? $this->getStatisticTotal('total') : '0')?></span></th>90 <th class="internal"><span class="icon"><?php echo ($this->getStatisticTotal('internal') ? $this->getStatisticTotal('internal') : '0')?></span></th> 91 <th class="total"><span class="icon"><?php echo ($this->getStatisticTotal('total') ? $this->getStatisticTotal('total') : '0')?></span></th> 92 92 </thead> 93 93 <tbody> … … 112 112 </div> 113 113 <div class="entry"> 114 <div class="container heading"><? =_e('Style', $this->pluginHook);?></div>115 <div class="container heading"><? =_e('Channels', $this->pluginHook);?></div>116 <div class="container heading"><? =_e('Placement', $this->pluginHook);?></div>114 <div class="container heading"><?php echo _e('Style', $this->pluginHook);?></div> 115 <div class="container heading"><?php echo _e('Channels', $this->pluginHook);?></div> 116 <div class="container heading"><?php echo _e('Placement', $this->pluginHook);?></div> 117 117 <div class="containerClear"></div> 118 118 <div class="container content style"> 119 119 <div class="theme"> 120 <div class="label"><? =_e('Style', $this->pluginHook);?></div>121 <input type="radio" name="<? =($this->optionKey)?>[theme]" value="bright" <?=($this->options['theme'] == 'bright' ? 'checked="checked"' : '')?>/> <span><?=_e('bright', $this->pluginHook);?></span><br/>122 <input type="radio" name="<? =($this->optionKey)?>[theme]" value="dark" <?=($this->options['theme'] == 'dark' ? 'checked="checked"' : '')?>/> <span><?=_e('dark', $this->pluginHook);?></span><br/>120 <div class="label"><?php echo _e('Style', $this->pluginHook);?></div> 121 <input type="radio" name="<?php echo ($this->optionKey)?>[theme]" value="bright" <?php echo ($this->options['theme'] == 'bright' ? 'checked="checked"' : '')?>/> <span><?php echo _e('bright', $this->pluginHook);?></span><br/> 122 <input type="radio" name="<?php echo ($this->optionKey)?>[theme]" value="dark" <?php echo ($this->options['theme'] == 'dark' ? 'checked="checked"' : '')?>/> <span><?php echo _e('dark', $this->pluginHook);?></span><br/> 123 123 </div> 124 124 <div class="containerClear"></div> 125 <input type="checkbox" name="<? =($this->optionKey)?>[displayVerb]" value="1" <?=($this->options['displayVerb'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Display verb', $this->pluginHook);?></span><br/>126 <span class="label"><? =_e('Verb', $this->pluginHook);?></span> <input class="verb" title="<?=_e('Verb', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[verb]" value="<?=($this->options['verb'])?>" /><br/>127 <input type="checkbox" name="<? =($this->optionKey)?>[removeBackgrounds]" value="1" <?=($this->options['removeBackgrounds'] ? 'checked="checked"' : '')?>/> <span class="label tooltip" title=""><?=_e('Remove Popup-Backgrounds', $this->pluginHook);?></span> <span class="premiumFeature">*</span><br/>128 <input type="checkbox" name="<? =($this->optionKey)?>[heartless]" value="1" <?=($this->options['heartless'] ? 'checked="checked"' : '')?>/> <span class="label tooltip" title="<?=_e('No love button is visible. Only sharing buttons are visible', $this->pluginHook);?>"><?=_e('Heartless Version', $this->pluginHook);?></span> <span class="premiumFeature">*</span><br/>129 <input type="radio" name="<? =($this->optionKey)?>[style]" value="59x16" <?=($this->options['style'] == '59x16' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="59x16" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/>130 <input type="radio" name="<? =($this->optionKey)?>[style]" value="75x20" <?=($this->options['style'] == '75x20' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="75x20" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/>131 <input type="radio" name="<? =($this->optionKey)?>[style]" value="91x24" <?=($this->options['style'] == '91x24' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="91x24" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/>132 <input type="radio" name="<? =($this->optionKey)?>[style]" value="52x60" <?=($this->options['style'] == '52x60' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="52x60" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/>133 <input type="radio" name="<? =($this->optionKey)?>[style]" value="custom" <?=($this->options['style'] == 'custom' ? 'checked="checked"' : '')?>/> <?=_e('Custom', $this->pluginHook);?> <span class="premiumFeature">*</span><br/>134 <input class="customImageUrl" title="<? =_e('Paste image URL', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[customImageUrl]" value="<?=($this->options['customImageUrl'])?>" /><br/>135 <span class="label hint"><? =_e('The custom sharing image<br/>is without a visible counter.', $this->pluginHook);?></span>125 <input type="checkbox" name="<?php echo ($this->optionKey)?>[displayVerb]" value="1" <?php echo ($this->options['displayVerb'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Display verb', $this->pluginHook);?></span><br/> 126 <span class="label"><?php echo _e('Verb', $this->pluginHook);?></span> <input class="verb" title="<?php echo _e('Verb', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[verb]" value="<?php echo ($this->options['verb'])?>" /><br/> 127 <input type="checkbox" name="<?php echo ($this->optionKey)?>[removeBackgrounds]" value="1" <?php echo ($this->options['removeBackgrounds'] ? 'checked="checked"' : '')?>/> <span class="label tooltip" title=""><?php echo _e('Remove Popup-Backgrounds', $this->pluginHook);?></span> <span class="premiumFeature">*</span><br/> 128 <input type="checkbox" name="<?php echo ($this->optionKey)?>[heartless]" value="1" <?php echo ($this->options['heartless'] ? 'checked="checked"' : '')?>/> <span class="label tooltip" title="<?php echo _e('No love button is visible. Only sharing buttons are visible', $this->pluginHook);?>"><?php echo _e('Heartless Version', $this->pluginHook);?></span> <span class="premiumFeature">*</span><br/> 129 <input type="radio" name="<?php echo ($this->optionKey)?>[style]" value="59x16" <?php echo ($this->options['style'] == '59x16' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="59x16" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/> 130 <input type="radio" name="<?php echo ($this->optionKey)?>[style]" value="75x20" <?php echo ($this->options['style'] == '75x20' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="75x20" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/> 131 <input type="radio" name="<?php echo ($this->optionKey)?>[style]" value="91x24" <?php echo ($this->options['style'] == '91x24' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="91x24" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/> 132 <input type="radio" name="<?php echo ($this->optionKey)?>[style]" value="52x60" <?php echo ($this->options['style'] == '52x60' ? 'checked="checked"' : '')?>/> <?php echo do_shortcode('[love-button style="52x60" align="none" marginTop="0" marginRight="0" marginBottom="0" marginLeft="0" position="relative" positionTop="0" positionRight="0" positionBottom="0" positionLeft="0"]');?><br/><br/> 133 <input type="radio" name="<?php echo ($this->optionKey)?>[style]" value="custom" <?php echo ($this->options['style'] == 'custom' ? 'checked="checked"' : '')?>/> <?php echo _e('Custom', $this->pluginHook);?> <span class="premiumFeature">*</span><br/> 134 <input class="customImageUrl" title="<?php echo _e('Paste image URL', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[customImageUrl]" value="<?php echo ($this->options['customImageUrl'])?>" /><br/> 135 <span class="label hint"><?php echo _e('The custom sharing image<br/>is without a visible counter.', $this->pluginHook);?></span> 136 136 </div> 137 137 <div class="container content functions"> 138 138 <?php foreach($this->sortedNetworks as $network){ ?> 139 <div class="network"><input type="checkbox" name="<? =($this->optionKey)?>[networks][]" value="<?=$network['name']?>" <?=($network['active'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e($network['name'], $this->pluginHook);?></span>139 <div class="network"><input type="checkbox" name="<?php echo ($this->optionKey)?>[networks][]" value="<?php echo $network['name']?>" <?php echo ($network['active'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e($network['name'], $this->pluginHook);?></span> 140 140 <?php if(isset($this->networkSettings[$network['name']])) : ?> 141 141 <div class="networkSettings"> 142 142 <?php foreach($this->networkSettings[$network['name']] as $k => $setting){ ?> 143 143 <div class="row<?php echo (isset($setting['tooltip']) && !empty($setting['tooltip']) ? ' tooltip' : ''); ?>"<?php echo (isset($setting['tooltip']) && !empty($setting['tooltip']) ? ' title="'.$setting['tooltip'].'"' : ''); ?>> 144 <span class="settingName"><? =$setting['label'];?>:</span>145 <span class="settingInput"><? =$this->getInput($setting, $network['name']);?></span>144 <span class="settingName"><?php echo $setting['label'];?>:</span> 145 <span class="settingInput"><?php echo $this->getInput($setting, $network['name']);?></span> 146 146 </div> 147 147 <?php } ?> … … 152 152 </div> 153 153 <div class="container content placement"> 154 <input type="radio" name="<? =($this->optionKey)?>[placement][type]" value="1" <?=($this->options['placement']['type'] == '1' ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Blog views, posts and pages', $this->pluginHook);?></span><br/>155 <input type="radio" name="<? =($this->optionKey)?>[placement][type]" value="2" <?=($this->options['placement']['type'] == '2' ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Posts and pages', $this->pluginHook);?></span><br/>156 <input type="radio" name="<? =($this->optionKey)?>[placement][type]" value="3" <?=($this->options['placement']['type'] == '3' ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Posts', $this->pluginHook);?></span><br/>157 <input type="radio" name="<? =($this->optionKey)?>[placement][type]" value="0" <?=($this->options['placement']['type'] == '0' ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Only use shortcode', $this->pluginHook);?></span><br/>154 <input type="radio" name="<?php echo ($this->optionKey)?>[placement][type]" value="1" <?php echo ($this->options['placement']['type'] == '1' ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Blog views, posts and pages', $this->pluginHook);?></span><br/> 155 <input type="radio" name="<?php echo ($this->optionKey)?>[placement][type]" value="2" <?php echo ($this->options['placement']['type'] == '2' ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Posts and pages', $this->pluginHook);?></span><br/> 156 <input type="radio" name="<?php echo ($this->optionKey)?>[placement][type]" value="3" <?php echo ($this->options['placement']['type'] == '3' ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Posts', $this->pluginHook);?></span><br/> 157 <input type="radio" name="<?php echo ($this->optionKey)?>[placement][type]" value="0" <?php echo ($this->options['placement']['type'] == '0' ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Only use shortcode', $this->pluginHook);?></span><br/> 158 158 <textarea class="shortcode"><?php echo "<?php echo do_shortcode('[love-button]');?>" ?></textarea><br/> 159 <select name="<? =($this->optionKey)?>[placement][align]" class="align">160 <option value="right" <? =($this->options['placement']['align'] == 'right' ? 'selected="selected"' : '')?>><?=_e('Right align', $this->pluginHook);?></option>161 <option value="left" <? =($this->options['placement']['align'] == 'left' ? 'selected="selected"' : '')?>><?=_e('Left align', $this->pluginHook);?></option>162 </select> 163 <select name="<? =($this->optionKey)?>[placement][filter]" class="filter">164 <option value="above" <? =($this->options['placement']['filter'] == 'above' ? 'selected="selected"' : '')?>><?=_e('Above content', $this->pluginHook);?></option>165 <option value="below" <? =($this->options['placement']['filter'] == 'below' ? 'selected="selected"' : '')?>><?=_e('Below content', $this->pluginHook);?></option>166 <option value="date" <? =($this->options['placement']['filter'] == 'date' ? 'selected="selected"' : '')?>><?=_e('Date', $this->pluginHook);?></option>159 <select name="<?php echo ($this->optionKey)?>[placement][align]" class="align"> 160 <option value="right" <?php echo ($this->options['placement']['align'] == 'right' ? 'selected="selected"' : '')?>><?php echo _e('Right align', $this->pluginHook);?></option> 161 <option value="left" <?php echo ($this->options['placement']['align'] == 'left' ? 'selected="selected"' : '')?>><?php echo _e('Left align', $this->pluginHook);?></option> 162 </select> 163 <select name="<?php echo ($this->optionKey)?>[placement][filter]" class="filter"> 164 <option value="above" <?php echo ($this->options['placement']['filter'] == 'above' ? 'selected="selected"' : '')?>><?php echo _e('Above content', $this->pluginHook);?></option> 165 <option value="below" <?php echo ($this->options['placement']['filter'] == 'below' ? 'selected="selected"' : '')?>><?php echo _e('Below content', $this->pluginHook);?></option> 166 <option value="date" <?php echo ($this->options['placement']['filter'] == 'date' ? 'selected="selected"' : '')?>><?php echo _e('Date', $this->pluginHook);?></option> 167 167 </select> 168 168 <div class="positionContainer"> 169 169 <div class="position"> 170 <span><? =_e('Position', $this->pluginHook);?></span>171 <input class="tooltip" title="<? =_e('Top', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][position-data][top]" value="<?=($this->options['placement']['position-data']['top'])?>" /> <input class="tooltip" title="<?=_e('Right', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][position-data][right]" value="<?=($this->options['placement']['position-data']['right'])?>" /> <input type="text" class="tooltip" title="<?=_e('Bottom', $this->pluginHook);?>" name="<?=($this->optionKey)?>[placement][position-data][bottom]" value="<?=($this->options['placement']['position-data']['bottom'])?>" /> <input class="tooltip" title="<?=_e('Left', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][position-data][left]" value="<?=($this->options['placement']['position-data']['left'])?>" />172 <select name="<? =($this->optionKey)?>[placement][position]" class="position">173 <option value="relative" <? =($this->options['placement']['position'] == 'relative' ? 'selected="selected"' : '')?>><?=_e('Relative', $this->pluginHook);?></option>174 <option value="absolute" <? =($this->options['placement']['position'] == 'absolute' ? 'selected="selected"' : '')?>><?=_e('Absolute', $this->pluginHook);?></option>175 <option value="fixed" <? =($this->options['placement']['position'] == 'fixed' ? 'selected="selected"' : '')?>><?=_e('Fixed', $this->pluginHook);?></option>170 <span><?php echo _e('Position', $this->pluginHook);?></span> 171 <input class="tooltip" title="<?php echo _e('Top', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][position-data][top]" value="<?php echo ($this->options['placement']['position-data']['top'])?>" /> <input class="tooltip" title="<?php echo _e('Right', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][position-data][right]" value="<?php echo ($this->options['placement']['position-data']['right'])?>" /> <input type="text" class="tooltip" title="<?php echo _e('Bottom', $this->pluginHook);?>" name="<?php echo ($this->optionKey)?>[placement][position-data][bottom]" value="<?php echo ($this->options['placement']['position-data']['bottom'])?>" /> <input class="tooltip" title="<?php echo _e('Left', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][position-data][left]" value="<?php echo ($this->options['placement']['position-data']['left'])?>" /> 172 <select name="<?php echo ($this->optionKey)?>[placement][position]" class="position"> 173 <option value="relative" <?php echo ($this->options['placement']['position'] == 'relative' ? 'selected="selected"' : '')?>><?php echo _e('Relative', $this->pluginHook);?></option> 174 <option value="absolute" <?php echo ($this->options['placement']['position'] == 'absolute' ? 'selected="selected"' : '')?>><?php echo _e('Absolute', $this->pluginHook);?></option> 175 <option value="fixed" <?php echo ($this->options['placement']['position'] == 'fixed' ? 'selected="selected"' : '')?>><?php echo _e('Fixed', $this->pluginHook);?></option> 176 176 </select> 177 177 </div> 178 178 <div class="margin"> 179 <span><? =_e('Margin', $this->pluginHook);?></span>180 <input class="tooltip" title="<? =_e('Top', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][margin][top]" value="<?=($this->options['placement']['margin']['top'])?>" /> <input class="tooltip" title="<?=_e('Right', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][margin][right]" value="<?=($this->options['placement']['margin']['right'])?>" /> <input class="tooltip" title="<?=_e('Bottom', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][margin][bottom]" value="<?=($this->options['placement']['margin']['bottom'])?>" /> <input class="tooltip" title="<?=_e('Left', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[placement][margin][left]" value="<?=($this->options['placement']['margin']['left'])?>" /><br/>179 <span><?php echo _e('Margin', $this->pluginHook);?></span> 180 <input class="tooltip" title="<?php echo _e('Top', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][margin][top]" value="<?php echo ($this->options['placement']['margin']['top'])?>" /> <input class="tooltip" title="<?php echo _e('Right', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][margin][right]" value="<?php echo ($this->options['placement']['margin']['right'])?>" /> <input class="tooltip" title="<?php echo _e('Bottom', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][margin][bottom]" value="<?php echo ($this->options['placement']['margin']['bottom'])?>" /> <input class="tooltip" title="<?php echo _e('Left', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[placement][margin][left]" value="<?php echo ($this->options['placement']['margin']['left'])?>" /><br/> 181 181 </div> 182 182 </div> … … 185 185 <div> </div> 186 186 <div> </div> 187 <div class="container heading"><? =_e('Popup', $this->pluginHook);?></div>188 <div class="container heading"><? =_e('Behavior', $this->pluginHook);?></div>189 <div class="container heading"><? =_e('License', $this->pluginHook);?></div>187 <div class="container heading"><?php echo _e('Popup', $this->pluginHook);?></div> 188 <div class="container heading"><?php echo _e('Behavior', $this->pluginHook);?></div> 189 <div class="container heading"><?php echo _e('License', $this->pluginHook);?></div> 190 190 <div class="containerClear"></div> 191 191 <div class="container content popup"> 192 <input type="checkbox" name="<? =($this->optionKey)?>[showDataPrivacy]" value="1" <?=($this->options['showDataPrivacy'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Show data privacy', $this->pluginHook);?></span><br/>193 <input type="checkbox" name="<? =($this->optionKey)?>[showDataPrivacyTextByDefault]" value="1" <?=($this->options['showDataPrivacyTextByDefault'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Show data privacy text by default', $this->pluginHook);?></span><br/>192 <input type="checkbox" name="<?php echo ($this->optionKey)?>[showDataPrivacy]" value="1" <?php echo ($this->options['showDataPrivacy'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Show data privacy', $this->pluginHook);?></span><br/> 193 <input type="checkbox" name="<?php echo ($this->optionKey)?>[showDataPrivacyTextByDefault]" value="1" <?php echo ($this->options['showDataPrivacyTextByDefault'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Show data privacy text by default', $this->pluginHook);?></span><br/> 194 194 <nobr> 195 <span class="label" style="width: 135px;"><? =_e('Popup v-position', $this->pluginHook);?></span>196 <select name="<? =($this->optionKey)?>[popup][position-y]" class="position">197 <option value="auto" <? =($this->options['popup']['position-y'] == 'auto' ? 'selected="selected"' : '')?>><?=_e('Auto', $this->pluginHook);?></option>198 <option value="above" <? =($this->options['popup']['position-y'] == 'above' ? 'selected="selected"' : '')?>><?=_e('Above button', $this->pluginHook);?></option>199 <option value="below" <? =($this->options['popup']['position-y'] == 'below' ? 'selected="selected"' : '')?>><?=_e('Below button', $this->pluginHook);?></option>195 <span class="label" style="width: 135px;"><?php echo _e('Popup v-position', $this->pluginHook);?></span> 196 <select name="<?php echo ($this->optionKey)?>[popup][position-y]" class="position"> 197 <option value="auto" <?php echo ($this->options['popup']['position-y'] == 'auto' ? 'selected="selected"' : '')?>><?php echo _e('Auto', $this->pluginHook);?></option> 198 <option value="above" <?php echo ($this->options['popup']['position-y'] == 'above' ? 'selected="selected"' : '')?>><?php echo _e('Above button', $this->pluginHook);?></option> 199 <option value="below" <?php echo ($this->options['popup']['position-y'] == 'below' ? 'selected="selected"' : '')?>><?php echo _e('Below button', $this->pluginHook);?></option> 200 200 </select></nobr><br/> 201 201 <nobr> 202 <span class="label" style="width: 135px;"><? =_e('Popup h-position', $this->pluginHook);?></span>203 <select name="<? =($this->optionKey)?>[popup][position-x]" class="position">204 <option value="auto" <? =($this->options['popup']['position-x'] == 'auto' ? 'selected="selected"' : '')?>><?=_e('Auto', $this->pluginHook);?></option>205 <option value="left" <? =($this->options['popup']['position-x'] == 'left' ? 'selected="selected"' : '')?>><?=_e('Left', $this->pluginHook);?></option>206 <option value="right" <? =($this->options['popup']['position-x'] == 'right' ? 'selected="selected"' : '')?>><?=_e('Right', $this->pluginHook);?></option>202 <span class="label" style="width: 135px;"><?php echo _e('Popup h-position', $this->pluginHook);?></span> 203 <select name="<?php echo ($this->optionKey)?>[popup][position-x]" class="position"> 204 <option value="auto" <?php echo ($this->options['popup']['position-x'] == 'auto' ? 'selected="selected"' : '')?>><?php echo _e('Auto', $this->pluginHook);?></option> 205 <option value="left" <?php echo ($this->options['popup']['position-x'] == 'left' ? 'selected="selected"' : '')?>><?php echo _e('Left', $this->pluginHook);?></option> 206 <option value="right" <?php echo ($this->options['popup']['position-x'] == 'right' ? 'selected="selected"' : '')?>><?php echo _e('Right', $this->pluginHook);?></option> 207 207 </select></nobr><br/> 208 <span class="label" style="width: 135px;"><? =_e('Popup columns', $this->pluginHook);?></span>209 <input size="1" type="text" name="<? =($this->optionKey)?>[popup][columns]" value="<?=($this->options['popup']['columns'])?>" /><br/>208 <span class="label" style="width: 135px;"><?php echo _e('Popup columns', $this->pluginHook);?></span> 209 <input size="1" type="text" name="<?php echo ($this->optionKey)?>[popup][columns]" value="<?php echo ($this->options['popup']['columns'])?>" /><br/> 210 210 </div> 211 211 <div class="container content behavior"> 212 <div class="tooltip" title="<? =_e('Recommended for post based sharing. if deactivated, the<br/>button would share the URL. Deactivation<br/>makes sense, if you only want to use one (global) love<br/>button for your frontpage, category pages and<br/>archive pages.', $this->pluginHook);?>">213 <input type="checkbox" name="<? =($this->optionKey)?>[shareBasedOnId]" value="1" <?=($this->options['shareBasedOnId'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Share based on ID', $this->pluginHook);?></span><br/>214 </div> 215 <div class="tooltip" title="<? =_e('If enabled, the plugin will remove all OpenGraph image tags from the html output and then create new tags for all images in the source which have a dimension of minimum [width]x[height] pixels.<br/>You can disallow to share an image by mark up as "unshareable" with the editor button.', $this->pluginHook);?>">216 <input type="checkbox" name="<? =($this->optionKey)?>[useOgImage]" value="1" <?=($this->options['useOgImage'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Proceed OpenGraph images', $this->pluginHook);?></span><br/>217 <span class="label"><? =_e('Minimum width', $this->pluginHook);?></span> <input size="1" type="text" name="<?=($this->optionKey)?>[useOgImageWidth]" value="<?=($this->options['useOgImageWidth'])?>" /> px / <span class="label"><?=_e('height', $this->pluginHook);?></span> <input size="1" type="text" name="<?=($this->optionKey)?>[useOgImageHeight]" value="<?=($this->options['useOgImageHeight'])?>" /> px<br/>212 <div class="tooltip" title="<?php echo _e('Recommended for post based sharing. if deactivated, the<br/>button would share the URL. Deactivation<br/>makes sense, if you only want to use one (global) love<br/>button for your frontpage, category pages and<br/>archive pages.', $this->pluginHook);?>"> 213 <input type="checkbox" name="<?php echo ($this->optionKey)?>[shareBasedOnId]" value="1" <?php echo ($this->options['shareBasedOnId'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Share based on ID', $this->pluginHook);?></span><br/> 214 </div> 215 <div class="tooltip" title="<?php echo _e('If enabled, the plugin will remove all OpenGraph image tags from the html output and then create new tags for all images in the source which have a dimension of minimum [width]x[height] pixels.<br/>You can disallow to share an image by mark up as "unshareable" with the editor button.', $this->pluginHook);?>"> 216 <input type="checkbox" name="<?php echo ($this->optionKey)?>[useOgImage]" value="1" <?php echo ($this->options['useOgImage'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Proceed OpenGraph images', $this->pluginHook);?></span><br/> 217 <span class="label"><?php echo _e('Minimum width', $this->pluginHook);?></span> <input size="1" type="text" name="<?php echo ($this->optionKey)?>[useOgImageWidth]" value="<?php echo ($this->options['useOgImageWidth'])?>" /> px / <span class="label"><?php echo _e('height', $this->pluginHook);?></span> <input size="1" type="text" name="<?php echo ($this->optionKey)?>[useOgImageHeight]" value="<?php echo ($this->options['useOgImageHeight'])?>" /> px<br/> 218 218 </div> 219 <div class="tooltip" title="<? =_e('Set this image to the first shareable OpenGraph image.', $this->pluginHook);?>">220 <span class="label"><? =_e('First OpenGraph image: ', $this->pluginHook);?></span>221 <input class="ogImage" title="<? =_e('Paste image URL', $this->pluginHook);?>" type="text" name="<?=($this->optionKey)?>[ogImage]" value="<?=($this->options['ogImage'])?>" /><br/>219 <div class="tooltip" title="<?php echo _e('Set this image to the first shareable OpenGraph image.', $this->pluginHook);?>"> 220 <span class="label"><?php echo _e('First OpenGraph image: ', $this->pluginHook);?></span> 221 <input class="ogImage" title="<?php echo _e('Paste image URL', $this->pluginHook);?>" type="text" name="<?php echo ($this->optionKey)?>[ogImage]" value="<?php echo ($this->options['ogImage'])?>" /><br/> 222 222 </div> 223 223 </div> 224 224 <div class="container content license"> 225 <span class="label"><? =_e('Premium license key', $this->pluginHook);?></span> <input type="text" style="width: 235px;" name="<?=($this->optionKey)?>[license]" value="<?=($this->options['license'])?>" /><br/>226 <span class="label hint premiumFeature">* <? = _e('You can purchase a premium license key to enable premium features. Please visit', $this->pluginHook);?> <a target="_blank" href="<?=($this->licenseServer)?>">love.delucks.com</a></span><br/>227 <input type="checkbox" name="<? =($this->optionKey)?>[showBranding]" value="1" <?=($this->options['showBranding'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Show love button branding', $this->pluginHook);?></span><br/>228 </div> 229 <div class="containerClear"></div> 230 <div> </div> 231 <div> </div> 232 <div class="container heading"><? =_e('Counting', $this->pluginHook);?></div>225 <span class="label"><?php echo _e('Premium license key', $this->pluginHook);?></span> <input type="text" style="width: 235px;" name="<?php echo ($this->optionKey)?>[license]" value="<?php echo ($this->options['license'])?>" /><br/> 226 <span class="label hint premiumFeature">* <?php echo _e('You can purchase a premium license key to enable premium features. Please visit', $this->pluginHook);?> <a target="_blank" href="<?php echo ($this->licenseServer)?>">love.delucks.com</a></span><br/> 227 <input type="checkbox" name="<?php echo ($this->optionKey)?>[showBranding]" value="1" <?php echo ($this->options['showBranding'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Show love button branding', $this->pluginHook);?></span><br/> 228 </div> 229 <div class="containerClear"></div> 230 <div> </div> 231 <div> </div> 232 <div class="container heading"><?php echo _e('Counting', $this->pluginHook);?></div> 233 233 <div class="containerClear"></div> 234 234 <div class="container content counting"> 235 <span class="label" style="width: 135px;"><? =_e('Only count clicks for this groups', $this->pluginHook);?></span>235 <span class="label" style="width: 135px;"><?php echo _e('Only count clicks for this groups', $this->pluginHook);?></span> 236 236 <nobr> 237 <select name="<? =($this->optionKey)?>[counting][countGroups][]" multiple="multiple" size="<?=(count($this->getRoles()->role_names)+1)?>">238 <option value="guest" <? =(isset($this->options['counting']['countGroups']) && is_array($this->options['counting']['countGroups']) && in_array('guest', $this->options['counting']['countGroups']) ? 'selected="selected"' : '')?>><?=_e('Guest', $this->pluginHook);?></option>237 <select name="<?php echo ($this->optionKey)?>[counting][countGroups][]" multiple="multiple" size="<?php echo (count($this->getRoles()->role_names)+1)?>"> 238 <option value="guest" <?php echo (isset($this->options['counting']['countGroups']) && is_array($this->options['counting']['countGroups']) && in_array('guest', $this->options['counting']['countGroups']) ? 'selected="selected"' : '')?>><?php echo _e('Guest', $this->pluginHook);?></option> 239 239 <?php foreach($this->getRoles()->role_names as $k => $v) { ?> 240 <option value="<? =($k)?>" <?=(isset($this->options['counting']['countGroups']) && is_array($this->options['counting']['countGroups']) && in_array($k, $this->options['counting']['countGroups']) ? 'selected="selected"' : '')?>><?=($v)?></option>240 <option value="<?php echo ($k)?>" <?php echo (isset($this->options['counting']['countGroups']) && is_array($this->options['counting']['countGroups']) && in_array($k, $this->options['counting']['countGroups']) ? 'selected="selected"' : '')?>><?php echo ($v)?></option> 241 241 <?php } ?> 242 242 </select></nobr><br/> 243 <div class="tooltip" title="<? =_e('Recommended. If deactivated, the click on the love<br/>button itself would not be counted as a click.', $this->pluginHook);?>">244 <input type="checkbox" name="<? =($this->optionKey)?>[countInternalLike]" value="1" <?=($this->options['countInternalLike'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Count Love Button clicks', $this->pluginHook);?></span>245 </div> 246 <input type="checkbox" name="<? =($this->optionKey)?>[showCounters]" value="1" <?=($this->options['showCounters'] ? 'checked="checked"' : '')?>/> <span class="label"><?=_e('Show counters', $this->pluginHook);?></span><br/>243 <div class="tooltip" title="<?php echo _e('Recommended. If deactivated, the click on the love<br/>button itself would not be counted as a click.', $this->pluginHook);?>"> 244 <input type="checkbox" name="<?php echo ($this->optionKey)?>[countInternalLike]" value="1" <?php echo ($this->options['countInternalLike'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Count Love Button clicks', $this->pluginHook);?></span> 245 </div> 246 <input type="checkbox" name="<?php echo ($this->optionKey)?>[showCounters]" value="1" <?php echo ($this->options['showCounters'] ? 'checked="checked"' : '')?>/> <span class="label"><?php echo _e('Show counters', $this->pluginHook);?></span><br/> 247 247 248 248 </div> -
love-button/trunk/love-button.php
r706403 r741039 4 4 Description: Secure social sharing plugin. With the Love Button the search for a data privacy correctly social sharing has an ned. This plugin only counts the number of time, the specific sharing buttons are clicked on each page of your website only in your database - nothing else and nowhere else. 5 5 Plugin URI: http://love.delucks.com 6 Version: 2.0. 16 Version: 2.0.2 7 7 Author: deLucks 8 8 Author URI: http://delucks.com … … 35 35 36 36 var $dbVersion = 1; 37 var $pluginVersion = '2.0. 1';37 var $pluginVersion = '2.0.2'; 38 38 var $licenseServer = 'http://love.delucks.com'; 39 39 var $pluginDir = null; … … 99 99 } else { 100 100 //prepare frontend 101 if( trim($this->options['ogImage']) && strlen(trim($this->options['ogImage']))){101 if(isset($this->options['ogImage']) && trim($this->options['ogImage']) && strlen(trim($this->options['ogImage']))){ 102 102 add_action('wp_head', array(&$this, 'addOgImage'), -9999999999999999); 103 103 } … … 105 105 add_action('wp_head', array(&$this, 'prepareFrontendHead')); 106 106 107 switch($this->options['placement']['filter']){ 108 case 'above': 109 case 'below': 110 add_filter('the_content', array(&$this, 'applyFilter'), 50); 111 break; 112 case 'date': 113 $applyOn = 'the_date'; 114 add_filter('the_date', array(&$this, 'applyFilter'), 50); 115 break; 107 if(isset($this->options['placement']['filter'])){ 108 switch($this->options['placement']['filter']){ 109 case 'above': 110 case 'below': 111 add_filter('the_content', array(&$this, 'applyFilter'), 50); 112 break; 113 case 'date': 114 $applyOn = 'the_date'; 115 add_filter('the_date', array(&$this, 'applyFilter'), 50); 116 break; 117 } 116 118 } 117 119 } … … 202 204 * */ 203 205 if(isset($_GET['delucksAjax']['method']) && method_exists($this, $_GET['delucksAjax']['method'])){ 206 //prevent error output by any plugin to return a valid response 207 ini_set('display_errors', 'off'); 208 error_reporting(0); 204 209 $output = call_user_func_array(array($this, $_GET['delucksAjax']['method']), (isset($_GET['delucksAjax']['params']) && is_array($_GET['delucksAjax']['params']) ? $_GET['delucksAjax']['params'] : array())); 205 210 if(is_array($output) || is_object($output)){ … … 229 234 $networks = array(); 230 235 $available = $this->getAvailableNetworks(); 231 $active = $this->options['networks'];236 $active = (isset($this->options['networks']) ? $this->options['networks'] : false); 232 237 233 238 if(is_array($active) && count($active)){ … … 317 322 echo "<link rel='stylesheet' href='".plugins_url( 'be/js/DataTables-1.9.4/media/css/jquery.dataTables.css', __FILE__ )."' type='text/css' />\n"; 318 323 echo "<link rel='stylesheet' href='".plugins_url( 'be/style.css', __FILE__ )."' type='text/css' />\n"; 319 if( $this->options['removeBackgrounds'] == 1){324 if(isset($this->options['removeBackgrounds']) && $this->options['removeBackgrounds'] == 1){ 320 325 echo "<link rel='stylesheet' href='".plugins_url( 'fe/removeBackgrounds.css', __FILE__ )."' type='text/css' />\n"; 321 326 } … … 330 335 echo " loveButtonLanguage = ".json_encode($language).";\n"; 331 336 echo "</script>\n"; 332 echo "<script type='text/javascript'>var loveButtonAjaxUrl = ' ".get_bloginfo('wpurl')."';</script>"."\n";337 echo "<script type='text/javascript'>var loveButtonAjaxUrl = 'http://".($_SERVER['HTTP_HOST'])."';</script>"."\n"; 333 338 echo "<link rel='stylesheet' href='".plugins_url( 'be/js/tipsy/tipsy.css', __FILE__ )."' type='text/css' />\n"; 334 339 echo "<script type='text/javascript' src='".plugins_url( 'be/js/tipsy/jquery.tipsy.js', __FILE__ )."'></script>\n"; … … 397 402 $edd_updater = new EDD_SL_Plugin_Updater( $this->licenseServer, __FILE__, array( 398 403 'version' => $this->pluginVersion, 399 'license' => trim($this->options['license']),404 'license' => (isset($this->options['license']) ? trim($this->options['license']) : ''), 400 405 'item_name' => 'Love Button Premium', 401 406 'author' => 'deLucks' … … 435 440 436 441 function addOgImage(){ 442 if(!isset($this->options['ogImage'])){ 443 return false; 444 } 437 445 echo '<meta property="og:image" content="'.esc_url(trim($this->options['ogImage'])).'" />'."\n"; 438 446 } … … 447 455 $language['DontShowAgain'] = __('Don\'t show again', $this->pluginHook); 448 456 $language['Sec'] = __('Sec.', $this->pluginHook); 449 450 451 echo "<link rel='stylesheet' href='".plugins_url( 'fe/style.css', __FILE__ )."' type='text/css' />\n"; 452 echo "<link rel='stylesheet' href='".plugins_url( 'fe/style_custom.css', __FILE__ )."' type='text/css' />\n"; 453 if($this->options['removeBackgrounds'] == 1){ 457 458 $customStyleFile = 'love-button-style_custom.css'; 459 if(is_readable(get_template_directory() . '/' . $customStyleFile)){ 460 echo "<link rel='stylesheet' href='".get_template_directory_uri() . '/' . $customStyleFile ."' type='text/css' />\n"; 461 } elseif(is_readable(plugin_dir_path(__FILE__) . 'fe/' . $customStyleFile)){ //get custom style file from plugins dir 462 echo "<link rel='stylesheet' href='".plugins_url( 'fe/' . $customStyleFile, __FILE__ )."' type='text/css' />\n"; 463 } 464 465 if(isset($this->options['removeBackgrounds']) && $this->options['removeBackgrounds'] == 1){ 454 466 echo "<link rel='stylesheet' href='".plugins_url( 'fe/removeBackgrounds.css', __FILE__ )."' type='text/css' />\n"; 455 467 } 456 468 457 echo "<script type='text/javascript'>var loveButtonAjaxUrl = ' ".get_bloginfo('wpurl')."';</script>";469 echo "<script type='text/javascript'>var loveButtonAjaxUrl = 'http://".($_SERVER['HTTP_HOST'])."';</script>"; 458 470 echo "<script type='text/javascript'>\n"; 459 471 echo " loveButtonOptions = ".json_encode($options).";\n"; … … 476 488 function applyFilter($content) { 477 489 $filterAllowed = false; 478 switch($this->options['placement']['type']){ 479 case 1: 480 if(is_single() || is_page() || is_front_page() || is_category()){ 481 $filterAllowed = true; 482 } 483 break; 484 case 2: 485 if(is_single() || is_page()){ 486 $filterAllowed = true; 487 } 488 break; 489 case 3: 490 if(is_single()){ 491 $filterAllowed = true; 492 } 493 break; 490 if(isset($this->options['placement']['type'])){ 491 switch($this->options['placement']['type']){ 492 case 1: 493 if(is_single() || is_page() || is_front_page() || is_category()){ 494 $filterAllowed = true; 495 } 496 break; 497 case 2: 498 if(is_single() || is_page()){ 499 $filterAllowed = true; 500 } 501 break; 502 case 3: 503 if(is_single()){ 504 $filterAllowed = true; 505 } 506 break; 507 } 494 508 } 495 509 … … 499 513 500 514 $buttons = $this->get(); 501 switch($this->options['placement']['filter']){ 502 case 'above': 503 return $buttons.$content; 504 break; 505 case 'below': 515 if(isset($this->options['placement']['filter'])){ 516 switch($this->options['placement']['filter']){ 517 case 'above': 518 return $buttons.$content; 519 break; 520 case 'below': 521 return $content.$buttons; 522 break; 523 case 'date': 524 return $buttons.$content; 525 break; 526 case 'title': 527 return $buttons.$content; 528 break; 529 } 530 531 if($this->options['placement']['filter'] == 'below'){ 506 532 return $content.$buttons; 507 break; 508 case 'date': 509 return $buttons.$content; 510 break; 511 case 'title': 512 return $buttons.$content; 513 break; 514 } 515 516 if($this->options['placement']['filter'] == 'below'){ 517 return $content.$buttons; 518 } 533 } 534 } 535 519 536 return $buttons.$content; 520 537 } … … 525 542 function getShareData(){ 526 543 $data = array(); 527 if( $this->options['placement']['type'] == 0 || $this->options['shareBasedOnId'] != 1){544 if((isset($this->options['placement']['type']) && $this->options['placement']['type'] == 0) || (isset($this->options['shareBasedOnId']) && $this->options['shareBasedOnId'] != 1)){ 528 545 $data['shareTitle'] = urlencode(trim((is_home() || is_front_page() || is_category() ? get_bloginfo('title', 'display') : get_the_title() . ' | ' . get_bloginfo('name')))); 529 546 $data['shareTitleOriginal'] = trim((is_home() || is_front_page() || is_category() ? get_bloginfo('title', 'display') : get_the_title() . ' | ' . get_bloginfo('name'))); … … 556 573 function get($args = false, $fromShortcode = false){ 557 574 if(!is_admin()){ 558 if(!is _array($this->options['networks']) || !array_keys($this->options['networks'])){575 if(!isset($this->options['networks']) || !is_array($this->options['networks']) || !array_keys($this->options['networks'])){ 559 576 return false; 560 577 } … … 575 592 } 576 593 577 $opt['style'] = ((isset($args['style']) && strlen($args['style'])) ? $args['style'] : $this->options['style']);578 $opt['theme'] = ((isset($args['theme']) && strlen($args['theme'])) ? $args['theme'] : $this->options['theme']);579 $opt['float'] = ((isset($args['align']) && strlen($args['align'])) ? $args['align'] : $this->options['placement']['align']);580 $opt['displayverb'] = ((isset($args['displayverb']) && strlen($args['displayverb'])) ? $args['displayverb'] : $this->options['displayVerb']);594 $opt['style'] = ((isset($args['style']) && strlen($args['style'])) ? $args['style'] : isset($this->options['style']) ? $this->options['style'] : ''); 595 $opt['theme'] = ((isset($args['theme']) && strlen($args['theme'])) ? $args['theme'] : isset($this->options['theme']) ? $this->options['theme'] : ''); 596 $opt['float'] = ((isset($args['align']) && strlen($args['align'])) ? $args['align'] : isset($this->options['placement']['align']) ? $this->options['placement']['align'] : ''); 597 $opt['displayverb'] = ((isset($args['displayverb']) && strlen($args['displayverb'])) ? $args['displayverb'] : (isset($this->options['displayVerb']) ? true : false)); 581 598 $opt['verb'] = ((isset($args['verb']) && strlen($args['verb'])) ? $args['verb'] : (isset($this->options['verb']) && strlen($this->options['verb']) ? $this->options['verb'] : $this->defaultVerb)); 582 $opt['heartless'] = ((isset($args['heartless']) && strlen($args['heartless'])) ? $args['heartless'] : $this->options['heartless']);583 584 $opt['showcounters'] = ((isset($args['showcounters']) && strlen($args['showcounters'])) ? $args['showcounters'] : $this->options['showCounters']);585 $opt['showdataprivacytextbydefault'] = ((isset($args['showdataprivacytextbydefault']) && strlen($args['showdataprivacytextbydefault'])) ? $args['showdataprivacytextbydefault'] : $this->options['showDataPrivacyTextByDefault']);586 $opt['showdataprivacy'] = ((isset($args['showdataprivacy']) && strlen($args['showdataprivacy'])) ? $args['showdataprivacy'] : $this->options['showDataPrivacy']);587 $opt['popupcolumns'] = ((isset($args['popupcolumns']) && strlen($args['popupcolumns'])) ? $args['popupcolumns'] : $this->options['popup']['columns']);588 $opt['customimageurl'] = ((isset($args['customimageurl']) && strlen($args['customimageurl'])) ? $args['customimageurl'] : $this->options['customImageUrl']);589 590 $opt['popupy'] = 'popupy' . ((isset($args['popupy']) && strlen($args['popupy'])) ? $args['popupy'] : $this->options['popup']['position-y']);591 $opt['popupx'] = 'popupx' . ((isset($args['popupx']) && strlen($args['popupx'])) ? $args['popupx'] : $this->options['popup']['position-x']);592 593 $opt['margin-top'] = ((isset($args['margintop']) && strlen($args['margintop'])) ? $args['margintop'] : $this->options['placement']['margin']['top']) . 'px';594 $opt['margin-right'] = ((isset($args['marginright']) && strlen($args['marginright'])) ? $args['marginright'] : $this->options['placement']['margin']['right']) . 'px';595 $opt['margin-bottom'] = ((isset($args['marginbottom']) && strlen($args['marginbottom'])) ? $args['marginbottom'] : $this->options['placement']['margin']['bottom']) . 'px';596 $opt['margin-left'] = ((isset($args['marginleft']) && strlen($args['marginleft'])) ? $args['marginleft'] : $this->options['placement']['margin']['left']) . 'px';599 $opt['heartless'] = ((isset($args['heartless']) && strlen($args['heartless'])) ? $args['heartless'] : isset($this->options['heartless']) ? true : false); 600 601 $opt['showcounters'] = ((isset($args['showcounters']) && strlen($args['showcounters'])) ? $args['showcounters'] : isset($this->options['showCounters']) ? true : false); 602 $opt['showdataprivacytextbydefault'] = ((isset($args['showdataprivacytextbydefault']) && strlen($args['showdataprivacytextbydefault'])) ? $args['showdataprivacytextbydefault'] : isset($this->options['showDataPrivacyTextByDefault']) ? true : false); 603 $opt['showdataprivacy'] = ((isset($args['showdataprivacy']) && strlen($args['showdataprivacy'])) ? $args['showdataprivacy'] : (isset($this->options['showDataPrivacy']) ? true : false)); 604 $opt['popupcolumns'] = ((isset($args['popupcolumns']) && strlen($args['popupcolumns'])) ? $args['popupcolumns'] : isset($this->options['popup']['columns']) ? $this->options['popup']['columns'] : 3); 605 $opt['customimageurl'] = ((isset($args['customimageurl']) && strlen($args['customimageurl'])) ? $args['customimageurl'] : isset($this->options['customImageUrl']) ? $this->options['customImageUrl'] : ''); 606 607 $opt['popupy'] = 'popupy' . ((isset($args['popupy']) && strlen($args['popupy'])) ? $args['popupy'] : isset($this->options['popup']['position-y']) ? $this->options['popup']['position-y'] : ''); 608 $opt['popupx'] = 'popupx' . ((isset($args['popupx']) && strlen($args['popupx'])) ? $args['popupx'] : isset($this->options['popup']['position-x']) ? $this->options['popup']['position-x'] : ''); 609 610 $opt['margin-top'] = ((isset($args['margintop']) && strlen($args['margintop'])) ? $args['margintop'] : isset($this->options['placement']['margin']['top']) ? $this->options['placement']['margin']['top'] : '0') . 'px'; 611 $opt['margin-right'] = ((isset($args['marginright']) && strlen($args['marginright'])) ? $args['marginright'] : isset($this->options['placement']['margin']['right']) ? $this->options['placement']['margin']['right'] : '0') . 'px'; 612 $opt['margin-bottom'] = ((isset($args['marginbottom']) && strlen($args['marginbottom'])) ? $args['marginbottom'] : isset($this->options['placement']['margin']['bottom']) ? $this->options['placement']['margin']['bottom'] : '0') . 'px'; 613 $opt['margin-left'] = ((isset($args['marginleft']) && strlen($args['marginleft'])) ? $args['marginleft'] : isset($this->options['placement']['margin']['left']) ? $this->options['placement']['margin']['left'] : '0') . 'px'; 597 614 598 $opt['position'] = ((isset($args['position']) && strlen($args['position'])) ? $args['position'] : $this->options['placement']['position']);599 $opt['position-top'] = ((isset($args['positiontop']) && strlen($args['positiontop'])) ? $args['positiontop'] . 'px' : ( strlen($this->options['placement']['position-data']['top']) ? $this->options['placement']['position-data']['top']. 'px' : ''));600 $opt['position-right'] = ((isset($args['positionright']) && strlen($args['positionright'])) ? $args['positionright'] . 'px' : ( strlen($this->options['placement']['position-data']['right']) ? $this->options['placement']['position-data']['right']. 'px' : ''));601 $opt['position-bottom'] = ((isset($args['positionbottom']) && strlen($args['positionbottom'])) ? $args['positionbottom'] . 'px' : ( strlen($this->options['placement']['position-data']['bottom']) ? $this->options['placement']['position-data']['bottom']. 'px' : ''));602 $opt['position-left'] = ((isset($args['positionleft']) && strlen($args['positionleft'])) ? $args['positionleft'] . 'px' : ( strlen($this->options['placement']['position-data']['left']) ? $this->options['placement']['position-data']['left']. 'px' : ''));615 $opt['position'] = ((isset($args['position']) && strlen($args['position'])) ? $args['position'] : isset($this->options['placement']['position']) ? $this->options['placement']['position'] : 'relative'); 616 $opt['position-top'] = ((isset($args['positiontop']) && strlen($args['positiontop'])) ? $args['positiontop'] . 'px' : (isset($this->options['placement']['position-data']['top']) && strlen($this->options['placement']['position-data']['top']) ? $this->options['placement']['position-data']['top']. 'px' : '')); 617 $opt['position-right'] = ((isset($args['positionright']) && strlen($args['positionright'])) ? $args['positionright'] . 'px' : (isset($this->options['placement']['position-data']['right']) && strlen($this->options['placement']['position-data']['right']) ? $this->options['placement']['position-data']['right']. 'px' : '')); 618 $opt['position-bottom'] = ((isset($args['positionbottom']) && strlen($args['positionbottom'])) ? $args['positionbottom'] . 'px' : (isset($this->options['placement']['position-data']['bottom']) && strlen($this->options['placement']['position-data']['bottom']) ? $this->options['placement']['position-data']['bottom']. 'px' : '')); 619 $opt['position-left'] = ((isset($args['positionleft']) && strlen($args['positionleft'])) ? $args['positionleft'] . 'px' : (isset($this->options['placement']['position-data']['left']) && strlen($this->options['placement']['position-data']['left']) ? $this->options['placement']['position-data']['left']. 'px' : '')); 603 620 604 621 $opt['position-string'] = (strlen($opt['position-top']) ? ' top: '.$opt['position-top'].';' : ''); … … 615 632 } 616 633 617 if($fromShortcode || $this->options['shareBasedOnId'] != 1){634 if($fromShortcode || (isset($this->options['shareBasedOnId']) && $this->options['shareBasedOnId'] != 1)){ 618 635 $this->shareTitle = urlencode(trim((is_home() || is_front_page() || is_category() ? get_bloginfo('title', 'display') : get_the_title() . ' | ' . get_bloginfo('name')))); 619 636 $this->shareUrl = urlencode(get_bloginfo('wpurl') . $_SERVER['REQUEST_URI']); … … 635 652 $output = '<div class="delucksShareButtonsClear"></div>'; 636 653 637 @$output .= '<div class="'.@$postId.'post'.(@$likePost ? ' likePost' : '').' delucksShareButtonsOuterWrapper style_'.$opt['style'].' theme_'.$opt['theme'].' '.(!$opt['showcounters'] ? 'hideCounters' : '').( $this->options['heartless'] && !is_admin() ? ' heartless' : '').' '.$opt['popupy'].' '.$opt['popupx'].'" style="float: '.$opt['float'].'; margin: '.$opt['margin-top'] . ' ' . $opt['margin-right'] . ' ' . $opt['margin-bottom'] . ' ' . $opt['margin-left'].'; position: '. $opt['position'] .';'.$opt['position-string'].'">';654 @$output .= '<div class="'.@$postId.'post'.(@$likePost ? ' likePost' : '').' delucksShareButtonsOuterWrapper style_'.$opt['style'].' theme_'.$opt['theme'].' '.(!$opt['showcounters'] ? 'hideCounters' : '').(isset($this->options['heartless']) && $this->options['heartless'] && !is_admin() ? ' heartless' : '').' '.$opt['popupy'].' '.$opt['popupx'].'" style="float: '.$opt['float'].'; margin: '.$opt['margin-top'] . ' ' . $opt['margin-right'] . ' ' . $opt['margin-bottom'] . ' ' . $opt['margin-left'].'; position: '. $opt['position'] .';'.$opt['position-string'].'">'; 638 655 $output .= '<div class="delucksShareButtonsTools" title="'.__('Love this, share your love', $this->pluginHook).'">'; 639 @$output .= ' <span class="delucksShareButtonsTrigger style_'.($args['style'] ? $args['style'] : $this->options['style']).($this->options['countInternalLike']? ' countClick' : '').'">';656 @$output .= ' <span class="delucksShareButtonsTrigger style_'.($args['style'] ? $args['style'] : isset($this->options['style']) ? $this->options['style'] : '').((isset($this->options['countInternalLike']) && $this->options['countInternalLike']) ? ' countClick' : '').'">'; 640 657 641 658 if($opt['style'] == '52x60'){ … … 708 725 * */ 709 726 function getCounter($network = false, $postId = false){ 710 711 if($network == 'false'){ 727 if(!strlen($network) || $network == 'false' || $network == false){ 712 728 $network = false; 713 729 } … … 773 789 774 790 //if option 'countInternalLike = 0' hide internal clicks for the frontend 775 if(! $this->options['countInternalLike']){791 if(!isset($this->options['countInternalLike']) || !$this->options['countInternalLike']){ 776 792 $res->total -= $res->internal; 777 793 } … … 813 829 $date = 'AND DATE(`date`) > DATE(DATE_SUB(NOW(), INTERVAL 7 day))'; 814 830 } else { 815 switch($this->options['stats']['range']){ 816 case 'today': 817 $date = 'AND `date` = CURDATE()'; 818 break; 819 case 'yesterday': 820 $date = "AND `date` = DATE_SUB( CONCAT( CURDATE( ) , ' 00:00:00' ) , INTERVAL 1 DAY )"; 821 break; 822 case 'currentWeek': 823 $date = "AND YEARWEEK(`date`) = YEARWEEK(CURRENT_DATE)"; 824 break; 825 case 'lastWeek': 826 $date = "AND YEARWEEK(`date`) = YEARWEEK(CURRENT_DATE - INTERVAL 7 DAY)"; 827 break; 828 case 'currentMonth': 829 $date = "AND MONTH(`date`) = MONTH(CURRENT_DATE) AND YEAR(`date`) = YEAR(CURRENT_DATE)"; 830 break; 831 case 'lastMonth': 832 $date = "AND MONTH(`date`) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH) AND YEAR(`date`) = YEAR(CURRENT_DATE)"; 833 break; 834 case 'currentYear': 835 $date = "AND YEAR(`date`) = YEAR(CURRENT_DATE)"; 836 break; 837 case 'lastYear': 838 $date = "AND YEAR(`date`) = YEAR(CURRENT_DATE - INTERVAL 1 YEAR)"; 839 break; 840 default: 841 $date = false; 831 if(isset($this->options['stats']['range'])){ 832 switch($this->options['stats']['range']){ 833 case 'today': 834 $date = 'AND `date` = CURDATE()'; 835 break; 836 case 'yesterday': 837 $date = "AND `date` = DATE_SUB( CONCAT( CURDATE( ) , ' 00:00:00' ) , INTERVAL 1 DAY )"; 838 break; 839 case 'currentWeek': 840 $date = "AND YEARWEEK(`date`) = YEARWEEK(CURRENT_DATE)"; 841 break; 842 case 'lastWeek': 843 $date = "AND YEARWEEK(`date`) = YEARWEEK(CURRENT_DATE - INTERVAL 7 DAY)"; 844 break; 845 case 'currentMonth': 846 $date = "AND MONTH(`date`) = MONTH(CURRENT_DATE) AND YEAR(`date`) = YEAR(CURRENT_DATE)"; 847 break; 848 case 'lastMonth': 849 $date = "AND MONTH(`date`) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH) AND YEAR(`date`) = YEAR(CURRENT_DATE)"; 850 break; 851 case 'currentYear': 852 $date = "AND YEAR(`date`) = YEAR(CURRENT_DATE)"; 853 break; 854 case 'lastYear': 855 $date = "AND YEAR(`date`) = YEAR(CURRENT_DATE - INTERVAL 1 YEAR)"; 856 break; 857 default: 858 $date = false; 859 } 842 860 } 843 861 } … … 846 864 global $wpdb; 847 865 $wpPrefix = $wpdb->get_blog_prefix(1); 848 $totals = $wpdb->get_results("SELECT * FROM `".$wpPrefix.$this->dbTable."` WHERE ".( $this->options['stats']['hideEmpty'] ? '`total` > 0' : '1')." ORDER BY `total` DESC " . (isset($this->options['stats']['limit']) && $this->options['stats']['limit'] > 0 ? 'LIMIT '.$this->options['stats']['limit'] : '' ));866 $totals = $wpdb->get_results("SELECT * FROM `".$wpPrefix.$this->dbTable."` WHERE ".(isset($this->options['stats']['hideEmpty']) && $this->options['stats']['hideEmpty'] ? '`total` > 0' : '1')." ORDER BY `total` DESC " . (isset($this->options['stats']['limit']) && $this->options['stats']['limit'] > 0 ? 'LIMIT '.$this->options['stats']['limit'] : '' )); 849 867 850 868 if(count($totals)){ … … 860 878 $sql .= "$date "; 861 879 } 862 if( strlen($this->options['stats']['from']) || strlen($this->options['stats']['to'])){880 if(isset($this->options['stats']['from']) && (strlen($this->options['stats']['from']) || strlen($this->options['stats']['to']))){ 863 881 if(strlen($this->options['stats']['from']) && strlen($this->options['stats']['to'])){ 864 882 $sql .= "AND `time` BETWEEN '{$this->options['stats']['from']}' AND '{$this->options['stats']['to']}' "; … … 878 896 } 879 897 $arr[$k]['range']['total'] = $rangeTotal; 880 } else if( $this->options['stats']['hideEmpty']){898 } else if(isset($this->options['stats']['hideEmpty']) && $this->options['stats']['hideEmpty']){ 881 899 unset($arr[$k]); 882 900 } … … 891 909 * */ 892 910 function getTotal($network = false){ 911 if(!$network){ 912 return false; 913 } 893 914 global $wpdb; 894 915 $wpPrefix = $wpdb->get_blog_prefix(1); … … 923 944 global $wpdb; 924 945 $wpPrefix = $wpdb->get_blog_prefix(1); 925 $totals = $wpdb->get_results("SELECT * FROM `".$wpPrefix.$this->dbTable."` WHERE ".( $this->options['stats']['hideEmpty'] ? '`total` > 0' : '1')." ORDER BY `total` DESC");946 $totals = $wpdb->get_results("SELECT * FROM `".$wpPrefix.$this->dbTable."` WHERE ".(isset($this->options['stats']['hideEmpty']) && $this->options['stats']['hideEmpty'] ? '`total` > 0' : '1')." ORDER BY `total` DESC"); 926 947 927 948 if(count($totals)){ … … 977 998 978 999 /* OUTPUT BUFFER */ 979 if( $loveButton->options['useOgImage']){1000 if(isset($loveButton->options['useOgImage']) && $loveButton->options['useOgImage']){ 980 1001 981 1002 function getMetaImage($img){ -
love-button/trunk/readme.txt
r706404 r741039 5 5 Requires at least: 2.5 6 6 Tested up to: 3.5.1 7 Stable tag: 2.0. 17 Stable tag: 2.0.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 51 51 2. New and Loved widget in administrator 52 52 == Changelog == 53 54 = 2.0.2 = 55 * IMPORTANT - BEFORE UPDATING: copy your custom style (/love-button/fe/style_custom.css) to your template directory an rename it to love-button-style_custom.css to keep your customized style 56 * File /love-button/fe/style_custom.css renamed to love-button-style_custom.css 57 * Fixed several bugs 58 * Changed php short_open_tag to echos in config.php 53 59 54 60 = 2.0.1 = -
love-button/trunk/widgets/suggest.php
r706031 r741039 12 12 13 13 if(count($articles)){ 14 echo '<div class="widget LoveButtonSuggest">';14 echo '<div class="widget LoveButtonSuggest">'; 15 15 if(isset($instance['title']) && strlen($instance['title'])){ 16 echo '<h 3 class="widget-title">'.$instance['title'].'</h3>';16 echo '<h2 class="widgettitle">'.$instance['title'].'</h2>'; 17 17 } 18 18 … … 82 82 remove_filter('posts_where', array($this, 'filter_where')); 83 83 84 wp_reset_query(); 85 84 86 $sql = "SELECT `id` FROM `".$wpPrefix.$this->loveButton->dbTable."` WHERE `url` IN ('".implode("','", $urls)."')"; 85 87 if($res = $wpdb->get_results($sql)){
Note: See TracChangeset
for help on using the changeset viewer.