Keyword

Tiny URL not working on 'Tweet this to your followers'

More
13 years 3 months ago #73547 by Fernando Nunes
Replied by Fernando Nunes on topic Tiny URL not working on 'Tweet this to your followers'
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'));        }

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #73548 by B_Dark
tnx!

Fernando Nunes said:
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'));        }

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #73549 by yaksushi
In K2, locate the file called view.html.php in components>com_k2>views>item

 

On line 220, change:

$item->twitterURL = 'twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
to:
$item->twitterURL = 'twitter.com/intent/tweet?text='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #73550 by Dan Wood
Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #73551 by John
Any answer to how to remove the + signs between the title? Nothing on your site Devsmi that I could see.

 

You'll see the problem if you click the twitter link from here: www.swaysearch.com/blog/item/7-finding-killer-keywords-for-successful-seo

 

Other than the additional + signs works great though.

 

Cheers

 

John

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #73552 by Rishona Campbell
Replied by Rishona Campbell on topic Tiny URL not working on 'Tweet this to your followers'
A solution to this was discussed earlier in the thread...Jonski said:
Any answer to how to remove the + signs between the title? Nothing on your site Devsmi that I could see.

 

You'll see the problem if you click the twitter link from here: www.swaysearch.com/blog/item/7-finding-killer-keywords-for-s...

 

Other than the additional + signs works great though.

 

Cheers

 

John

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum