Exemplo n.º 1
2
function displayTwextra($screen_name = '')
{
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $banner = banner('', 'banner');
    //(user, banner_class)
    $footer = $config_params['footer'];
    //
    $docroot = $config_params['docroot'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $show_maintenance_page = $config_params['show_maintenance_page'];
    $print_full_message_list = $config_params['print_full_message_list'];
    $search_len_max = $config_params['search_len_max'];
    $search_len_size = $config_params['search_len_size'];
    $search_count_offset = $config_params['search_count_offset'];
    if ($show_maintenance_page == 1) {
        maintenance_page();
    }
    $script_path = __FUNCTION__;
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        //
        $model->saveStat();
    }
    if (isset($_REQUEST['message_from'])) {
        $message_from = $_REQUEST['message_from'];
        //validate data..
    } else {
        $message_from = 0;
    }
    if (isset($_REQUEST['order'])) {
        $order = $_REQUEST['order'];
        //validate data..
    }
    if (isset($_REQUEST['toggle'])) {
        if ($_REQUEST['asc_desc'] == 'asc') {
            $asc_desc = 'desc';
        } else {
            $asc_desc = 'asc';
        }
    } else {
        $asc_desc = $_REQUEST['asc_desc'];
    }
    //if not set, define the default values
    if (empty($order)) {
        $order = 'created';
    }
    if (empty($asc_desc)) {
        $asc_desc = 'desc';
    }
    if (isset($_REQUEST['less'])) {
        $next = 'less';
    } else {
        $next = 'more';
    }
    $search = $_REQUEST['search'];
    $model = new TwextraModel();
    //
    //$message_id, $created, $view_count, $last_viewed, $prefix
    $length = 20;
    //number of messages to get
    $message_history = $model->get_twextra_search($screen_name, $message_from, $next, $order, $asc_desc, $length, $search);
    $msg_cnt = $message_history[0]['msg_cnt'];
    $msg_pages = ceil($msg_cnt / 20);
    $msg_current = ceil($message_from / 20) + 1;
    $msg_page_of_pages = "Page {$msg_current} of {$msg_pages}";
    $model = new TwextraModel();
    $user_info = $model->get_user_info($message_history[0]['message_id']);
    $display_remote_ip = trim($_SERVER['REMOTE_ADDR']);
    logger($script_path . "  display_remote_ip: ", $display_remote_ip);
    //don't count twitter bot access for correct view count..
    if ($_SERVER['REMOTE_ADDR'] == '128.242.241.134') {
        //$view_inc = false;
        return;
    }
    $screen_name = trim($user_info['screen_name']);
    //screen name of poster
    $name = trim($user_info['name']);
    $location = trim($user_info['location']);
    $description = trim($user_info['description']);
    $user_image_url = trim($user_info['user_image_url']);
    $message_totals = $model->get_message_totals();
    //round to nearest thousand:
    $message_totals = $message_totals - $message_totals % 1000;
    //$message_totals = $message_totals - $search_count_offset;
    $message_totals = number_format($message_totals);
    //format into human readable form
    if (isset($_SESSION['profile_image_url'])) {
        $message_created_by = "";
        //redundant, was used to concatenate profile_image_url
    }
    $message_created_by = " <span style='float:left'>&nbsp;&nbsp;Search results (Total: {$msg_cnt})</span>";
    $message_created_by .= "&nbsp;&nbsp;&nbsp;&nbsp;<span style='float:right'>\n\t\t<input type='text' name='search' size='{$search_len_size}' maxlength='{$search_len_max}' value='{$search}' id='search' ></input>\n\t\t<input class='button_del' type='submit' value='Search Twextra' name='submit'  />\n\t\t<input type='hidden' name='screen_name' value='{$screen_name}' />\n\t\t</span>";
    $message_created_by .= "<br style='clear:both; width:100%' />";
    //test
    $header = header_html($prefix);
    //
    //..........................................................
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    $message = '';
    $message .= $doctype;
    $message .= "<html {$html_attribute} >\n";
    $message .= $header;
    $message .= "<body>\n";
    $message .= "<div class='p5_wrapper'>\n";
    $message .= "<div class='p5_page'>\n";
    $message .= $banner;
    $message .= "<div class='p5_main'>\n";
    //p5_main
    $message .= "<div class='p5_main_inner'>\n";
    //p5_main_inner
    $message .= "<div class='p5_tweet'>";
    //p5_tweet
    $message .= "<h4>&nbsp;&nbsp;Search over {$message_totals} messages</h4>";
    $message .= "<form method='post' action='/searchTwextra.php'>";
    $message .= "<p style='text-align:center;font-weight:bold;' >{$message_created_by}</p>";
    $message .= "</form>";
    if ($msg_cnt > 0) {
        $message .= "<table class='p5_message_history' >";
        $message .= "\n\t<tr>\n\t<th class='p5_th'>ID</th>\n\t<th class='p5_th'><a href='{$hostname}/searchTwextra.php?order=prefix&message_from=0&more&asc_desc={$asc_desc}&toggle&screen_name={$screen_name}&search={$search}'>\n\tMessage</a></th>\n\t<th class='p5_th'><a href='{$hostname}/searchTwextra.php?order=created&message_from=0&more&asc_desc={$asc_desc}&toggle&screen_name={$screen_name}&search={$search}'>\n\tCreated</a></th>\n\t<th class='p5_th'><a href='{$hostname}/searchTwextra.php?order=last_viewed&message_from=0&more&asc_desc={$asc_desc}&toggle&screen_name={$screen_name}&search={$search}'>\n\tLast Viewed</a></th>\n\t<th class='p5_th'><a href='{$hostname}/searchTwextra.php?order=views&message_from=0&more&asc_desc={$asc_desc}&toggle&screen_name={$screen_name}&search={$search}'>\n\tViews</a></th>\n\t</tr>\n\t";
        $message_history_row = 'p5_message_history_row_odd';
        $message_from_more = $message_from + 20;
        $message_from_less = $message_from - 20;
        if ($message_from_less < 0) {
            $message_from_less = 0;
        }
        $more = "<a href='{$hostname}/searchTwextra.php?message_from={$message_from_more}&more&order={$order}&asc_desc={$asc_desc}&screen_name={$screen_name}&search={$search}'\n\t                    >Next ></a>";
        $less = "<a href='{$hostname}/searchTwextra.php?message_from={$message_from_less}&less&order={$order}&asc_desc={$asc_desc}&screen_name={$screen_name}&search={$search}'\n\t                   >&lt; Previous</a>";
        foreach ($message_history as $id => $message_entry) {
            if (!empty($message_entry['last_viewed'])) {
                //$message_last_viewed = date ( "Y-m-d", $message_entry ['last_viewed'] );
                $message_last_viewed = last_viewed($message_entry['last_viewed']);
            } else {
                $message_last_viewed = '';
            }
            $message_id = $message_entry['message_id'];
            $prefix_size_max = 130;
            $message_prefix = substr($message_entry['prefix'], 0, $prefix_size_max);
            if (strlen($message_prefix) == $prefix_size_max) {
                $message_prefix = $message_prefix . '...';
            }
            $message_id_link = "<a href='{$hostname}/{$message_id}' target='_blank' >{$message_id}</a>";
            $message .= "<tr class='{$message_history_row}' >\n\t\t                 <td class='p5_tc1' >" . $message_id_link . "</td>\n\t\t                 <td class='p5_tc2' >" . $message_prefix . "</td>\n\t\t                 <td class='p5_tc3' >" . $message_entry['created_date'] . "</td>\n\t\t                 <td class='p5_tc4' >" . $message_last_viewed . "</td>\n\t\t                 <td class='p5_tc5' >" . $message_entry['view_count'] . "</td>\n\t\t            </tr>";
            if ($message_history_row == 'p5_message_history_row_even') {
                $message_history_row = 'p5_message_history_row_odd';
            } else {
                $message_history_row = 'p5_message_history_row_even';
            }
        }
        if ($message_from == 0) {
            $less = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
        }
        if (count($message_history) != 20) {
            $more = '';
        }
        $message .= "</table>";
        //		$message .= "<div style='float:right;margin-top:10px;' >
        //		<input class='button' type='submit' value='Delete' name='submit' onclick='return _delete()' /></div>";
    } else {
        if ($search == '') {
            $message .= "";
        } else {
            $message .= "<div style='text-align:center;'>No messages found with the phrase: {$search} \n\t\t                   </div>";
        }
    }
    $message .= "<div style='margin-top:20px; font-weight:bold;'>";
    //marker a
    if ($msg_cnt > 0) {
        $message .= "<div  class='p5_pofp1' >{$less}&nbsp;&nbsp;{$more}</div>";
        $message .= "<div class='p5_pofp2' >{$msg_page_of_pages}</div>";
    }
    $message .= "<br style='clear:both;' />";
    $message .= "</div>";
    //marker a
    $message .= "</div>\n";
    //p5_tweet
    echo $message;
    $message = "";
    $message .= "<br style='clear:both;'>\n";
    $message .= "</div>\n";
    //p5_main_inner
    $message .= "<br style='clear:both;' />";
    $message .= "</div>\n";
    //p5_main
    $message .= $footer;
    $message .= "</div>\n";
    //page
    $message .= "</div>\n";
    //wrapper
    $message .= $godaddy_analytics;
    $message .= "</body>\n</html>\n";
    echo $message;
}
Exemplo n.º 2
0
function index($tweet = '', $error = '', $message_id = '')
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $show_maintenance_page = $config_params['show_maintenance_page'];
    $fb_app_id = $config_params['fb_app_id'];
    $search_count_offset = $config_params['search_count_offset'];
    if ($show_maintenance_page == 1) {
        maintenance_page();
    }
    if (isset($_REQUEST['screen_name_reply'])) {
        $screen_name_reply = $_REQUEST['screen_name_reply'];
    } else {
        $screen_name_reply = '';
    }
    if (isset($_REQUEST['message_id_reply'])) {
        $message_id_reply = $_REQUEST['message_id_reply'];
    } else {
        $message_id_reply = '';
    }
    logger($script_path . "  index page: ");
    logger($script_path . " cookie:", $_COOKIE);
    //---------------------------------------------------
    $model = new TwextraModel();
    $message_totals = $model->get_message_totals();
    //round to nearest thousand:
    $message_totals = $message_totals - $message_totals % 1000;
    //$message_totals = $message_totals - $search_count_offset;
    $message_totals = number_format($message_totals);
    //format into human readable form
    //---------------------------------------------------
    //get twitter credentials and store in session variables for use in banner
    if (isset($_COOKIE[$cookie_name])) {
        $controller = new TwextraController();
        $result_t = $controller->getTwCredentials($_COOKIE[$cookie_name]);
        //
        $screen_name = $result_t['screen_name'];
        logger($script_path . " result_t:", $result_t);
    }
    $script_path = __FUNCTION__;
    logger($script_path . "  session: ", $_SESSION);
    logger($script_path . "  request: ", $_REQUEST);
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        $model->saveStat();
    }
    //set error flag if a twitter error, or any other error
    if (isset($_REQUEST['error']) && $_REQUEST['error'] == 'twitter_error') {
        $error = "Twitter is returning an error right now. Please try again later. \n\t\tFollow <a href='http://twitter.com/twextradotcom' target='_blank' >@twextradotcom</a> for updates.";
    } else {
        if (isset($_REQUEST['error']) && $_REQUEST['error'] == 'ep4') {
            $error = $ep4;
        } else {
            if (isset($_REQUEST['error'])) {
                $error = urldecode($_REQUEST['error']);
            } else {
                if (isset($_REQUEST['signout'])) {
                    $error = "You are now signed out of Twextra, but you may still be signed in on Twitter.  " . $error;
                    $_SESSION['user'] = '';
                } else {
                    if (isset($_SESSION['error_size'])) {
                        $error = $_SESSION['error_size'];
                        unset($_SESSION['error_size']);
                    }
                }
            }
        }
    }
    if (isset($_SESSION['tweet'])) {
        $tweet = $_SESSION['tweet'];
        unset($_SESSION['tweet']);
    }
    if (!empty($screen_name)) {
        $twitter_checked = 'checked';
        $twextra_checked = '';
    } else {
        if (!empty($screen_name_reply)) {
            $twitter_checked = 'checked';
            $twextra_checked = '';
        } else {
            $twitter_checked = '';
            $twextra_checked = 'checked';
        }
    }
    if (!empty($message_id)) {
        $model = new TwextraModel();
        $result = $model->readTweet($message_id, false);
        //
        $tweet = $result['tweet'];
    } else {
        if ($screen_name_reply != '') {
            $tweet = '@' . $screen_name_reply . '&nbsp;';
        }
    }
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    $useragent = $_SERVER['HTTP_USER_AGENT'];
    $useragent = strtolower($useragent);
    $useragent = "  " . $useragent;
    //so that strpos works fine..
    //	$blackberry = preg_match ( "/blackberry/i", $useragent );
    //	$iphone = preg_match ( "/iphone/i", $useragent );
    $blackberry = strpos($useragent, "blackberry");
    $iphone = strpos($useragent, "iphone");
    $symbian = strpos($useragent, "symbian");
    $android = strpos($useragent, "android");
    $nokia = strpos($useragent, "nokia");
    $samsung = strpos($useragent, "samsung");
    $sony = strpos($useragent, "sony");
    $vodafone = strpos($useragent, "vodafone");
    $nintendo = strpos($useragent, "nintendo");
    $sprint = strpos($useragent, "sprint");
    $playstation = strpos($useragent, "playstation");
    $mot = strpos($useragent, "mot");
    $docomo = strpos($useragent, "docomo");
    $palm = strpos($useragent, "palm");
    $avantgo = strpos($useragent, "avantgo");
    if ($blackberry || $iphone || $symbian || $android || $nokia || $samsung || $sony || $vodafone || $nintendo || $sprint || $playstation || $mot || $docomo || $palm || $avantgo) {
        $editor = 'editorI';
        $_SESSION['useragent'] = 'device';
    } else {
        $editor = 'editor';
        $_SESSION['useragent'] = 'desktop';
    }
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    echo header_html();
    $body_top = "<body>\n<div class='wrapper'>\n<div class='page'>";
    echo $body_top;
    if (!empty($error)) {
        $screen_name = '';
        $twitter_checked = '';
        $twextra_checked = 'checked';
    }
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    logger("index/hostname:", $hostname);
    $message = '';
    ?>


