@ 2014-02-15T04:30:54Z <?php
include_once("config.php");
if($_POST)
{
$garray = array_filter($_POST["usergroups"]);
if (empty($garray)) {
die("No group selected");
}
//Post variables we received from user
$userGroupId = $_POST["usergroups"];
$userMessage = $_POST["message"];
if(strlen($userMessage)<1)
{
//message is empty
die('No message was entered!');
}
$link=$_POST['link'];
if($link=="http://"){
$link=null;
}
if($link){
$html=file_get_contents($link) or die("Link unreachable!");
libxml_use_internal_errors(true);
$doc = new DomDocument();
$doc->loadHTML($html);
$xpath = new DOMXPath($doc);
$query = '//*/meta[starts-with(@property, \'og:\')]';
$metas = $xpath->query($query);
foreach ($metas as $meta) {
$property = $meta->getAttribute('property');
$content = $meta->getAttribute('content');
$tags[$property] = $content;
}
$t2=get_meta_tags($link);
if(!$tags['og:title']){
if($t2['og:title']){
$tags['og:title']=$t2['og:title'];
}
if(!$tags['og:title']){
if (preg_match(
'/<title>(.+)<\/title>/',
$html,$matches)
&& isset($matches[1] ))
$title = $matches[1];
else
$title = $link;
$tags['og:title']=$title;
}
}
if($_POST['name']){
$tags['og:title']=$_POST['name'];
}
if(!$tags['og:image']){
$links = $xpath->query('//link[@rel="image_src"]');
foreach ($links as $link) {
$tags['og:image'] = $link->nodeValue;
}
if!($tags['og:image']){
if($t2['og:image']){
$tags['og:image']=$t2['og:image'];
}
}
}
if(!$tags['og:image']){
$tags['og:image']="http://placehold.it/250x250&text=%C2%A0";
}
if(!$tags['og:description']){
$tags['og:description=$t2['og:description'];
if(!$tags['og:description']){
$tags['og:description']=$t2['description'];
}
}
if($tags['description']){
$tags['description']=$link;
}
$linkarray=parse_url($link);
$msg_body = array(
"access_token" => $access_token,
"message" => $userMessage,
"link" => $link,
"picture" => $tags['og:image'],
"name" => $tags['og:title'],
"caption" => $linkarray['host'],
"description" => $tags['og:description']
);
} else {
$msg_body = array(
"access_token" => $access_token,
"message" => $userMessage
);
}
if ($fbuser) {
?>
<html><head><title>Post Status</title><link href="style.css" rel="stylesheet" type="text/css" /></head><body>
<div id="fbgroupform" class="groupform" align="center">
<h1>Your post was processed.</h1>
<p>
<?php
if(!is_array($userGroupId)){
echo "error occured!<br/>";
}
foreach($userGroupId as $userGroupId){
$fql_query = 'select name from group where gid ='.$userGroupId;
$na = $facebook->api(array( 'method' => 'fql.query', 'query' => $fql_query));
foreach($na as $name){
$name=$name['name'];
}
try {
$post_url = '/'.$userGroupId.'/feed';
$postResult = $facebook->api($post_url, 'post', $msg_body );
if($postResult){
echo 'Post success to <a href="//www.facebook.com/groups/'.$userGroupId.'" target="_blank">'.$name.'</a><br/>';
}
} catch (FacebookApiException $e) {
echo 'Error while posting to '.$name.': '. $e->getMessage()."<br/>";
}
}
?>
<br/><a class="button" href="<?=$homeurl?>">Back to Main Page</a><br/>
</p>
</div>
</body>
</html>
<?php
}else{
$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$homeurl,'scope'=>$fbPermissions));
header('Location: ' . $loginUrl);
}
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.25 0.010 0.060 18.76 5.4.24 0.003 0.083 18.96 5.4.23 0.007 0.063 19.02 5.4.22 0.007 0.053 18.83 5.4.21 0.007 0.053 18.79 5.4.20 0.010 0.077 18.79 5.4.19 0.020 0.043 18.83 5.4.18 0.007 0.053 18.84 5.4.17 0.013 0.050 18.93 5.4.16 0.007 0.060 18.98 5.4.15 0.013 0.050 18.89 5.4.14 0.010 0.047 16.58 5.4.13 0.010 0.053 16.48 5.4.12 0.013 0.060 16.38 5.4.11 0.010 0.053 16.50 5.4.10 0.003 0.070 16.56 5.4.9 0.003 0.050 16.38 5.4.8 0.003 0.053 16.49 5.4.7 0.007 0.050 16.45 5.4.6 0.007 0.063 16.48 5.4.5 0.007 0.050 16.39 5.4.4 0.017 0.043 16.43 5.4.3 0.007 0.047 16.39 5.4.2 0.013 0.043 16.52 5.4.1 0.000 0.060 16.39 5.4.0 0.007 0.050 15.82 5.3.28 0.013 0.067 14.47 5.3.27 0.000 0.057 14.62 5.3.26 0.007 0.057 14.62 5.3.25 0.010 0.063 14.47 5.3.24 0.010 0.050 14.63 5.3.23 0.010 0.053 14.48 5.3.22 0.017 0.043 14.60 5.3.21 0.007 0.057 14.68 5.3.20 0.003 0.053 14.60 5.3.19 0.007 0.050 14.60 5.3.18 0.010 0.053 14.60 5.3.17 0.000 0.057 14.58 5.3.16 0.007 0.047 14.60 5.3.15 0.010 0.077 14.61 5.3.14 0.010 0.057 14.58 5.3.13 0.000 0.063 14.44 5.3.12 0.010 0.050 14.59 5.3.11 0.010 0.060 14.59 5.3.10 0.010 0.060 14.07 5.3.9 0.010 0.057 14.08 5.3.8 0.010 0.060 14.08 5.3.7 0.007 0.057 14.05 5.3.6 0.007 0.070 14.06 5.3.5 0.013 0.060 13.93 5.3.4 0.000 0.053 13.81 5.3.3 0.010 0.047 13.87 5.3.2 0.007 0.050 13.73 5.3.1 0.000 0.053 13.82 5.3.0 0.003 0.053 13.57
preferences:dark mode live preview
136.36 ms | 1394 KiB | 7 Q