Ejemplo n.º 1
0
 function getButtons()
 {
     // should maybe but a 'light init' of buttons?
     $selection = $this->data["selection"];
     $buttonsArray = array();
     if (count($selection) == 0) {
         return $buttonsArray;
     }
     $table = maxUtils::get_buttons_table_name();
     $query_selection = $selection;
     $selectstring = implode($query_selection, ",");
     $sql = "SELECT DISTINCT * FROM {$table} WHERE id in (" . $selectstring . ")";
     global $wpdb;
     $results = $wpdb->get_results($sql, ARRAY_A);
     $data_array = array();
     foreach ($results as $result) {
         $data_array[$result['id']] = $result;
     }
     foreach ($selection as $button_id) {
         $button = MB()->getClass("button");
         // performance: bypass the set ( = query ) for every button
         //$button->set($button_id);
         $data = isset($data_array[$button_id]) ? $data_array[$button_id] : array();
         if (count($data) > 0) {
             maxButtons::buttonLoad(array("button_id" => $button_id));
             // central registration - from button
             $button->setupData($data);
         }
         maxButtons::forceNextID();
         $buttonsArray[] = $button;
     }
     return $buttonsArray;
 }
function check_charset()
{
    global $maxbuttons_installed_version;
    global $wpdb;
    $check = "SHOW FULL COLUMNS FROM " . maxUtils::get_buttons_table_name();
    $charset = $wpdb->query($check);
    return $charset;
}
Ejemplo n.º 3
0
 function getButtonCount($args = array())
 {
     $defaults = array("status" => "publish");
     $args = wp_parse_args($args, $defaults);
     $sql = "SELECT count(id) FROM " . maxUtils::get_buttons_table_name() . " WHERE status = '%s'";
     $sql = $this->wpdb->prepare($sql, $args["status"]);
     $result = $this->wpdb->get_var($sql);
     return $result;
 }
Ejemplo n.º 4
0
    public function admin_fields()
    {
        $data = $this->data[$this->blockname];
        foreach ($this->fields as $field => $options) {
            $default = isset($options["default"]) ? $options["default"] : '';
            ${$field} = isset($data[$field]) ? $data[$field] : $default;
            ${$field . "_default"} = $default;
        }
        ?>
	<div class="mb_tab option-container">
		<div class="title"><?php 
        _e('Dimensions', 'maxbuttons');
        ?>
</div>
		<div class="inside">
			<div class="option-design">
			<div class="label"><?php 
        _e('Button Width', 'maxbuttons');
        ?>
</div>
			<div class="input"><input class="tiny-nopad" type="text" id="button_width" name="button_width" value="<?php 
        echo maxUtils::strip_px($button_width);
        ?>
" />px</div>
			<div class="clear"></div>
			</div>
			<div class="option-design">
			<div class="label"><?php 
        _e('Button Height', 'maxbuttons');
        ?>
</div>
			<div class="input"><input class="tiny-nopad" type="text" id="button_height" name="button_height" value="<?php 
        echo maxUtils::strip_px($button_height);
        ?>
" />px</div>
			<div class="clear"></div>
			</div>
		</div>
	</div>
<?php 
    }