<div class='p1main'>
<div class='p1main_inner'>
<div class='p1desc'>

<?php 
    //print any error messages here:
    if (!empty($error)) {
        ?>
<div class='p1main_form_label' id='p1main_form_label'
	style='border: solid 2px red; padding: 10px; background-color: pink; width: 744px; margin: 10px 0;'> 
	<?php 
        echo $error;
        ?>
	<a href='javascript: hide_message_status("p1main_form_label")'
	style='float: right; font-size: 0.8em;'>Close</a></div>
<?php 
    }
    ?>

<div style='float: left; width: 768px; padding-bottom: 10px;'>
<h4 class='p1main_form_label'>Type your message below:&nbsp;</h4>
<div style='font-size: 11px; float: left;'>(<a
	href=<?php 
    echo $hostname . '/howto.php';
    ?>
>Tips for Videos, Images, etc</a>)</div>

<br style='clear: both' />
</div>

<?php 
    $bookmarklet = "\n<div class='bookmarklet_outer' style='width: 300px;line-height: 150%;'>\n       <div>\n       <a class='bookmarklet_inner' href=\"javascript:(function(){_twextra_bookmarklet=document.createElement('SCRIPT');\n        _twextra_bookmarklet.type='text/javascript';_twextra_bookmarklet.src='http://twetest.com/scripts/twextra_bookmarklet.js?\n        x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_twextra_bookmarklet);})();\">\n        Twextra Bookmarklet</a>\n        </div>\n</div>";
    //echo $bookmarklet;
    ?>

<?php 
    //form and editor;
    ?>
<form method='post' action='/router.php' id='tweet_post'
	accept-charset="utf-8" class='p1form'><textarea class='ckeditor'
	id="<?php 
    echo $editor;
    ?>
" name="<?php 
    echo $editor;
    ?>
" rows="15"
	cols="100" style="width: 768px"><?php 
    echo $tweet;
    ?>
</textarea> <script type="text/javascript">
	CKEDITOR.replace( 'editor' );
</script> <input type='hidden' name='route' value='tweet_post'></input>
<input type='hidden' name='message_id_reply'
	value="<?php 
    echo $message_id_reply;
    ?>
"></input> <input type='hidden'
	name='message_id' value="<?php 
    echo $message_id;
    ?>
"></input>

<div class='p1form_buttons'><input type="submit" name="save" id="save"
	value="Post Message" class='button'></input></div><?php 
    //p1form_buttons;
    ?>

<?php 
    //show buttons:
    ?>
	
<div class='p1form_social_buttons'>
<div
	style='font-size: 18px; border-bottom: 1px solid black; margin-bottom: 10px;'>Post
message to:</div>

<div style='margin-top: 5px;'><input type="radio" name="social"
	value="twitter" <?php 
    echo $twitter_checked;
    ?>
	style="margin-left: 0px; float: left; margin-top: 5px; margin-right: 10px;"></input>
