function process_dreams() { foreach ($this->results as &$dream) { $dream->content = find_links($dream->content); $dream->content = find_at_user($dream->content); $dream->smart_timestamp = smart_timestamp($dream->created_at); $dream->iso_timestamp = date("c", $dream->created_at); $dream->full_timestamp = date("l, F j, Y \\a\\t g:ia", $dream->created_at); $dream->date_for = date("l", $dream->created_at); $dream->user_liked = $this->Comment_Model->user_liked($this->user->data->user_id, $dream->dream_id); //$dream->likes = $this->Comment_Model->get_likes($dream->dream_id); } }
function plugin_todo_link_show($data) { if ($links = find_links($data['content'])) { ?> <div class="todo_elink"> <?php foreach ($links as $link) { ?> <a href="<?php echo t($link); ?> " target="_blank"><?php echo t($link); ?> <i class="icon-external-link"></i></a> <?php } ?> </div> <?php } }
$tid = null; if (!isset($_GET['tid'])) { die("nope, sorry, no tweet specified"); } $tid = trim($_GET['tid']); require 'tmhOAuth/tmhOAuth.php'; require 'twitter_auth.php'; $tmhOAuth = new tmhOAuth($twitter_auth); $url = "/1.1/statuses/show.json"; $options = array('id' => $tid); // DO ! $code = $tmhOAuth->request('GET', $tmhOAuth->url($url), $options); $tweet = json_decode($tmhOAuth->response['response'], false); $title = htmlspecialchars(htmlspecialchars_decode($tweet->user->name . ": " . strip_tags($tweet->text))); $description = htmlspecialchars(htmlspecialchars_decode(strip_tags($tweet->text))); $description_html = find_hashtags(find_links($description)); $url = htmlspecialchars("https://twitter.com/" . $tweet->user->screen_name . "/statuses/" . $tweet->id_str); $image = strlen($tweet->entities->media[0]->media_url) > 0 ? htmlspecialchars($tweet->entities->media[0]->media_url) : null; $datetime = new DateTime($tweet->created_at); $datetime->setTimezone(new DateTimeZone('Europe/Brussels')); $created_at = $datetime->format(DATE_RFC822); $profile_url = $tweet->user->profile_image_url; ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><?php echo $title; ?> </title>
function process_comments() { foreach ($this->comments as &$comment) { $comment->content = find_links($comment->content); $comment->content = find_at_user($comment->content); $comment->smart_timestamp = smart_timestamp($comment->created_at); $comment->iso_timestamp = date("c", $comment->created_at); $comment->full_timestamp = date("l, F j, Y \\a\\t g:ia", $comment->created_at); } }