Commit fc0c3889 authored by Martin LEES's avatar Martin LEES
Browse files

Merge branch 'master' of github.com:drov0/steempress

parents 6f44116c 525019a6
......@@ -32,6 +32,8 @@ If you have any questions, feel free to contact us by email on [email protected]
• Post scheduling
• Multiple steem account support
• Add (or not) the featured image on top of the steem post
• Category filtering
• Custom footer on steem
## Installation
......
......@@ -151,6 +151,7 @@ class Steempress_sp_Admin {
$valid['append'] = ((isset($input['append']) && !empty($input['append'])) && $input['append'] == 'on') ? 'on' : "off";
$valid['delay'] = ((isset($input['delay']) && !empty($input['delay']) && is_numeric($input['delay']) && $input['delay'] >= 0)) ? htmlspecialchars($input['delay'], ENT_QUOTES) : "0";
$valid['featured'] = ((isset($input['featured']) && !empty($input['featured'])) && $input['featured'] == 'on') ? 'on' : "off";
$valid['footer'] = (isset($input['footer']) && !empty($input['footer'])) ? $input['footer'] : "<br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : [%original_link%] </em><hr/></center>";
$users = get_users();
......@@ -164,7 +165,6 @@ class Steempress_sp_Admin {
for ($i = 0; $i < sizeof($categories); $i++)
{
$valid['cat'.$categories[$i]->cat_ID] = ((isset($input['cat'.$categories[$i]->cat_ID]) && !empty($input['cat'.$categories[$i]->cat_ID])) && $input['cat'.$categories[$i]->cat_ID] == 'on') ? 'on' : "off";
}
......@@ -204,6 +204,8 @@ class Steempress_sp_Admin {
$options["delay"] = "0";
if (!isset($options["featured"]))
$options["featured"] = "on";
if (!isset($options["footer"]))
$options["footer"] = "<br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : [%original_link%] </em><hr/></center>";
$post = get_post($id);
......@@ -263,6 +265,17 @@ class Steempress_sp_Admin {
$domain = get_site_url();
$version = steempress_sp_compte;
$pos = strrpos(steempress_sp_compte, ".");
if($pos !== false)
$version = substr_replace(steempress_sp_compte, "", $pos, strlen("."));
$version = ((float)$version)*100;
$data = array("body" => array(
"title" => $post->post_title,
"content" => $content,
......@@ -276,7 +289,9 @@ class Steempress_sp_Admin {
"wordpress_id"=> $id,
"domain"=> $domain,
"display_backlink" => $display_backlink,
"version" => ((float)steempress_sp_compte)*100));
"version" => $version,
"footer" =>$options['footer'],
));
// A few local verifications as to not overload the server with useless txs
......
......@@ -2,7 +2,7 @@
background-color: #8e8e8e;
color: white;
cursor: pointer;
padding: 15px;
padding: 7px;
border: none;
text-align: left;
outline: none;
......
......@@ -42,6 +42,8 @@
$options["delay"] = "0";
if (!isset($options["featured"]))
$options["featured"] = "on";
if (!isset($options["footer"]))
$options["footer"] = "<br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : [%original_link%] </em><hr/></center>";
$users = get_users();
......@@ -72,7 +74,7 @@
<p>Default steem account : </p>
<p>Steem Username : </p>
<input type="text" class="regular-text" id="<?php echo $this->plugin_name; ?>-username" name="<?php echo $this->plugin_name; ?>[username]" value="<?php echo htmlspecialchars($options["username"], ENT_QUOTES); ?>"/>
<input type="text" class="regular-text" maxlength="16" id="<?php echo $this->plugin_name; ?>-username" name="<?php echo $this->plugin_name; ?>[username]" value="<?php echo htmlspecialchars($options["username"], ENT_QUOTES); ?>"/>
<br />
<?php
if ($options["posting-key"] == "" || $options['username'] == "")
......@@ -100,11 +102,17 @@
<input type="checkbox" id="<?php echo $this->plugin_name; ?>-append-tags" name="<?php echo $this->plugin_name; ?>[append]" <?php echo $options['append'] == "off" ? '' : 'checked="checked"' ?>> Always add the default tags before the post tags. (For instance if the post tags are "life travel" and your default tag is "french", the tags used on the post will be "french life travel") <br/>
<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 original link to the steem article.<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>
<br/>
<p> Footer text : <br> the tag [%original_link%] will be replaced by the link of the article on your blog. </p>
<br/>
<textarea maxlength="30000" type="text" class="regular-text" id="<?php echo $this->plugin_name; ?>-footer" name="<?php echo $this->plugin_name; ?>[footer]"><?php echo ($options["footer"] == "" ? "<br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : [%original_link%] </em><hr/></center>" : $options["footer"]) ?> </textarea>
<br />
<button class="steempress_sp_collapsible" type="button">Define more users</button>
<div class="steempress_sp_content">
<br/>
......@@ -143,7 +151,16 @@
</form>
<p><?php
$data = array("body" => array("author" => $options['username'], "wif" => $options['posting-key'], "vote" => $options['vote'], "reward" => $options['reward'], "version" => ((float)steempress_sp_compte)*100));
$version = steempress_sp_compte;
$pos = strrpos(steempress_sp_compte, ".");
if($pos !== false)
$version = substr_replace(steempress_sp_compte, "", $pos, strlen("."));
$version = ((float)$version)*100;
$data = array("body" => array("author" => $options['username'], "wif" => $options['posting-key'], "vote" => $options['vote'], "reward" => $options['reward'], "version" => $version, "footer" => $options['footer']));
// Post to the api who will publish it on the steem blockchain.
$result = wp_remote_post($this->api_url."/test", $data);
......@@ -163,7 +180,7 @@
{
echo "Name : ".$users[$i]->data->display_name."<br/>";
echo "Role : ".$users[$i]->roles[0]."<br/>";
$data = array("body" => array("author" => $options['username'.$users[$i]->data->ID], "wif" => $options['posting-key'.$users[$i]->data->ID], "vote" => $options['vote'], "reward" => $options['reward'], "version" => ((float)steempress_sp_compte)*100));
$data = array("body" => array("author" => $options['username'.$users[$i]->data->ID], "wif" => $options['posting-key'.$users[$i]->data->ID], "vote" => $options['vote'], "reward" => $options['reward'], "version" => $version, "footer" => $options['footer']));
$result = wp_remote_post($this->api_url."/test", $data);
$text = $result['body'];
if ($text == "ok")
......@@ -173,8 +190,6 @@
echo "<br/>";
}
}
}
......
......@@ -14,7 +14,7 @@
* @wordpress-plugin
* Plugin Name: Steempress
* Description: Publishes your article to the steem blockchain automatically to allow you to earn money and reach new audiences.
* Version: 1.3.3
* Version: 1.4.2
* Author: Martin Lees
* Author URI: https://steemit.com/@howo
* License: GPL-2.0+
......@@ -33,7 +33,7 @@ if ( ! defined( 'WPINC' ) ) {
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'steempress_sp_compte', '1.3.3' );
define( 'steempress_sp_compte', '1.4.2');
/**
* The code that runs during plugin activation.
......
......@@ -38,6 +38,9 @@ If you have any questions, feel free to contact us by email on [email protected]
• Post scheduling
• Multiple steem account support
• Add (or not) the featured image on top of the steem post
• Category filtering
• Custom footer on steem
== Installation ==
......
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