application/modules/g/views/helpers/Social.php
public function tweetUrl($msg, $shortenUrls = false) {
        $url = 'http://twitter.com/?status=';
        if ($shortenUrls) {
            $msg = preg_replace_callback(
                '~https?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?~i',
                function ($matches) {
                    $_this = new G_View_Helper_Social();
                    return $_this->tinyUrl($matches[0]);
                },
                $msg
            );
        }
        $url .= urlencode($msg);
        return $url;
    }
public function tweetUrl($msg, $shortenUrls = false) {
        $url = 'http://twitter.com/?status=';
        if ($shortenUrls) {
            $msg = preg_replace_callback(
                '~https?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?~i',
                function ($matches) {
                    $_this = new G_View_Helper_Social();
                    return $_this->tinyUrl($matches[0]);
                },
                $msg
            );
        }
        $url .= urlencode($msg);
        return $url;
    }
public function tweetUrl ( $ msg , $ shortenUrls = false ) { $ url = 'http://twitter.com/?status=' ; if ( $ shortenUrls ) { $ msg = preg_replace_callback ( '~https?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?~i' , function ( $ matches ) { $ _this = new G_View_Helper_Social ( ) ; return $ _this -> tinyUrl ( $ matches [ 0 ] ) ; } , $ msg ) ; } $ url .= urlencode ( $ msg ) ; return $ url ; }
Generate a "Tweet this!" URL.
Note that the status is automatically cut off at 140 characters.

@param string $msg The tweet
@param bool $shortenUrls Wether to shorten the URLs
@return string
Generate a Tweet this! URL . Note that the status is automatically cut off at 140 characters .