Ejemplo n.º 5
0
    public function admin_fields()
    {
        $data = $this->data[$this->blockname];
        foreach ($this->fields as $field => $options) {
            $default = isset($options["default"]) ? $options["default"] : '';
            ${$field} = isset($data[$field]) ? $data[$field] : $default;
            ${$field . "_default"} = $default;
            global $maxbuttons_container_alignments;
        }
        ?>
		
	<div class="option-container mb_tab">
				<div class="title"><?php 
        _e('Container', 'maxbuttons');
        ?>
</div>
				<div class="inside">
					<div class="option-design">
						<div class="label"><?php 
        _e('Use Container', 'maxbuttons');
        ?>
</div>
						<div class="input"><input type="checkbox" id="container_enabled" name="container_enabled" value="1" <?php 
        checked($container_enabled, 1);
        ?>
></div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Wrap with Center Div', 'maxbuttons');
        ?>
</div>
					<div class="input"><input type="checkbox" id="container_center_div_wrap" name="container_center_div_wrap" value="1" <?php 
        checked($container_center_div_wrap, 1);
        ?>
></div>
						<div class="default">&lt;div align="center"&gt;</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Width', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="container_width" name="container_width" value="<?php 
        echo maxUtils::strip_px($container_width);
        ?>
" />px</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Margin Top', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="container_margin_top" name="container_margin_top" value="<?php 
        echo maxUtils::strip_px($container_margin_top);
        ?>
" />px</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Margin Right', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="container_margin_right" name="container_margin_right" value="<?php 
        echo maxUtils::strip_px($container_margin_right);
        ?>
" />px</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Margin Bottom', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="container_margin_bottom" name="container_margin_bottom" value="<?php 
        echo maxUtils::strip_px($container_margin_bottom);
        ?>
" />px</div>
						<div class="clear"></div>
					</div>

					<div class="option-design">
						<div class="label"><?php 
        _e('Margin Left', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="container_margin_left" name="container_margin_left" value="<?php 
        echo maxUtils::strip_px($container_margin_left);
        ?>
" />px</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Alignment', 'maxbuttons');
        ?>
</div>
						<div class="input">
							<select id="container_alignment" name="container_alignment">
							<?php 
        foreach ($maxbuttons_container_alignments as $name => $value) {
            echo '<option value="' . $value . '" ' . selected($container_alignment, $value) . '>' . $name . '</option>';
        }
        ?>
							</select>
						</div>
						<div class="clear"></div>
					</div>
				</div>
			</div>
<?php 
    }
Ejemplo n.º 6
0
 function outputInline($domObj, $pseudo = 'normal')
 {
     $domObj = $domObj->load($domObj->save());
     $inline = $this->inline;
     // ISSUE #43 Sometimes this breaks
     if (!isset($inline[$pseudo])) {
         return $domObj;
     }
     $elements = array_keys($inline[$pseudo]);
     if ($pseudo != 'normal') {
         // gather all elements
         $elements = array_merge($elements, array_keys($inline["normal"]));
     }
     foreach ($elements as $element) {
         $styles = isset($inline[$pseudo][$element]) ? $inline[$pseudo][$element] : '';
         if ($pseudo != 'normal') {
             // parse all possible missing styles from pseudo el.
             $normstyle = $this->compile($inline['normal'][$element]);
         }
         $normstyle = '';
         if ($pseudo != 'normal') {
             // parse all possible missing styles from pseudo el.
             $normstyle = $this->compile($inline['normal'][$element]);
         }
         maxUtils::addTime("CSSParser: Parse inline done");
         $styles = $normstyle . $this->compile($styles);
         $element = trim(str_replace(".", " ", $element));
         // molten css class, seperator.
         $el = $domObj->find('[class*="' . $element . '"]', 0);
         if (is_null($el)) {
             echo "NULL";
         }
         $el->style = $styles;
     }
     return $domObj;
 }
Ejemplo n.º 7
0
 public function reset_cache()
 {
     global $wpdb;
     $fields = array("cache" => null);
     $where = array(1 => 1);
     //$where_format = array('%d');
     $sql = "UPDATE " . maxUtils::get_buttons_table_name() . " SET cache = NULL ";
     $wpdb->query($sql);
 }
Ejemplo n.º 8
0
 static function timeInit()
 {
     if (!defined('MAXBUTTONS_BENCHMARK') || MAXBUTTONS_BENCHMARK !== true) {
         return;
     }
     self::$timer = microtime(true);
     if (is_admin()) {
         add_filter("admin_footer", array('maxUtils', "showTime"), 100);
     } else {
         add_action("wp_footer", array('maxUtils', "showTime"));
     }
 }
Ejemplo n.º 9
0
    public function admin_fields()
    {
        $data = $this->data[$this->blockname];
        $media_names = maxUtils::get_media_query(1);
        // nicenames
        $media_desc = maxUtils::get_media_query(3);
        $units = array("px" => __("px", "maxbuttons"), "%" => __("%", "maxbuttons"));
        $container_floats = array("" => "", "none" => __("None", "maxbuttons"), "left" => __("Left", "maxbuttons"), "right" => __("Right", "maxbuttons"));
        foreach ($this->fields as $field => $options) {
            $default = isset($options["default"]) ? $options["default"] : '';
            ${$field} = isset($data[$field]) ? $data[$field] : $default;
            ${$field . "_default"} = $default;
        }
        // sorting routine via array merge.
        $fk = array_flip(array_keys($media_query));
        $names_used = array_intersect_key($media_names, $fk);
        $media_query = array_merge($names_used, $media_query);
        ?>
			<div class="mb_tab option-container">
				<div class="title"><?php 
        _e('Responsive Settings', 'maxbuttons');
        ?>
</div>
				<div class="inside">

					<div class="option-design"> 
						<p class="note"><?php 
        _e("Responsive settings let you decide the behavior of the button on different devices and screen sizes. For instance large buttons on small screens.", "maxbuttons");
        ?>
</p>	
						<div class="label"><?php 
        _e("Auto Responsive", 'maxbuttons');
        ?>
 <?php 
        _e("(Experimental)", "maxbuttons");
        ?>
</div>

						<div class="input"> 
							<input type='checkbox' name='auto_responsive' value='1' <?php 
        checked(1, $auto_responsive);
        ?>
 >
						</div>

											<div class="clear"></div>
						<p class="note"><strong><?php 
        _e("Note:", "maxbuttons");
        ?>
 </strong><?php 
        _e(" Auto responsive settings will take a guess only on small screens. To control your responsive settings uncheck this button. This will show more options.", "maxbuttons");
        ?>
</p>	
					</div>
 
					
				<div class='option-design media_queries_options'>
					<?php 
        $i = 0;
        foreach ($media_query as $item => $data) {
            foreach ($data as $index => $fields) {
                ?>
						<div class='media_query'> 
							<span class='removebutton'><img src="<?php 
                echo MB()->get_plugin_url();
                ?>
/assets/icons/remove.png"></span>
							
							<input type="hidden" name="media_query[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $item;
                ?>
"> 
							<label class='title'><?php 
                echo $media_names[$item];
                ?>
</label>
							<p class='description'><?php 
                echo $media_desc[$item];
                ?>
</p>							
							<?php 
                if ($item == "custom") {
                    $custom_class = '';
                } else {
                    $custom_class = 'hidden';
                }
                ?>
							<div class="custom" <?php 
                echo $custom_class;
                ?>
 > 
								<div class="label"><?php 
                _e("Min width", "maxbuttons");
                ?>
</div>								
								<div class="input"><input type="text" class="tiny" name="mq_custom_minwidth[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $fields["mq_custom_minwidth"];
                ?>
" />px</div> 
								
								<div class="label max"> <?php 
                _e("Max width", "maxbuttons");
                ?>
</div>
								<div class="input max"><input type="text" class="tiny" name="mq_custom_maxwidth[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $fields["mq_custom_maxwidth"];
                ?>
" />px</div> 

								
							</div>	
						
							<div class='label'><?php 
                _e("Font size", "maxbuttons");
                ?>
</div>
							<div class='input'><input type='text' name='mq_font_size[<?php 
                echo $i;
                ?>
]' class='tiny' value="<?php 
                echo $fields["mq_font_size"];
                ?>
"> <?php 
                echo maxUtils::selectify("mq_font_size_unit[{$i}]", $units, $fields["mq_font_size_unit"]);
                ?>
							</div>	
						
							<div class='label'><?php 
                _e("Button width", 'maxbuttons');
                ?>
</div>
							
							<div class='input'><input type='text' name="mq_button_width[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $fields["mq_button_width"];
                ?>
" class='tiny'> <?php 
                echo maxUtils::selectify("mq_button_width_unit[{$i}]", $units, $fields["mq_button_width_unit"]);
                ?>
</div>
							
							<div class='label'><?php 
                _e("Container width", 'maxbuttons');
                ?>
</div>
							
							<div class='input'><input type='text' name="mq_container_width[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $fields["mq_container_width"];
                ?>
" class='tiny'> <?php 
                echo maxUtils::selectify("mq_container_width_unit[{$i}]", $units, $fields["mq_container_width_unit"]);
                ?>
							</div>
							
							<div class='label'><?php 
                _e("Container float", "maxbuttons");
                ?>
</div>
							<div class="input"><?php 
                echo maxUtils::selectify("mq_container_float[{$i}]", $container_floats, $fields["mq_container_float"]);
                ?>
</div>
							
							<?php 
                $mq_hide = isset($fields["mq_hide"]) ? $fields["mq_hide"] : '';
                ?>
							<div class="label"><?php 
                _e("Hide button on this view", "maxbuttons");
                ?>
</div>
							<div class="input">
 
								<input type="checkbox" name="mq_hide[<?php 
                echo $i;
                ?>
]" value="none" <?php 
                checked('none', $mq_hide);
                ?>
 ></div>
							
								
						</div>
					 
						<?php 
                $i++;
                if ($item != 'custom') {
                    unset($media_names[$item]);
                }
                // remove existing queries from new query selection
            }
        }
        ?>

					<div class="new_query_space"></div>
					<div class="clear"></div>					
					<div class="option-design new-query">
						<div class="label"><?php 
        _e('New Query', 'maxbuttons');
        ?>
