Files
Piwigo-Social-Buttons/include/twitter.inc.php
mistic100 267f127067 add light mode: no script loaded
tests in migration task
add an id to the div on picture page

git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@24757 68402e56-0260-453c-a942-63ccdbb3a9ee
2013-10-04 20:09:05 +00:00

36 lines
1008 B
PHP

<?php
defined('SOCIALBUTT_PATH') or die('Hacking attempt!');
function socialbutt_twitter($basename, $root_url, &$tpl_vars, &$buttons)
{
global $conf, $template, $user;
$twitter_langs = array(
'fr','en','ar','ja','es','de','it','id','pt','ko','tr','ru','nl','fil','msa','zh-tw',
'zh-cn','hi','no','sv','fi','da','pl','hu','fa','he','ur','th','uk','ca','el','eu','cs'
);
// config
$tpl_vars['TWITTER'] = $conf['SocialButtons']['twitter'];
// button language
if ( in_array(str_replace('_','-',strtolower($user['language'])), $twitter_langs) )
{
$tpl_vars['TWITTER']['lang'] = str_replace('_','-',strtolower($user['language']));
}
if ( in_array(substr($user['language'],0,2), $twitter_langs) )
{
$tpl_vars['TWITTER']['lang'] = substr($user['language'],0,2);
}
else
{
$tpl_vars['TWITTER']['lang'] = 'en';
}
$template->set_filename('twitter_button', realpath(SOCIALBUTT_PATH .'template/twitter.tpl'));
$buttons[] = 'twitter_button';
}
?>