Keyword

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

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.

 

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

More
13 years 4 months ago #73538 by devsmi
Good Job Mary I didnt even think of that :)

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

More
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;

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

More
13 years 4 months ago #73540 by Chris Valius
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;

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

More
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 ...

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

More
13 years 4 months ago #73542 by Chris Valius
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.

 

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

More
13 years 3 months ago #73543 by B_Dark
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 ...

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

More
13 years 3 months ago #73544 by B_Dark
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.

More
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?

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

More
13 years 3 months ago #73546 by B_Dark
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?

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


Powered by Kunena Forum