Let it be your will. I test this and report the results.
if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) { $itemURLForTwitter = $item->absoluteURL; if($params->get('tinyURL')) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL,'tinyurl.com/api-create.php?url='.$item->absoluteURL); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $itemURLForTwitter = curl_exec($ch); curl_close($ch); } $item->twitterURL = 'twitter.com/share?text=' . urlencode( $item->title . '|' ) . '&url=' . $itemURLForTwitter . '&via=' . urlencode( $params->get('twitterUsername')); }
if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) { $itemURLForTwitter = $item->absoluteURL; if($params->get('tinyURL')) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL,'tinyurl.com/api-create.php?url='.$item->absoluteURL); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $itemURLForTwitter = curl_exec($ch); curl_close($ch); } $item->twitterURL = 'twitter.com/share?text=' . urlencode( $item->title . '|' ) . '&url=' . $itemURLForTwitter . '&via=' . urlencode( $params->get('twitterUsername')); }