<img src="/images/twitter_100px.png" /></div>

<div style='margin-top: 5px; margin-bottom: 5px;'><input type="radio"
	name="social" value="linkedin"
	style="margin-left: 0px; float: left; margin-top: 7px; margin-right: 10px;"></input>
<img src="/images/linkedin_100px.png" /></div>

<div style='margin-top: 5px; margin-bottom: 5px;'><input type="radio"
	name="social" value="twextra" <?php 
    echo $twextra_checked;
    ?>
	style="margin-left: 0px; float: left; margin-top: 7px; margin-right: 10px;"></input>
<img src="/images/twextra_100px.png" /></div>

</div>
</form>

<br style='clear: both;' />

<?php 
    $message .= "<div class='p1_buttons' >";
    //tweet button
    $message .= "<div class='p1_twitter_button' style='float:right;' >";
    //p1_twitter_button
    $message .= '<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
		>Tweet</a><script type="text/javascript" 
		src="http://platform.twitter.com/widgets.js"></script>';
    $message .= "</div>";
    //p1_twitter_button
    //facebook like button
    $message .= "<div class='p1_facebook_button' style='float:right;' >";
    //p1_facebook_button
    $message .= "\n<fb:like href=\"http://twextra.com\" layout=\"button_count\" show_faces=\"false\" width=\"100px\"></fb:like>\n\n    <div id=\"fb-root\"></div>\n    <script>\n      window.fbAsyncInit = function() {\n        FB.init({appId: '{$fb_app_id}', status: true, cookie: true,  \n                 xfbml: true});\n      };\n      (function() {\n        var e = document.createElement('script');\n        e.type = 'text/javascript';\n        e.src = document.location.protocol +\n          '//connect.facebook.net/en_US/all.js';\n        e.async = true;\n        document.getElementById('fb-root').appendChild(e);\n      }());\n    </script>\n\t\t";
    $message .= "</div>";
    //p1_facebook_button
    //$message .= "<br style='clear:both;' />";
    $message .= "</div>";
    //p1_buttons
    $message .= "&nbsp;&nbsp;&nbsp;&nbsp;<h4 style='text-align:center'>Over {$message_totals} messages created</h4>";
    echo $message;
    ?>
	
