- Posts: 4
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Tiny URL not working on 'Tweet this to your followers'
Tiny URL not working on 'Tweet this to your followers'
- Fernando Nunes
-
- Offline
- New Member
Less
More
13 years 11 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')); }
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.
- B_Dark
-
- Offline
- Premium Member
Less
More
- Posts: 126
13 years 11 months ago #73548
by B_Dark
Replied by B_Dark on topic Tiny URL not working on 'Tweet this to your followers'
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')); }
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.
- yaksushi
-
- Offline
- Premium Member
Less
More
- Posts: 157
13 years 10 months ago #73549
by yaksushi
Replied by yaksushi on topic Tiny URL not working on 'Tweet this to your followers'
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);
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.
- Dan Wood
-
- Offline
- New Member
Less
More
- Posts: 11
13 years 10 months ago #73550
by Dan Wood
Replied by Dan Wood on topic Tiny URL not working on 'Tweet this to your followers'
Thanks!
Please Log in or Create an account to join the conversation.
- John
-
- Offline
- New Member
Less
More
- Posts: 5
13 years 10 months ago #73551
by John
Replied by John on topic Tiny URL not working on 'Tweet this to your followers'
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
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.
- Rishona Campbell
-
- Offline
- New Member
Less
More
- Posts: 9
13 years 10 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
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.
- Forum
- K2 Community Forum
- English K2 Community
- Tiny URL not working on 'Tweet this to your followers'