コード例 #1
0
ファイル: post.php プロジェクト: andersoonluan/PHP
<?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");
                }
コード例 #2
0
ファイル: scheduledposts.php プロジェクト: andersoonluan/PHP
 // Post param
 $postParam = json_decode($post->content);
 $postType = Posts::PostType($post->content);
 // Get list of groups
 $groups = json_decode($scheduled->targets, true);
 // Check if the current target is the last one
 if ($scheduled->next_target + 1 >= count($groups)) {
     // This was the last target
     DB::GetInstance()->update("scheduledposts", "id", $scheduled->id, array("status" => "1"));
 } else {
     // Update the scheduled
     $currentDateTime->modify("+" . $scheduled->post_interval . " minutes");
     // Set the next target
     DB::GetInstance()->update("scheduledposts", "id", $scheduled->id, array("next_target" => $scheduled->next_target + 1, "next_post_time" => $currentDateTime->format('Y-m-d H:i')));
 }
 $message = $spintax->get($postParam->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;
     }
 }
 if ($postParam->message != "") {
     $params[] = "message=" . urlencode($message);
 }
 if ($postType == "link") {
     $link = $spintax->get($postParam->link);
     // If is unique post enabled
     if (isset($user->Options()->uniqueLink)) {