Changeset 15122 for extensions
- Timestamp:
- May 19, 2012, 1:12:51 PM (13 years ago)
- Location:
- extensions/TweetThis
- Files:
-
- 2 added
- 3 deleted
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/TweetThis/admin.php
r11425 r15122 5 5 6 6 load_language('plugin.lang', TWEET_PATH); 7 $conf['TweetThis'] = explode(',',$conf['TweetThis']);7 $conf['TweetThis'] = unserialize($conf['TweetThis']); 8 8 9 9 if (isset($_POST['submit'])) 10 10 { 11 11 $conf['TweetThis'] = array( 12 $_POST['button_style'], 13 $_POST['position'], 12 'size' => $_POST['button_size'], 13 'position' => $_POST['position'], 14 'count' => isset($_POST['count']), 15 'via' => trim($_POST['via']), 14 16 ); 15 17 16 conf_update_param('TweetThis', implode(',',$conf['TweetThis']));18 conf_update_param('TweetThis', serialize($conf['TweetThis'])); 17 19 array_push($page['infos'], l10n('Information data registered in database')); 18 20 … … 22 24 23 25 $template->assign(array( 24 'button_style' => $conf['TweetThis'][0], 25 'position' => $conf['TweetThis'][1], 26 'button_size' => $conf['TweetThis']['size'], 27 'position' => $conf['TweetThis']['position'], 28 'count_check' => $conf['TweetThis']['count'] ? 'checked="checked"' : null, 29 'via' => $conf['TweetThis']['via'], 26 30 'TWEET_PATH' => TWEET_PATH, 27 31 )); -
extensions/TweetThis/admin.tpl
r11514 r15122 8 8 9 9 <table class="twitter_buttons"> 10 <tr> 11 <td><label> 12 <img src="{$TWEET_PATH}images/tweeth.png"/> 13 <input type="radio" name="button_style" value="horizontal" {if $button_style == 'horizontal'}checked="checked"{/if}/> 14 </label></td> 15 <td><label> 16 <img src="{$TWEET_PATH}images/tweetv.png"/> 17 <input type="radio" name="button_style" value="vertical" {if $button_style == 'vertical'}checked="checked"{/if}/> 18 </label></td> 19 <td><label> 20 <img src="{$TWEET_PATH}images/tweetn.png"/> 21 <input type="radio" name="button_style" value="none" {if $button_style == 'none'}checked="checked"{/if}/> 22 </label></td> 23 <td> </td> 10 <tr class="property"> 11 <td> 12 {'Button size'|@translate} 13 </td> 14 <td></td> 24 15 </tr> 25 16 <tr> 26 17 <td><label> 27 <img src=" http://twitter-badges.s3.amazonaws.com/twitter-a.png"/>28 <input type="radio" name="button_s tyle" value="twitter-a" {if $button_style == 'twitter-a'}checked="checked"{/if}/>18 <img src="{$TWEET_PATH}images/small.png"/> 19 <input type="radio" name="button_size" value="small" {if $button_size == 'small'}checked="checked"{/if}/> 29 20 </label></td> 30 21 <td><label> 31 <img src="http://twitter-badges.s3.amazonaws.com/t_logo-a.png"/> 32 <input type="radio" name="button_style" value="t_logo-a" {if $button_style == 't_logo-a'}checked="checked"{/if}/> 33 </label></td> 34 <td><label> 35 <img src="http://twitter-badges.s3.amazonaws.com/t_small-a.png"/> 36 <input type="radio" name="button_style" value="t_small-a" {if $button_style == 't_small-a'}checked="checked"{/if}/> 37 </label></td> 38 <td><label> 39 <img src="http://twitter-badges.s3.amazonaws.com/t_mini-a.png"/> 40 <input type="radio" name="button_style" value="t_mini-a" {if $button_style == 't_mini-a'}checked="checked"{/if}/> 22 <img src="{$TWEET_PATH}images/large.png"/> 23 <input type="radio" name="button_size" value="large" {if $button_size == 'large'}checked="checked"{/if}/> 41 24 </label></td> 42 25 </tr> 43 <tr> 44 <td><label> 45 <img src="http://twitter-badges.s3.amazonaws.com/twitter-b.png"/> 46 <input type="radio" name="button_style" value="twitter-b" {if $button_style == 'twitter-b'}checked="checked"{/if}/> 47 </label></td> 48 <td><label> 49 <img src="http://twitter-badges.s3.amazonaws.com/t_logo-b.png"/> 50 <input type="radio" name="button_style" value="t_logo-b" {if $button_style == 't_logo-b'}checked="checked"{/if}/> 51 </label></td> 52 <td><label> 53 <img src="http://twitter-badges.s3.amazonaws.com/t_small-b.png"/> 54 <input type="radio" name="button_style" value="t_small-b" {if $button_style == 't_small-b'}checked="checked"{/if}/> 55 </label></td> 56 <td><label> 57 <img src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png"/> 58 <input type="radio" name="button_style" value="t_mini-b" {if $button_style == 't_mini-b'}checked="checked"{/if}/> 59 </label></td> 26 <tr class="property"> 27 <td> 28 <label for="count">{'Display counter'|@translate}</label> 29 </td> 30 <td> 31 <input type="checkbox" id="count" name="count" value="1" {$count_check}/> 32 </td> 60 33 </tr> 61 <tr>62 <td><label>63 <img src="http://twitter-badges.s3.amazonaws.com/twitter-c.png"/>64 <input type="radio" name="button_style" value="twitter-c" {if $button_style == 'twitter-c'}checked="checked"{/if}/>65 </label></td>66 <td><label>67 <img src="http://twitter-badges.s3.amazonaws.com/t_logo-c.png"/>68 <input type="radio" name="button_style" value="t_logo-c" {if $button_style == 't_logo-c'}checked="checked"{/if}/>69 </label></td>70 <td><label>71 <img src="http://twitter-badges.s3.amazonaws.com/t_small-c.png"/>72 <input type="radio" name="button_style" value="t_small-c" {if $button_style == 't_small-c'}checked="checked"{/if}/>73 </label></td>74 <td><label>75 <img src="http://twitter-badges.s3.amazonaws.com/t_mini-c.png"/>76 <input type="radio" name="button_style" value="t_mini-c" {if $button_style == 't_mini-c'}checked="checked"{/if}/>77 </label></td>78 </tr>79 80 34 <tr class="property"> 81 <td colspan="2">35 <td> 82 36 {'Button position on picture page'|@translate} 83 37 </td> 84 <td colspan="2">38 <td> 85 39 <label><input type="radio" name="position" value="top" {if $position == 'top'}checked="checked"{/if}/> {'Top'|@translate}</label> 86 40 <label><input type="radio" name="position" value="bottom" {if $position == 'bottom'}checked="checked"{/if}/> {'Bottom'|@translate}</label> … … 88 42 </td> 89 43 </tr> 44 <tr class="property"> 45 <td> 46 {'Via'|@translate} 47 </td> 48 <td> 49 @ <input type="text" name="via" value="{$via}"/> 50 </td> 51 </tr> 90 52 <tr class="submit"> 91 <td colspan=" 4">53 <td colspan="2"> 92 54 <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /> 93 55 </td> -
extensions/TweetThis/language/ca_ES/plugin.lang.php
r14738 r15122 23 23 $lang['Bottom'] = 'Inferior'; 24 24 $lang['Button position on picture page'] = 'Posició del botó a la pàgina de la imatge'; 25 $lang['Share on Twitter'] = 'Compartir a Twitter';26 25 $lang['Toolbar'] = 'Barra d\'eines'; 27 26 $lang['Top'] = 'Superior'; -
extensions/TweetThis/language/cs_CZ/plugin.lang.php
r11504 r15122 5 5 $lang['Bottom'] = 'Dole'; 6 6 $lang['Toolbar'] = 'Panel nástrojů'; 7 $lang['Share on Twitter'] = 'Sdílet na Twitteru';8 7 9 8 ?> -
extensions/TweetThis/language/de_DE/plugin.lang.php
r13127 r15122 23 23 $lang['Bottom'] = 'Unten'; 24 24 $lang['Button position on picture page'] = 'Tastenposition auf der Bilderseite'; 25 $lang['Share on Twitter'] = 'Auf Twitter teilen';26 25 $lang['Toolbar'] = 'Symbolleiste'; 27 26 $lang['Top'] = 'Oben'; -
extensions/TweetThis/language/el_GR/plugin.lang.php
r14953 r15122 23 23 $lang['Bottom'] = 'Κάτω μέρος'; 24 24 $lang['Button position on picture page'] = 'θέση Κουμπιού στη σελίδα της εικόνας'; 25 $lang['Share on Twitter'] = 'Μοιραστείτε το στο Twitter';26 25 $lang['Toolbar'] = 'Γραμμή Εργαλείων'; 27 26 $lang['Top'] = 'Κορυφή'; -
extensions/TweetThis/language/en_UK/plugin.lang.php
r11476 r15122 5 5 $lang['Bottom'] = 'Bottom'; 6 6 $lang['Toolbar'] = 'Toolbar'; 7 $lang['Share on Twitter'] = 'Share on Twitter'; 7 $lang['Button size'] = 'Button size'; 8 $lang['Display counter'] = 'Display counts'; 9 $lang['Via'] = 'Via'; 8 10 9 11 ?> -
extensions/TweetThis/language/es_ES/plugin.lang.php
r11533 r15122 5 5 $lang['Bottom'] = 'Abajo'; 6 6 $lang['Toolbar'] = 'Barra de herramientas'; 7 $lang['Share on Twitter'] = 'Compartir en Twitter';8 7 9 8 ?> -
extensions/TweetThis/language/fr_FR/plugin.lang.php
r11476 r15122 5 5 $lang['Bottom'] = 'Bas'; 6 6 $lang['Toolbar'] = 'Barre d\'outils'; 7 $lang['Share on Twitter'] = 'Partager sur Twitter'; 7 $lang['Button size'] = 'Taille du bouton'; 8 $lang['Display counter'] = 'Afficcher le compteur'; 9 $lang['Via'] = 'Via'; 8 10 9 11 ?> -
extensions/TweetThis/language/hu_HU/plugin.lang.php
r11774 r15122 5 5 $lang['Bottom'] = 'Lent'; 6 6 $lang['Toolbar'] = 'Eszköztár'; 7 $lang['Share on Twitter'] = 'Megosztás a Twitteren';8 7 9 8 ?> -
extensions/TweetThis/language/it_IT/plugin.lang.php
r11605 r15122 5 5 $lang['Bottom'] = 'Basso'; 6 6 $lang['Toolbar'] = 'Barra degli strumenti'; 7 $lang['Share on Twitter'] = 'Condividere su Twitter';8 7 9 8 ?> -
extensions/TweetThis/language/lv_LV/plugin.lang.php
r11643 r15122 5 5 $lang['Bottom'] = 'Apakšā'; 6 6 $lang['Toolbar'] = 'Rīkjoslā'; 7 $lang['Share on Twitter'] = 'Dalīties Tviterī';8 7 9 8 ?> -
extensions/TweetThis/language/nl_NL/plugin.lang.php
r12050 r15122 4 4 $lang['Bottom'] = 'Onder'; 5 5 $lang['Toolbar'] = 'Werkbalk'; 6 $lang['Share on Twitter'] = 'Deel op Twitter';7 6 $lang['Button position on picture page'] = 'Knop positie op afbeelding pagina'; 8 7 -
extensions/TweetThis/language/pl_PL/plugin.lang.php
r12143 r15122 21 21 // | USA. | 22 22 // +-----------------------------------------------------------------------+ 23 $lang['Share on Twitter'] = 'Udostępnij na Twitterze';24 23 $lang['Bottom'] = 'Dół'; 25 24 $lang['Button position on picture page'] = 'Miejsce umieszczenia przycisku'; -
extensions/TweetThis/language/pt_PT/plugin.lang.php
r14501 r15122 23 23 $lang['Bottom'] = 'Base'; 24 24 $lang['Button position on picture page'] = 'Posição do botão na página da foto'; 25 $lang['Share on Twitter'] = 'Partilhar no Twiter';26 25 $lang['Toolbar'] = 'Barra de tarefas'; 27 26 $lang['Top'] = 'Topo'; -
extensions/TweetThis/language/ru_RU/plugin.lang.php
r11643 r15122 5 5 $lang['Bottom'] = 'Внизу'; 6 6 $lang['Toolbar'] = 'На панели инструментов'; 7 $lang['Share on Twitter'] = 'Опубликовать в Twitter';8 7 9 8 ?> -
extensions/TweetThis/language/sk_SK/plugin.lang.php
r11885 r15122 4 4 $lang['Bottom'] = 'Dole'; 5 5 $lang['Toolbar'] = 'Lišta nástrojov'; 6 $lang['Share on Twitter'] = 'Zdieľať na Twitteri';7 6 $lang['Button position on picture page'] = 'Tlačidlo pozície na stránke fotiek'; 8 7 -
extensions/TweetThis/language/sv_SE/plugin.lang.php
r11796 r15122 4 4 $lang['Bottom'] = 'Botten'; 5 5 $lang['Toolbar'] = 'Verktygsfältet'; 6 $lang['Share on Twitter'] = 'Dela på Twitter';7 6 $lang['Button position on picture page'] = 'Knappens position på sidan'; 8 7 -
extensions/TweetThis/language/tr_TR/plugin.lang.php
r11476 r15122 5 5 $lang['Bottom'] = 'Alt'; 6 6 $lang['Toolbar'] = 'menübar'; 7 $lang['Share on Twitter'] = 'Twitter\'da paylaş';8 7 9 8 ?> -
extensions/TweetThis/language/uk_UA/plugin.lang.php
r13429 r15122 21 21 // | USA. | 22 22 // +-----------------------------------------------------------------------+ 23 $lang['Share on Twitter'] = 'Поділитись на Twitter';24 23 $lang['Bottom'] = 'Низ'; 25 24 $lang['Button position on picture page'] = 'Положення кнопки на сторінці зображення'; -
extensions/TweetThis/language/vi_VN/plugin.lang.php
r11534 r15122 5 5 $lang['Bottom'] = 'Dưới cùng'; 6 6 $lang['Toolbar'] = 'Thanh công cụ'; 7 $lang['Share on Twitter'] = 'Chia sẻ qua Twitter';8 7 9 8 ?> -
extensions/TweetThis/main.inc.php
r12388 r15122 20 20 function tweet_add_button() 21 21 { 22 global $conf, $template; 23 $conf['TweetThis'] = explode(',', $conf['TweetThis']); 22 global $conf, $template, $user; 23 24 $conf['TweetThis'] = unserialize($conf['TweetThis']); 25 $conf['TweetThis']['lang'] = array( 26 'no','de','zh-cn','en','pl','sv','zh-tw','tr','es','th','fa','hu','pt','it','ar','he', 27 'ko','id','ru','ja','da','fi','hi','ur','fr','nl', 28 ); 29 30 $template->assign(array( 31 'TWEET_SIZE' => $conf['TweetThis']['size'], 32 'TWEET_COUNT' => $conf['TweetThis']['count'], 33 'TWEET_VIA' => $conf['TweetThis']['via'], 34 )); 24 35 25 36 if (script_basename() == 'picture') 26 37 { 27 $template->assign(array( 28 'TWEET_IMAGE' => $conf['TweetThis'][0], 29 'TWEET_POSITON' => $conf['TweetThis'][1], 30 )); 31 38 $template->assign('TWEET_POSITON', $conf['TweetThis']['position']); 32 39 $template->set_prefilter('picture', 'tweet_add_button_prefilter'); 33 40 } 34 41 else if (script_basename() == 'index') 35 42 { 36 $template->assign(array( 37 'TWEET_IMAGE' => $conf['TweetThis'][0], 38 'TWEET_POSITON' => 'index', 39 )); 40 43 $template->assign('TWEET_POSITON', 'index'); 41 44 $template->set_prefilter('index', 'tweet_add_button_prefilter'); 42 45 } 43 46 44 // html change a bit if we use custom button, or official with counter45 if ( in_array( $conf['TweetThis'][0], array('none','horizontal','vertical')) )47 // button language 48 if ( in_array(str_replace('_','-',strtolower($user['language'])), $conf['TweetThis']['lang']) ) 46 49 { 47 $template->assign(array( 48 'TWEET_IFRAME' => true, 49 'TWEET_COUNTER' => $conf['TweetThis'][0], 50 )); 50 $template->assign('TWEET_LANG', str_replace('_','-',strtolower($user['language']))); 51 } 52 if ( in_array(substr($user['language'],0,2), $conf['TweetThis']['lang']) ) 53 { 54 $template->assign('TWEET_LANG', substr($user['language'],0,2)); 51 55 } 52 56 else 53 57 { 54 $template->assign(array( 55 'TWEET_IFRAME' => false, 56 'TWEET_COUNTER' => 'none', 57 )); 58 } 59 60 // if the link is in the toolbar, we must use smallier buttons 61 if ( script_basename() == 'index' OR $conf['TweetThis'][1] == 'toolbar') 62 { 63 switch ($conf['TweetThis'][0]) 64 { 65 case 'vertical': 66 $template->assign('TWEET_COUNTER', 'horizontal'); break; 67 case 't_logo-a': 68 $template->assign('TWEET_IMAGE', 't_small-a'); break; 69 case 't_logo-b': 70 $template->assign('TWEET_IMAGE', 't_small-b'); break; 71 case 't_logo-c': 72 $template->assign('TWEET_IMAGE', 't_small-c'); break; 73 } 58 $template->assign('TWEET_LANG', 'en'); 74 59 } 75 60 } … … 79 64 global $template; 80 65 66 $replace = '{combine_script id=\'twitter_widgets\' path=\'http://platform.twitter.com/widgets.js} 67 <a href="https://twitter.com/share" class="twitter-share-button" data-lang="{$TWEET_LANG}" {if not empty($TWEET_VIA)}data-via="{$TWEET_VIA}"{/if} {if $TWEET_SIZE=="large"}data-size="large"{/if} {if not $TWEET_COUNT}data-count="none"{/if}>Tweet</a>'; 68 81 69 switch ($template->get_template_vars('TWEET_POSITON')) 82 70 { 83 71 case 'top': 84 72 $search = '<div id="theImage">'; 85 $replace = ' 86 <div><a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 87 class="{if $TWEET_IFRAME}twitter-share-button{/if}" title="{\'Share on Twitter\'|@translate}"> 88 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 89 </a></div> 90 '; 73 $replace = '<div>'.$replace.'</div>'; 91 74 break; 92 75 93 76 case 'bottom': 94 77 $search = '{$ELEMENT_CONTENT}'; 95 $replace = '96 <a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')"97 class="{if $TWEET_IFRAME}twitter-share-button{/if}" title="{\'Share on Twitter\'|@translate}">98 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if}99 </a>100 ';101 78 break; 102 79 103 80 case 'toolbar': 104 $search = '{*caddie management END*}'; 105 $replace = ' 106 <a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 107 class="{if $TWEET_IFRAME}twitter-share-button{/if} pwg-button" title="{\'Share on Twitter\'|@translate}"> 108 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 109 </a> 110 '; 81 $search = '<div class="actionButtons">'; 111 82 break; 112 83 113 84 case 'index': 114 85 $search = '<ul class="categoryActions">'; 115 $replace = ' 116 {combine_script id=\'scripts\' path=\'themes/default/js/scripts.js\'} 117 <li><a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 118 class="{if $TWEET_IFRAME}twitter-share-button{/if} pwg-button" title="{\'Share on Twitter\'|@translate}"> 119 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 120 </a></li> 121 '; 86 $replace = '<li>'.$replace.'</li>'; 122 87 break; 123 88 } 124 89 125 $replace = $search . $replace . '{if $TWEET_IFRAME}{combine_script id=\'twitter_widgets\' path=\'http://platform.twitter.com/widgets.js}{/if}'; 126 127 return str_replace($search, $replace, $content); 90 return str_replace($search, $search.$replace, $content); 128 91 } 129 92 … … 135 98 function tweet_plugin_admin_menu($menu) 136 99 { 137 array_push( 138 $menu, 139 array( 140 'NAME' => 'TweetThis', 141 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 142 ) 143 ); 144 100 array_push($menu, array( 101 'NAME' => 'TweetThis', 102 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 103 )); 145 104 return $menu; 146 105 } -
extensions/TweetThis/maintain.inc.php
r12388 r15122 1 1 <?php 2 2 function plugin_install() 3 { 4 pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("TweetThis","horizontal,toolbar","TweetThis config");'); 3 { 4 $conf = array( 5 'size' => 'small', 6 'position' => 'toolbar', 7 'count' => true, 8 'via' => null, 9 ); 10 11 conf_update_param('TweetThis', serialize($conf)); 12 } 13 14 function plugin_activate() 15 { 16 global $conf; 17 18 if (@unserialize($conf['TweetThis']) === false) 19 { 20 $conf = explode(',', $conf['TweetThis']); 21 $conf = array( 22 'size' => 'small', 23 'position' => $conf[1], 24 'count' => $conf[1]=='horizontal' || $conf[1]=='vertical', 25 'via' => null, 26 ); 27 28 conf_update_param('TweetThis', serialize($conf)); 29 } 5 30 } 6 31 -
extensions/TweetThis/style.css
r11514 r15122 23 23 .twitter_buttons tr:last-child td { 24 24 border-bottom:none; 25 } 26 .twitter_buttons input { 27 background:#eee; 28 border:1px solid #aaa; 29 border-radius:4px; 30 box-shadow:inset 0 1px 0 rgba(0,0,0,0.05); 31 padding:5px; 32 } 33 .twitter_buttons input:focus { 34 background:#fff; 35 border-color:#3399ff; 25 36 } 26 37 tr.property td, tr.submit td {
Note: See TracChangeset
for help on using the changeset viewer.