Some users reported file_get_contents warnings from their server. I modified the plugin to detected whether fopen wrappers are enabled, and if not, use CURL instead. If that’s not available it will simply use your site’s main URL as the event link in your tweet .. otherwise the URL will get cut off by Twitter’s 140 character limit.
Your server doesn’t support the file_get_contents function, but I think I have a solution.

Solution #1 would be to edit your site’s PHP.ini file and set this:
allow_url_fopen = On
It may currently be set to allow_url_fopen = Off, but needs to be on.

See this link for a full description of what to do;
http://www.logaholic.com/support-center/index.php?x=&mod_id=2&id=8
Note that you may need to add this line inside your /httpdocs/php.ini file as well as inside /httpdocs/administrator/php.ini, and you may need to create those php.ini files and FTP them to the server.
On some servers, a PHP.ini file is only allowed in certain locations, like /etc/ or /cgi-bin. But in most cases it should be in the folders I described.
That may fix it.

Solution #2
It means in your case the Twitter links will have to use the actual site URLs rather than TinyURL ones, but it should work.

So, in /plugins/system/eventlisttwitter.php, around line 103, find:

function _createTinyUrl($strURL) {
global $mainframe;
$tinyurl = file_get_contents(“http://tinyurl.com/api-create.php?url=”.$strURL);
return $tinyurl;
}

…. replace that with this:

function _createTinyUrl($strURL) {
global $mainframe;
if(ini_get(‘allow_url_fopen’)){
$tinyurl = file_get_contents(“http://tinyurl.com/api-create.php?url=”.$strURL);
return $tinyurl;
}
elseif(1==3){
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,’http://tinyurl.com/api-create.php?url=’.$strURL);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
else{
return JURI::base();
}
}

If modifying the code is too daunting, uninstall and then reinstall the plugin, using the attached plugin zip file. It’s also on my site at http://www.plethoradesign.com/downloads/.
The above modified code should work for you even without touching php.ini, so it may actually be the easiest solution. If your host doesn’t support PHP’s CURL libraries, the Twitter link will simple link to your site, rather than the individual event. Otherwise the event URL will get cut off because of Twitter’s limit of 140 characters.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • RSS
  • Slashdot
  • StumbleUpon
  • Technorati
  • Yahoo! Bookmarks
  • Twitter