</div>
						
 
						<div class="input">
							<?php 
        echo maxUtils::selectify("new_query", $media_names, '');
        ?>
							<a class="button add_media_query"><?php 
        _e("Add", "maxbuttons");
        ?>
</a>
						</div>
						
 
						<div class="clear"></div>
					</div>
				 </div>		
			</div> <!-- inside --> 
		
			<input type="hidden" name="next_media_index" value="<?php 
        echo $i;
        ?>
" >
			<div class='media_option_prot'>

				<div class='media_query'> 
							<span class='removebutton'><img src="<?php 
        echo MB()->get_plugin_url();
        ?>
assets/icons/remove.png"></span>

							<input type="hidden" name="media_query[]" value=""> 
							<label class='title'></label>
							<p class='description'>Description here</p>
							
							<div class="custom"> 
								<div class="label"><?php 
        _e("Min width", "maxbuttons");
        ?>
</div>								
								<div class="input"><input type="text" class="tiny" name="mq_custom_minwidth[]" value="0" />px</div> 
								
								<div class="label max"> <?php 
        _e("Max width", "maxbuttons");
        ?>
</div>
								<div class="input max"><input type="text" class="tiny" name="mq_custom_maxwidth[]" value="0" />px</div> 

								
							</div>	
							<div class='label'><?php 
        _e("Font size", "maxbuttons");
        ?>
</div>
							<div class='input'><input type='text' name='mq_font_size[]' class='tiny' value="90"> <?php 
        echo maxUtils::selectify("mq_font_size_unit[]", $units, "%");
        ?>
							</div>	
												
							<div class='label'><?php 
        _e("Button width", "maxbuttons");
        ?>
</div>
							<div class='input'><input type='text' name="mq_button_width[]" value="0" class='tiny'> <?php 
        echo maxUtils::selectify("mq_button_width_unit[]", $units, "");
        ?>
</div>
							<div class='label'><?php 
        _e("Container width", "maxbuttons");
        ?>
</div>
							<div class='input'>
							<input type='text' name="mq_container_width[]" value="0" class='tiny'> <?php 
        echo maxUtils::selectify("mq_container_width_unit[]", $units, "");
        ?>
							</div>

							<div class='label'><?php 
        _e("Container float", "maxbuttons");
        ?>
</div>
							<div class="input"><?php 
        echo maxUtils::selectify("mq_container_float[]", $container_floats, "");
        ?>
</div>
							<div class="label"><?php 
        _e("Hide button on this view", "maxbuttons");
        ?>
