Example #1
0
function ViewText($tweets)
{
    $strList = "";
    foreach ($tweets as $tweet) {
        $items = $tweet->entities->urls;
        $medias = $tweet->entities->media;
        $one = true;
        //公式画像
        foreach ($medias as $media) {
            if ($media->media_url) {
                if ($one) {
                    $strList = $strList . viewTextList($tweet);
                    $one = false;
                }
                $strList = $strList . "<div id=\"user_image\"><a href=" . $media->media_url . ">" . "<img src= " . $media->media_url . "></a></div>";
            }
        }
        //twipic,instgramなど
        foreach ($items as $item) {
            if (isImageURL($item->expanded_url)) {
                if ($one) {
                    $strList = $strList . viewTextList($tweet);
                    $one = false;
                }
                $strList = $strList . "<div id=\"user_image\">" . getImageURL($item->expanded_url) . "</div>";
            }
        }
        if (!$one) {
            $strList = $strList . "</ul>";
        }
    }
    echo $strList;
}
Example #2
0
 public function display()
 {
     ///////////////////////////////////////////////////////////////////////////////////ADMIN////////////////////////////////////////////////////////////////////////////////
     //Enable or disable or delete a user
     if (isset($_POST['enableOrDisable'])) {
         $task = substr(POST('enableOrDisable'), 0, 3);
         // ena ou dis
         $idUser = substr(POST('enableOrDisable'), 3);
         // ex : 69
         if ($task == "del") {
             $this->model->deleteUser($idUser);
         } else {
             $this->model->enableOrDisableUser($task, $idUser);
         }
     } else {
         if (isset($_POST['userToFind'])) {
             $rep = $this->model->userToFindAndToDisplay(POST('userToFind'));
             echo $rep;
         } else {
             if (isset($_POST['imgToTest'])) {
                 echo isImageURL(POST('imgToTest'));
             } else {
                 if (isset($_POST['titreArticle']) && isset($_POST['themeArticle']) && isset($_POST['urlImgArticle']) && isset($_POST['contentArticle'])) {
                     $articleToAdd = array();
                     array_push($articleToAdd, POST('titreArticle'));
                     array_push($articleToAdd, POST('themeArticle'));
                     array_push($articleToAdd, POST('urlImgArticle'));
                     array_push($articleToAdd, POST('contentArticle'));
                     $this->model->addArticle($articleToAdd);
                 } else {
                     if (isset($_POST['linkImgFavorite']) && isset($_POST['idRSSFeed']) && isset($_POST['idCategory'])) {
                         if (POST('linkImgFavorite') === "http://aaron-aaron.alwaysdata.net/src/images/favorite_on.png") {
                             $value = "off";
                         } else {
                             $value = "on";
                         }
                         $this->model->changeFavoriteRSSFeed($value, POST('idRSSFeed'), POST('idCategory'));
                     } else {
                         if (isset($_POST['urlToFocus'])) {
                             $rep = $this->model->focusToThisRSSFeed(POST('urlToFocus'));
                             echo $rep;
                         } else {
                             if (isset($_POST['idRSSFeedToDeleteOfACategory']) && isset($_POST['idCategory'])) {
                                 $this->model->RSSFeedToDeleteOfACategory(POST('idRSSFeedToDeleteOfACategory'), POST('idCategory'));
                             } else {
                                 if (isset($_POST['nameFluxAdd']) && isset($_POST['nameCategorieToAdd']) && isset($_POST['urlFluxAdd'])) {
                                     $sValidator = 'http://feedvalidator.org/check.cgi?url=';
                                     if ($sValidationResponse = @file_get_contents($sValidator . urlencode(POST('urlFluxAdd')))) {
                                         if (stristr($sValidationResponse, 'This is a valid RSS feed') !== false) {
                                             $this->model->addRSSFeedCategoryUser(POST('nameFluxAdd'), POST('nameCategorieToAdd'), POST('urlFluxAdd'));
                                             return;
                                         } else {
                                             echo "false";
                                             return;
                                         }
                                     } else {
                                         echo "false";
                                         return;
                                     }
                                 } else {
                                     if (isset($_POST['nameCategorie']) && isset($_POST['colorCategorie'])) {
                                         $tab = array();
                                         array_push($tab, POST('nameCategorie'));
                                         array_push($tab, POST('colorCategorie'));
                                         $this->model->addCategory($tab);
                                     } else {
                                         if (isset($_POST['catToDelete'])) {
                                             $rep = $this->model->catToDelete(POST('catToDelete'));
                                         } else {
                                             if (isset($_POST['allCategories'])) {
                                                 $rep = $this->model->allCategories();
                                                 echo $rep;
                                             } else {
                                                 if (isset($_POST['idFriendFocus'])) {
                                                     $rep = $this->model->friendBlog(POST('idFriendFocus'));
                                                     echo $rep;
                                                 } else {
                                                     if (isset($_POST['idFriendDelete'])) {
                                                         $this->model->deleteOneFriend(POST('idFriendDelete'));
                                                     } else {
                                                         if (isset($_POST['userToAddInFriend'])) {
                                                             $this->model->userToAddInFriend(POST('userToAddInFriend'));
                                                         } else {
                                                             if (isset($_POST['loadMail'])) {
                                                                 $res = $this->model->loadMail(POST('loadMail'));
                                                                 echo $res;
                                                             } else {
                                                                 if (isset($_POST['emailName']) && isset($_POST['emailPassword']) && isset($_POST['emailServer']) && isset($_POST['emailPort'])) {
                                                                     $this->model->addMail(POST('emailName'), POST('emailPassword'), POST('emailServer'), POST('emailPort'));
                                                                 } else {
                                                                     if (isset($_POST['deleteMail'])) {
                                                                         $this->model->deleteMail(POST('deleteMail'));
                                                                     } else {
                                                                         if (isset($_POST['searchTwitter'])) {
                                                                             $this->model->searchTwitter(POST('searchTwitter'));
                                                                         } else {
                                                                             if (isset($_POST['loadTwitter'])) {
                                                                                 $res = $this->model->loadTwitter(POST('loadTwitter'));
                                                                                 echo $res;
                                                                             } else {
                                                                                 if (isset($_POST['deleteTwitter'])) {
                                                                                     $this->model->deleteTwitter(POST('deleteTwitter'));
                                                                                 } else {
                                                                                     if (isset($_POST['nameInformation']) && isset($_POST['emailInformation']) && isset($_POST['imgInformation'])) {
                                                                                         if (POST('nameInformation') !== "false") {
                                                                                             $this->model->changeName(POST('nameInformation'));
                                                                                         }
                                                                                         if (POST('emailInformation') !== "false") {
                                                                                             if (mail_check(POST('emailInformation'))) {
                                                                                                 $this->model->changeEmail(POST('emailOption'));
                                                                                             }
                                                                                         }
                                                                                         if (POST('imgInformation') !== "false") {
                                                                                             $this->model->changeImg(POST('imgInformation'));
                                                                                         }
                                                                                     } else {
                                                                                         if (isset($_POST['disconnectUser'])) {
                                                                                             session_destroy();
                                                                                             header('Location:http://aaron-aaron.alwaysdata.net');
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     ////////////////////////////////////////////////////////////////////////////////~OPTIONS/////////////////////////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////////////////////////~FOR A USER//////////////////////////////////////////////////////////////////////////////
 }