File "noindexpages.php"
Full path: /home5/hallettsvillepow/public_html/wp-content/themes/flexsqueeze151/includes/noindexpages.php
File
size: 0 KB (3.74 KB bytes)
MIME-type: text/x-php; charset=us-ascii
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php $d = 0; // search depth;
while (!file_exists(str_repeat('../', $d) . 'wp-config.php')) if (++$d > 99) exit;
$wp_config = str_repeat('../', $d) . 'wp-config.php';
require_once($wp_config);
$url_base = get_bloginfo('template_directory');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Noindex/Nofollow Posts and Pages</title>
<style>
body {font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:12px;}
h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}
h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}
input{margin-right:9px;}
</style>
<script type="text/javascript"> var Shadowbox = window.parent.Shadowbox; </script>
<script type="text/javascript">
function checkstr(mystr){
var outstr = ((mystr.charAt(mystr.length-1,1) == ",") ? mystr.substring(0,mystr.length-1) : mystr);
return outstr;
}
function getpostsandpages() {
var total="";
for(var i=0; i < document.postform.x.length; i++){
if(document.postform.x[i].checked) {
total += document.postform.x[i].value + ",";
}
}
finalvalue = checkstr(total);
parent.document.flexibilityoptions.flex_page_noindex.value = finalvalue;
Shadowbox.close();
}
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
if(!document.forms[FormName])
return;
var objCheckBoxes = document.forms[FormName].elements[FieldName];
if(!objCheckBoxes)
return;
var countCheckBoxes = objCheckBoxes.length;
if(!countCheckBoxes)
objCheckBoxes.checked = CheckValue;
else
// set the check value for all check boxes
for(var i = 0; i < countCheckBoxes; i++)
objCheckBoxes[i].checked = CheckValue;
}
function checkboxes() {
var setoptions = parent.document.flexibilityoptions.flex_page_noindex.value;
if (setoptions) {
var splitpages = setoptions.split(",");
var cbs = document.postform.elements["x"];
for(var i=0; i < splitpages.length; i++)
{
document.getElementById(splitpages[i]).checked = true;
}
}
}
</script>
</head>
<body style="background-color:#fff;margin:20px;" onload="checkboxes();">
<?php
$nonce=$_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce, 'fs_noindex') ) { echo 'You cannot access this page'; } else { ?>
<form name="postform">
<p>Choose the posts or pages you want to add the 'noindex/nofollow' robots meta tag to and click the 'Apply' button below. </p>
<input name="submit" type="submit" value="Apply" onclick="getpostsandpages();"/>
<p><input type="button" onclick="SetAllCheckBoxes('postform', 'x', true);" value="Check all">
<input type="button" onclick="SetAllCheckBoxes('postform', 'x', false);" value="Uncheck all">
</p>
<table width="100%" border="0" cellpadding="10">
<tr>
<td width="50%"><h2>Posts</h2></td>
<td width="50%"><h2>Pages</h2></td>
</tr>
<tr>
<td valign="top"><?php
global $post;
$myposts = get_posts('numberposts=1000');
foreach($myposts as $mypost) {
setup_postdata($mypost);
echo'<input type="checkbox" id="' . $mypost->ID . '" name="x" value="' . $mypost->ID . '" />' . $mypost->post_title . '<br />';
}
?></td>
<td valign="top"><?php
$mypages = get_pages();
foreach($mypages as $mypage) {
setup_postdata($mypage);
echo'<input type="checkbox" id="' . $mypage->ID . '" name="x" value="' . $mypage->ID . '" />' . $mypage->post_title . '<br />';
}
?></td>
</tr>
</table>
</form>
<?php } ?>
</body>
</html>