<?
$page = "ping.php";
include "manager_header.php";
if($owner_group_info[allow_pinging] != "1") { exit(); }
if(isset($_POST['task'])) { $task = $_POST['task']; } else { $task = "main"; }






if($task == "doping") {
$title = $_POST['title'];
$url = $_POST['url'];
$ping_weblogs_com = $_POST['ping_weblogs_com'];
$ping_blogs_gs = $_POST['ping_blogs_gs'];
$ping_technorati = $_POST['ping_technorati'];
$ping_ping_o_matic = $_POST['ping_ping_o_matic'];

if($ping_weblogs_com != "yes" AND $ping_blogs_gs != "yes" AND $ping_technorati != "yes" AND $ping_ping_o_matic != "yes") {
echo $head;
echo "
<h2>$ping1</h2>
$ping2
<br><br>
<form action='ping.php' method='POST'>
<input type='submit' class='button' value='$ping3'>
</form>
";
echo $foot;
exit();
}

echo $head;
echo "
<h2>$ping1</h2>
$ping4
<br><br>

<table cellpadding='0' cellspacing='0' class='pingslist'>
";

require('../include/weblog_pinger.php');

$failure_icon = "<img src='../images/ping_error.gif' border='0' style='vertical-align: middle;'>";
$success_icon = "<img src='../images/ping_success.gif' border='0' style='vertical-align: middle;'> ";
$num = 1;

if($ping_weblogs_com == "yes") {
echo "<tr><td class='pingslist$num'><b>Weblogs.com:</b></td><td class='pingslist$num'>";
$pinger = new Weblog_Pinger();
$response1 = $pinger->ping_weblogs_com($title, $url);
  if($response1 == "4") {
  echo "$success_icon $ping5";
  } elseif($response1 == "3") {
  echo "$failure_icon $ping6";
  } elseif($response1 == "2") {
  echo "$failure_icon $ping7";
  } elseif($response1 == "1") {
  echo "$failure_icon $ping8";
  }
echo "</td></tr>";
$num = 2;
}

if($ping_blogs_gs == "yes") {
echo "<tr><td class='pingslist$num'><b>Blogs.gs:</b></td><td class='pingslist$num'>";
$pinger = new Weblog_Pinger();
$response2 = $pinger->ping_blo_gs($title, $url);
  if($response2 == "4") {
  echo "$success_icon $ping5";
  } elseif($response2 == "3") {
  echo "$failure_icon $ping6";
  } elseif($response2 == "2") {
  echo "$failure_icon $ping7";
  } elseif($response2 == "1") {
  echo "$failure_icon $ping8";
  }
echo "</td></tr>";
$num = 2;
}

if($ping_technorati == "yes") {
echo "<tr><td class='pingslist$num'><b>Technorati:</b></td><td class='pingslist$num'>";
$pinger = new Weblog_Pinger();
$response3 = $pinger->ping_technorati($title, $url);
  if($response3 == "4") {
  echo "$success_icon $ping5";
  } elseif($response3 == "3") {
  echo "$failure_icon $ping6";
  } elseif($response3 == "2") {
  echo "$failure_icon $ping7";
  } elseif($response3 == "1") {
  echo "$failure_icon $ping8";
  }
echo "</td></tr>";
$num = 2;
}

if($ping_ping_o_matic == "yes") {
echo "<tr><td class='pingslist$num'><b>Ping-O-Matic:</b></td><td class='pingslist$num'>";
$pinger = new Weblog_Pinger();
$response4 = $pinger->ping_ping_o_matic($title, $url);
  if($response4 == "4") {
  echo "$success_icon $ping5";
  } elseif($response4 == "3") {
  echo "$failure_icon $ping6";
  } elseif($response4 == "2") {
  echo "$failure_icon $ping7";
  } elseif($response4 == "1") {
  echo "$failure_icon $ping8";
  }
echo "</td></tr>";
$num = 2; 
}

echo "
</table>

<br>
<form action='ping.php' method='POST'>
<input type='submit' class='button' value='$ping3'>
</form>
";

echo $foot;
exit();
}







if($task == "main") {

$weblog_url = url("index", "$weblog_info[weblog]");

echo $head;
echo "
<h2>$ping9</h2>
$ping10
<br><br>

<table cellpadding='3' cellspacing='0'>
<form action='ping.php' method='POST'>
<tr>
<td align='right'>$ping11</td>
<td><input type='text' size='40' name='title' class='text' maxlength='100' value='$weblog_info[title]'></td>
</tr>
<tr>
<td align='right'>$ping12</td>
<td><input type='text' size='60' name='url' class='text' maxlength='255' value='$weblog_url'></td>
</tr>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td align='right'><input type='checkbox' name='ping_weblogs_com' value='yes' CHECKED></td>
<td>Ping <a href='http://www.weblogs.com' target='_blank'>Weblogs.com</a></td>
</tr>
<tr>
<td align='right'><input type='checkbox' name='ping_blogs_gs' value='yes' CHECKED></td>
<td>Ping <a href='http://www.blo.gs' target='_blank'>Blo.gs</a></td>
</tr>
<tr>
<td align='right'><input type='checkbox' name='ping_technorati' value='yes' CHECKED></td>
<td>Ping <a href='http://www.technorati.com' target='_blank'>Technorati</a></td>
</tr>
<tr>
<td align='right'><input type='checkbox' name='ping_ping_o_matic' value='yes' CHECKED></td>
<td>Ping <a href='http://www.pingomatic.com' target='_blank'>Ping-O-Matic</a></td>
</tr>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td>&nbsp;</td>
<td><input type='submit' class='button' value='$ping13'></td>
</tr>
<input type='hidden' name='task' value='doping'>
</form>
</table>

";
echo $foot;
exit();
}




?>