</div>
							<div class="input"><input type="checkbox" name="mq_hide[]" value="none">
							</div>								
				`</div>

			</div>
			<div id="media_desc">
			<?php 
        foreach ($media_desc as $key => $desc) {
            echo "<span id='{$key}'>{$desc}</span>";
        }
        ?>
			</div>
			

		</div> <!-- container --> 
		
				

			
<?php 
    }
Ejemplo n.º 10
0
 static function getCollectionbyName($name)
 {
     //$collection = new maxCollection();
     global $wpdb;
     $sql = "select collection_id from " . maxUtils::get_collection_table_name() . " where collection_key = 'collection_name' and collection_value = %s ";
     $sql = $wpdb->prepare($sql, $name);
     $result = $wpdb->get_row($sql, ARRAY_A);
     // find first
     if (count($result) > 0) {
         if (isset($result["collection_id"])) {
             $usecol = self::getCollectionByID($result["collection_id"]);
             return $usecol;
         }
     }
     return false;
 }
Ejemplo n.º 11
0
    function admin_fields()
    {
        extract($this->data);
        $orientation_array = array("auto" => __("Auto", "maxbuttons"), "horizontal" => __("Horizontal", "maxbuttons"), "vertical" => __("Vertical", "maxbuttons"));
        $staticposver = array("auto" => __("Auto", "maxbuttons"), "center" => __("Center", "maxbuttons"), "top" => __("Top", "maxbuttons"), "bottom" => __("Bottom", "maxbuttons"));
        $staticposhor = array("auto" => __("Auto", "maxbuttons"), "center" => __("Center", "maxbutton-pro"), "left" => __("Left", "maxbuttons"), "right" => __("Right", "maxbuttons"));
        $px = __("px", "maxbuttons");
        ?>
<div class="mb_tab option-container layout-block" data-options="layout"> 
	<div class="title">
		<span class="dashicons dashicons-admin-appearance"></span>
		<span class="title"><?php 
        _e("Layout", "maxbuttons");
        ?>
</span>
	    <span class='manual-box'><a class='manual-toggle' data-target="layout"> <?php 
        _e("Getting Started", "maxbuttons-pro");
        ?>
 </a></span> 
		<span class='right'><button name="save" type="submit"  data-form='collection_edit' class="button button-primary"><?php 
        _e("Save All", "maxbuttons");
        ?>
</button>
		</span>		
	</div>
	
	<div class="inside"> 
		<div class="option"> 
			<label for="margin-left"><?php 
        _e("Margin left", "maxbuttons");
        ?>
</label>
			<input type="number" class="tiny-nopad" id="margin_left" name="margin_left" value="<?php 
        echo intval($margin_left);
        ?>
" class="tiny"> <?php 
        echo $px;
        ?>
		</div>

		<div class="option"> 
			<label for="margin-right"><?php 
        _e("Margin right", "maxbuttons");
        ?>
</label>
			<input type="number" name="margin_right" id="margin_right" value="<?php 
        echo intval($margin_right);
        ?>
" class="tiny"> <?php 
        echo $px;
        ?>
		</div>

		<div class="option"> 
			<label for="margin-top"><?php 
        _e("Margin bottom", "maxbuttons");
        ?>
</label>
			<input type="number" name="margin_bottom" id="margin_bottom" value="<?php 
        echo maxUtils::strip_px($margin_top);
        ?>
" class="tiny"> <?php 
        echo $px;
        ?>
		</div>
		
		<div class="option"> 
			<label for="margin-bottom"><?php 
        _e("Margin top", "maxbuttons");
        ?>
</label>
			<input type="number" name="margin_top" id="margin_top" value="<?php 
        echo maxUtils::strip_px($margin_bottom);
        ?>
" class="tiny"> <?php 
        echo $px;
        ?>
		</div>						

		<div class="option"> 
			<label for="orientation"><?php 
        _e("Orientation", "maxbuttons");
        ?>
</label>
			<?php 
        echo maxUtils::selectify("orientation", $orientation_array, $orientation);
        ?>
		</div>
		
		<div class="option"> 
			<label for="item_margin_right"><?php 
        _e("Item margin right", "maxbuttons");
        ?>
</label>
			<input type="number" name="item_margin_right" id="item_margin_right" value="<?php 
        echo maxUtils::strip_px($item_margin_right);
        ?>
"> <?php 
        echo $px;
        ?>
		</div>
		
		<div class="option"> 
			<label for="item_margin_bottom"><?php 
        _e("Item margin bottom", "maxbuttons");
        ?>
</label>
			<input type="number" name="item_margin_bottom" id="item_margin_bottom" value="<?php 
        echo maxUtils::strip_px($item_margin_bottom);
        ?>
"> 
				<?php 
        echo $px;
        ?>
 
 
		</div>
		
		<div class="option"> 
			<label for="ignore_container"><?php 
        _e("Remove container width and margins", "maxbuttons");
        ?>
</label>
			<input type="checkbox" name="ignore_container" value="1" <?php 
        checked($ignore_container, 1);
        ?>
>
			<div class="help fa fa-question-circle "> 
			<span><?php 
        _e("Removes the margins and widths of the button container.", "maxbuttons");
        ?>
 
				</span>
			</div>
						
		</div>
	</div>
	
	<?php 
        $condition = array("target" => "placement", "values" => array("static-left", "static-right", "static-top", "static-bottom"));
        $static_conditional = htmlentities(json_encode($condition));
        ?>
	<div class='conditional-option' data-show="<?php 
        echo $static_conditional;
        ?>
">
		<div class="title"><span class="dashicons dashicons-admin-appearance"></span> <?php 
        _e("Static positioning", "maxbuttons");
        ?>
</div>		
		<div class="inside"> 
	<?php 
        $condition = array("target" => "placement", "values" => array("static-left", "static-right"));
        $static_conditional = htmlentities(json_encode($condition));
        ?>
			<div class="option conditional-option" data-show="<?php 
        echo $static_conditional;
        ?>
"> 
				<label for="static_position_ver"><?php 
        _e("Static position vertical", "maxbuttons");
        ?>
</label>
				<?php 
        echo maxUtils::selectify("static_position_ver", $staticposver, $static_position_ver);
        ?>
		
			</div>
		<?php 
        $condition = array("target" => "placement", "values" => array("static-top", "static-bottom"));
        $static_conditional = htmlentities(json_encode($condition));
        ?>
	
			<div class="option conditional-option" data-show="<?php 
        echo $static_conditional;
        ?>
"> 
				<label for="static_position_hor"><?php 
        _e("Static position horizontal", "maxbuttons");
        ?>
</label>
				<?php 
        echo maxUtils::selectify("static_position_hor", $staticposhor, $static_position_hor);
        ?>
		
			</div>
		</div>
	</div>
	<!-- manual entry -->
	<div class="manual-entry" data-manual="layout"> 	
		<h3><?php 
        _e("Layout settings", "maxbuttons");
        ?>
			 <span class="dashicons dashicons-no window close manual-toggle" data-target="layout"></span>  
		</h3>
						
		<p><?php 
        _e("The first 4 options - margins left, right, buttom and top - are for positioning the entire collection.  Click the Preview tab on so you can see the changes to your collection as you make them.  The Orientation options let’s you choose between Auto, Horizontal and Vertical. Image margin allows you to set the spacing between the icons.", "maxbuttons");
        ?>
</p>
	
	</div>	
</div> <!-- tab --> 
		
	<?php 
    }
Ejemplo n.º 12
0
    function do_social_option($button_id, $data, $button_array = array())
    {
        global $supported_networks, $share_url_settings;
        extract($data);
        $index = $data["index"];
        $button = MB()->getClass("button");
        if ($button_id > 0 && (!isset($button_array["meta"]) || !$button_array["meta"]["is_virtual"])) {
            $button->set($button_id);
        } elseif (count($button_array) > 0) {
            $button_array["name"] = $button_array["basic"]["name"];
            $button_array["status"] = $button_array["basic"]["status"];
            $button->clear();
            maxButtons::buttonLoad(array("button_id" => $button_id));
            // central registration - from button
            $button->setupData($button_array);
        }
        $document_id = $button->getDocumentID();
        ?>
	<div class="social-option" data-id="<?php 
        echo $button_id;
        ?>
" data-document_id="<?php 
        echo $document_id;
        ?>
"> 
		<input type="hidden" name="social-option[]" value="<?php 
        echo $button_id;
        ?>
" /> 
		<div class="option"> 
			<div class="shortcode-container">
			<?php 
        $button->display(array("mode" => "preview"));
        ?>

			</div>
					<span class="button_name"><?php 
        echo $button->getName();
        ?>
</span>
		</div>
		
		
		<div class="option  "> 
			<label><?php 
        _e("Sharing network", "maxbuttons");
        ?>
</label>
			<?php 
        echo maxUtils::selectify("network-{$button_id}-{$index}", $supported_networks, $network, 'network');
        ?>
 
			
		</div>
		
		<div class="option conditional-option"  data-show="<?php 
        echo $this->do_supports('display_count', $button_id, $index);
        ?>
"> 
			<label><?php 
        _e("Show Share Counts", "maxbuttons");
        ?>
</label>
			<input type="checkbox" name="display_count-<?php 
        echo $button_id;
        ?>
-<?php 
        echo $index;
        ?>
" value="1" <?php 
        checked($display_count, 1);
        ?>
  /> 
		</div>
		
		<div class="option conditional-option"  data-show="<?php 
        echo $this->do_supports('count_threshold', $button_id, $index);
        ?>
"> 
			<label><?php 
        _e("Minimum share count", "maxbuttons");
        ?>
</label>
			<input type="number" name="count_threshold-<?php 
        echo $button_id;
        ?>
-<?php 
        echo $index;
        ?>
" min="0" 
			value="<?php 
        echo intval($count_threshold);
        ?>
" />  
		</div>	

		<div class="option conditional-option"  data-show="<?php 
        echo $this->do_supports('share_url_setting', $button_id, $index);
        ?>
"> 
			<label><?php 
        _e("Share URL settings", "maxbuttons");
        ?>
</label>
			<?php 
        echo maxUtils::selectify("share_url_setting-{$button_id}-{$index}", $share_url_settings, $share_url_setting);
        ?>
			 

			<div class="help fa fa-question-circle "> 
			<span><?php 
        _e("Which URL (link) is to be shared. Auto will share the current page on pages, and the full site URL on the homepage", "maxbuttons");
        ?>
 
				</span>
			</div>
				
		</div>	
		
		<!-- bloglovin --> 
		<div class="option conditional-option"  data-show="<?php 
        echo $this->do_supports('blog_url', $button_id, $index);
        ?>
"> 
			<label><?php 
        _e("Bloglovin' Blog URL", "maxbuttons");
        ?>
</label>
			<input type="text" name="blog_url-<?php 
        echo $button_id;
        ?>
-<?php 
        echo $index;
        ?>
"
				 value="<?php 
        echo esc_attr($blog_url);
        ?>
"> 
		</div>
		
	<?php 
        $condition = array("target" => "share_url_setting-{$button_id}-{$index}", "values" => array("custom-url"));
        $custom_conditional = htmlentities(json_encode($condition));
        ?>
	
			
  		
		<div class="option conditional-option" data-show="<?php 
        echo $custom_conditional;
        ?>
">	
			<label><?php 
        _e("Custom URL", "maxbuttons");
        ?>
</label> 
			<input type="text" name="share_url_custom-<?php 
        echo $button_id;
        ?>
-<?php 
        echo $index;
        ?>
"
			 value="<?php 
        echo esc_attr($share_url_custom);
        ?>
"> 
  
		</div>
	</div> <!-- social option --> 
		<?php 
    }
Ejemplo n.º 13
0
    function admin_fields()
    {
        extract($this->data);
        // admin data
        $placement_options = array("after" => __("After", "maxbuttons"), "before" => __("Before", "maxbuttons"), "after-before" => __("Before + After (both)", "maxbuttons"), "static-left" => __("Static left", "maxbuttons"), "static-right" => __("Static right", "maxbuttons"), "static-top" => __("Static top", "maxbuttons"), "static-bottom" => __("Static bottom", "maxbuttons"));
        ?>
<div class="mb_tab option-container" data-options="settings"> 
	<div class="title">
		<span class="dashicons dashicons-admin-settings"></span> 
		<span class="title"><?php 
        _e("Settings", "maxbuttons");
        ?>
</span>
		  <span class='manual-box'><a class='manual-toggle' data-target="settings"> <?php 
        _e("Getting Started", "maxbuttons-pro");
        ?>
 </a></span> 
		<span class='right'><button name="save" type="submit"  data-form='collection_edit' class="button button-primary"><?php 
        _e("Save All", "maxbuttons");
        ?>
</button>
		</span>
	</div>
	
	<div class="inside"> 
		
		<div class="option">
			<label for="collection_name"><?php 
        _e("Name");
        ?>
</label>
			<input type="text" id='collection_name' name="name" value="<?php 
        echo esc_attr($name);
        ?>
" /> 
			<div class="help fa fa-question-circle"> 
				<span><?php 
        _e("The name of your collection. It will not be displayed on the site.", "maxbuttons");
        ?>
				</span>
			</div>
						
		</div>
		
		<div class="option"> 
			<label for="collection_show"><?php 
        _e("Automatically show on", "maxbuttons");
        ?>
</label>
			
			<div class='option-list'>
				<div class="help fa fa-question-circle"> 
					<span><?php 
        _e("Auto-display your buttons on the site. Checking the options will display the buttons on the corresponding part.", "maxbuttons");
        ?>
					</span>
				</div>			
				<input type="checkbox" name="show_homepage" value="1" <?php 
        checked(1, $show_homepage);
        ?>
 >  
					<?php 
        _e("Homepage", "maxbuttons");
        ?>
<br /> 
					
				<input type="checkbox" name="show_page" value="1" <?php 
        checked(1, $show_page);
        ?>
 > <?php 
        _e("Pages", "maxbuttons");
        ?>
<br>
				<input type="checkbox" name="show_post" value="1" <?php 
        checked(1, $show_post);
        ?>
 >  <?php 
        _e("Posts", "maxbuttons");
        ?>
<br>				
				<input type="checkbox" name="show_archive" value="1" <?php 
        checked(1, $show_archive);
        ?>
 > 
					<?php 
        _e("Category / Archives", "maxbuttons");
        ?>
 <br>
					
			
			</div>
		</div>
		
		<div class="option"> 
			<label for="collection_placement"><?php 
        _e("Placement");
        ?>
</label>
			<?php 
        echo maxUtils::selectify("placement", $placement_options, $placement);
        ?>
				<div class="help fa fa-question-circle"> 
					<span><?php 
        _e("Choose where the buttons will show up.", "maxbuttons");
        ?>
					</span>
				</div>	
		</div>
		
		
		
	</div>
</div> <!-- option container --> 

	<div class="manual-entry" data-manual="settings"> 	
		<h3><?php 
        _e("General settings", "maxbuttons");
        ?>
			 <span class="dashicons dashicons-no window close manual-toggle" data-target="settings"></span>  
		</h3>
						
		<p><?php 
        _e("Give a name to your collection of buttons and select which portions and locations on your site you want the collection to appear.  Anytime you want to see how your collection is going to look click the Preview tab to open up the Preview tab.  We suggest you do this first. ", "maxbuttons");
        ?>
</p>
		

	</div>
	
	
	<?php 
    }
Ejemplo n.º 14
0
    public function admin_fields()
    {
        $data = $this->data[$this->blockname];
        foreach ($this->fields as $field => $options) {
            $default = isset($options["default"]) ? $options["default"] : '';
            ${$field} = isset($data[$field]) ? $data[$field] : $default;
            ${$field . "_default"} = $default;
        }
        global $maxbuttons_font_families;
        global $maxbuttons_font_sizes;
        global $maxbuttons_font_styles;
        global $maxbuttons_font_weights;
        global $maxbuttons_text_alignments;
        ?>
			<div class="mb_tab option-container">
				<div class="title"><?php 
        _e('Text', 'maxbuttons');
        ?>
</div>
				<div class="inside">
				

					<div class="option-design">
						<div class="label"><?php 
        _e('Text', 'maxbuttons');
        ?>
</div>
						
 
						<div class="input">
							<input type="text" id="text" name="text" value="<?php 
        echo $text;
        ?>
" maxlength="100"/>
						</div>
						<div class="default"><?php 
        _e('The actual words that appear on the button.', 'maxbuttons');
        ?>
</div>
						<div class="clear"></div>
					</div>
									
					<div class="option-design">
						<div class="label"><?php 
        _e('Font', 'maxbuttons');
        ?>
</div>
						<div class="input">
							<select id="font" name="font">
							<?php 
        foreach ($maxbuttons_font_families as $name => $value) {
            //$selected = ($maxbutton_text_font_family_value == $value) ? 'selected="selected"' : '';
            echo '<option value="' . $value . '"' . selected($font, $value) . '>' . $name . '</option>';
        }
        ?>
							</select>
						</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $font_default;
        ?>
</div>
						<div class="clear"></div>
					</div>


					
					<div class="option-design">
						<div class="label"><?php 
        _e('Size', 'maxbuttons');
        ?>
</div>
						<div class="input">		
							<select id="font_size" name="font_size">
							<?php 
        $font_size = maxUtils::strip_px($font_size);
        foreach ($maxbuttons_font_sizes as $name => $value) {
            //$selected = ($maxbutton_text_font_size_value == $value) ? 'selected="selected"' : '';
            echo '<option value="' . $name . '" ' . selected($font_size, $name, false) . '>' . $value . '</option>';
        }
        ?>
							</select> 
						</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $font_size_default;
        ?>
</div>
						<div class="clear"></div>
					</div>

 
										
					<div class="option-design">
						<div class="label"><?php 
        _e('Text align', 'maxbuttons');
        ?>
</div>
						<div class="input">
							<select id="text_align" name="text_align">
							<?php 
        foreach ($maxbuttons_text_alignments as $name => $value) {
            //$selected = ($maxbutton_text_font_style_value == $value) ? 'selected="selected"' : '';
            echo '<option value="' . $value . '" ' . selected($text_align, $value) . '>' . $name . '</option>';
        }
        ?>
							</select>
						</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $text_align_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Weight', 'maxbuttons');
        ?>
</div>
						<div class="input">
							<select id="font_weight" name="font_weight">
							<?php 
        foreach ($maxbuttons_font_weights as $name => $value) {
            //$selected = ($maxbutton_text_font_weight_value == $value) ? 'selected="selected"' : '';
            echo '<option value="' . $value . '" ' . selected($font_weight, $value) . '>' . $name . '</option>';
        }
        ?>
							</select>
						</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $font_weight_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Shadow Offset Left', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="text_shadow_offset_left" name="text_shadow_offset_left" value="<?php 
        echo maxUtils::strip_px($text_shadow_offset_left);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $text_shadow_offset_left_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Shadow Offset Top', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="text_shadow_offset_top" name="text_shadow_offset_top" value="<?php 
        echo maxUtils::strip_px($text_shadow_offset_top);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $text_shadow_offset_top_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Shadow Width', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="text_shadow_width" name="text_shadow_width" value="<?php 
        echo maxUtils::strip_px($text_shadow_width);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $text_shadow_width_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="spacer"></div>
					
					<div class="option-design">
						<div class="label"><label><?php 
        _e('Padding', 'maxbuttons');
        ?>
</label></div>
						<div class="input">
							<table>
								<tr>
									<td>
										<div class="cell-label"><?php 
        _e('Top', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="padding_top" name="padding_top" 
										value="<?php 
        echo maxUtils::strip_px($padding_top);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $padding_top_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
									<td>
										<div class="cell-label"><?php 
        _e('Bottom', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="padding_bottom" name="padding_bottom" value="<?php 
        echo maxUtils::strip_px($padding_bottom);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $padding_bottom_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="cell-label"><?php 
        _e('Left', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="padding_left" name="padding_left" value="<?php 
        echo maxUtils::strip_px($padding_left);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $padding_left_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
									<td>
										<div class="cell-label"><?php 
        _e('Right', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="padding_right" name="padding_right" value="<?php 
        echo maxUtils::strip_px($padding_right);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $padding_right_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
								</tr>
							</table>
						</div>
						<div class="clear"></div>
					</div>
				</div>
			</div>
<?php 
    }
Ejemplo n.º 15
0
 function parse($args)
 {
     $preview = isset($args["preview"]) ? $args["preview"] : false;
     $domObj = new simple_html_dom();
     $collection_id = $this->collection_id;
     $node = "<div class='maxcollection maxcollection-" . $collection_id . "' data-collection='" . $collection_id . "'>\n\t\t\t\t\t   </div>";
     $node = apply_filters("mb-col-basic-container", $node);
     $domObj->load($node);
     // use picker to get button classes in array
     $picker = $this->getBlock("picker");
     $this->buttons = $picker->getButtons();
     // changes to buttons in this function
     maxUtils::startTime('collection-parse-parsebuttons');
     foreach ($this->blocks as $block) {
         $block->setPreview($preview);
         $this->buttons = $block->parseButtons($this->buttons);
     }
     maxUtils::endTime('collection-parse-parsebuttons');
     maxUtils::startTime('collection-parse-blockparse');
     // general parsing
     foreach ($this->blocks as $block) {
         $domObj = $block->parse($domObj, $args);
     }
     maxUtils::endTime('collection-parse-blockparse');
     $this->buttons = array();
     $cssParser = $this->getCSSParser();
     $domObj->load($domObj->save());
     $cssParser->loadDom($domObj);
     return $domObj;
 }
 public function check_database($blocks)
 {
     maxUtils::addTime("Check database");
     $sql = "SELECT id,name,status,cache";
     foreach ($blocks as $block => $class) {
         $sql .= ", {$block}";
     }
     $sql .= " from " . maxUtils::get_buttons_table_name() . " limit 1";
     global $wpdb;
     $wpdb->hide_errors();
     $result = $wpdb->get_results($sql);
     // check this query for errors. If there is an error, one or more database fields are missing. Fix that.
     if (isset($wpdb->last_error) && $wpdb->last_error != '') {
         $install = $this->getClass("install");
         $install::create_database_table();
         $install::migrate();
     }
     maxUtils::addTime("End check database");
 }
Ejemplo n.º 17
0
 public static function upgradeUTF()
 {
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     if (!function_exists('maybe_convert_table_to_utf8mb4')) {
         return;
     }
     // Versions before 4.2.0
     $table_name = maxUtils::get_buttons_table_name();
     $collection_table_name = maxUtils::get_collection_table_name();
     maybe_convert_table_to_utf8mb4($table_name);
     maybe_convert_table_to_utf8mb4($collection_table_name);
 }
Ejemplo n.º 18
0
    public function admin_fields()
    {
        $data = $this->data[$this->blockname];
        foreach ($this->fields as $field => $options) {
            $default = isset($options["default"]) ? $options["default"] : '';
            ${$field} = isset($data[$field]) ? $data[$field] : $default;
            ${$field . "_default"} = $default;
        }
        global $maxbuttons_border_styles;
        ?>
	
	<div class="option-container mb_tab">
				<div class="title"><?php 
        _e('Border', 'maxbuttons');
        ?>
</div>
				<div class="inside">
					<div class="option-design">
						<div class="label"><label><?php 
        _e('Radius', 'maxbuttons');
        ?>
</label></div>
						<div class="input">
							<table>
								<tr>
									<td>
										<div class="cell-label"><?php 
        _e('Top Left', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="radius_top_left" name="radius_top_left" value="<?php 
        echo maxUtils::strip_px($radius_top_left);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $radius_top_left_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
									<td>
										<div class="cell-label"><?php 
        _e('Top Right', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="radius_top_right" name="radius_top_right" value="<?php 
        echo maxUtils::strip_px($radius_top_right);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $radius_top_right_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="cell-label"><?php 
        _e('Bottom Left', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="radius_bottom_left" name="radius_bottom_left" value="<?php 
        echo maxUtils::strip_px($radius_bottom_left);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $radius_bottom_left_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
									<td>
										<div class="cell-label"><?php 
        _e('Bottom Right', 'maxbuttons');
        ?>
</div>
										<div class="input"><input class="tiny" type="text" id="radius_bottom_right" name="radius_bottom_right" value="<?php 
        echo maxUtils::strip_px($radius_bottom_right);
        ?>
" />px</div>
										<div class="default-other"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $radius_bottom_right_default;
        ?>
</div>
										<div class="clear"></div>
									</td>
								</tr>
							</table>
						</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Style', 'maxbuttons');
        ?>
</div>
						<div class="input">
							<select id="border_style" name="border_style">
							<?php 
        foreach ($maxbuttons_border_styles as $name => $value) {
            echo '<option value="' . $value . '" ' . selected($border_style, $value) . '>' . $name . '</option>';
        }
        ?>
							</select>
						</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $border_style_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Width', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="border_width" name="border_width" value="<?php 
        echo maxUtils::strip_px($border_width);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $border_width_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Shadow Offset Left', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="box_shadow_offset_left" name="box_shadow_offset_left" value="<?php 
        echo maxUtils::strip_px($box_shadow_offset_left);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $box_shadow_offset_left_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Shadow Offset Top', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="box_shadow_offset_top" name="box_shadow_offset_top" value="<?php 
        echo maxUtils::strip_px($box_shadow_offset_top);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $box_shadow_offset_top_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
					
					<div class="option-design">
						<div class="label"><?php 
        _e('Shadow Width', 'maxbuttons');
        ?>
</div>
						<div class="input"><input class="tiny-nopad" type="text" id="box_shadow_width" name="box_shadow_width" value="<?php 
        echo maxUtils::strip_px($box_shadow_width);
        ?>
" />px</div>
						<div class="default"><?php 
        _e('Default:', 'maxbuttons');
        ?>
 <?php 
        echo $box_shadow_width_default;
        ?>
</div>
						<div class="clear"></div>
					</div>
				</div>
			</div>
<?php 
    }
      	<div class="title"> <?php 
    _e("Bulk edit", "maxbuttons");
    ?>
</div>
     
      	<div class="inside"  >
      	<p><strong><?php 
    _e("Using Bulk editor MAY and probably WILL destroy your buttons. In case you wish to prevent this - please BACKUP all your buttons before proceeding!", "maxbuttons");
    ?>
</strong></p>	
      	
      	<div class="option"><label><?php 
    _e("Field", "maxbuttons");
    ?>
 </label> <?php 
    echo maxUtils::selectify("replace_field", $allfields, 'url');
    ?>
</div>	
      
      	<div class="option"><label><?php 
    _e("Search", "maxbuttons");
    ?>
 </label> <input type="text" name="search" value=""></div>
      	<div class="option"><label><?php 
    _e("Replace", "maxbuttons");
    ?>
 </label> <input type="text" name="replace" value=""></div>
      	
    
    	<p style="color: #ff0000"> <?php 
    _e("I understand that this may destroy all my buttons", "maxbuttons");
 public function getRemoteShareCount($share_url)
 {
     $count_api = $this->network_data["count_api"];
     if ($count_api == '') {
         return false;
     }
     // no api
     $network = $this->network;
     $timeout = 60;
     // prevent the same requests from running multiple times ( i.e. one page, many collections on same url ) .
     $locked = maxUtils::get_transient('mbcol-shares-' . $network . '-' . $share_url . '-lock');
     if ($locked == true) {
         return 'locked';
     }
     // try again on next refresh.
     //lock out next request while this one is still running.
     maxUtils::set_transient('mbcol-shares-' . $network . '-' . $share_url . '-lock', true, $timeout);
     $count_api = str_replace("{url}", $share_url, $count_api);
     $func = $this->network_data["count_function"];
     $count = $this->{$func}($count_api);
     if (defined('MAXBUTTONS_DEBUG') && MAXBUTTONS_DEBUG) {
         $admin = MB()->getClass("admin");
         $admin->log("Get Remote Share", "Call: {$count_api} - Network : " . $this->network . " - Count: {$count} \n ");
     }
     if ($count !== false) {
         $network = $this->network;
         $check_time = $this->network_data["count_check_time"];
         // set count
         maxUtils::set_transient('mbcol-shares-' . $network . '-' . $share_url, $count, $check_time);
     }
     // remove lock
     maxUtils::delete_transient('mbcol-shares-' . $network . '-' . $share_url . '-lock');
     return $count;
 }