if (!$access_token) { die($lang['No Token']); } $resp = $lang['posted']; $params = array("access_token" => $access_token); if (isset($_POST['Type'])) { $ptype = $_POST['Type']; } else { $ptype = "T"; } if (($ptype == "A" || $ptype == "I") && isset($_POST['proxy'])) { // If proxy option is selected by user $_POST['URL'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?proxyurl=' . encrypt($_POST['URL']); } $postlink = "http://www.facebook.com/"; $spintax = new Spintax(); if ($ptype == "I") { // It is an Image Post if ($_POST['URL'] == '') { die($failImg . " " . $lang['No image']); } $params["message"] = $spintax->process($_POST['Message']); $params["url"] = $_POST['URL']; $feed = '/v2.3/' . $_POST['pageid'] . '/' . "photos"; $postlink .= "photo.php?fbid="; } elseif ($ptype == "A") { // Album Post if (!isset($_POST['AlbumID'])) { if ($_POST['URL'] == '') { die($failImg . " " . $lang['No album']); }
<?php require "../core/init.php"; if (isset($_POST["groupID"]) && isset($_POST["postType"])) { $fb = new Facebook(); $spintax = new Spintax(); $params = array(); if (Input::Get("message")) { $message = $spintax->get(Input::Get("message")); // If is unique post enabled if (isset($user->Options()->uniquePost)) { if ($user->Options()->uniquePost == 1) { $uniqueID = strtoupper(uniqid()); // Generate unique ID $message .= "\n\n" . $uniqueID; } } $params[] = "message=" . urlencode($message); } if (Input::Get("postType") == "link") { $link = $spintax->get(Input::Get("link")); // If is unique post link enabled if (isset($user->Options()->uniqueLink)) { if ($user->Options()->uniqueLink == 1) { $uniqueID = strtoupper(uniqid()); // Generate unique ID if (strpos($link, '?') !== false) { $link = rtrim($link, "/") . "&post_" . $uniqueID . "=" . Input::get("groupID"); } else { $link = rtrim($link, "/") . "/?post_" . $uniqueID . "=" . Input::get("groupID"); }
<?php if (!defined('ABSPATH')) { exit('No direct script access allowed'); } if (!Session::Exists('scheduleInProcess')) { // Set a session to prevent multi proccess at once Session::Put('scheduleInProcess', true); // Get posts that have status 0 (not completed) and pause = 0 and date <= current date $scheduledposts = new scheduledposts(); $fb = new Facebook(); $posts = new Posts(); $spintax = new Spintax(); foreach ($scheduledposts->post() as $scheduled) { $user = new User($scheduled->userid); // Set user timezone if the user defined the timezone if (isset($user->Options()->timezone)) { if ($user->Options()->timezone) { date_default_timezone_set($user->Options()->timezone); } } // Check if the post date <= current datetime of the user // Get current time $currentDateTime = new DateTime(); $next_post_time = new DateTime($scheduled->next_post_time); if (strtotime($currentDateTime->format("Y-m-d H:i")) >= strtotime($next_post_time->format("Y-m-d H:i"))) { // get the post $post = $posts->GetPost($scheduled->post_id); // Post is ready if (count($post) == 0) { logs::Save($scheduled->id, lang('POST_NOT_FOUND'));