- Posts: 13
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'
- Lynn Heighton
-
Topic Author
- Offline
- New Member
I've created some pages on my site for latest news and job vacancies and have included the twitter social integration link for 'tweet this to your followers'
However, when I click this, it opens my link in Twitter but doesn't add a TINY URL.
I've checked in the K2 parameters and the option to show Tiny URL is checked.
If I uncheck this then the tweet shows the link, but it is too long.
Any ideas? Thanks in advance
Please Log in or Create an account to join the conversation.
- pembaris
-
- Offline
- New Member
- Posts: 7
Last time I was using this for JReview, and I signed up Bit.ly, then I added my Twitter accounts on bit.ly page. I don't know if this will solve your problem, but maybe worth a try.
ps: k2 are becoming so popular, they are having shortage of workers. They never answer these days.
Please Log in or Create an account to join the conversation.
- Ivan Descartes
-
- Offline
- New Member
- Posts: 10
if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) {
$itemURLForTwitter = ($params->get('tinyURL')) ? @file_get_contents('tinyurl.com/api-create.php?url='.$item->absoluteURL) : $item->absoluteURL;
$item->twitterURL = 'twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
}
With:
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/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
}
Please Log in or Create an account to join the conversation.
- Simon Olsen
-
- Offline
- Junior Member
- Posts: 34
Ivan Descartes said:In my case, this was because the file_get_contents function in PHP is disabled by my host. This is a common hosting restriction, for security. I fixed this by replacing it with CURL function instead. To make the fix, find components/com_k2/views/item/view_html.php and replace...
Please Log in or Create an account to join the conversation.
- Manolis Markatselas
-
- Offline
- New Member
- Posts: 10
Please Log in or Create an account to join the conversation.
- Raymond Ringston
-
- Offline
- Junior Member
- Posts: 32
Please Log in or Create an account to join the conversation.
- Omar Al-Ansari
-
- Offline
- New Member
- Posts: 14
Ivan Descartes said:In my case, this was because the file_get_contents function in PHP is disabled by my host. This is a common hosting restriction, for security. I fixed this by replacing it with CURL function instead. To make the fix, find components/com_k2/views/item/view_html.php and replace:
if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) {
$itemURLForTwitter = ($params->get('tinyURL')) ? @file_get_contents('tinyurl.com/api-create.php?url='.$item->absoluteURL) : $item->absoluteURL;
$item->twitterURL = 'twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
}
With:
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/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
}
Please Log in or Create an account to join the conversation.
- depika k.
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Matt Payne
-
- Offline
- New Member
- Posts: 11
Please Log in or Create an account to join the conversation.
- Simon Olsen
-
- Offline
- Junior Member
- Posts: 34
Please Log in or Create an account to join the conversation.
- NosyWeb
-
- Offline
- New Member
- Posts: 10
twitter.com/home/?status=Reading.........
in :
twitter.com/#!/?status=Reading......
and it's doesn't work.
Some ideas to fix this problem ?
Thanks.
Please Log in or Create an account to join the conversation.
- Jason See
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Rishona Campbell
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- Rishona Campbell
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- Rishona Campbell
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- dsa787
-
- Offline
- New Member
- Posts: 12
marco said:
Yah I noticed this today as well. The link goes to twitter but then doesn't populate the text or url in the little twitter box. Has something changed with Twitter?
Please Log in or Create an account to join the conversation.
- devsmi
-
- Offline
- New Member
- Posts: 7
Tiny URL not working on 'Tweet this to your followers'
in the blog. Good luck let me know if this works for you.
Please Log in or Create an account to join the conversation.
- Rishona Campbell
-
- Offline
- New Member
- Posts: 9
Thank you again though!devsmi said:
I have a fix for this. I am offering this to all but you must visit www.devsmi.com and register (quick easy and free) and once you login you will see "Tiny URL not working on 'Tweet this to your followers'
in the blog. Good luck let me know if this works for you.
Please Log in or Create an account to join the conversation.
- devsmi
-
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.
- Rishona Campbell
-
- Offline
- New Member
- Posts: 9
I had no problems when testing this myself. Could I see your site ?
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'