</div>
</div>
</div>
<!-- p1main -->
<a
	style='margin: 20px auto 20px auto; display: block; text-align: center;'
	href='http://twitter.com/melaniejane88'> <img src='/images/twex.jpg'
	style='width: 600px; height: 100px' /></a>
<?php 
    echo $footer;
    ?>
</div>
</div>
<?php 
    echo $godaddy_analytics;
    ?>
</body>
</html>
<?php 
}
Exemplo n.º 3
0
 function displayTranslatedTweet($src_lang, $src_lang_value = '', $tgt_lang, $tgt_lang_value = '', $message_id)
 {
     //configuration parameters:
     $config_params = Config::getConfigParams();
     $css = $config_params['css'];
     $tweet_size_max_google = $config_params['tweet_size_max_google'];
     $hostname = $config_params['hostname'];
     $doctype = $config_params['doctype'];
     $html_attribute = $config_params['html_attribute'];
     //$header = $config_params['header'];//
     //$banner = $config_params['banner'];//
     $banner = banner('', 'banner');
     //(user, banner_class)
     $footer = $config_params['footer'];
     //
     $docroot = $config_params['docroot'];
     $godaddy_analytics = $config_params['godaddy_analytics'];
     $show_maintenance_page = $config_params['show_maintenance_page'];
     if ($show_maintenance_page == 1) {
         maintenance_page();
     }
     $url = $hostname . "tweet_display.php?message_id={$message_id}&#38;mthd=displayTweet";
     $url_rewrite = "{$hostname}/{$message_id}";
     $src_lang_value = $this->language_list[$src_lang];
     $tgt_lang_value = $this->language_list[$tgt_lang];
     //get src_tweet from model;
     $model = new TwextraModel();
     $result = $model->readTweet($message_id, false);
     $src_tweet = $result['tweet'];
     //embed @replies for all cases
     $pattern_to_embed = 'at_reply';
     $embed = new EmbedInLink($src_tweet, $pattern_to_embed);
     $src_tweet = $embed->embedPattern();
     //embed links for all cases (Twitter, LinkedIn, Twextra)
     $pattern_to_embed = 'link';
     $embed = new EmbedInLink($src_tweet, $pattern_to_embed);
     $src_tweet = $embed->embedPattern();
     $created = $result['created'];
     $controller = new TwextraController();
     $prefix = $controller->getPrefix($src_tweet, $message_id);
     $header = header_html($prefix);
     //
     //get tgt_tweet from google service
     //CHECK MAX SIZE, AND FREQUENCY OF TRANSLATIONS..
     if (trim($src_tweet) != '') {
         $tgt_tweet = $this->translate($src_lang, $tgt_lang, $src_tweet);
         $tweet_object = json_decode($tgt_tweet);
         if (isset($tweet_object->responseData->translatedText)) {
             $tgt_tweet = $tweet_object->responseData->translatedText;
         } else {
             $tgt_tweet = '';
         }
     } else {
         $tgt_tweet = '';
         $url = '';
     }
     header("Pragma: no-cache");
     header("cache-Control: no-cache, must-revalidate");
     // HTTP/1.1
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     // Date in the past
     $message = '';
     $message .= $doctype;
     $message .= "<html {$html_attribute} >\n";
     $message .= $header;
     $message .= "<body>";
     $message .= "<div class='p3_wrapper'>";
     $message .= "<div class='page'>";
     $message .= $banner;
     $message .= "<div class='p3main'>\n";
     $message .= "<div class='p3main_inner'>\n";
     $message .= "<div class='p3main_text'>\n";
     $message .= "<div class='p3tweet_header'>\n";
     $message .= "<div class='p3count'> Created: " . $created . " (Pacific Time)</div>\n";
     $message .= "<div style='float:left;'>\n";
     $message .= "<div class='p3tweet_url'>Message URL: </div>\n";
     $message .= "<div class='p3url_outer'><a href='{$url_rewrite}'>" . $url_rewrite . "</a></div>\n";
     $message .= "</div>\n";
     $message .= "<br style='clear:both;' />\n";
     $message .= "</div>\n";
     $message .= "<div>";
     $message .= "<div class='p3tweet_title'>Source language ({$src_lang_value}):</div>\n";
     $message .= "<div style='float:right; text-align:center;padding-bottom:5px;'><a href='{$hostname}' >\n        New</a> | <a href='{$hostname}/index.php?message_id={$message_id}'>Edit</a></div>";
     $message .= "<br style='clear:both;' />";
     $message .= "</div>";
     $message .= "<div class='p3tweet'>{$src_tweet}</div>";
     $message .= "<div class='p3tweet_title_tr'>Target language ({$tgt_lang_value}):</div>\n";
     $message .= "<div class='p3tweet'>{$tgt_tweet}</div>";
     $message .= "</div>\n";
     //main_text
     $message .= "<div class='p3main_form'>\n";
     $message .= "<div class='p3main_form_inner'>\n";
     $message .= "<form method='post' action='{$hostname}/router.php' name='tweet_translate' >\n";
     $message .= "<div class='p3main_trans'>\n";
     $message .= "Translate again: \n";
     $message .= "</div>\n";
     $message .= "<div class='p3_src_tgt_tran'>";
     $message .= "<div class='p3main_src' >Source Language: \n";
     $message .= "<select name='src_lang'>\n";
     $selected = '';
     foreach ($this->language_list as $key => $val) {
         if ($src_lang == $key) {
             $selected = "selected='selected'";
         }
         $option = "<option value='{$key}' {$selected} >{$val}</option>\n";
         $message .= $option;
         $selected = '';
     }
     $message .= "</select>\n";
     $message .= "</div>\n";
     $message .= "<div class='p3main_tgt' >Target Language: \n";
     $message .= "<select name='tgt_lang'>\n";
     foreach ($this->language_list as $key => $val) {
         $option = "<option value='{$key}'>{$val}</option>\n";
         $message .= $option;
     }
     $message .= "</select>\n";
     $message .= "<input type='hidden' name='route' value='tweet_translate' ></input>\n";
     $message .= "<input type='hidden' name='url' value='{$url}' ></input>\n";
     $message .= "<input type='hidden' name='message_id' value='{$message_id}' ></input>\n";
     $message .= "</div>\n";
     $message .= "<div class='p3sub'>\n";
     $message .= "<input class='button_translate' type='submit' name='submit' value='Translate' />\n";
     $message .= "</div>\n";
     //p3sub
     $message .= "<br style='clear:both;' />";
     $message .= "</div>";
     //p3_src_tgt_tran
     $message .= "</form>\n";
     $message .= "<br style='clear:both' />\n";
     $message .= "</div>\n";
     //p3main_form_inner
     $message .= "</div>\n";
     //p3main_form
     $message .= "</div>\n";
     //main_inner
     $message .= "</div>\n";
     //main
     $message .= $footer;
     $message .= "</div>\n";
     //page
     $message .= "</div>\n";
     //wrapper
     $message .= $godaddy_analytics;
     $message .= "</body></html>\n";
     echo $message;
 }