Commit 5c1211b8 authored by Martin Lees's avatar Martin Lees
Browse files

Added a feature to disable front page display

parent 99d08017
......@@ -150,6 +150,7 @@ class Steempress_sp_Admin {
$valid['featured'] = ((isset($input['featured']) && !empty($input['featured'])) && $input['featured'] == 'on') ? 'on' : "off";
$valid['footer'] = (isset($input['footer']) && !empty($input['footer'])) ? htmlspecialchars($input['footer'], ENT_QUOTES) : "<br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : [%original_link%] </em><hr/></center>";
$valid['twoway'] = ((isset($input['twoway']) && !empty($input['twoway'])) && $input['twoway'] == 'on') ? 'on' : "off";
$valid['twoway-front'] = ((isset($input['twoway-front']) && !empty($input['twoway-front'])) && $input['twoway-front'] == 'on') ? 'on' : "off";
$valid['update'] = ((isset($input['update']) && !empty($input['update'])) && $input['update'] == 'on') ? 'on' : "off";
$users = get_users();
......
......@@ -49,6 +49,8 @@
$options["twoway"] = "off";
if (!isset($options["update"]))
$options["update"] = "on";
if (!isset($options["twoway-front"]))
$options["twoway-front"] = "off";
$users = get_users();
......@@ -109,7 +111,7 @@
<input type="checkbox" id="<?php echo $this->plugin_name; ?>-vote" name="<?php echo $this->plugin_name; ?>[vote]" <?php echo $options['vote'] == "off" ? '' : 'checked="checked"' ?>> Self vote<br>
<input type="checkbox" id="<?php echo $this->plugin_name; ?>-seo" name="<?php echo $this->plugin_name; ?>[seo]" <?php echo $options['seo'] == "off" ? '' : 'checked="checked"' ?>> Add the footer text to the end of the article.<br>
<input type="checkbox" id="<?php echo $this->plugin_name; ?>-featured" name="<?php echo $this->plugin_name; ?>[featured]" <?php echo $options['featured'] == "off" ? '' : 'checked="checked"' ?>> Add featured images on top of the steem post.<br>
<input type="checkbox" id="<?php echo $this->plugin_name; ?>-update" name="<?php echo $this->plugin_name; ?>[update]" <?php echo $options['update'] == "off" ? '' : 'checked="checked"' ?>> Update the steem post when updating on wordpress.<br>
<!--<input type="checkbox" id="<?php echo $this->plugin_name; ?>-update" name="<?php echo $this->plugin_name; ?>[update]" <?php echo $options['update'] == "off" ? '' : 'checked="checked"' ?>> Update the steem post when updating on wordpress.<br>-->
<br/>
......@@ -156,7 +158,10 @@
Two way integration : <br/>
These options are related to how the plugin will pull payout data and comments onto your wordpress blog. <br/>
<?php
echo "<input type='checkbox' id='".$this->plugin_name."-twoway' name='".$this->plugin_name."[twoway]' ".($options['twoway'] == "on" ? "checked='checked'" : "")."> Activate two way integration (BETA) ";
echo "<input type='checkbox' id='".$this->plugin_name."-twoway' name='".$this->plugin_name."[twoway]' ".($options['twoway'] == "on" ? "checked='checked'" : "")."> Activate two way integration (BETA) <br/>";
echo "<input type='checkbox' id='".$this->plugin_name."-twoway-front' name='".$this->plugin_name."[twoway-front]' ".($options['twoway-front'] == "on" ? "checked='checked'" : "")."> Display the two way integration in the front page.";
submit_button('Save all changes', 'primary','submit', TRUE); ?>
......
......@@ -108,6 +108,8 @@ class Steempress_sp_Public {
if (!isset($options["twoway"]))
$options["twoway"] = "off";
if (!isset($options["twoway-front"]))
$options["twoway-front"] = "off";
if ($options['twoway'] == "on") {
$id = get_the_ID();
......@@ -134,6 +136,8 @@ class Steempress_sp_Public {
if ($meta_author != $author && $meta_author != "")
$author = $meta_author;
$steempress = "";
if ($permlink != "" && $author != "") {
// If it's the front page, we display a smaller iframe.
$steempress = "<div id='steempress_sp_comment_feed'>";
......@@ -144,6 +148,10 @@ class Steempress_sp_Public {
$steempress .= "</div>";
}
if ($options["twoway-front"] === "off" && is_front_page())
return $content;
return $content . $steempress;
} else
return $content;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment