added wp-o-matic

This commit is contained in:
Kenneth Reitz
2010-03-18 18:35:05 -04:00
parent e95e9eadb4
commit 0f220519ec
47 changed files with 19162 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
require_once(dirname(__FILE__) . '/../../../wp-config.php');
nocache_headers();
// if uninstalled, let's not do anything
if(! get_option('wpo_version'))
return false;
// check password
if(isset($_REQUEST['code']) && $_REQUEST['code'] == get_option('wpo_croncode'))
{
require_once( dirname(__FILE__) . '/wpomatic.php' );
$wpomatic->runCron();
} else
$wpomatic->log('Warning! cron.php was called with the wrong password or without one!');
+140
View File
@@ -0,0 +1,140 @@
<?php
require_once( dirname(__FILE__) . '/../../../wp-config.php');
if(! isset($_REQUEST['item']))
die(__('This file cannot be accessed directly', 'wpomatic'));
else
{
preg_match('/\w*/', $_REQUEST['item'], $content);
$file = dirname(__FILE__) . '/inc/help/' . $content[0] . '.php';
ob_start();
@include($file);
$content = ob_get_clean();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title><?php _e('Help') ?> &rsaquo; <?php echo $title ?> </title>
<style type="text/css" media="screen">
* {
margin: 0;
padding: 0;
font: 0.92em "Lucida Grande", "Verdana";
}
a {
border-bottom: 1px solid #69c;
color: #00019b;
text-decoration: none;
}
#header {
background: #14568A;
border-bottom: 2px solid #448ABD;
overflow: hidden;
height: auto !important;
height: 1%;
padding: 0.7em 0.9em;
margin-bottom: 0.8em;
}
#header h1 {
font: 1.65em "Georgia";
color: #C3DEF1;
float: left;
}
#header #link_close {
display: block;
float: right;
color: white;
text-decoration: none;
}
#content {
padding: 0 1em;
}
h2 {
font-size: 1.1em;
font-weight: bold;
border-bottom: 1px dotted #999;
padding-bottom: 0.3em;
color: #666;
margin-bottom: -0.8em;
}
h3 {
font-size: 0.95em;
font-weight: bold;
margin-top: 1.5em;
margin-bottom: 0.5em;
padding: 0.2em 0;
}
#content ul {
margin-left: 20px;
}
#content ul li {
margin-bottom: 5px;
list-style-type: square;
}
#content p {
line-height: 1.4em;
margin-bottom: 0.9em;
}
#content a.link_top {
float: right;
margin-top: -2.2em;
}
#content a.link_main {
font-style: oblique;
}
#content strong {
font-weight: bold;
background: #FFFFCC;
}
#content em {
font-style: oblique;
}
#content .code { border: 1px solid #ccc; background: #fafafa; margin-bottom: 0.9em; padding: 0.9em 1em 0; }
</style>
<script type="text/javascript" charset="utf-8">
var init = function() {
document.getElementById('link_close').onclick = function() {
window.close();
return false;
}
}
window.onload = init;
</script>
</head>
<body id="help">
<div id="header">
<h1>WP-o-Matic <?php _e('Help', 'wpomatic') ?></h1>
<a href="#" id="link_close"><?php _e('Close window', 'wpomatic') ?></a>
</div>
<div id="content">
<?php echo ($content) ? $content : __('Help file not found', 'wpomatic') ?>
</div>
</body>
</html>
+212
View File
@@ -0,0 +1,212 @@
Object.extend(String.prototype, {
toSlug: function() {
return this.toLowerCase().replace(/\W/g, ' ').replace(/\ +/g, '-').replace(/\-$/g, '').replace(/^\-/g, '');
},
test: function(regex, params) {
return ((typeof regex == 'string') ? new RegExp(regex, params) : regex).test(this);
}
})
Event.observe( window, 'load', function(){
if($('edit_tabs')) {
$$('#edit_tabs a').each(function(el){
Event.observe(el, 'click', function(event){
Element.removeClassName($$('#edit_tabs .current').first(), 'current');
Element.addClassName(el.parentNode, 'current')
Element.removeClassName($$('#edit_sections .current').first(), 'current');
Element.addClassName($('section_' + el.id.replace('tab_', '')), 'current');
Event.stop(event);
}, false);
});
// Basic tab
Event.observe('campaign_title', 'keyup', function(){
$('campaign_slug').value = $F('campaign_title').toSlug();
});
// Feeds tab
//- Test feed links
var check_feed = function(el) {
el.className = 'input_text';
if($F(el).length > 0)
{
var oncomplete = function(t) {
var t = typeof t === 'string' ? t : t.responseText;
el.className = (t == '1') ? 'ok input_text' : 'err input_text';
};
if(typeof jQuery !== 'undefined')
jQuery.post("admin-ajax.php", {action: "test-feed", url: el.value, 'cookie': encodeURIComponent(document.cookie)}, oncomplete);
else if(typeof Ajax !== 'undefined')
new Ajax.Request("admin-ajax.php", { method: "post", parameters: "action=test-feed&url="+el.value+'&cookie=' + encodeURIComponent(document.cookie), onComplete: oncomplete })
else
return false;
el.className = 'load input_text';
}
};
var update_feeds = function() {
$$('#edit_feed div input[type=text]').each(function(el){
Event.stopObserving(el, 'blur');
Event.stopObserving(el, 'focus');
Event.observe(el, 'focus', function(e){
el.className = 'input_text';
});
Event.observe(el, 'blur', function(e){
check_feed(el);
});
});
};
update_feeds();
//- Add feed link
feed_index = $$('#edit_feed label').length;
Event.observe('add_feed', 'click', function(){
feed_index++;
var label = $$('#edit_feed label').first().innerHTML;
new Insertion.Bottom('edit_feed', '<div class="inlinetext"><label for="campaign_feed_new_'+feed_index+'">'+ label + '</label> <input type="text" name="campaign_feed[new][]" id="campaign_feed_new_'+feed_index+'" />');
$$('#edit_feed input').last().focus();
update_feeds();
}, false);
Event.observe('test_feeds', 'click', function(e){
Event.stop(e);
$$('#edit_feed input').each(function(el){ check_feed(el); });
});
// Categories
Event.observe('quick_add', 'click', function(){
new Insertion.Bottom('categories', '<li><input type="checkbox" checked="checked" name="campaign_newcat[]" /> <input type="text" name="campaign_newcatname[]" class="input_text" /></li>');
$$('#categories input').last().focus();
}, false);
// Rewrite
var rewrite_index = 2;
var rewrite_keys = function(){
$$('#edit_words .rewrite textarea', '#edit_words .relink textarea').each(function(area){
var check = '';
var inputs = $A(area.parentNode.getElementsByTagName('INPUT'));
inputs.each(function(input){
if(input.type.toLowerCase() == 'checkbox')
check = input;
});
Event.stopObserving(area, 'keyup');
Event.observe(area, 'keyup', function(){
check.checked = (area.value.length > 0);
});
});
};
rewrite_keys();
Event.observe('add_word', 'click', function(e){
Event.stop(e);
rewrite_index++;
var originvar = $('edit_words').getElementsBySelector('.origin label').first().innerHTML;
var regexvar = $('edit_words').getElementsBySelector('.origin .regex span').first().innerHTML;
var rewritevar = $('edit_words').getElementsBySelector('.rewrite label span').last().innerHTML;
var relinkvar = $('edit_words').getElementsBySelector('.relink label span').last().innerHTML;
var li = document.createElement('LI');
li.innerHTML = '<div class="textarea"><label>'+originvar+'</label><textarea name="campaign_word_origin[new'+rewrite_index+']"></textarea><label class="regex"><input type="checkbox" name="campaign_word_option_regex[new'+rewrite_index+']" /> '+regexvar+'</label></div><div class="rewrite textarea"><label><input type="checkbox" value="1" name="campaign_word_option_rewrite[new'+rewrite_index+']" /> '+rewritevar+'</label><textarea name="campaign_word_rewrite[new'+rewrite_index+']"></textarea></div><div class="relink textarea"><label><input type="checkbox" value="1" name="campaign_word_option_relink[new'+rewrite_index+']" /> '+relinkvar+'</label><textarea name="campaign_word_relink[new'+rewrite_index+']"></textarea></div>';
li.className = 'word';
$('edit_words').appendChild(li);
rewrite_keys();
});
// - Options
Event.observe('campaign_templatechk', 'click', function(){
if(!$('campaign_templatechk').checked) Element.removeClassName('post_template', 'current')
else Element.addClassName('post_template', 'current');
}, false);
Event.observe('enlarge_link', 'click', function() {
Element.toggleClassName('campaign_template', 'large');
return false;
}, false);
}
$$('a.help_link').each(function(el){
Event.observe(el, 'click', function(event){
window.open(el.href, 'popup', 'width=450,height=400,top=' + (screen.height - 400)/2 + ',left=' + (screen.width - 450)/2+',scrollbars=1,menubar=0,toolbar=0');
Event.stop(event);
}, false);
});
if($('option_cachepath'))
Event.observe('option_cachepath', 'keyup', function(){
$('cachepath_input').innerHTML = $F(this);
});
$$('.check a').each(function(el){
el.checked = true;
Event.observe(el, 'click', function(e){
Event.stop(e);
el.checked = !el.checked;
var inputs = $A(el.parentNode.parentNode.getElementsByTagName('INPUT'));
inputs.each(function(i){ i.checked = el.checked; });
});
});
// setup steps
if($('wpo-section-setup'))
{
var stepsnum = $A($('setup_steps').getElementsByTagName('LI')).length;
var current = $('setup_steps').getElementsBySelector('.current').first();
var current_index = parseInt(current.id.replace('step_', ''));
var enable_button = function(input) {
var input = $(input);
input.disabled = false;
Element.removeClassName(input, 'disabled');
}
var disable_button = function(input) {
var input = $(input);
input.disabled = 'disabled';
Element.addClassName(input, 'disabled');
}
var update_buttons_status = function() {
disable_button('setup_button_submit');
disable_button('setup_button_next');
disable_button('setup_button_previous');
if(current_index > 1) enable_button('setup_button_previous');
if(current_index < stepsnum) enable_button('setup_button_next');
if(current_index == stepsnum) enable_button('setup_button_submit');
}
var show_page = function(index)
{
Element.removeClassName('step_' + current_index, 'current');
current_index = index;
Element.addClassName('step_' + current_index, 'current');
update_buttons_status();
$('current_indicator').innerHTML = index;
}
Event.observe('setup_button_next', 'click', function(){
if(current_index < stepsnum ) show_page(current_index + 1);
});
Event.observe('setup_button_previous', 'click', function(){
if(current_index > 1) show_page(current_index - 1);
});
}
if($('import_mode_2'))
Event.observe('import_custom_campaign', 'change', function(){ $('import_mode_2').checked = true });
if($('import_mode_3'))
Event.observe('import_new_campaign', 'keyup', function(){ $('import_mode_3').checked = true });
}, false );
@@ -0,0 +1,72 @@
#wpomain {
height: auto !important;
height: 1%;
overflow: hidden;
max-width: 980px;
}
#wpomenu, #wpomenu ul, #wpomenu ul li, #wpomenu ul li a { background: none !important; }
#wpomenu ul li, #wpomenu ul li a { float: none; display: block; }
#wpomenu ul li.current a { color: #C4542A; }
#wpomenu {
margin: 5px 0;
float: left;
width: 160px;
height: 0;
}
#wpomenu a { text-decoration: none; }
#wpomenu div {
padding: 0;
}
#wpocontent {
margin-left: 170px;
min-height: 200px;
height: auto !important;
height: 200px;
}
#wpocontent .wrap { margin-top: 0; }
#wpocontent .wrap h2 { margin-top: 0; margin-bottom: 10px; }
#wpocontent .wrap .error, #wpocontent .wrap .updated { margin-bottom: 10px; }
#setup_steps {
border: none;
padding: 0;
}
#setup_steps li {
background-color: #EAF3FA;
padding: 5px 20px;
margin-bottom: 20px;
}
.command {
background: white;
}
div#setup_buttons { padding-top: 10px; }
#edit_campaign #edit_buttons { border-top: none; padding-top: 0; }
#edit_buttons a { font-size: 11px; color: #2583AD; }
#edit_buttons input { padding-top: 1px; padding-bottom: 1px; }
#edit_tabs a { text-decoration: none; }
#logs_pages { padding-top: 5px; }
#wpocontent .wrap #clean_logs { float: right; border-top: none; margin-top: 0; padding-top: 0; }
#options li, #edit_sections div.section div.checkbox, #edit_sections div.section div.text, #edit_sections div.section div.inlinetext, #edit_sections div.section div.radio, #edit_sections div.section div.longtext, #edit_sections div.section div.multipletext, #edit_sections div.section div.btn, #export_campaigns, #importoptions { border-bottom: none; background-color: #EAF3FA; padding: 10px 15px; margin-bottom: 10px; }
#export_campaigns, #importoptions { border-top: none; }
#edit_sections div.section div.section_warn { float: none; width: auto; margin-bottom: 10px; }
#section_categories #categories .input_text { display: inline; width: 130px; }
#edit_sections .section { background: none; padding-left: 0; }
.import_submit .button { margin-top: 0; }
#edit_submit { margin-bottom: 0; }
#edit_words .word { width: 320px; }
tr.highlight { background: #ffffe0; }
@@ -0,0 +1,609 @@
#options, #edit_tabs, #edit_buttons, ul.import_links, div#setup_buttons {
margin: 0;
padding: 0;
overflow: hidden;
height: auto !important;
height: 1%;
}
#categories, #edit_words {
overflow: hidden;
margin: 0;
padding: 0;
}
#add_word {
clear: both;
}
#sidebar h3 {
margin-top: 10px;
color: #333;
}
#wpomenu {
background: url('../images/bg_menu.gif');
padding: 0;
border: 0;
padding-left: 10px;
}
#wpomenu ul {
margin: 0;
padding: 0;
background: url('../images/bg_menu.gif') right;
height: 36px;
}
#wpomenu ul li {
float: left;
list-style-type: none;
margin: 6px 10px 0 0;
padding-left: 7px;
}
#wpomenu ul li a {
display: block;
float: left;
border-bottom: none;
font-size: 85%;
font-family: "Lucida Grande", "Verdana";
font-weight: bold;
color: #6C95B4;
height: 21px;
padding: 2px 7px 0 0;
}
#wpomenu ul li.current {
background: url('../images/bg_menu_current.gif') left;
border: none;
}
#wpomenu ul li.current a {
color: white;
background: url('../images/bg_menu_current.gif') right;
}
#activity h3 {
}
#main {
margin-right: 440px;
}
#sidebar {
float: right;
border: 1px solid #ccc;
padding: 0 10px !important;
padding: 10px;
width: 350px;
background: #fafafa;
}
#sidebar .help_link {
float: right;
}
#sidebar h3 {
margin-bottom: 0;
}
#sidebar_cron {
}
#sidebar p {
margin-top: 10px;
}
p.none {
color: #666;
}
p#log_status {
margin-top: 10px
}
.import_submit {
border-top: 1px dotted #ccc;
padding-top: 10px;
margin-top: 10px;
position: relative;
width: 400px;
}
.import_submit .submit {
position: absolute;
right: 0;
}
#importurl {
width: 290px;
}
#searchform {
padding-bottom: 10px;
}
p.errors {
color: red;
}
#edit_buttons {
float: right;
}
#edit_buttons li {
float: left;
margin-left: 10px;
list-style-type: none;
}
#edit_tabs li {
list-style-type: none;
float: left;
margin: 2px 5px 0 0;
background: url('../images/bg_tab.gif') top left;
padding-left: 15px;
text-align: center;
}
#edit_tabs li a {
display: block;
font-size: 85%;
font-family: "Lucida Grande", "Verdana";
font-weight: bold;
float: left;
color: #999;
border-bottom: none;
background: url('../images/bg_tab.gif') top right;
padding: 2px 15px 2px 0;
width: auto !important;
width: 50px;
min-width: 50px;
text-shadow: white 0 1px 0;
}
#edit_tabs li:hover {
margin-top: 1px;
}
#edit_tabs li:hover a {
padding-top: 3px;
}
#edit_tabs li a:hover {
color: #666;
}
#edit_tabs li.current {
margin-top: 0;
background-image: url('../images/bg_tab_current.gif');
border: none;
}
#edit_tabs li.current a {
background-image: url('../images/bg_tab_current.gif');
color: #729DBD;
padding-top: 4px;
cursor: default;
}
#edit_sections {
background: url('../images/bg_tab_section.gif') no-repeat top right;
padding-right: 5px;
}
#edit_sections .section {
background: url('../images/bg_tab_section.gif') no-repeat top left;
padding-left: 10px;
padding-top: 15px;
height: auto !important;
height: 200px;
min-height: 200px;
display: none;
}
#edit_sections .section .buttons ul {
padding-left: 10px;
width: 500px;
}
#edit_sections .section .buttons ul li {
list-style-type: none;
}
#edit_sections .section .buttons ul li div {
}
#edit_sections .section .buttons ul li label {
color: #333;
}
#edit_sections .section h3 {
margin: 0;
}
#edit_sections .current {
display: block;
border: none;
}
#edit_sections .section label, label.main {
font-weight: bold !important;
}
#edit_sections .section .text, #edit_sections .section .longtext,
#edit_sections .section .checkbox, #edit_sections .section .btn,
#edit_sections .section .multipletext, #edit_sections .section .radio,
#edit_sections .section .textarea, #edit_sections .section .inlinetext {
margin-bottom: 10px;
border-bottom: 1px dotted #999;
padding-bottom: 10px;
}
#edit_sections .section .longtext label, #edit_sections .section .btn label,
#edit_sections .section .select label, #edit_sections .section .multipletext label,
#edit_sections .section .radio label.main, #edit_sections .section .textarea label,
#edit_sections .section .text label {
display: block;
margin-bottom: 4px;
font-weight: bold !important;
}
#edit_sections .section .radio label.main {
margin-bottom: 8px;
cursor: default;
font-size: 100%;
}
#edit_sections .section .radio label {
margin-right: 10px;
font-size: 85%;
}
#edit_sections .section .longtext input {
width: 300px;
}
#edit_sections .section .textarea textarea {
width: 300px;
height: 80px;
}
#edit_sections .section #post_template {
margin-top: 5px;
border-bottom: none;
padding-bottom: 0;
margin-bottom: 0;
display: none;
}
#edit_sections .section #post_template textarea.large {
width: 500px;
height: 400px;
}
#edit_sections .section #post_template.current {
display: block;
}
#edit_sections .section #post_template textarea {
width: 400px;
height: 150px;
}
#edit_sections .section p {
margin: 0 0 .7em 0;
}
#edit_sections .section p.note, p.note {
margin: 3px 0 0 0;
color: #666;
font-size: 11px;
font-weight: normal !important;
}
#edit_sections .section .section_warn {
background: #FFFFE0;
border: 1px solid #EBEBA9;
padding: 8px;
float: right;
width: 300px;
font-size: 11px;
}
#edit_sections .section .section_warn .icon {
float: right;
}
#edit_sections .section .section_warn h3 {
font-size: 12px;
margin-bottom: 5px;
}
#edit_feed div.inlinetext input.input_text {
width: 480px;
padding-right: 25px;
}
#edit_feed div.inlinetext input.ok, #edit_feed div input.err, #edit_feed div input.load {
background-position: 490px 3px;
background-repeat: no-repeat;
}
#edit_feed div.inlinetext .delete_label {
font-weight: normal;
}
#edit_feed div input.ok {
background-image: url('../images/icon_ok.gif');
}
#edit_feed div input.load {
background-image: url('../images/icon_spinner.gif');
}
#edit_feed div input.err {
background-image: url('../images/icon_stop.gif');
}
#edit_submit {
font-size: 11px;
padding: 2px 3px;
margin-bottom: 5px;
}
.word {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
}
.word .relink, .word .rewrite {
margin-left: 10px;
}
#edit_words li {
list-style-type: none;
float: left;
width: 400px;
margin: 10px;
}
#edit_words .word .textarea textarea {
height: 50px;
}
#edit_words .word .textarea .regex {
display: block;
margin-top: 5px;
}
#categories {
width: 600px;
list-style-type: none;
margin: 10px 0 10px 10px;
padding: 0;
}
#categories li {
width: 200px;
}
#categories li label { }
#categories li.pad1 { margin-left: 10px; }
#categories li.pad2 { margin-left: 20px; }
#categories li.pad3 { margin-left: 30px; }
#categories li.pad4 { margin-left: 40px; }
#categories li.pad5 { margin-left: 50px; }
#categories li.pad6 { margin-left: 60px; }
/* ...if you go past level 4 you're insane enough! */
.test_link {
font-size: 10px;
position: relative;
bottom: 3px;
border-bottom: none;
text-indent: -500em;
width: 16px;
height: 16px;
}
.test_ok {
background: url('../images/icon_ok.gif');
}
#importtree li ul li {
margin-left: 20px;
color: red !important;
}
#options {
}
#options li {
border-bottom: 1px dotted #ccc;
padding-bottom: 10px;
}
#options li label {
font-weight: bold;
}
#wpofooter p {
background: url('../images/bg_line_short.gif') no-repeat top;
padding-top: 10px;
text-align: center;
font-size: 85%;
}
#importtree {
width: 400px;
}
#importtree ul {
list-style-type: none;
margin-left: 0;
padding-left: 0;
}
#importtree h4 {
font-size: 13px;
margin: 10px 0 0 0;
padding: 0;
}
#importtree li li h4 {
color: #666;
}
#importtree li li li h4 {
color: #999;
}
#importtree li li.odd {
background: #F1F5FA;
}
#importtree li li h4 label {
padding: 3px;
}
#importtree h4 label {
display: block;
}
#importtree .import_links {
float: right;
margin: 3px 3px 0 0;
}
#importtree .import_links li {
list-style-type: none;
float: left;
margin-left: 5px;
}
#importtree .import_links li a {
display: block;
float: left;
text-indent: -500em;
width: 16px;
height: 16px;
border-bottom-width: 0;
}
#importtree .import_links li a.feed_rss {
background: url('../images/icon_rss.png');
}
#importtree .import_links li a.feed_link {
background: url('../images/icon_link.png');
}
#importtree .check {
float: right;
font-size: 11px;
margin-right: 3px;
}
ol.campaignlist {
width: 300px;
}
ol.campaignlist li span.details {
float: right;
font-weight: bold;
}
div.error ul {
margin: 0 0 20px 20px;
padding: 0;
}
div.error ul li {
list-style-type: square;
}
#command_input {
width: 600px;
margin-right: 8px;
}
#logs {
padding-left: 25px;
}
#logs li {
font-size: 11px;
}
#tags_list {
font-size: 11px;
color: #999;
padding-left: 6px;
border-left: 3px solid #eee;
}
#cachepath {
color: #333;
}
#importoptions {
padding: 10px 0;
margin: 10px 0;
border-top: 1px dotted #999;
border-bottom: 1px dotted #999;
}
#importoptions h4 {
margin-top: 0;
margin-bottom: 10px;
}
#importoptions ul, #export_campaigns {
list-style: none;
padding-left: 15px;
}
#clean_logs {
float: right;
}
.logs_bar {
border-bottom: 1px dotted #999;
height: 35px;
}
#export_campaigns {
border-top: 1px dotted #999;
border-bottom: 1px dotted #999;
padding: 10px 0 8px;
}
#setup_steps {
padding-top: 10px;
padding-left: 10px;
border: 1px dotted #999;
border-width: 1px 0;
}
#setup_steps li {
margin-bottom: 30px;
list-style-type: none;
display: none;
}
#setup_steps li.current {
display: list-item !important;
display: block;
}
#setup_button_submit { float: right; }
#setup_buttons input.disabled { background: #eee; color: #999; }
.command { border: 1px solid #ccc; background: 1px solid #fafafa; padding: 10px; color: #666; }
#options_cron .command { margin: 10px 0; }
#options_cron h3 { font-size: 11px; color: #333; margin: 10px 0; }
+362
View File
@@ -0,0 +1,362 @@
<?php require_once(WPOTPL . '/helper/form.helper.php' ) ?>
<?php require_once(WPOTPL . '/helper/edit.helper.php' ) ?>
<?php $this->adminHeader() ?>
<div class="wrap">
<?php if(isset($campaign_add)): ?>
<h2>Add campaign</h2>
<?php else: ?>
<h2>Editing campaign</h2>
<?php endif;?>
<?php if(isset($this->errno) && $this->errno): ?>
<div id="edit-warning" class="error">
<p><strong><?php _e('The following errors have been encountered:', 'wpomatic') ?></strong></p>
<ul>
<?php foreach($this->errors as $section => $errs): ?>
<?php if($errs): ?>
<li>
<?php echo ucfirst($section) ?>
<ul class="errors">
<?php foreach($errs as $error): ?>
<li><?php echo $error ?></li>
<?php endforeach ?>
</ul>
</li>
<?php endif?>
<?php endforeach; ?>
</ul>
</div>
<?php else: ?>
<?php if(isset($addedid)): ?>
<div id="added-warning" class="updated"><p><?php printf(__('Campaign added successfully. <a href="%s">Edit it</a> or <a href="%s">fetch it now</a>', 'wpomatic'), $this->adminurl . '&s=edit&id=' . $addedid, wp_nonce_url($this->adminurl . '&amp;s=forcefetch&amp;id=' . $addedid, 'forcefetch-campaign_' . $addedid)) ?></p></div>
<?php elseif(isset($this->tool_success)): ?>
<div id="added-warning" class="updated"><p><?php echo $this->tool_success ?></p></div>
<?php elseif(isset($edited)): ?>
<div id="added-warning" class="updated"><p><?php _e('Campaign edited successfully.', 'wpomatic') ?></p></div>
<?php endif ?>
<?php endif; ?>
<form id="edit_campaign" action="" method="post" accept-charset="utf-8">
<?php wp_nonce_field('wpomatic-edit-campaign') ?>
<?php if(isset($campaign_add)): ?>
<?php echo input_hidden_tag('campaign_add', 1) ?>
<?php else: ?>
<?php echo input_hidden_tag('campaign_edit', $id) ?>
<?php endif; ?>
<ul id="edit_buttons" class="submit">
<li><a href="<?php echo $this->helpurl ?>campaigns" class="help_link"><?php _e('Help', 'wpomatic') ?></a></li>
<li><input type="submit" name="edit_submit" value="Submit" id="edit_submit" /></li>
</ul>
<ul id="edit_tabs">
<li class="current"><a href="#" id="tab_basic"><?php _e('Basic', 'wpomatic') ?></a></li>
<li><a href="#" id="tab_feeds"><?php _e('Feeds', 'wpomatic') ?></a></li>
<li><a href="#" id="tab_categories"><?php _e('Categories', 'wpomatic') ?></a></li>
<li><a href="#" id="tab_rewrite"><?php _e('Rewrite', 'wpomatic') ?></a></li>
<li><a href="#" id="tab_options"><?php _e('Options', 'wpomatic') ?></a></li>
<?php if(isset($campaign_edit)): ?>
<li><a href="#" id="tab_tools"><?php _e('Tools', 'wpomatic') ?></a></li>
<?php endif ?>
</ul>
<div id="edit_sections">
<!-- Basic section -->
<div class="section current" id="section_basic">
<div class="longtext required">
<?php echo label_for('campaign_title', __('Title', 'wpomatic')) ?>
<?php echo input_tag('campaign_title', _data_value($data['main'], 'title')) ?>
<p class="note"><?php _e('Tip: pick a name that is general for all the campaign\'s feeds (eg: Paris Hilton)', 'wpomatic' ) ?></p>
</div>
<div class="checkbox required">
<?php echo label_for('campaign_active', __('Active?', 'wpomatic')) ?>
<?php echo checkbox_tag('campaign_active', 1, _data_value($data['main'], 'active', true)) ?>
<p class="note"><?php _e('If inactive, the parser will ignore these feeds', 'wpomatic' ) ?></p>
</div>
<div class="text">
<?php echo label_for('campaign_slug', __('Campaign slug', 'wpomatic')) ?>
<?php echo input_tag('campaign_slug', _data_value($data['main'], 'slug')) ?>
<p class="note"><?php _e('Optionally, you can set an identifier for this campaign. Useful for detailed track of your ad-revenue.', 'wpomatic' ) ?></p>
</div>
</div>
<!-- Feeds section -->
<div class="section" id="section_feeds">
<p><?php _e('Please fill in at least one feed. If you\'re not sure about the exact feed url, just type in the domain name, and the feed will be autodetected', 'wpomatic') ?></p>
<div id="edit_feed">
<?php if(isset($data['feeds']['edit'])): ?>
<?php foreach($data['feeds']['edit'] as $id => $feed): ?>
<div class="inlinetext required">
<?php echo label_for('campaign_feed_edit_' . $id, __('Feed URL', 'wpomatic')) ?>
<?php echo input_tag('campaign_feed[edit]['. $id .']', $feed, 'disabled=disabled class=input_text id=campaign_feed_edit_' . $id) ?>
<?php echo checkbox_tag('campaign_feed[delete]['.$id.']', 1, (isset($data['feeds']['delete']) && _data_value($data['feeds']['delete'], $id)), 'id=campaign_feed_delete_' . $id) ?> <label for="campaign_feed_delete_<?php echo $id ?>" class="delete_label">Delete ?</label>
</div>
<?php endforeach ?>
<?php endif ?>
<?php if(isset($data['feeds']['new'])): ?>
<?php foreach($data['feeds']['new'] as $i => $feed): ?>
<div class="inlinetext required">
<?php echo label_for('campaign_feed_new_' . $i, __('Feed URL', 'wpomatic')) ?>
<?php echo input_tag('campaign_feed[new]['.$i.']', $feed, 'class=input_text id=campaign_feed_new_' . $i) ?>
</div>
<?php endforeach ?>
<?php else: ?>
<?php for($i = 0; $i < 4; $i++): ?>
<div class="inlinetext required">
<?php echo label_for('campaign_feed_new_' . $i, __('Feed URL', 'wpomatic')) ?>
<?php echo input_tag('campaign_feed[new][]', null, 'class=input_text id=campaign_feed_new_' . $i) ?>
</div>
<?php endfor ?>
<?php endif ?>
</div>
<a href="#add_feed" id="add_feed"><?php _e('Add more', 'wpomatic') ?></a> | <a href="#" id="test_feeds"><?php _e('Check all', 'wpomatic') ?></a>
</div>
<!-- Categories section -->
<div class="section" id="section_categories">
<p><?php _e('These are the categories where the posts will be created once they\'re fetched from the feeds.', 'wpomatic') ?></p><p><?php _e('You have to select at least one.', 'wpomatic') ?></p>
<ul id="categories">
<?php $this->adminEditCategories($data) ?>
<?php if(isset($data['categories']['new'])): ?>
<?php foreach($data['categories']['new'] as $i => $catname): ?>
<li>
<?php echo checkbox_tag('campaign_newcat[]', 1, true, 'id=campaign_newcat_' . $i) ?>
<?php echo input_tag('campaign_newcatname[]', $catname, 'class=input_text id=campaign_newcatname_' . $i) ?>
</li>
<?php endforeach ?>
<?php endif ?>
</ul>
<a href="#quick_add" id="quick_add"><?php _e('Quick add', 'wpomatic') ?></a>
</div>
<!-- Rewrite section -->
<div class="section" id="section_rewrite">
<p><?php _e('Want to transform a word into another? Or link a specific word to some website?', 'wpomatic') ?> <?php printf(__('<a href="%s" class="help_link">Read more</a>', 'wpomatic'), $this->helpurl . 'campaign_rewrite') ?></p>
<ul id="edit_words">
<?php if(isset($data['rewrites']) && count($data['rewrites'])): ?>
<?php foreach($data['rewrites'] as $i => $rewrite): ?>
<li class="word">
<div class="origin textarea">
<?php echo label_for('campaign_word_origin_' . $i, __('Origin', 'wpomatic')) ?>
<?php echo textarea_tag('campaign_word_origin['.$i . ']', $rewrite['origin']['search'], 'id=campaign_word_origin_' . $rewrite->id) ?>
<label class="regex">
<?php echo checkbox_tag('campaign_word_option_regex['. $i .']', 1, $rewrite['origin']['regex']) ?>
<span><?php _e('RegEx', 'wpomatic') ?></span>
</label>
</div>
<div class="rewrite textarea">
<label>
<?php echo checkbox_tag('campaign_word_option_rewrite['. $i .']', 1, isset($rewrite['rewrite'])) ?>
<span><?php _e('Rewrite to:', 'wpomatic') ?></span>
</label>
<?php echo textarea_tag('campaign_word_rewrite['. $i .']', _data_value($rewrite, 'rewrite')) ?>
</div>
<div class="relink textarea">
<label>
<?php echo checkbox_tag('campaign_word_option_relink['. $i .']', 1, isset($rewrite['relink'])) ?>
<span><?php _e('Relink to:', 'wpomatic') ?></span>
</label>
<?php echo textarea_tag('campaign_word_relink['. $i .']', _data_value($rewrite, 'relink')) ?>
</div>
</li>
<?php endforeach ?>
<?php else: ?>
<li class="word">
<div class="origin textarea">
<label for="campaign_word_origin_new1"><?php _e('Origin', 'wpomatic') ?></label>
<textarea name="campaign_word_origin[new1]" id="campaign_word_origin_new1"></textarea>
<label class="regex"><input type="checkbox" name="campaign_word_option_regex[new1]" /> <span><?php _e('RegEx', 'wpomatic') ?></span></label>
</div>
<div class="rewrite textarea">
<label><input type="checkbox" value="1" name="campaign_word_option_rewrite[new1]" /> <span><?php _e('Rewrite to:', 'wpomatic') ?></span></label>
<textarea name="campaign_word_rewrite[new1]"></textarea>
</div>
<div class="relink textarea">
<label><input type="checkbox" value="1" name="campaign_word_option_relink[new1]" /> <span><?php _e('Relink to:', 'wpomatic') ?></span></label>
<textarea name="campaign_word_relink[new1]"></textarea>
</div>
</li>
<?php endif ?>
</ul>
<a href="#add_word" id="add_word"><?php _e('Add more', 'wpomatic') ?></a>
</div>
<!-- Options -->
<div class="section" id="section_options">
<?php if(isset($campaign_edit)): ?>
<div class="section_warn">
<img src="<?php echo $this->tplpath ?>/images/icon_alert.gif" alt="<?php _e('Warning', 'wpomatic') ?>" class="icon" />
<h3><?php _e('Remember that', 'wpomatic') ?></h3>
<p><?php _e('Changing these options only affects the creation of posts after the next time feeds are parsed.', 'wpomatic') ?></p>
<p><?php _e('If you need to edit existing posts, you can do so by using the options under the Tools tab', 'wpomatic') ?></p>
</div>
<?php endif ?>
<div class="checkbox">
<label for="campaign_templatechk"><?php _e('Custom post template', 'wpomatic') ?></label>
<?php echo checkbox_tag('campaign_templatechk', 1, _data_value($data['main'], 'template')) ?>
<div id="post_template" class="textarea <?php if(_data_value($data['main'], 'template', '{content}') !== '{content}') echo 'current' ?>">
<?php echo textarea_tag('campaign_template', _data_value($data['main'], 'template', '{content}')) ?>
<a href="#" id="enlarge_link"><?php _e('Enlarge', 'wpomatic') ?></a>
<p class="note" id="tags_note">
<?php _e('Valid tags:', 'wpomatic') ?>
</p>
<p id="tags_list">
<span class="tag">{content}</span>, <span class="tag">{title}</span>, <span class="tag">{permalink}</span>, <span class="tag">{feedurl}</span>, <span class="tag">{feedtitle}</span>, <span class="tag">{feedlogo}</span>,<br /> <span class="tag">{campaigntitle}</span>, <span class="tag">{campaignid}</span>, <span class="tag">{campaignslug}</span>
</p>
</div>
<p class="note"><?php printf(__('Read about <a href="%s" class="help_link">post templates</a>, or check some <a href="%s" class="help_link">examples</a>', 'wpomatic'), $this->helpurl . 'post_templates', $this->helpurl . 'post_templates_examples') ?></p>
</div>
<div class="multipletext">
<?php
$f = _data_value($data['main'], 'frequency');
if($f) {
$frequency = WPOTools::calcTime($f);
}
else
$frequency = array();
?>
<label><?php _e('Frequency', 'wpomatic') ?></label>
<?php echo input_tag('campaign_frequency_d', _data_value($frequency, 'days', 1), 'size=2 maxlength=3')?>
<?php _e('d', 'wpomatic') ?>
<?php echo input_tag('campaign_frequency_h', _data_value($frequency, 'hours', 5), 'size=2 maxlength=2')?>
<?php _e('h', 'wpomatic') ?>
<?php echo input_tag('campaign_frequency_m', _data_value($frequency, 'minutes', 0), 'size=2 maxlength=2')?>
<?php _e('m', 'wpomatic') ?>
<p class="note"><?php _e('How often should feeds be checked? (days, hours and minutes)', 'wpomatic') ?></p>
</div>
<div class="checkbox">
<?php echo label_for('campaign_cacheimages', __('Cache images', 'wpomatic')) ?>
<?php echo checkbox_tag('campaign_cacheimages', 1, _data_value($data['main'], 'cacheimages', is_writable($this->cachepath))) ?>
<p class="note"><?php _e('Images will be stored in your server, instead of hotlinking from the original site.', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>image_caching" class="help_link"><?php _e('More', 'wpomatic') ?></a></p>
</div>
<div class="checkbox">
<?php echo label_for('campaign_feeddate', __('Use feed date', 'wpomatic')) ?>
<?php echo checkbox_tag('campaign_feeddate', 1, _data_value($data['main'], 'feeddate', false)) ?>
<p class="note"><?php _e('Use the original date from the post instead of the time the post is created by WP-o-Matic.', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>feed_date_option" class="help_link"><?php _e('More', 'wpomatic') ?></a></p>
</div>
<div class="checkbox">
<?php echo label_for('campaign_dopingbacks', __('Perform pingbacks', 'wpomatic')) ?>
<?php echo checkbox_tag('campaign_dopingbacks', 1, _data_value($data['main'], 'dopingbacks', false)) ?>
</div>
<div class="radio">
<label class="main"><?php _e('Type of post to create', 'wpomatic')?></label>
<?php echo radiobutton_tag('campaign_posttype', 'publish', !isset($data['main']['posttype']) || _data_value($data['main'], 'posttype') == 'publish', 'id=type_published') ?>
<?php echo label_for('type_published', __('Published', 'wpomatic')) ?>
<?php echo radiobutton_tag('campaign_posttype', 'private', _data_value($data['main'], 'posttype') == 'private', 'id=type_private') ?>
<?php echo label_for('type_private', __('Private', 'wpomatic')) ?>
<?php echo radiobutton_tag('campaign_posttype', 'draft', _data_value($data['main'], 'posttype') == 'draft', 'id=type_draft') ?>
<?php echo label_for('type_draft', __('Draft', 'wpomatic')) ?>
</div>
<div class="text">
<?php echo label_for('campaign_author', __('Author:', 'wpomatic')) ?>
<?php echo select_tag('campaign_author', options_for_select($author_usernames, _data_value($data['main'], 'author', 'admin'))) ?>
<p class="note"><?php _e("The created posts will be assigned to this author.", 'wpomatic') ?></p>
</div>
<div class="text required">
<?php echo label_for('campaign_max', __('Max items to create on each fetch', 'wpomatic')) ?>
<?php echo input_tag('campaign_max', _data_value($data['main'], 'max', '10'), 'size=2 maxlength=3') ?>
<p class="note"><?php _e("Set it to 0 for unlimited. If set to a value, only the last X items will be selected, ignoring the older ones.", 'wpomatic') ?></p>
</div>
<div class="checkbox">
<?php echo label_for('campaign_linktosource', __('Post title links to source?', 'wpomatic')) ?>
<?php echo checkbox_tag('campaign_linktosource', 1, _data_value($data['main'], 'linktosource', false)) ?>
</div>
<div class="radio">
<label class="main"><?php _e('Discussion options:', 'wpomatic')?></label>
<?php echo select_tag('campaign_commentstatus',
options_for_select(
array('open' => __('Open', 'wpomatic'),
'closed' => __('Closed', 'wpomatic'),
'registered_only' => __('Registered only', 'registered_only')
), _data_value($data['main'], 'comment_status', 'open'))) ?>
<?php echo checkbox_tag('campaign_allowpings', 1, _data_value($data['main'], 'allowpings', true)) ?>
<?php echo label_for('campaign_allowpings', __('Allow pings', 'wpomatic')) ?>
</div>
</div>
<?php if(isset($campaign_edit)): ?>
<!-- Tools -->
<div class="section" id="section_tools">
<div class="buttons">
<h3><?php _e('Posts action', 'wpomatic') ?></h3>
<p class="note"><?php _e("The selected action applies to all the posts created by this campaign", 'wpomatic') ?></p>
<ul>
<li>
<div class="btn">
<input type="submit" name="tool_removeall" value="<?php _e('Remove all', 'wpomatic') ?>" />
</div>
</li>
<li>
<div class="radio">
<label class="main"><?php _e('Change status to:', 'wpomatic')?></label>
<input type="radio" name="campaign_tool_changetype" value="publish" id="changetype_published" checked="checked" /> <label for="changetype_published"><?php _e('Published', 'wpomatic') ?></label>
<input type="radio" name="campaign_tool_changetype" value="private" id="changetype_private" /> <label for="changetype_private"><?php _e('Private', 'wpomatic') ?></label>
<input type="radio" name="campaign_tool_changetype" value="draft" id="changetype_draft" /> <label for="changetype_draft"><?php _e('Draft', 'wpomatic') ?></label>
<input type="submit" name="tool_changetype" value="<?php _e('Change', 'wpomatic') ?>" />
</div>
</li>
<li>
<div class="text">
<label for="campaign_tool_changeauthor"><?php _e('Change author username to:', 'wpomatic')?></label>
<?php echo select_tag('campaign_tool_changeauthor', options_for_select($author_usernames, _data_value($data['main'], 'author', 'admin'))) ?>
<input type="submit" name="tool_changeauthor" value="<?php _e('Change', 'wpomatic') ?>" />
</div>
</li>
</ul>
</div>
<!--
<div class="btn">
<label><?php _e('Test all feeds', 'wpomatic') ?></label>
<input type="button" name="campaign_tool_testall_btn" value="Test" />
<p class="note"><?php _e('This option creates one draft from each feed you added.', 'wpomatic') ?></p>
</div>
-->
</div>
<?php endif ?>
</div>
</form>
</div>
<?php $this->adminFooter() ?>
@@ -0,0 +1,16 @@
<?php echo '<?xml version="1.0"?>'; ?>
<opml version="1.1">
<head>
<title>WPOMATIC</title>
<dateCreated><?php echo date('D, d M Y h:i:s e') ?></dateCreated>
</head>
<body>
<?php foreach($campaigns as $campaign): ?>
<outline text="<?php echo $campaign->title ?>">
<?php foreach($campaign->feeds as $feed): ?>
<outline text="<?php echo $feed->title ?>" type="link" xmlURL="<?php echo $feed->url ?>" htmlUrl="" />
<?php endforeach ?>
</outline>
<?php endforeach ?>
</body>
</opml>
+33
View File
@@ -0,0 +1,33 @@
<?php require_once(WPOTPL . '/helper/form.helper.php' ) ?>
<?php $this->adminHeader() ?>
<?php if(isset($error)): ?>
<div id="export-warning" class="error">
<p><?php echo $error ?></p>
</div>
<?php endif; ?>
<div class="wrap">
<h2><?php _e('Export', 'wpomatic') ?></h2>
<p><?php _e('<strong>Note:</strong> This tool only exports lists of feeds, not custom options.', 'wpomatic') ?></p>
<form action="" method="post" accept-charset="utf-8">
<?php if($campaigns): ?>
<ul id="export_campaigns">
<?php foreach($campaigns as $campaign): ?>
<li>
<?php echo checkbox_tag('export_campaign[]', $campaign->id, isset($_REQUEST['export_campaign']) && _data_value($_REQUEST['export_campaign'], $campaign->id), 'id=export_campaign_' . $campaign->id) ?>
<?php echo label_for('export_campaign_' . $campaign->id, $campaign->title . ' <strong>' . $campaign->id . '</strong>') ?>
</li>
<?php endforeach ?>
</ul>
<p class="submit"><?php echo submit_tag(__('Export', 'wpomatic')) ?></p>
<?php else: ?>
<p><?php _e('No campaigns to show', 'wpomatic') ?>
<?php endif ?>
</form>
</div>
<?php $this->adminFooter() ?>
@@ -0,0 +1,7 @@
</div>
</div>
<div id="wpofooter">
<!-- Remove me not! -->
<p>WP-o-Matic <?php echo $this->version ?> &mdash; Copyright &copy;2008 <a href="http://devthought.com">Guillermo Rauch</a></p>
</div>
+21
View File
@@ -0,0 +1,21 @@
<link rel="stylesheet" href="<?php echo $this->tplpath ?>/css/admin.css" type="text/css" media="all" title="" />
<?php if($this->newadmin): ?>
<link rel="stylesheet" href="<?php echo $this->tplpath ?>/css/admin-new.css" type="text/css" media="all" title="" />
<?php endif ?>
<div id="wpomain">
<div id="wpomenu" class="wrap">
<div>
<ul>
<li <?php echo $current['home'] ?>><a id="menu_home" href="<?php echo $this->adminurl ?>&amp;s=home"><?php _e('Dashboard', 'wpomatic') ?></a></li>
<li <?php echo $current['list'] ?>><a id="menu_list" href="<?php echo $this->adminurl ?>&amp;s=list"><?php _e('Campaigns', 'wpomatic') ?></a></li>
<li <?php echo $current['add'] ?>><a id="menu_add" href="<?php echo $this->adminurl ?>&amp;s=add"><?php _e('Add campaign', 'wpomatic') ?></a></li>
<li <?php echo $current['options'] ?>><a id="menu_options" href="<?php echo $this->adminurl ?>&amp;s=options"><?php _e('Options', 'wpomatic') ?></a></li>
<li <?php echo $current['import'] ?>><a id="menu_backup" href="<?php echo $this->adminurl ?>&amp;s=import"><?php _e('Import', 'wpomatic') ?></a></li>
<li <?php echo $current['export'] ?>><a id="menu_backup" href="<?php echo $this->adminurl ?>&amp;s=export"><?php _e('Export', 'wpomatic') ?></a></li>
</ul>
</div>
</div>
<div id="wpocontent">
@@ -0,0 +1,12 @@
<?php
function _wpo_edit_cat_row($category, $level, &$data)
{
$category = get_category( $category );
$name = $category->cat_name;
echo '
<li class="required pad'.$level.'">
' . checkbox_tag('campaign_categories[]', $category->cat_ID, in_array($category->cat_ID, $data['categories']), 'id=category_' . $category->cat_ID) . '
' . label_for('category_' . $category->cat_ID, $name) . '</li>';
}
@@ -0,0 +1,590 @@
<?php
// Taken from symfony-project.com. Some slightly modified
require_once(dirname(__FILE__) . '/tag.helper.php');
/**
* Returns a formatted set of <option> tags based on optional <i>$options</i> array variable.
*
* The options_for_select helper is usually called in conjunction with the select_tag helper, as it is relatively
* useless on its own. By passing an array of <i>$options</i>, the helper will automatically generate <option> tags
* using the array key as the value and the array value as the display title. Additionally the options_for_select tag is
* smart enough to detect nested arrays as <optgroup> tags. If the helper detects that the array value is an array itself,
* it creates an <optgroup> tag with the name of the group being the key and the contents of the <optgroup> being the array.
*
* <b>Options:</b>
* - include_blank - Includes a blank <option> tag at the beginning of the string with an empty value
* - include_custom - Includes an <option> tag with a custom display title at the beginning of the string with an empty value
*
* <b>Examples:</b>
* <code>
* echo select_tag('person', options_for_select(array(1 => 'Larry', 2 => 'Moe', 3 => 'Curly')));
* </code>
*
* <code>
* $card_list = array('VISA' => 'Visa', 'MAST' => 'MasterCard', 'AMEX' => 'American Express', 'DISC' => 'Discover');
* echo select_tag('cc_type', options_for_select($card_list, 'AMEX', array('include_custom' => '-- Select Credit Card Type --')));
* </code>
*
* <code>
* $optgroup_array = array(1 => 'Joe', 2 => 'Sue', 'Group A' => array(3 => 'Mary', 4 => 'Tom'), 'Group B' => array(5 => 'Bill', 6 =>'Andy'));
* echo select_tag('employee', options_for_select($optgroup_array, null, array('include_blank' => true)), array('class' => 'mystyle'));
* </code>
*
* @param array dataset to create <option> tags and <optgroup> tags from
* @param string selected option value
* @param array additional HTML compliant <option> tag parameters
* @return string populated with <option> tags derived from the <i>$options</i> array variable
* @see select_tag
*/
function options_for_select($options = array(), $selected = '', $html_options = array())
{
$html_options = _parse_attributes($html_options);
if (is_array($selected))
{
$selected = array_map('strval', array_values($selected));
}
$html = '';
if ($value = _get_option($html_options, 'include_custom'))
{
$html .= content_tag('option', $value, array('value' => ''))."\n";
}
else if (_get_option($html_options, 'include_blank'))
{
$html .= content_tag('option', '', array('value' => ''))."\n";
}
foreach ($options as $key => $value)
{
if (is_array($value))
{
$html .= content_tag('optgroup', options_for_select($value, $selected, $html_options), array('label' => $key))."\n";
}
else
{
$option_options = array('value' => $key);
if (
(is_array($selected) && in_array(strval($key), $selected, true))
||
(strval($key) == strval($selected))
)
{
$option_options['selected'] = 'selected';
}
$html .= content_tag('option', $value, $option_options)."\n";
}
}
return $html;
}
/**
* Returns an HTML <form> tag that points to a valid action, route or URL as defined by <i>$url_for_options</i>.
*
* By default, the form tag is generated in POST format, but can easily be configured along with any additional
* HTML parameters via the optional <i>$options</i> parameter. If you are using file uploads, be sure to set the
* <i>multipart</i> option to true.
*
* <b>Options:</b>
* - multipart - When set to true, enctype is set to "multipart/form-data".
*
* <b>Examples:</b>
* <code><?php echo form_tag('@myroute'); ?></code>
* <code><?php echo form_tag('/module/action', array('name' => 'myformname', 'multipart' => true)); ?></code>
*
* @param string valid action, route or URL
* @param array optional HTML parameters for the <form> tag
* @return string opening HTML <form> tag with options
*/
function form_tag($url_for_options = '', $options = array())
{
$options = _parse_attributes($options);
$html_options = $options;
if (!isset($html_options['method']))
{
$html_options['method'] = 'post';
}
if (_get_option($html_options, 'multipart'))
{
$html_options['enctype'] = 'multipart/form-data';
}
$html_options['action'] = url_for($url_for_options);
return tag('form', $html_options, true);
}
/**
* Returns a <select> tag, optionally comprised of <option> tags.
*
* The select tag does not generate <option> tags by default.
* To do so, you must populate the <i>$option_tags</i> parameter with a string of valid HTML compliant <option> tags.
* Fortunately, Symfony provides a handy helper function to convert an array of data into option tags (see options_for_select).
* If you need to create a "multiple" select tag (ability to select multiple options), set the <i>multiple</i> option to true.
* Doing so will automatically convert the name field to an array type variable (i.e. name="name" becomes name="name[]").
*
* <b>Options:</b>
* - multiple - If set to true, the select tag will allow multiple options to be selected at once.
*
* <b>Examples:</b>
* <code>
* $person_list = array(1 => 'Larry', 2 => 'Moe', 3 => 'Curly');
* echo select_tag('person', options_for_select($person_list, $sf_params->get('person')), array('class' => 'full'));
* </code>
*
* <code>
* echo select_tag('department', options_for_select($department_list), array('multiple' => true));
* </code>
*
* <code>
* echo select_tag('url', options_for_select($url_list), array('onChange' => 'Javascript:this.form.submit();'));
* </code>
*
* @param string field name
* @param mixed contains a string of valid <option></option> tags, or an array of options that will be passed to options_for_select
* @param array additional HTML compliant <select> tag parameters
* @return string <select> tag optionally comprised of <option> tags.
* @see options_for_select, content_tag
*/
function select_tag($name, $option_tags = null, $options = array())
{
$options = _convert_options($options);
$id = $name;
if (isset($options['multiple']) && $options['multiple'] && substr($name, -2) !== '[]')
{
$name .= '[]';
}
if (is_array($option_tags))
{
$option_tags = options_for_select($option_tags);
}
return content_tag('select', $option_tags, array_merge(array('name' => $name, 'id' => get_id_from_name($id)), $options));
}
/**
* Returns an XHTML compliant <input> tag with type="text".
*
* The input_tag helper generates your basic XHTML <input> tag and can utilize any standard <input> tag parameters
* passed in the optional <i>$options</i> parameter.
*
* <b>Examples:</b>
* <code>
* echo input_tag('name');
* </code>
*
* <code>
* echo input_tag('amount', $sf_params->get('amount'), array('size' => 8, 'maxlength' => 8));
* </code>
*
* @param string field name
* @param string selected field value
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="text"
*/
function input_tag($name, $value = null, $options = array())
{
return tag('input', array_merge(array('type' => 'text', 'name' => $name, 'id' => get_id_from_name($name, $value), 'value' => $value), _convert_options($options)));
}
/**
* Returns an XHTML compliant <input> tag with type="hidden".
*
* Similar to the input_tag helper, the input_hidden_tag helper generates an XHTML <input> tag and can utilize
* any standard <input> tag parameters passed in the optional <i>$options</i> parameter. The only difference is
* that it creates the tag with type="hidden", meaning that is not visible on the page.
*
* <b>Examples:</b>
* <code>
* echo input_hidden_tag('id', $id);
* </code>
*
* @param string field name
* @param string populated field value
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="hidden"
*/
function input_hidden_tag($name, $value = null, $options = array())
{
$options = _parse_attributes($options);
$options['type'] = 'hidden';
return input_tag($name, $value, $options);
}
/**
* Returns an XHTML compliant <input> tag with type="file".
*
* Similar to the input_tag helper, the input_hidden_tag helper generates your basic XHTML <input> tag and can utilize
* any standard <input> tag parameters passed in the optional <i>$options</i> parameter. The only difference is that it
* creates the tag with type="file", meaning that next to the field will be a "browse" (or similar) button.
* This gives the user the ability to choose a file from there computer to upload to the web server. Remember, if you
* plan to upload files to your website, be sure to set the <i>multipart</i> option form_tag helper function to true
* or your files will not be properly uploaded to the web server.
*
* <b>Examples:</b>
* <code>
* echo input_file_tag('filename', array('size' => 30));
* </code>
*
* @param string field name
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="file"
* @see input_tag, form_tag
*/
function input_file_tag($name, $options = array())
{
$options = _parse_attributes($options);
$options['type'] = 'file';
return input_tag($name, null, $options);
}
/**
* Returns an XHTML compliant <input> tag with type="password".
*
* Similar to the input_tag helper, the input_hidden_tag helper generates your basic XHTML <input> tag and can utilize
* any standard <input> tag parameters passed in the optional <i>$options</i> parameter. The only difference is that it
* creates the tag with type="password", meaning that the text entered into this field will not be visible to the end user.
* In most cases it is replaced by * * * * * * * *. Even though this text is not readable, it is recommended that you do not
* populate the optional <i>$value</i> option with a plain-text password or any other sensitive information, as this is a
* potential security risk.
*
* <b>Examples:</b>
* <code>
* echo input_password_tag('password');
* echo input_password_tag('password_confirm');
* </code>
*
* @param string field name
* @param string populated field value
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="password"
* @see input_tag
*/
function input_password_tag($name = 'password', $value = null, $options = array())
{
$options = _parse_attributes($options);
$options['type'] = 'password';
return input_tag($name, $value, $options);
}
/**
* Returns a <textarea> tag, optionally wrapped with an inline rich-text JavaScript editor.
*
* The texarea_tag helper generates a standard HTML <textarea> tag and can be manipulated with
* any number of standard HTML parameters via the <i>$options</i> array variable. However, the
* textarea tag also has the unique capability of being transformed into a WYSIWYG rich-text editor
* such as TinyMCE (http://tinymce.moxiecode.com) very easily with the use of some specific options:
*
* <b>Options:</b>
* - rich: A rich text editor class (for example sfRichTextEditorTinyMCE for TinyMCE).
*
* <b>Examples:</b>
* <code>
* echo textarea_tag('notes');
* </code>
*
* <code>
* echo textarea_tag('description', 'This is a description', array('rows' => 10, 'cols' => 50));
* </code>
*
* @param string field name
* @param string populated field value
* @param array additional HTML compliant <textarea> tag parameters
*
* @return string <textarea> tag optionally wrapped with a rich-text WYSIWYG editor
*/
function textarea_tag($name, $content = null, $options = array())
{
$options = _parse_attributes($options);
if ($size = _get_option($options, 'size'))
{
list($options['cols'], $options['rows']) = split('x', $size, 2);
}
return content_tag('textarea', escape_once((is_object($content)) ? $content->__toString() : $content), array_merge(array('name' => $name, 'id' => get_id_from_name(_get_option($options, 'id', $name), null)), _convert_options($options)));
}
/**
* Returns an XHTML compliant <input> tag with type="checkbox".
*
* When creating multiple checkboxes with the same name, be sure to use an array for the
* <i>$name</i> parameter (i.e. 'name[]'). The checkbox_tag is smart enough to create unique ID's
* based on the <i>$value</i> parameter like so:
*
* <samp>
* <input type="checkbox" name="status[]" id="status_3" value="3" />
* <input type="checkbox" name="status[]" id="status_4" value="4" />
* </samp>
*
* <b>Examples:</b>
* <code>
* echo checkbox_tag('newsletter', 1, $sf_params->get('newsletter'));
* </code>
*
* <code>
* echo checkbox_tag('option_a', 'yes', true, array('class' => 'style_a'));
* </code>
*
* <code>
* // one request variable with an array of checkbox values
* echo checkbox_tag('choice[]', 1);
* echo checkbox_tag('choice[]', 2);
* echo checkbox_tag('choice[]', 3);
* echo checkbox_tag('choice[]', 4);
* </code>
*
* <code>
* // assuming you have Prototype.js enabled, you could do this
* echo checkbox_tag('show_tos', 1, false, array('onclick' => "Element.toggle('tos'); return false;"));
* </code>
*
* @param string field name
* @param string checkbox value (if checked)
* @param bool is the checkbox checked? (1 or 0)
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="checkbox"
*/
function checkbox_tag($name, $value = '1', $checked = false, $options = array())
{
$html_options = array_merge(array('type' => 'checkbox', 'name' => $name, 'id' => get_id_from_name($name, $value), 'value' => $value), _convert_options($options));
if ($checked)
{
$html_options['checked'] = 'checked';
}
return tag('input', $html_options);
}
/**
* Returns an XHTML compliant <input> tag with type="radio".
*
* <b>Examples:</b>
* <code>
* echo ' Yes '.radiobutton_tag('newsletter', 1);
* echo ' No '.radiobutton_tag('newsletter', 0);
* </code>
*
* @param string field name
* @param string radio button value (if selected)
* @param bool is the radio button selected? (1 or 0)
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="radio"
*/
function radiobutton_tag($name, $value, $checked = false, $options = array())
{
$html_options = array_merge(array('type' => 'radio', 'name' => $name, 'id' => get_id_from_name($name, $value), 'value' => $value), _convert_options($options));
if ($checked)
{
$html_options['checked'] = 'checked';
}
return tag('input', $html_options);
}
/**
* Returns an XHTML compliant <input> tag with type="submit".
*
* By default, this helper creates a submit tag with a name of <em>commit</em> to avoid
* conflicts with other parts of the framework. It is recommended that you do not use the name
* "submit" for submit tags unless absolutely necessary. Also, the default <i>$value</i> parameter
* (title of the button) is set to "Save changes", which can be easily overwritten by passing a
* <i>$value</i> parameter.
*
* <b>Examples:</b>
* <code>
* echo submit_tag();
* </code>
*
* <code>
* echo submit_tag('Update Record');
* </code>
*
* @param string field value (title of submit button)
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="submit"
*/
function submit_tag($value = 'Save changes', $options = array())
{
return tag('input', array_merge(array('type' => 'submit', 'name' => 'commit', 'value' => $value), _convert_options_to_javascript(_convert_options($options))));
}
/**
* Returns an XHTML compliant <input> tag with type="reset".
*
* By default, this helper creates a submit tag with a name of <em>reset</em>. Also, the default
* <i>$value</i> parameter (title of the button) is set to "Reset" which can be easily overwritten
* by passing a <i>$value</i> parameter.
*
* <b>Examples:</b>
* <code>
* echo reset_tag();
* </code>
*
* <code>
* echo reset_tag('Start Over');
* </code>
*
* @param string field value (title of reset button)
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="reset"
*/
function reset_tag($value = 'Reset', $options = array())
{
return tag('input', array_merge(array('type' => 'reset', 'name' => 'reset', 'value' => $value), _convert_options($options)));
}
/**
* Returns an XHTML compliant <input> tag with type="image".
*
* The submit_image_tag is very similar to the submit_tag, the only difference being that it uses an image
* for the submit button instead of the browser-generated default button. The image is defined by the
* <i>$source</i> parameter and must be a valid image, either local or remote (URL). By default, this
* helper creates a submit tag with a name of <em>commit</em> to avoid conflicts with other parts of the
* framework. It is recommended that you do not use the name "submit" for submit tags unless absolutely necessary.
*
* <b>Examples:</b>
* <code>
* // Assuming your image is in the /web/images/ directory
* echo submit_image_tag('my_submit_button.gif');
* </code>
*
* <code>
* echo submit_image_tag('http://mydomain.com/my_submit_button.gif');
* </code>
*
* @param string path to image file
* @param array additional HTML compliant <input> tag parameters
* @return string XHTML compliant <input> tag with type="image"
*/
function submit_image_tag($source, $options = array())
{
if (!isset($options['alt']))
{
$path_pos = strrpos($source, '/');
$dot_pos = strrpos($source, '.');
$begin = $path_pos ? $path_pos + 1 : 0;
$nb_str = ($dot_pos ? $dot_pos : strlen($source)) - $begin;
$options['alt'] = ucfirst(substr($source, $begin, $nb_str));
}
return tag('input', array_merge(array('type' => 'image', 'name' => 'commit', 'src' => image_path($source)), _convert_options_to_javascript(_convert_options($options))));
}
/**
* Returns a <label> tag with <i>$label</i> for the specified <i>$id</i> parameter.
*
* @param string id
* @param string label or title
* @param array additional HTML compliant <label> tag parameters
* @return string <label> tag with <i>$label</i> for the specified <i>$id</i> parameter.
*/
function label_for($id, $label, $options = array())
{
$options = _parse_attributes($options);
return content_tag('label', $label, array_merge(array('for' => get_id_from_name($id, null)), $options));
}
/**
* Returns a formatted ID based on the <i>$name</i> parameter and optionally the <i>$value</i> parameter.
*
* This function determines the proper form field ID name based on the parameters. If a form field has an
* array value as a name we need to convert them to proper and unique IDs like so:
* <samp>
* name[] => name (if value == null)
* name[] => name_value (if value != null)
* name[bob] => name_bob
* name[item][total] => name_item_total
* </samp>
*
* <b>Examples:</b>
* <code>
* echo get_id_from_name('status[]', '1');
* </code>
*
* @param string field name
* @param string field value
* @return string <select> tag populated with all the languages in the world.
*/
function get_id_from_name($name, $value = null)
{
// check to see if we have an array variable for a field name
if (strstr($name, '['))
{
$name = str_replace(array('[]', '][', '[', ']'), array((($value != null) ? '_'.$value : ''), '_', '_', ''), $name);
}
return $name;
}
/**
* Converts specific <i>$options</i> to their correct HTML format
*
* @param array options
* @return array returns properly formatted options
*/
function _convert_options($options)
{
$options = _parse_attributes($options);
foreach (array('disabled', 'readonly', 'multiple') as $attribute)
{
if (array_key_exists($attribute, $options))
{
if ($options[$attribute])
{
$options[$attribute] = $attribute;
}
else
{
unset($options[$attribute]);
}
}
}
return $options;
}
function _convert_include_custom_for_select($options, &$select_options)
{
if (_get_option($options, 'include_blank'))
{
$select_options[''] = '';
}
else if ($include_custom = _get_option($options, 'include_custom'))
{
$select_options[''] = $include_custom;
}
}
function form_text_value($key, $default)
{
if(isset($_REQUEST[$key]))
echo attribute_escape($_REQUEST[$key]);
else
echo $default;
}
function form_checkbox_checked($key, $default = true)
{
if(isset($_REQUEST[$key]))
echo 'checked="checked"';
else
echo ($default) ? 'checked="checked"' : '';
}
@@ -0,0 +1,73 @@
<?php
function import_process_tree($opml) {
import_process_item($opml);
}
function import_process_item($opml, $campaign = 0) {
$i = 0;
foreach($opml['OUTLINE'] as $key => $item)
{
?>
<li class="<?php echo $i % 2 ? 'even' : 'odd' ?>">
<?php
if(isset($item['OUTLINE']))
{
$campaign++;
?>
<?php echo input_hidden_tag('campaign['.$campaign.']', import_get_item_title($item)) ?>
<div class="check">
<a href="#">(un)check all</a>
</div>
<h4><?php echo import_get_item_title($item) ?></h4>
<ul>
<?php import_process_item($item, $campaign) ?>
</ul>
<?php
} else {
$url = urlencode(import_get_item_xmlurl($item));
if(!$campaign)
{
$campaign++;
echo input_hidden_tag('campaign['.$campaign.']', import_get_item_title($item));
}
if($url):
?>
<ul class="import_links">
<li><?php echo checkbox_tag('feed['.$campaign.']['.$url.']', 1, (isset($_REQUEST['add']) ? (isset($_REQUEST['feed']) ? _data_value($_REQUEST['feed'][$campaign], $url) : false) : true )) ?></li>
<li><a class="feed_rss" href="<?php echo import_get_item_xmlurl($item) ?>">RSS</a></li>
<?php if(import_get_item_htmlurl($item)): ?>
<li><a class="feed_link" href="<?php echo import_get_item_htmlurl($item) ?>">Website</a></li>
<?php endif ?>
</ul>
<h4><label for="feed_<?php echo $campaign ?>_<?php echo $url ?>"><?php echo import_get_item_title($item) ?></label></h4>
<?php
endif;
}
echo '</li>';
$i++;
}
}
function import_get_item_title($item)
{
return $item['ATTRIBUTES']['TEXT'];
}
function import_get_item_xmlurl($item)
{
return $item['ATTRIBUTES']['XMLURL'];
}
function import_get_item_htmlurl($item)
{
return $item['ATTRIBUTES']['HTMLURL'];
}
?>
@@ -0,0 +1,158 @@
<?php
// Taken from symfony-project.com. Some slightly modified
/**
* Constructs an html tag.
*
* @param $name string tag name
* @param $options array tag options
* @param $open boolean true to leave tag open
* @return string
*/
function tag($name, $options = array(), $open = false)
{
if (!$name)
{
return '';
}
return '<'.$name._tag_options($options).(($open) ? '>' : ' />');
}
function content_tag($name, $content = '', $options = array())
{
if (!$name)
{
return '';
}
return '<'.$name._tag_options($options).'>'.$content.'</'.$name.'>';
}
function cdata_section($content)
{
return "<![CDATA[$content]]>";
}
/**
* Escape carrier returns and single and double quotes for Javascript segments.
*/
function escape_javascript($javascript = '')
{
$javascript = preg_replace('/\r\n|\n|\r/', "\\n", $javascript);
$javascript = preg_replace('/(["\'])/', '\\\\\1', $javascript);
return $javascript;
}
/**
* Escapes an HTML string.
*
* @param string HTML string to escape
* @return string escaped string
*/
function escape_once($html)
{
return fix_double_escape(htmlspecialchars($html));
}
/**
* Fixes double escaped strings.
*
* @param string HTML string to fix
* @return string escaped string
*/
function fix_double_escape($escaped)
{
return preg_replace('/&amp;([a-z]+|(#\d+)|(#x[\da-f]+));/i', '&$1;', $escaped);
}
function _tag_options($options = array())
{
$options = _parse_attributes($options);
$html = '';
foreach ($options as $key => $value)
{
$html .= ' '.$key.'="'.escape_once($value).'"';
}
return $html;
}
function _parse_attributes($string)
{
return is_array($string) ? $string : WPOTools::stringToArray($string);
}
function _get_option(&$options, $name, $default = null)
{
if (array_key_exists($name, $options))
{
$value = $options[$name];
unset($options[$name]);
}
else
{
$value = $default;
}
return $value;
}
function _convert_options_to_javascript($html_options, $internal_uri = '')
{
// confirm
$confirm = isset($html_options['confirm']) ? $html_options['confirm'] : '';
unset($html_options['confirm']);
// popup
$popup = isset($html_options['popup']) ? $html_options['popup'] : '';
unset($html_options['popup']);
// post
$post = isset($html_options['post']) ? $html_options['post'] : '';
unset($html_options['post']);
$onclick = isset($html_options['onclick']) ? $html_options['onclick'] : '';
if ($popup && $post)
{}
else if ($confirm && $popup)
{
$html_options['onclick'] = $onclick.'if ('._confirm_javascript_function($confirm).') { '._popup_javascript_function($popup, $internal_uri).' };return false;';
}
else if ($confirm && $post)
{
$html_options['onclick'] = $onclick.'if ('._confirm_javascript_function($confirm).') { '._post_javascript_function().' };return false;';
}
else if ($confirm)
{
if ($onclick)
{
$html_options['onclick'] = 'if ('._confirm_javascript_function($confirm).') {'.$onclick.'}';
}
else
{
$html_options['onclick'] = 'return '._confirm_javascript_function($confirm).';';
}
}
else if ($post)
{
$html_options['onclick'] = $onclick._post_javascript_function().'return false;';
}
else if ($popup)
{
$html_options['onclick'] = $onclick._popup_javascript_function($popup, $internal_uri).'return false;';
}
return $html_options;
}
function _data_value($arr, $key, $default = false)
{
if($arr && isset($arr[$key]))
return escape_once($arr[$key]);
return escape_once($default);
}
+79
View File
@@ -0,0 +1,79 @@
<?php $this->adminHeader() ?>
<div class="wrap">
<h2><?php _e('Dashboard', 'wpomatic') ?></h2>
<div id="sidebar">
<div id="sidebar_logging">
<a href="<?php echo $this->helpurl ?>logging" class="help_link"><?php _e('Help', 'wpomatic') ?></a>
<h3>&rsaquo; <?php _e('Latest log entries', 'wpomatic') ?> <a href="<?php echo $this->adminurl ?>&amp;s=logs"><?php _e('(view all)', 'wpomatic')?></a></h3>
<?php if(!$logs): ?>
<p class="none"><?php echo _e('No actions to display', 'wpomatic') ?></p>
<?php else: ?>
<ul id="logs">
<?php foreach($logs as $log): ?>
<li><?php echo WPOTools::timezoneMysql('F j, g:i a', $log->created_on) . ' &mdash; <strong>' . attribute_escape($log->message) ?></strong></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<p id="log_status"><?php _e(sprintf('Logging is currently <strong>%s</strong>', __($logging ? 'enabled' : 'disabled')), 'wpomatic') ?> (<a title="<?php _e('We recommend keeping logging on only when experimenting with new feeds.', 'wpomatic') ?>" href="<?php echo $this->adminurl ?>&amp;s=options"><?php _e('change', 'wpomatic')?></a>).</p>
</div>
</div>
<div id="main">
<p><?php _e('Welcome to WP-o-Matic Dashboard! This is the place where you can quickly watch WP-o-Matic activity, and keep track of your top campaigns and feeds.', 'wpomatic') ?></p>
<h3>Next campaigns to process</h3>
<?php if(count($nextcampaigns) == 0): ?>
<p class="none"><?php _e('No campaigns to display', 'wpomatic') ?>
<?php else: ?>
<ol class="campaignlist">
<?php foreach($nextcampaigns as $campaign):
$cl = $this->getCampaignRemaining($campaign);
$cl = WPOTools::calcTime($cl, 0, 'd', false);
$timestr = '';
if($cl['days']) $timestr .= $cl['days'] . __('d', 'wpomatic') . ' ';
if($cl['hours']) $timestr .= $cl['hours'] . __('h', 'wpomatic') . ' ';
if($cl['minutes']) $timestr .= $cl['minutes'] . __('m', 'wpomatic') . ' ';
if($cl['seconds']) $timestr .= $cl['seconds'] . __('s', 'wpomatic');
?>
<li>
<span class="details"><?php echo ($timestr) ? $timestr : __('Next!', 'wpomatic') ?></span>
<a href="<?php echo $this->adminurl ?>&amp;s=list&amp;id=<?php echo $campaign->id ?>"><?php echo attribute_escape($campaign->title) ?></a></li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<h3>Latest processed campaigns</h3>
<?php if(count($lastcampaigns) == 0): ?>
<p class="none"><?php _e('No campaigns to display', 'wpomatic') ?>
<?php else: ?>
<ol class="campaignlist">
<?php foreach($lastcampaigns as $campaign): ?>
<li>
<span class="details"><?php echo WPOTools::timezoneMysql('F j, g:i a', $campaign->lastactive) ?></span>
<a href="<?php echo $this->adminurl ?>&amp;s=list&amp;id=<?php echo $campaign->id ?>"><?php echo attribute_escape($campaign->title) ?></a></li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<h3><?php echo _e('Your top campaigns', 'wpomatic') ?></h3>
<?php if(count($campaigns) == 0): ?>
<p class="none"><?php _e('No campaigns to display', 'wpomatic') ?></p>
<?php else: ?>
<ol class="campaignlist">
<?php foreach($campaigns as $campaign): ?>
<li>
<span class="details"><?php echo $campaign->count ?></span>
<a href="<?php echo $this->adminurl ?>&amp;s=list&amp;id=<?php echo $campaign->id ?>"><?php echo attribute_escape($campaign->title) ?></a></li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
</div>
</div>
<?php $this->adminFooter() ?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

+94
View File
@@ -0,0 +1,94 @@
<?php require_once(WPOTPL . '/helper/form.helper.php' ) ?>
<?php require_once(WPOTPL . '/helper/import.helper.php' ) ?>
<?php $this->adminHeader() ?>
<div class="wrap">
<h2><?php _e('Import', 'wpomatic') ?></h2>
<?php if(isset($import_error)): ?>
<div id="import-warning" class="error">
<?php if(isset($fromurl)): ?>
<p><?php _e("The supplied URL could not be parsed. Please check the URL or try uploading the file manually", 'wpomatic') ?></p>
<?php else: ?>
<p><?php _e("The supplied file could not be parsed. Make sure it's a valid XML OPML file and retry.", 'wpomatic') ?></p>
<?php endif ?>
</div>
<?php endif; ?>
<?php if(isset($add_error)): ?>
<div id="import-warning" class="error">
<p><?php echo $add_error ?></p>
</div>
<?php endif ?>
<?php if(isset($this->add_success)): ?>
<div id="import-warning" class="updated">
<p><?php echo $this->add_success ?></p>
</div>
<?php endif ?>
<?php if(isset($success) && !isset($this->add_success)): ?>
<?php if(isset($title)): ?>
<?php if($title == 'WPOMATIC'): ?>
<h3><?php _e('Importing from a WP-o-Matic installation', 'wpomatic') ?></h3>
<?php else: ?>
<h3><?php echo $title ?></h3>
<?php endif ?>
<?php endif ?>
<form action="" method="post">
<?php wp_nonce_field('import-campaign') ?>
<?php echo input_hidden_tag('add', 1) ?>
<ul id="importtree">
<?php import_process_tree($opml); ?>
</ul>
<div id="importoptions">
<h4>Import Options</h4>
<ul>
<li><?php echo radiobutton_tag('import_mode', 1, !_data_value($_REQUEST, 'import_mode') || _data_value($_REQUEST, 'import_mode') == 1, 'id=import_mode_1') ?>
<?php echo label_for('import_mode_1', 'Make a campaign per category') ?></li>
<?php if(count($campaigns)): ?>
<li>
<?php echo radiobutton_tag('import_mode', 2, _data_value($_REQUEST, 'import_mode') == 2, 'id=import_mode_2') ?>
<?php echo label_for('import_mode_2', 'Insert feeds into campaign:') ?>
<?php echo select_tag('import_custom_campaign', options_for_select($campaigns, _data_value($_REQUEST, 'import_custom_campaign'))) ?>
</li>
<?php endif ?>
<li>
<?php echo radiobutton_tag('import_mode', 3, _data_value($_REQUEST, 'import_mode') == 3, 'id=import_mode_3') ?>
<?php echo label_for('import_mode_3', 'Insert feeds in a new campaign called') ?>
<?php echo input_tag('import_new_campaign', attribute_escape(_data_value($_REQUEST, 'import_new_campaign'))) ?>
</li>
</ul>
</div>
<p class="submit"><?php echo submit_tag('Process') ?></p>
</form>
<?php else: ?>
<div id="import_desc">
<p><?php _e('WP-o-Matic enables you to import <strong>OPML</strong> files. The <a href="http://en.wikipedia.org/wiki/OPML">OPML</a> format provides an easy way to exchange lists of feeds.', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>import" class="help_link"><?php _e('Help', 'wpomatic') ?></a></p>
</div>
<form action="" class="import_submit" method="post" enctype="multipart/form-data">
<?php wp_nonce_field('import-campaign') ?>
<input type="file" class="input_text" name="importfile" />
<input type="submit" class="button submit" value="Upload &rarr;">
</form>
<form action="" class="import_submit" method="post" enctype="multipart/form-data">
<?php wp_nonce_field('import-campaign') ?>
<input type="text" class="input_text" value="<?php form_text_value('importurl', 'http://') ?>" name="importurl" id="importurl" />
<input type="submit" class="button submit" value="Upload &rarr;" />
</form>
<?php endif; ?>
</div>
<?php $this->adminFooter() ?>
+53
View File
@@ -0,0 +1,53 @@
<?php $this->adminHeader() ?>
<div class="wrap">
<h2>Campaigns</h2>
<?php if(isset($this->forcefetched)): ?>
<div id="fetched-warning" class="updated">
<p><?php printf(__("Campaign processed. %s posts fetched", 'wpomatic'), $this->forcefetched) ?></p>
</div>
<?php endif; ?>
<table class="widefat">
<thead>
<tr>
<th scope="col" style="text-align: center">ID</th>
<th scope="col"><?php _e('Title', 'wpomatic') ?></th>
<th style="text-align: center" scope="col"><?php _e('Active', 'wpomatic') ?></th>
<th style="text-align: center" scope="col"><?php _e('Total posts', 'wpomatic') ?></th>
<th scope="col"><?php _e('Last active', 'wpomatic') ?></th>
<th scope="col" colspan="4" style="text-align: center"><?php _e('Actions', 'wpomatic') ?></th>
</tr>
</thead>
<tbody id="the-list">
<?php if(!$campaigns): ?>
<tr>
<td colspan="5"><?php _e('No campaigns to display', 'wpomatic') ?></td>
</tr>
<?php else: ?>
<?php $class = ''; ?>
<?php foreach($campaigns as $campaign): ?>
<?php $class = ('alternate' == $class) ? '' : 'alternate'; ?>
<tr id='campaign-<?php echo $campaign->id ?>' class='<?php echo $class ?> <?php if($_REQUEST['id'] == $campaign->id) echo 'highlight'; ?>'>
<th scope="row" style="text-align: center"><?php echo $campaign->id ?></th>
<td><?php echo attribute_escape($campaign->title) ?></td>
<td style="text-align: center"><?php echo _e($campaign->active ? 'Yes' : 'No', 'wpomatic') ?></td>
<td style="text-align: center"><?php echo $campaign->count ?></td>
<td><?php echo $campaign->lastactive != '0000-00-00 00:00:00' ? WPOTools::timezoneMysql('F j, g:i a', $campaign->lastactive) : __('Never', 'wpomatic') ?></td>
<td><a href="<?php echo $this->adminurl ?>&amp;s=edit&amp;id=<?php echo $campaign->id ?>" class='edit'>Edit</a></td>
<td><?php echo "<a href='" . wp_nonce_url($this->adminurl . '&amp;s=forcefetch&amp;id=' . $campaign->id, 'forcefetch-campaign_' . $campaign->id) . "' class='edit' onclick=\"return confirm('". __('Are you sure you want to process all feeds from this campaign?', 'wpomatic') ."')\">" . __('Fetch', 'wpomatic') . "</a>"; ?></td>
<td><?php echo "<a href='" . wp_nonce_url($this->adminurl . '&amp;s=reset&amp;id=' . $campaign->id, 'reset-campaign_' . $campaign->id) . "' class='delete' onclick=\"return confirm('". __('Are you sure you want to reset this campaign? Resetting does not affect already created wp posts.', 'wpomatic') ."')\">" . __('Reset', 'wpomatic') . "</a>"; ?></td>
<td><?php echo "<a href='" . wp_nonce_url($this->adminurl . '&amp;s=delete&amp;id=' . $campaign->id, 'delete-campaign_' . $campaign->id) . "' class='delete' onclick=\"return confirm('" . __("You are about to delete the campaign '%s'. This action doesn't remove campaign generated wp posts.\n'OK' to delete, 'Cancel' to stop.") ."')\">" . __('Delete', 'wpomatic') . "</a>"; ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
<div id="ajax-response"></div>
</div>
<?php $this->adminFooter() ?>
+35
View File
@@ -0,0 +1,35 @@
<?php $this->adminHeader() ?>
<div class="wrap">
<h2><?php _e('Logs', 'wpomatic') ?></h2>
<div class="logs_bar">
<form action="">
<?php wp_nonce_field('clean-logs') ?>
<input type="hidden" name="page" value="wpomatic.php" />
<input type="hidden" name="s" value="logs" />
<input type="hidden" name="clean_logs" value="1" />
<p id="clean_logs" class="submit">
<input type="submit" value="Clean logs" />
</p>
</form>
<div id="logs_pages">
<?php echo $paging ? $paging . ' - ' : '' ?> Displaying <?php echo $total ?> log entries
</div>
</div>
<?php if($logs): ?>
<ul id="logs">
<?php foreach($logs as $log): ?>
<li><?php echo WPOTools::timezoneMysql('F j, g:i:s a', $log->created_on) ?> - <?php echo $log->message ?></li>
<?php endforeach ?>
</ul>
<?php else: ?>
<p><?php _e('No logs to show', 'wpomatic') ?>
<?php endif ?>
</div>
<?php $this->adminFooter() ?>
+67
View File
@@ -0,0 +1,67 @@
<?php require_once(WPOTPL . '/helper/form.helper.php' ) ?>
<?php $this->adminHeader() ?>
<div id="wpo-section-options" class="wrap">
<h2>Options</h2>
<?php if(isset($updated)): ?>
<div id="added-warning" class="updated"><p><?php _e('Options saved.', 'wpomatic') ?></p></div>
<?php endif ?>
<?php if(isset($not_writable)): ?>
<div class="error"><p><?php _e('Image cache path ' . WPODIR . get_option('wpo_cachepath') . ' is not writable!' ) ?></p></div>
<?php endif ?>
<form action="" method="post" accept-charset="utf-8">
<input type="hidden" name="update" value="1" />
<ul id="options">
<li id="options_cron">
<?php echo label_for('option_unixcron', __('Unix cron', 'wpomatic')) ?>
<?php echo checkbox_tag('option_unixcron', 1, get_option('wpo_unixcron')) ?>
<h3>Cron command:</h3>
<div id="cron_command" class="command"><?php echo $this->cron_command ?></div>
<h3>WebCron-ready URL:</h3>
<div id="cron_command" class="command"><?php echo $this->cron_url ?></div>
<p class="note"><?php _e('Cron is set up to handle fetching.', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>cron" class="help_link"><?php _e('More', 'wpomatic') ?></a></p>
</li>
<li>
<?php echo label_for('option_logging', __('Enable logging', 'wpomatic')) ?>
<?php echo checkbox_tag('option_logging', 1, get_option('wpo_log')) ?>
<p class="note"><?php _e('Enable database-driven logging of events.', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>logging" class="help_link"><?php _e('More', 'wpomatic') ?></a></p>
</li>
<li>
<?php echo label_for('option_logging_stdout', __('Enable logging stdout', 'wpomatic')) ?>
<?php echo checkbox_tag('option_logging_stdout', 1, get_option('wpo_log_stdout')) ?>
<p class="note"><?php _e('With this option enabled, WP-o-Matic will attempt to show you logs creation in real time when manual fetching is used.', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>logging" class="help_link"><?php _e('More', 'wpomatic') ?></a></p>
</li>
<li>
<?php echo label_for('option_caching', __('Cache images', 'wpomatic')) ?>
<?php echo checkbox_tag('option_caching', 1, get_option('wpo_cacheimages')) ?>
<p class="note"><?php _e('This option overrides all campaign-specific settings', 'wpomatic') ?> <a href="<?php echo $this->helpurl ?>image_caching" class="help_link"><?php _e('More', 'wpomatic') ?></a></p>
</li>
<li>
<?php echo label_for('option_cachepath', __('Image cache path')) ?>
<?php echo input_tag('option_cachepath', get_option('wpo_cachepath')) ?>
<p class="note"><?php printf(__('The path %s must exist, be writable by the server and accessible through browser.', 'wpomatic'), '<span id="cachepath">'. WPODIR . '<span id="cachepath_input">' . get_option('wpo_cachepath') . '</span></span>') ?></p>
</li>
</ul>
<p class="submit">
<?php echo submit_tag(__('Save', 'wpomatic')) ?>
</p>
</form>
</div>
<?php $this->adminFooter() ?>
+71
View File
@@ -0,0 +1,71 @@
<?php $this->adminHeader() ?>
<form action="<?php echo $this->adminurl ?>&amp;s=setup" method="post">
<input type="hidden" name="dosetup" value="1" id="dosetup" />
<div id="wpo-section-setup" class="wrap">
<h2><?php _e('Setup', 'wpomatic') ?></h2>
<p><?php _e('Please follow the next few steps to make sure WP-o-Matic works perfectly for you.', 'wpomatic') ?></p>
<ol id="setup_steps">
<li id="step_1" class="current">
<p><?php _e('First of all, make sure <a href="http://simplepie.org" target="_blank">SimplePie</a>, the feed parsing engine that empowers WP-o-Matic is compatible with your server setup.', 'wpomatic') ?></p>
<p><?php printf(__('To do so, please run <a href="%s" target="_blank">this test</a> and evaluate the results. Typically, <em>You have everything you need to run SimplePie properly! Congratulations!</em> is a result you\'d be happy with.', 'wpomatic'), $this->pluginpath . '/inc/simplepie/simplepie.tests.php') ?></p>
<p><?php _e('Even though WP-o-Matic is bundled with the latest SimplePie version at the time it was released, we encourage you to install the <a href="http://wordpress.org/extend/plugins/simplepie-core/">SimplePie Core Wordpress</a> plugin. It is automatically used in place of the bundled version, and it allows you to update SimplePie easily for all the plugins that use it.', 'wpomatic') ?></p>
</li>
<li id="step_2">
<p><?php _e('Timing is a key aspect of this type of feed aggregating software.', 'wpomatic') ?></p>
<p><?php printf(__('For WP-o-Matic to work properly, you have to make sure server time is accurate, and that the correct timezone is configured <a href="%s">here</a> (hint: <strong>Date and Time</strong> subsection)', 'wpomatic'), $this->optionsurl) ?></p>
<p><?php _e('Make sure the following settings are correct:', 'wpomatic') ?></p>
<div class="command">
<strong><?php _e('UTC time:', 'wpomatic') ?></strong> <?php echo gmdate('d F, Y H:i:s', current_time('timestamp', true)) ?> <br />
<strong><?php _e('Your time:', 'wpomatic') ?></strong> <?php echo gmdate('d F, Y H:i:s', current_time('timestamp')) ?>
</div>
<p><?php _e('Do not proceed unless time is configured properly.', 'wpomatic') ?></p>
</li>
<li id="step_3">
<p><?php _e('If you want to go automated, and let WP-o-Matic do the nasty job of pulling rss feeds and creating posts, you need to set up a <strong>cron job</strong>. For performance reasons, it\'s highly recommended that you do so, but you can also let WP-o-Matic handle it in browser requests.', 'wpomatic') ?></p>
<p><?php printf(__('Add this line to your crontab, or use your web panel of choice interface. %s', 'wpomatic'), ($nophp) ? __('<strong>Warning!</strong> WP-o-Matic has been unable to detect the location of the wget command. This means you\'ll have to check it exists from the command line or find it by your own. In the case it\'s not installed, you can alternative use the ftp command, or lynx -dump', 'wpomatic') : '') ?></p>
<div class="command"><?php echo $command ?></div>
<p><?php _e('If you decide not to enable cron, a pseudo-cron web-based approach takes place, which relies on web requests. Disadvantages? It can harm user experience (the page won\'t load for the visitor until feeds are parsed), and will only take place if someone visits your site, which is not good for sites that may not receive visits in days (intranet sites may be an example).', 'wpomatic') ?></p>
<p><?php _e('There\'s, however, an option in the middle. It\'s called <a href="http://webcron.org/index.php?&lang=en">WebCron</a>, a service that will request a webpage you specify at the time you specify, just like cron. Disadvantages? We don\'t know about its reliability. But if you can\'t run cron, this might be a great option for you. Set it up for every hour and point it to this URL: ', 'wpomatic') ?>
<div class="command"><?php echo $url ?></div>
<p><input type="checkbox" name="option_unixcron" checked="checked" id="option_unixcron" /> <label for="option_unixcron"><?php _e('I\'ll be using a cron job (for Unix-like cron or WebCron, uncheck if you want pseudo-cron functionality)', 'wpomatic') ?></label></p>
</li>
<?php if($safe_mode): ?>
<li id="step_4">
<p><?php _e('It appears that you\'re running Wordpress in a <strong>Safe Mode</strong> environment. If you\'re <strong>not going</strong> to use cron, or when you process feeds manually from your browser, you may experience problems with the execution time.', 'wpomatic') ?></p>
<p><?php _e('PHP sets a limit (that you hosting provider can tweak) for execution time of scripts, except when running from command line. WP-o-Matic tries to override it, but is unable to do so when safe_mode directive is enabled, like in this case.', 'wpomatic') ?></p>
<p><?php _e('The solution typically involves contacting your hosting support, or switching to a new host (d\'uh)', 'wpomatic') ?></p>
</li>
<?php endif ?>
<li id="step_<?php echo ($safe_mode) ? 5 : 4 ?>">
<p><?php _e('And you\'re done!', 'wpomatic') ?></p>
<p><?php _e('Remember that these settings can be edited from the Options tab in the future.') ?></p>
<p><strong><?php _e('Hit Submit to complete the installation.') ?></strong></p>
</li>
</ol>
<div id="setup_buttons" class="submit">
<input id="setup_button_submit" class="disabled" type="submit" value="<?php _e('Submit', 'wpomatic') ?>" disabled="disabled" />
<input id="setup_button_previous" class="disabled" type="button" name="next" value="Previous" disabled="disabled" />
<input id="setup_button_next" type="button" name="next" value="Next" /> <span id="current_indicator">1</span> / <?php echo ($safe_mode) ? 5 : 4 ?>
</div>
</div>
</form>
<?php $this->adminFooter() ?>
@@ -0,0 +1,5 @@
<?php if($works): ?>
<?php printf(__('The feed %s has been parsed successfully.', 'wpomatic'), $url) ?>
<?php else: ?>
<?php printf(__('The feed %s cannot be parsed. Simplepie said: %s', 'wpomatic'), $url, $works) ?>
<?php endif ?>
@@ -0,0 +1,14 @@
<?php $title = __('Campaign Rewrite option', 'wpomatic') ?>
<h2><?php _e('Campaign Rewrite option', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('The rewriting settings allow you to replace parts of the content with the text you specify.', 'wpomatic') ?></p>
<h3><?php _e('Basic rewriting', 'wpomatic') ?></h3>
<p><?php _e('To replace all occurrences the word <em>ass</em> with <em>butt</em>, simply type <em>ass</em> in the &quot;origin field&quot;, and <em>butt</em> in &quot;rewrite to&quot;', 'wpomatic') ?></p>
<h3><?php _e('Relinking', 'wpomatic') ?></h3>
<p><?php _e('If you want to find all occurrences of <em>google</em> and make them link to <a href="#">Google</a>, just type <em>google</em> in the &quot;origin field&quot; and http://google.com in the &quot;relink to&quot; field', 'wpomatic') ?></p>
<h3><?php _e('Regular expressions', 'wpomatic') ?></h3>
<p><?php _e('For advanced users, regular expressions are supported. Using this will allow you to make more powerful replacements. Take multiple word replacements for example. Instead of using many rewriting boxes to replace <em>ass</em> and <em>arse</em> with <em>butt</em>, you can use the <strong>|</strong> operator: (ass|arse).', 'wpomatic') ?></p>
@@ -0,0 +1,40 @@
<?php $title = __('Campaigns', 'wpomatic') ?>
<h2><?php _e('Campaigns', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('WP-o-Matic is designed to provide enough flexibility to administrators to manage dozens of XML feeds easily. It\'d naturally be tedious to handle dozens of them, with so many options and parameters, or to keep track of ad revenue easily.', 'wpomatic') ?></p>
<p><?php _e('That\'s why the campaign concept has been introduced since the 1.0 version. In short, a <strong>campaign</strong> is a group of feeds you define with a shared configuration.</p>', 'wpomatic')?>
<h3><?php _e('Creating a campaign', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('Creating a campaign is as easy as clicking <strong>Add campaign</strong>, filling a campaign name, at least one feed URL and one category. Some more advanced options are described in the related help entries.', 'wpomatic') ?></p>
<p><?php _e('', 'wpomatic') ?>
<h3><?php _e('Campaign feeds', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('WP-o-Matic feed parsing is handled by the marvelous SimplePie library. Currently it supports the <a href="http://simplepie.org/wiki/faq/what_versions_of_rss_or_atom_do_you_support">following specifications</a>:') ?></p>
<ul>
<li>RSS 0.90</li>
<li>RSS 0.91 (Netscape)</li>
<li>RSS 0.91 (Userland)</li>
<li>RSS 0.92</li>
<li>RSS 1.0</li>
<li>RSS 2.0</li>
<li>Atom 0.3</li>
<li>Atom 1.0</li>
</ul>
<h3><?php _e('Campaign categories', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('Each campaign has one or more assigned categories. When WP-o-Matic processes a campaign, and gets each post from the feeds, it will add it to all the categories you selected. ', 'wpomatic') ?>
<p><?php _e('The <strong>Quick add</strong> link will let you quickly add new categories without leaving the WP-o-Matic section. Keep in mind, however, that they are all normal Wordpress categories, like the ones you create from the Manage categories section.', 'wpomatic')?>
<h3><?php _e('Campaign rewriting', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><a href="<?php echo $PHP_SELF ?>?item=campaign_rewrite" class="link_main"><?php _e('Main article', 'wpomatic') ?></a></p>
<p><?php _e('WP-o-Matic makes it possible to create your own set of rules and filters to customize the content of a post. You can make it change, for example, all the occurrences of the word <em>freeway</em> for the word <em>highway</em>.', 'wpomatic') ?>
<h3><?php _e('Campaign options', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('Under the <strong>options</strong> tab, you\'ll be able to set different options to change the behavior of WP-o-Matic. You can alter each post by defining your own <a href="'. $PHP_SELF . '?item=campaign_templates">'. __('post templates', 'wpomatic') . '</a>, select how often feeds should be pulled or turn on/off <a href="'. $PHP_SELF . '?item=image_caching">'. __('image caching', 'wpomatic') . '</a>.', 'wpomatic') ?></p>
<p><?php _e('You can also customize the Wordpress-specific options of each post. For example, you can tell it to use the <a href="'. $PHP_SELF . '?item=feed_date">'. __('date', 'wpomatic') . '</a> from the feed instead or the date when the post is inserted into the database. If you want to test a feed for a few days, WP-o-Matic lets you make the posts Private, Draft, or just Plubic.', 'wpomatic') ?>
@@ -0,0 +1,13 @@
<?php $title = __('Feed Date option', 'wpomatic') ?>
<h2><?php _e('Feed Date option', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('By default, WP-o-Matic sets the date and time of the posts to that of the moment they\'re created. By using this option, however, you can alter that behavior.', 'wpomatic') ?></p>
<h3><?php _e('How it works', 'wpomatic') ?></h3>
<p><?php _e('To avoid incoherent dates due to lousy setup feeds, WP-o-Matic will use the feed date only if these conditions are met:', 'wpomatic') ?></p>
<ul>
<li>First, of course, if the option is enabled in the campaign settings</li>
<li>The feed item date is not is not too far in the past (specifically, as much time as the campaign frequency)</li>
<li>The feed item date is not in the future</li>
</ul>
@@ -0,0 +1,9 @@
<?php $title = __('Image Caching', 'wpomatic') ?>
<h2><?php _e('Image Caching', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('When image caching is on, a copy of every image found (only in <em>&lt;img&gt;</em> tags) is made under the specified directory, by default <em>WPOMATIC_ROOT</em>/cache.', 'wpomatic') ?></p>
<p><?php _e('It\'s important that you this featured is ON at all times. It will only reduce the load of the image owner\'s server, but also make your website faster for your visitors.', 'wpomatic')?>
<h3><?php _e('Caching all images', 'wpomatic') ?></h3>
<p><?php _e('If the caching option is enabled in the general Options section, then all campaign-specific options will be overridden. We encourage you to do so.', 'wpomatic') ?></p>
+5
View File
@@ -0,0 +1,5 @@
<?php $title = __('Importing', 'wpomatic') ?>
<h2><?php _e('Importing', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('Importing OPML files make it easy to make incredible campaigns in no time. An OPML is an XML format for outlines, commonly used to distribute lists of feeds.', 'wpomatic') ?></p>
+13
View File
@@ -0,0 +1,13 @@
<?php $title = __('Logging', 'wpomatic') ?>
<h2><?php _e('Logging', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('Logging is an essential tool for testing and debugging WP-o-Matic. It enabled administrators to know precisely when feeds are being fetched, what errors might arise, to act on them.</p><p>If you think something might be wrong with one of your campaigns, it\'s generally a wise idea to enable logging for a while.', 'wpomatic') ?></p>
<h3><?php _e('How to enable it', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('Go to <strong>Options</strong> and check the option <strong>Enable logging</strong>', 'wpomatic') ?></p>
<h3><?php _e('Dashboard logging', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('The latest log entries are displayed in the dashboard, if it\'s enabled.', 'wpomatic') ?></p>
@@ -0,0 +1,28 @@
<?php $title = __('Post Templates', 'wpomatic') ?>
<h2><?php _e('Post Templates', 'wpomatic') ?></h2>
<h3><?php _e('Basics', 'wpomatic') ?></h3>
<p><?php _e('WP-o-Matic takes the full text of each feed item it encounters, and then uses it as the post content. A post template, if used, allows you to alter that content, by adding extra information, such as text, images, campaign data, etc.', 'wpomatic') ?></p>
<h3><?php _e('Supported tags', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><?php _e('A tag is a piece of text that gets replaced dynamically when the post is created. Currently, these tags are supported:', 'wpomatic') ?></p>
<ul>
<li><strong>{content}</strong> <?php _e('The feed item content', 'wpomatic') ?></li>
<li><strong>{title}</strong> <?php _e('The feed item title', 'wpomatic') ?></li>
<li><strong>{permalink}</strong> <?php _e('The feed item permalink', 'wpomatic') ?></li>
<li><strong>{feedurl}</strong> <?php _e('The feed URL', 'wpomatic') ?></li>
<li><strong>{feedtitle}</strong> <?php _e('The feed title', 'wpomatic') ?></li>
<li><strong>{feedlogo}</strong> <?php _e('The feed logo image', 'wpomatic') ?></li>
<li><strong>{campaigntitle}</strong> <?php _e('This campaign title', 'wpomatic') ?></li>
<li><strong>{campaignid}</strong> <?php _e('This campaign id', 'wpomatic') ?></li>
<li><strong>{campaignslug}</strong> <?php _e('This campaign slug', 'wpomatic') ?></li>
</ul>
<h3><?php _e('Example', 'wpomatic') ?></h3>
<a href="#" class="link_top">&uarr; <?php _e('top', 'wpomatic') ?></a>
<p><a href="<?php echo $PHP_SELF ?>?item=post_templates_examples" class="link_main"><?php _e('Main article', 'wpomatic') ?></a></p>
<p><?php _e('If you want to add a link to the source at the bottom of every post, the post template would look like this:') ?></p>
<div class="code"><p>{content}<br />&lt;a href=&quot;{feedurl}&quot;&gt;Go to Source&lt;/a&gt;</p></div>
<p><?php _e('The <em>{content}</em> string gets replaced by the feed content, and then {feedurl} by the url, which makes it a working link.') ?></p>
@@ -0,0 +1,26 @@
<?php $title = __('Post Templates Examples', 'wpomatic') ?>
<h2><?php _e('Post Templates Examples', 'wpomatic') ?></h2>
<h3><?php _e('Linking to original source', 'wpomatic') ?></h3>
<p><?php _e('This example adds a link to the source after the content of each post.', 'wpomatic') ?></p>
<div class="code"><p>{content}<br />&lt;a href=&quot;{feedurl}&quot;&gt;Go to Source&lt;/a&gt;</p></div>
<h3><?php _e('Adding Google AdSense', 'wpomatic') ?></h3>
<p><?php _e('This example adds a Google Adsense ad after every post.', 'wpomatic') ?></p>
<div class="code"><p>{content}<br /> <?php echo htmlentities('<script type="text/javascript"><!--
google_ad_client = "pub-0752878588469406";
//Devthought Sidebar
google_ad_slot = "6547978492";
google_ad_width = 160;
google_ad_height = 600;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
') ?></p></div>
<h3><?php _e('Manipulating style', 'wpomatic') ?></h3>
<p><?php _e('If you want to manipulate the style of how WP-o-Matic posts are displayed, first add a tag that wraps the content.', 'wpomatic') ?></p>
<div class="code"><p>&lt;div class=&quot;wpomatic-post&quot;&gt;{content}&lt;/div&gt;</p></div>
<p><?php _e('And then add CSS for the wpomatic-post class:', 'wpomatic') ?></p>
<div class="code"><p>.wpomatic-post { color: red }</p></div>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+367
View File
@@ -0,0 +1,367 @@
<?php
class WPOTools {
function pick()
{
$argc = func_num_args();
for ($i = 0; $i < $argc; $i++) {
$arg = func_get_arg($i);
if (! is_null($arg)) {
return $arg;
}
}
return null;
}
function getOptions($args)
{
if (is_array($args))
$r = &$args;
else
parse_str($args, $r);
return $r;
}
function isAjax() {
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest');
}
function isUnix()
{
return in_array(php_uname('s'), array('Linux', 'FreeBSD', 'OpenBSD', 'Darwin', 'SunOS', 'AIX'));
}
// from Pear System::which, released under the PHP License
// http://www.php.net/license/3_0.txt
// slightly modified
function getBinaryPath($program, $append = '', $fallback = null)
{
$win = substr(PHP_OS, 0, 3) == 'WIN';
// enforce API
if (!is_string($program) || '' == $program) {
return $fallback;
}
// available since 4.3.0RC2
if (defined('PATH_SEPARATOR')) {
$path_delim = PATH_SEPARATOR;
} else {
$path_delim = $win ? ';' : ':';
}
// full path given
if (basename($program) != $program) {
$path_elements[] = dirname($program);
$program = basename($program);
} else {
// Honor safe mode
if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) {
$path = getenv('PATH');
if (!$path) {
$path = getenv('Path'); // some OSes are just stupid enough to do this
}
}
$path_elements = explode($path_delim, $path);
}
if ($win) {
$exe_suffixes = getenv('PATHEXT')
? explode($path_delim, getenv('PATHEXT'))
: array('.exe','.bat','.cmd','.com');
// allow passing a command.exe param
if (strpos($program, '.') !== false) {
array_unshift($exe_suffixes, '');
}
// is_executable() is not available on windows for PHP4
$pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file';
} else {
$exe_suffixes = array('');
$pear_is_executable = 'is_executable';
}
foreach ($exe_suffixes as $suff) {
foreach ($path_elements as $dir) {
$file = $dir . DIRECTORY_SEPARATOR . $program . $suff;
if (@$pear_is_executable($file)) {
return $file . $append;
}
}
}
return $fallback;
}
function getQueryArgs($args, $defaults = array())
{
$r = WPOTools::getOptions($args);
$ret = array_merge($defaults, $r);
if(isset($ret['page']) && $ret['page'] && isset($ret['perpage']) && $ret['perpage'])
{
$perpage = $ret['perpage'];
$page = ($ret['page'] == 0) ? 1 : $ret['page'];
$page--;
$start = $page * $perpage;
$end = $start + $perpage;
$ret['limit'] = "{$start}, {$end}";
}
if(isset($ret['where']) && $ret['where'])
$ret['where'] = ' AND ' . $ret['where'];
if(isset($ret['limit']) && $ret['limit'])
$ret['limit'] = 'LIMIT ' . $ret['limit'];
return $ret;
}
function insertQuery($table, $params)
{
$fields = array_keys($params);
return "INSERT INTO $table (".implode(', ',$fields).") VALUES ('".implode("','",$params)."')" ;
}
function updateQuery($table, $params, $where)
{
$bits = array();
foreach(array_keys($params) as $k )
$bits[] = "{$table}.{$k}='$params[$k]'";
return "UPDATE $table SET ".implode(', ',$bits)." WHERE $where";
}
function addOptions($options)
{
foreach($options as $option => $vars)
add_option($option, $vars[0], $vars[1], (isset($vars[2])) ? $vars[2] : null);
}
function addMissingOptions($options)
{
$opt = array();
foreach($options as $option => $vars)
if(! get_option($option)) $opt[$option] = $vars;
return count($opt) ? WPOTools::addOptions($opt) : true;
}
function deleteOptions($options)
{
foreach($options as $option)
delete_option($option);
}
function parseImages($text)
{
preg_match_all('/<img(.+?)src=\"(.+?)\"(.*?)>/', $text, $out);
return $out;
}
function stripText($text)
{
$text = strtolower($text);
// strip all non word chars
$text = preg_replace('/\W/', ' ', $text);
// replace all white space sections with a dash
$text = preg_replace('/\ +/', '-', $text);
// trim dashes
$text = preg_replace('/\-$/', '', $text);
$text = preg_replace('/^\-/', '', $text);
return $text;
}
// from somewhere in the internet.. too lazy to do it myself
// @todo add right copyright
function calcTime($t, $sT = 0, $sel = 'Y', $includenull = true) {
$sY = 31536000;
$sW = 604800;
$sD = 86400;
$sH = 3600;
$sM = 60;
if($sT) {
$t = ($sT - $t);
}
if($t <= 0) {
$t = 0;
}
$bs[1] = ('1'^'9'); /* Backspace */
$r = array('string' => '');
switch(strtolower($sel)) {
case 'y':
$y = ((int)($t / $sY));
$t = ($t - ($y * $sY));
$e = isset($bs[$y]) ? $bs[$y] : '';
if($y != 0 || ($y == 0 && $includenull)) $r['string'] .= "{$y} years{$e} ";
$r['years'] = $y;
case 'w':
$w = ((int)($t / $sW));
$t = ($t - ($w * $sW));
$e = isset($bs[$w]) ? $bs[$w] : '';
if($w != 0 || ($w == 0 && $includenull)) $r['string'] .= "{$w} weeks{$e} ";
$r['weeks'] = $w;
case 'd':
$d = ((int)($t / $sD));
$t = ($t - ($d * $sD));
$e = isset($bs[$d]) ? $bs[$d] : '';
if($d != 0 || ($d == 0 && $includenull)) $r['string'] .= "{$d} days{$e} ";
$r['days'] = $d;
case 'h':
$h = ((int)($t / $sH));
$t = ($t - ($h * $sH));
$e = isset($bs[$h]) ? $bs[$h] : '';
if($h != 0 || ($h == 0 && $includenull)) $r['string'] .= "{$h} hours{$e} ";
$r['hours'] = $h;
case 'm':
$m = ((int)($t / $sM));
$t = ($t - ($m * $sM));
$e = isset($bs[$m]) ? $bs[$m] : '';
if($m != 0 || ($m == 0 && $includenull)) $r['string'] .= "{$m} minutes{$e} ";
$r['minutes'] = $m;
case 's':
$s = $t;
$e = isset($bs[$s]) ? $bs[$s] : '';
if($s != 0 || ($s == 0 && $includenull)) $r['string'] .= "{$s} seconds{$e} ";
$r['seconds'] = $s;
break;
}
return $r;
}
function stringToArray($string)
{
preg_match_all('/
\s*(\w+) # key \\1
\s*=\s* # =
(\'|")? # values may be included in \' or " \\2
(.*?) # value \\3
(?(2) \\2) # matching \' or " if needed \\4
\s*(?:
(?=\w+\s*=) | \s*$ # followed by another key= or the end of the string
)
/x', $string, $matches, PREG_SET_ORDER);
$attributes = array();
foreach ($matches as $val)
{
$attributes[$val[1]] = WPOTools::literalize($val[3]);
}
return $attributes;
}
/**
* Finds the type of the passed value, returns the value as the new type.
*
* @param string
* @return mixed
*/
function literalize($value, $quoted = false)
{
// lowercase our value for comparison
$value = trim($value);
$lvalue = strtolower($value);
if (in_array($lvalue, array('null', '~', '')))
{
$value = null;
}
else if (in_array($lvalue, array('true', 'on', '+', 'yes')))
{
$value = true;
}
else if (in_array($lvalue, array('false', 'off', '-', 'no')))
{
$value = false;
}
else if (ctype_digit($value))
{
$value = (int) $value;
}
else if (is_numeric($value))
{
$value = (float) $value;
}
else
{
if ($quoted)
{
$value = '\''.str_replace('\'', '\\\'', $value).'\'';
}
}
return $value;
}
function tryThese()
{
$num = func_num_args();
for($i = 0; $i < $num; $i++)
{
if(func_get_arg($i))
return func_get_arg($i);
}
}
function every()
{
$num = func_num_args();
for($i = 0; $i < $num; $i++)
{
if(! func_get_arg($i))
return false;
}
return true;
}
function timezoneMysql($format, $time)
{
return mysql2date($format, get_date_from_gmt($time));
}
}
// thanks php.net
if ( !function_exists('file_put_contents') && !defined('FILE_APPEND') )
{
define('FILE_APPEND', 1);
function file_put_contents($n, $d, $flag = false)
{
$mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w';
$f = @fopen($n, $mode);
if ($f === false) {
return 0;
} else {
if (is_array($d)) $d = implode($d);
$bytes_written = fwrite($f, $d);
fclose($f);
return $bytes_written;
}
}
}
if(!function_exists('str_ireplace'))
{
function str_Ireplace($search, $replace, $subject)
{
if (is_array($search))
foreach ($search as $word) $words[] = "/".$word."/i";
else
$words = "/".$search."/i";
return preg_replace($words, $replace, $subject);
}
}
@@ -0,0 +1,122 @@
<?php
//
// Based on code found online at:
// http://php.net/manual/en/function.xml-parse-into-struct.php
//
// Author: Eric Pollmann
// Released into public domain September 2003
// http://eric.pollmann.net/work/public_domain/
// 2006-12-22, 2007-02-09: Patch for PHP 5 compatibility to fix handling
// of tags with no properties, thanks to Jan De Luyck and
// John McGuire (JDL + JM)
// 2007-02-10: Preserve parent tag name if unclosed tag is present (EP)
class XMLParser {
var $data; // Input XML data buffer
var $vals; // Struct created by xml_parse_into_struct
var $collapse_dups; // If there is only one tag of a given name,
// shall we store as scalar or array?
var $index_numeric; // Index tags by numeric position, not name.
// useful for ordered XML like CallXML.
// Read in XML on object creation.
// We can take raw XML data, a stream, a filename, or a url.
function XMLParser($data_source, $data_source_type='raw', $collapse_dups=0, $index_numeric=0) {
$this->collapse_dups = $collapse_dups;
$this->index_numeric = $index_numeric;
$this->data = '';
if ($data_source_type == 'raw')
$this->data = $data_source;
elseif ($data_source_type == 'stream') {
while (!feof($data_source))
$this->data .= fread($data_source, 1000);
// try filename, then if that fails...
} elseif (file_exists($data_source))
$this->data = implode('', file($data_source));
// try url
else {
$fp = fopen($data_source,'r');
while (!feof($fp))
$this->data .= fread($fp, 1000);
fclose($fp);
}
}
// Parse the XML file into a verbose, flat array struct.
// Then, coerce that into a simple nested array.
function getTree() {
$parser = xml_parser_create('ISO-8859-1');
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $this->data, $vals, $index);
xml_parser_free($parser);
$i = -1;
return $this->getchildren($vals, $i);
}
// internal function: build a node of the tree
function buildtag($thisvals, $vals, &$i, $type) {
// JDL + JM: PHP 5 requires initialization
$tag = array();
if (isset($thisvals['attributes']))
$tag['ATTRIBUTES'] = $thisvals['attributes'];
// complete tag, just return it for storage in array
if ($type === 'complete')
$tag['VALUE'] = $thisvals['value'];
// open tag, recurse
else
$tag = array_merge($tag, $this->getchildren($vals, $i));
return $tag;
}
// internal function: build an nested array representing children
function getchildren($vals, &$i) {
$children = array(); // Contains node data
// Node has CDATA before it's children
if ($i > -1 && isset($vals[$i]['value']))
$children['VALUE'] = $vals[$i]['value'];
// Loop through children, until hit close tag or run out of tags
while (++$i < count($vals)) {
$type = $vals[$i]['type'];
// 'cdata': Node has CDATA after one of it's children
// (Add to cdata found before in this case)
if ($type === 'cdata')
$children['VALUE'] .= $vals[$i]['value'];
// 'complete': At end of current branch
// 'open': Node has children, recurse
elseif ($type === 'complete' || $type === 'open') {
// EP: Preserve parent tag name
$name = $vals[$i]['tag'];
$tag = $this->buildtag($vals[$i], $vals, $i, $type);
if ($this->index_numeric) {
$tag['TAG'] = $name;
$children[] = $tag;
} else
$children[$name][] = $tag;
}
// 'close: End of node, return collected data
// Do not increment $i or nodes disappear!
elseif ($type === 'close')
break;
}
if ($this->collapse_dups)
foreach($children as $key => $value)
if (is_array($value) && (count($value) == 1))
$children[$key] = $value[0];
return $children;
}
}
+82
View File
@@ -0,0 +1,82 @@
=== WP-o-Matic ===
Contributors: Appletalk
Donate link: http://devthought.com/wp-o-matic-the-wordpress-rss-agreggator/#donate
Tags: autoblogging, feeds, rss, atom, aggregation, content, syndication, posts, post, writing, bot, admin
Requires at least: 2.2.1
Tested up to: 2.6
Stable tag: trunk
WP-o-Matic makes autoblogging a snap by automatically creating posts from the RSS/Atom feeds you choose, which are organized into campaigns.
== Description ==
WP-o-Matic makes autoblogging a snap by automatically creating posts from the RSS/Atom feeds you choose, which are organized into campaigns.
Supported features:
* Campaigs Feeds and all settings and options are now organized into campaigns for the perfect organization and comfort.
* Multiple feeds / categories: its possible to add as many feeds as you want, and add them to as many categories as you want. Its not obstrusive, so you can also write your own posts to any of those categories.
* Every form of XML syndication supported. This includes RSS 0.91 and RSS 1.0 formats, the popular RSS 2.0 format, and the emerging Atom.
* Feed autodiscovery, which lets you add feeds without even knowing the exact URL. (Thanks Simplepie!)
* Unix cron and Wordpress cron jobs For maximum performance, you can make the RSS fetching process be called by a Unix cron job, or simply let Wordpress handle it.
* Comfortable interface. The admin is powered by a state of the art ajaxy interface that lets you handle your feeds with ease. Updated!
* Images caching for extreme performance and hotlinking bypassing.
* Words Rewriting. Regular expressions supported.
* Words Relinking. Define custom links for words you specify.
* Post templating. Define a global header and footer for the posts, or even for a specific feed. Add ads
* Campaigns import/export using OPML files. Easily import hundreds of feeds into new or existing campaigns!
Upcoming features:
* Improved export (to include campaign options, with an extended OPML)
* Image thumbnailing
* Improved importing with drag and drop
* Advanced templates
* Advanced filters
== Installation ==
1. Extract wpomatic.zip in the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Follow the on-screen instructions.s
== Frequently Asked Questions ==
= WP-o-Matic is not fetching plugins automatically =
Make sure the cron is set up properly. Enable logging and check for 'Running cron' entries.
= I get an error 'Maximum execution time of 30 seconds exceeded' when fetching =
WP-o-Matic attempts to override the maximum execution time setting by its own. In some setups, however, this is not allowed, which causes WP-o-Matic to exit unexpectedly when fetching large feeds. You can try changing this setting via the .htaccess file or by contacting your hosting provider.
= How do I include a link back to the original article? =
Use the post template feature -located in campaign settings-.
For example: {content} <p><a href={permalink}>Link to the original site</a></p>
= Why isnt the full article showing? =
Because the feed you're using is only syndicating excerpts, not full content.
= Why does the cron task run every twenty minutes and not an hour ? =
This is a limitation that will soon go away. This, however, does not create extra overhead, and you feeds will be fetched in the timeframe you specify. We just make some extra unnecessary queries to the db.
= What's the benefit of campaigns ? =
Campaigns give you the ability to group feeds and select common options for them. So, if you ever decide to change a setting, all the feeds in that logical group will be affected.
The best way to organize your feeds is up to you.
== Screenshots ==
1. Dashboard
2. Campaigns list
3. Add campaign main tab
4. Add campaign feeds tab
5. Add campaign categories tab
6. Add campaign rewrite tab
7. Add campaign options tab
8. Campaign tools
9. Campaign import
File diff suppressed because it is too large Load Diff