File: /home/httpd/html/barebackedtube.com/DEADS/wp-content/plugins/social-poster/mm_options.php
<?php
$blogmemes_cats = array( 56 => 'Africa', 19 => 'America',35 => 'Apple',49 => 'Arts',53 => 'Asia',1 => 'Blogs',50 => 'Books',33 => 'Business',30 => 'Cinema',10 => 'Culture',39 => 'Design',41 => 'Ecology',11 => 'Economy',26 => 'Education',25 => 'Employment',13 => 'Environment',18 => 'Europe',23 => 'Every Day Life',40 => 'Fashion',34 => 'Finance',24 => 'Food',7 => 'Fun',42 => 'Gadgets',6 => 'Games',8 => 'Hardware',27 => 'Health',9 => 'History',28 => 'Humanitarian',4 => 'Internet',3 => 'Links',37 => 'Linux/Unix',38 => 'Marketing',15 => 'Media',36 => 'Microsoft',43 => 'Mobile',32 => 'Music',54 => 'Oceanie',44 => 'Open source',22 => 'People',45 => 'Photo',16 => 'Politics',55 => 'Programming',12 => 'Science',46 => 'Security',21 => 'Society',5 => 'Software',47 => 'Space',14 => 'Sports',17 => 'Technology',31 => 'Television',29 => 'Travel',51 => 'UK',2 => 'Web', 20 => 'World');
$mister_code = array( 'com' => 'US', 'cn' => 'China', 'de' => 'Germany','fr' => 'France','es' => 'Spain','ru' => 'Russia');
$sphin_cat = array("2"=>" Google ","27"=>" Google SEO ","4"=>" Google AdWords ","3"=>" Google AdSense ","5"=>" Google Searching ","28"=>" Google Other ","6"=>" Yahoo ","7"=>" Yahoo SEO ","8"=>" Yahoo Paid Search ","9"=>" Yahoo Publisher Network ","29"=>" Yahoo Searching ","30"=>" Yahoo Other ","10"=>" Microsoft ","31"=>" Microsoft SEO ","11"=>" Microsoft adCenter ","32"=>" Microsoft Searching ","33"=>" Microsoft Other ","19"=>" Search Marketing ","38"=>" SEM ","20"=>" SEO ","22"=>" Paid Search ","21"=>" Link Building ","39"=>" SEM Industry ","40"=>" In House SEM ","41"=>" Other Search Marketing ","23"=>" Social Media ","34"=>" News Sites ","35"=>" Bookmarking ","36"=>" Networking ","53"=>" Blogging ","37"=>" Other Social Media ","48"=>" Online Marketing ","49"=>" Web Analytics ","50"=>" Contextual Ads ","51"=>" Affiliate Marketing ","52"=>" Display Advertising ","62"=>" Usability ","63"=>" Domaining ","61"=>" Other Online Marketing ","24"=>" Searching ","25"=>" Ask.com ","26"=>" AOL ","58"=>" Local & Maps ","59"=>" Mobile Search ","60"=>" Video Search ","44"=>" Tips & Tools ","45"=>" Other Searching ","46"=>" Other ","47"=>" Sphinn Zone ","54"=>" Jobs Wanted ","55"=>" Jobs Offered ","56"=>" Water Cooler ");
$plugim_cat=array("1"=> "Business","2"=> "Development","3"=> "Marketing","4"=> "Products","5" => "Search Engines");
$scoop_cat=array("1"=>" Search Engine News ","6"=>" Mobile Searching ","2"=>" Search Engine Marketing ","3"=>" Search Engine Optimization ","9"=>" Internet Marketing ","4"=>" Web Hosting ","5"=>" Domain Names ","8"=>" Social Media ","7"=>" Search Engine Conferences ","10"=>" Forum Discussions ","11"=>" Internet Searching ","12"=>" Tools and Hacks ","13"=>" Local Search ","14"=>" Online Directories ");
/** Creates default options and saves them to database. */
function mm_createDefaultOptions()
{
$options = array(
"mm_tags" => array("startMarker" => "Tags:", "separator" => ",", "max" => "10"),
'email_report' => true,"future_later" => "on","random" =>"on");
add_option(MM_GLOBAL_ID, $options);
return $options;
}
require_once (dirname(__FILE__) . '/spyc.php');
$spyc =& new Spyc;
$options = get_option(MM_GLOBAL_ID);
if (!$options) $options = mm_createDefaultOptions();
if ($_POST['update'])
{
$mm_opt = array();
if (is_array($_POST['service'])) {
foreach (array_keys($_POST['service']) as $id) {
$mm_opt[$_POST['service'][$id]][] = array(
'doPosting' => isset($_POST['enabled'][$id]) ? '1' : '0',
'username' => $_POST['username'][$id],
'password' => $_POST['password'][$id],
'extra' => $_POST['extra'][$id]
);
}
}
$mm_tags = array("startMarker" => $_POST['mm_tags_startMarker'],
"separator" => $_POST['mm_tags_separator'],
"max" => $_POST['mm_tags_max']);
$options['mm_tags'] = $mm_tags;
$options['email_report'] = isset($_POST['email_report']);
$options['num_sites'] = intval($_POST['num_sites']);
$options['random'] = isset($_POST['random']);
$options['convert_tags'] = isset($_POST['convert_tags']);
$options['use_preset'] = isset($_POST['use_preset']);
$options['show_preset'] = isset($_POST['show_preset']);
$options['preset_to_technorati'] = $options['show_preset'] ? isset($_POST['preset_to_technorati']) : false;
$options['preset_tags'] = array_map('trim', explode(',', $_POST['preset_tags']));
$options['future_later'] = isset($_POST['future_later']);
update_option(MM_GLOBAL_ID, $options);
$fh = fopen(MM_CONF_FILE,'w');
fwrite($fh, $spyc->dump($mm_opt));
fclose($fh);
echo '<div id="message" class="updated fade"><p><strong>Options saved.</strong><p></div>';
}
$mm_opt = array();
$mm_opt = $spyc->load(MM_CONF_FILE);
$mm_tags = $options['mm_tags'];
$email_report = $options['email_report'];
$random = $options['random'];
$convert_tags = $options['convert_tags'];
$num_sites = intval($options['num_sites']);
$use_preset = $options['use_preset'];
$show_preset = $options['show_preset'];
$future_later = $options['future_later'];
$preset_to_technorati = $options['preset_to_technorati'];
$preset_tags = is_array($options['preset_tags']) ? implode(', ', $options['preset_tags']) : '';
if (!is_writable(MM_CONF_FILE)) {
echo '<div class="error"><p><strong>The configuration file ' . MM_CONF_FILE . ' must be writable in order to save account settings.</strong></p></div>';
}
?>
<script type="text/javascript">
var $ = function(el) {
return document.getElementById(el);
};
var DynaForm = {
init: function() {
$('butt').onclick = DynaForm.addRow;
// $('check_all').onclick=DynaForm.checkAll;
<?php
if (count($mm_opt)) {
foreach ($mm_opt as $service => $accounts) {
foreach ($accounts as $account) {
echo sprintf("DynaForm.addRow(%d, '%s', '%s', '%s', '%s');",
$account['doPosting'], $service, $account['username'], $account['password'], $account['extra']);
}
}
}
?>
},
getServices: function(selected) {
var services = new Array('<?php echo implode("','", $asp_services); ?>');
var str = '';
for (var i = 0; i < services.length; i++) {
str += '<option' + ( selected == services[i] ? ' selected="selected"' : '' ) + ' value="' + services[i] + '">' + services[i] + '</option>';
}
return str;
},
handleSelect: function(id, def) {
var select = $('service' + id);
var service = select.options[select.selectedIndex].value;
var extra = $('extra' + id);
if (undefined == def) def = '';
if (service == 'scuttle') {
var tb = $('extra-input' + id);
extra.style.display = 'block';
if (!tb) {
extra.innerHTML = '<input type="textbox" name="extra[' + id + ']"'+ ' value="' + def + '" id="extra-input' + id + '">';
tb = $('extra-input' + id);
}
if (tb.value.length == 0) {
tb.value = 'http://scuttle.org';
}
}else if (service == 'scuttlePLUS') {
var tb = $('extra-input' + id);
extra.style.display = 'block';
if (!tb) {
extra.innerHTML = '<input type="textbox" name="extra[' + id + ']"' + ' value="' + def + '" id="extra-input' + id + '">';
tb = $('extra-input' + id);
}
if (tb.value.length == 0) {
tb.value = '';
}
} else if (service == 'blogmemes') {
var cats = {
<?php
$ccount = count($blogmemes_cats);
$i = 0;
foreach ($blogmemes_cats as $id => $cat) {
printf('%d: "%s"%s', $id, $cat, (++$i == $ccount) ? '' : ',');
}
?>
};
var str = '';
str = '<select name="extra[' + id + ']">';
for (var id in cats) {
str += '<option' + ( def == id ? ' selected="selected"' : '' ) + ' value="' + id + '">' + cats[id] + '</option>';
}
str += '</select>';
extra.style.display = 'block';
extra.innerHTML = str;
}else if (service == 'misterWong') {
var cats = {
<?php
$ccount = count($mister_code);
$i = 0;
foreach ($mister_code as $id => $cat) {
printf('%s: "%s"%s', $id, $cat, (++$i == $ccount) ? '' : ',');
}
?>
};
var str = '';
str = '<select name="extra[' + id + ']">';
for (var id in cats) {
str += '<option' + ( def == id ? ' selected="selected"' : '' ) + ' value="' + id + '">' + cats[id] + '</option>';
}
str += '</select>';
extra.style.display = 'block';
extra.innerHTML = str;
}else if (service == 'sphinn') {
var cats = {
<?php
$ccount = count($sphin_cat);
$i = 0;
foreach ($sphin_cat as $id => $cat) {
printf('%s: "%s"%s', $id, $cat, (++$i == $ccount) ? '' : ',');
}
?>
};
var str = '';
str = '<select name="extra[' + id + ']">';
for (var id in cats) {
str += '<option' + ( def == id ? ' selected="selected"' : '' ) + ' value="' + id + '">' + cats[id] + '</option>';
}
str += '</select>';
extra.style.display = 'block';
extra.innerHTML = str;
}else if (service == 'scoopIsedb') {
var cats = {
<?php
$ccount = count($scoop_cat);
$i = 0;
foreach ($scoop_cat as $id => $cat) {
printf('%s: "%s"%s', $id, $cat, (++$i == $ccount) ? '' : ',');
}
?>
};
var str = '';
str = '<select name="extra[' + id + ']">';
for (var id in cats) {
str += '<option' + ( def == id ? ' selected="selected"' : '' ) + ' value="' + id + '">' + cats[id] + '</option>';
}
str += '</select>';
extra.style.display = 'block';
extra.innerHTML = str;
}else if (service == 'plugim') {
var cats = {
<?php
$ccount = count($plugim_cat);
$i = 0;
foreach ($plugim_cat as $id => $cat) {
printf('%s: "%s"%s', $id, $cat, (++$i == $ccount) ? '' : ',');
}
?>
};
var str = '';
str = '<select name="extra[' + id + ']">';
for (var id in cats) {
str += '<option' + ( def == id ? ' selected="selected"' : '' ) + ' value="' + id + '">' + cats[id] + '</option>';
}
str += '</select>';
extra.style.display = 'block';
extra.innerHTML = str;
}else {
extra.innerHTML = '';
extra.style.display = 'none';
}
},
addRow: function(enabled, service, username, password, extra) {
var extra_td, row, id;
if (undefined == enabled) enabled = 1;
if (!service) service = '';
if (!username) username = '';
if (!password) password = '';
if (undefined == extra) extra = '';
do {
id = Math.ceil(Math.random() * 10000);
} while ($('row' + id));
row = $('accounts').insertRow($('accounts').rows.length);
row.id = 'row' + id;
row.insertCell(0).innerHTML = '<input type="checkbox" name="enabled[' + id + ']" id="enabled' + id + '" value="1"'
+ (enabled ? 'checked="checked"' : '') + '>';
row.insertCell(1).innerHTML = '<select onchange="DynaForm.handleSelect('
+ id + ')" id="service' + id + '" name="service['
+ id + ']">' + DynaForm.getServices(service) + '</select>';
row.insertCell(2).innerHTML = '<div id="extra' + id + '"></div>';
/*
row.insertCell(2).innerHTML = '<div id="extra' + id + '"><input type="textbox" name="extra[' + id + ']"'
+ ' value="' + extra + '" id="extra-input' + id + '">'
+ '</div>';
*/
row.insertCell(3).innerHTML = '<input type="text" name="username[' + id + ']" value="' + username + '">';
row.insertCell(4).innerHTML = '<input type="text" name="password[' + id + ']" value="' + password + '">';
row.insertCell(5).innerHTML = '<a href="javascript:void(0)" class="delete" onclick="DynaForm.deleteRow(\'' + row.id + '\')">Delete</a>';
DynaForm.handleSelect(id, extra);
return false;
},
deleteRow: function(id) {
var rows = $('accounts').getElementsByTagName('tr');
for (var i = 0; i < rows.length; i++) {
if (id == rows[i].id) {
$('accounts').deleteRow(rows[i].rowIndex);
break;
}
}
},
checkAll: function() {
var elems = document.getElementsByTagName('input');
if($('check_all').checked==true){
var chk=true;
}else{
var chk=false;
}
DynaForm.check_box_select(chk);
},
check_box_select: function(chk) {
var elems = document.getElementsByTagName('input');
for(i=0 ; i < elems.length ; i++){
if(elems[i].type=='checkbox'){
id_str=elems[i].id.toString();
if(id_str.substring(0,7)=="enabled"){
$(id_str).checked=chk;
}
}
}
}
};
window.onload = DynaForm.init;
</script>
<form method="post" action="">
<input type="hidden" name="update" value="1">
<div class="wrap">
<h2><?php echo MM_PLUGIN_NAME; ?></h2>
<fieldset class="options">
<legend>Manual Tag Options</legend>
<table class="optiontable">
<tr>
<th scope="row">Start Marker:</th>
<td><input type="text" name="mm_tags_startMarker" value="<?php echo $mm_tags['startMarker'] ?>"></td>
</tr>
<tr>
<th scope="row">Separator:</th>
<td><input name="mm_tags_separator" type="text" value="<?php echo $mm_tags['separator'] ?>" size="5"></td>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="checkbox" name="convert_tags" <?php if ($convert_tags) echo 'checked'; ?>>
Convert <code>[tags]..[/tags]</code> tags to Technorati tags</td>
</tr>
</table>
<hr align="center" width="60%" noshade>
</fieldset>
<fieldset class="options">
<legend>Pre-set Tag Options</legend>
<table class="optiontable">
<tr>
<th scope="row"> </th>
<td><input type="checkbox" id="use_preset" name="use_preset" <?php if ($use_preset) echo 'checked'; ?>>
<label>Randomly use these pre-set tags:<br />
<textarea name="preset_tags" rows="2" cols="80" onchange="document.getElementById('use_preset').checked=true"><?php echo $preset_tags ?></textarea>
</label></td>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="checkbox" name="show_preset" <?php if ($show_preset) echo 'checked'; ?>>
Show pre-set tags in post (
<input type="checkbox" name="preset_to_technorati" <?php if ($preset_to_technorati) echo 'checked'; ?>>
as technorati tags)</td>
</tr>
<tr>
<th scope="row"> </th>
<td>Number of tags to use:
<input name="mm_tags_max" type="text" value="<?php echo $mm_tags['max'] ?>" size="5"></td>
</tr>
</table>
<hr align="center" width="60%" noshade>
</fieldset>
<fieldset class="options">
<p>
<legend>Other Posting Options</legend>
</p>
<table class="optiontable">
<tr>
<th scope="row"> </th>
<td><input type="checkbox" name="random" <?php if ($random) echo 'checked'; ?>> <label>Only post to
<input type="text" size=3 name="num_sites" value="<?php echo $num_sites ?>"> random sites</label></td>
</tr>
<tr>
<th scope="row"> </th>
<td><input name="email_report" type="checkbox" <?php if ($email_report) echo 'checked'; ?>>
Email submission reports</td>
</tr>
<tr>
<th scope="row"> </th>
<td><input name="future_later" type="checkbox" <?php if ($future_later) echo 'checked'; ?>>
Bookmark Future Posts When Visible</td>
</tr>
</table>
<hr align="center" width="60%" noshade>
</fieldset>
<fieldset class="options">
<legend>Bookmarking Accounts</legend>
<h4><a href="javascript:void(0)" id="butt">Add New Account »</a></h4>
<table id="accounts" border="0" width="50%" cellpadding="3" cellspacing="3">
<tr>
<th scope="col" width="5%">Enabled<!--<input type="checkbox" name="check_all" id="check_all" />--></th>
<th scope="col">Service</th>
<th scope="col"> </th>
<th scope="col">Username</th>
<th scope="col">Password</th>
<th scope="col"> </th>
</tr>
</table>
</fieldset>
<p class="submit" style="float:left"><input type="button" name="select" value="Select All" onclick="DynaForm.check_box_select(true);" /> <input type="button" name="unselect" value="DeSelect All" onclick="DynaForm.check_box_select(false);" />
<input type="submit" name="submit" value="Update »" /></p>
</form>
</div>