- 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'
- Mary Jezierski
- Offline
- New Member
Less
More
13 years 4 months ago #73537
by Mary Jezierski
Replied by Mary Jezierski on topic Tiny URL not working on 'Tweet this to your followers'
My bad... I had "Enable TinyURL integration for 'Tweet this' link" in the K2 parameters turned off. All is good now!
Thanks again!
Mary Jezierski said:
Hello devsmi,
Thanks for your help with registration on your site. I was able to get in and applied the fix.
The fix works great, but the url is not shortened. :-(
Re: the '+' symbol, I changed "urlencode" to "urldecode", which replaces the plus sign with a space.
Thanks again!
Mary Jezierski said:
Hello devsmi,
Thanks for your help with registration on your site. I was able to get in and applied the fix.
The fix works great, but the url is not shortened. :-(
Re: the '+' symbol, I changed "urlencode" to "urldecode", which replaces the plus sign with a space.
Please Log in or Create an account to join the conversation.
- devsmi
- Offline
- New Member
Less
More
- Posts: 7
13 years 4 months ago #73538
by devsmi
Replied by devsmi on topic Tiny URL not working on 'Tweet this to your followers'
Good Job Mary I didnt even think of that :)
Please Log in or Create an account to join the conversation.
- Fernando Nunes
- Offline
- New Member
Less
More
- Posts: 4
13 years 4 months ago #73539
by Fernando Nunes
Replied by Fernando Nunes on topic Tiny URL not working on 'Tweet this to your followers'
$item->twitterURL = 'twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
to
$item->twitterURL = 'twitter.com/share?text='. urlencode( $params->get('twitterUsername') ).'&url=' . $itemURLForTwitter;
to
$item->twitterURL = 'twitter.com/share?text='. urlencode( $params->get('twitterUsername') ).'&url=' . $itemURLForTwitter;
Please Log in or Create an account to join the conversation.
- Chris Valius
- Offline
- New Member
Less
More
- Posts: 5
13 years 4 months ago #73540
by Chris Valius
Replied by Chris Valius on topic Tiny URL not working on 'Tweet this to your followers'
This doesn't work.. and when I don't do anything I still get + signs in the description.
Fernando Nunes said:
$item->twitterURL = 'twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
to
$item->twitterURL = 'twitter.com/share?text='. urlencode( $params->get('twitterUsername') ).'&url=' . $itemURLForTwitter;
Fernando Nunes said:
$item->twitterURL = 'twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
to
$item->twitterURL = 'twitter.com/share?text='. urlencode( $params->get('twitterUsername') ).'&url=' . $itemURLForTwitter;
Please Log in or Create an account to join the conversation.
- Fernando Nunes
- Offline
- New Member
Less
More
- Posts: 4
13 years 4 months ago #73541
by Fernando Nunes
Replied by Fernando Nunes on topic Tiny URL not working on 'Tweet this to your followers'
go to: components\com_k2\views\item\view.html.php and view.raw.php
find: if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) { ...
and replace function 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/share?text='. urlencode( $params->get('twitterUsername') . ' '. $item->title ).'&url=' . $itemURLForTwitter; }
You can check whether your hosting supports you curl by phpinfoSorry for English ...
find: if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) { ...
and replace function 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/share?text='. urlencode( $params->get('twitterUsername') . ' '. $item->title ).'&url=' . $itemURLForTwitter; }
You can check whether your hosting supports you curl by phpinfoSorry for English ...
Please Log in or Create an account to join the conversation.
- Chris Valius
- Offline
- New Member
Less
More
- Posts: 5
13 years 4 months ago #73542
by Chris Valius
Replied by Chris Valius on topic Tiny URL not working on 'Tweet this to your followers'
This fixed it. Sorry it was at the bottom and did not notice.
Mary Jezierski said:
Hello devsmi,
Thanks for your help with registration on your site. I was able to get in and applied the fix.
The fix works great, but the url is not shortened. :-(
Re: the '+' symbol, I changed "urlencode" to "urldecode", which replaces the plus sign with a space.
Mary Jezierski said:
Hello devsmi,
Thanks for your help with registration on your site. I was able to get in and applied the fix.
The fix works great, but the url is not shortened. :-(
Re: the '+' symbol, I changed "urlencode" to "urldecode", which replaces the plus sign with a space.
Please Log in or Create an account to join the conversation.
- B_Dark
- Offline
- Premium Member
Less
More
- Posts: 126
13 years 3 months ago #73543
by B_Dark
Replied by B_Dark on topic Tiny URL not working on 'Tweet this to your followers'
all good but the don't link the name of your site tweeter account with "@" before the twitterUsername
Fernando Nunes said:
go to: components\com_k2\views\item\view.html.php and view.raw.php
find: if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) { ...
and replace function 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/share?text='. urlencode( $params->get('twitterUsername') . ' '. $item->title ).'&url=' . $itemURLForTwitter; }
You can check whether your hosting supports you curl by phpinfoSorry for English ...
Fernando Nunes said:
go to: components\com_k2\views\item\view.html.php and view.raw.php
find: if ($params->get('itemTwitterLink') && $params->get('twitterUsername')) { ...
and replace function 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/share?text='. urlencode( $params->get('twitterUsername') . ' '. $item->title ).'&url=' . $itemURLForTwitter; }
You can check whether your hosting supports you curl by phpinfoSorry for English ...
Please Log in or Create an account to join the conversation.
- B_Dark
- Offline
- Premium Member
Less
More
- Posts: 126
13 years 3 months ago #73544
by B_Dark
Replied by B_Dark on topic Tiny URL not working on 'Tweet this to your followers'
something like that "via @myusername" the only thing that post right now with this fix is is username and after the title and the link of twitter
Please Log in or Create an account to join the conversation.
- Fernando Nunes
- Offline
- New Member
Less
More
- Posts: 4
13 years 3 months ago #73545
by Fernando Nunes
Replied by Fernando Nunes on topic Tiny URL not working on 'Tweet this to your followers'
Twitter API
You can do a variety of ways ... just follow the API. It is somewhat customizable. How do you want?
You can do a variety of ways ... just follow the API. It is somewhat customizable. How do you want?
Please Log in or Create an account to join the conversation.
- B_Dark
- Offline
- Premium Member
Less
More
- Posts: 126
13 years 3 months ago #73546
by B_Dark
Replied by B_Dark on topic Tiny URL not working on 'Tweet this to your followers'
item title | twitter link via @username
Fernando Nunes said:
Twitter API
You can do a variety of ways ... just follow the API. It is somewhat customizable. How do you want?
Fernando Nunes said:
Twitter API
You can do a variety of ways ... just follow the API. It is somewhat customizable. How do you want?
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'