Changeset 27196
- Timestamp:
- Feb 4, 2014, 11:14:14 PM (10 years ago)
- Location:
- extensions/MostCommented
- Files:
-
- 1 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/MostCommented/language/cs_CZ/plugin.lang.php
r9603 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Nejcasteji hodnocený';4 $lang[' most_commented_cat_hint'] = 'Zobraz nejcasteji hodnocené fotky';3 $lang['Most commented'] = 'Nejcasteji hodnocený'; 4 $lang['displays most commented pictures'] = 'Zobraz nejcasteji hodnocené fotky'; 5 5 6 6 ?> -
extensions/MostCommented/language/de_DE/plugin.lang.php
r7359 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Am häufigsten kommentiert';4 $lang[' most_commented_cat_hint'] = 'Zeigt die am häufigsten kommentierte Bilder an';3 $lang['Most commented'] = 'Am häufigsten kommentiert'; 4 $lang['displays most commented pictures'] = 'Zeigt die am häufigsten kommentierte Bilder an'; 5 5 6 6 ?> -
extensions/MostCommented/language/en_UK/plugin.lang.php
r3609 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Most commented';4 $lang[' most_commented_cat_hint'] = 'displays most commented pictures';3 $lang['Most commented'] = 'Most commented'; 4 $lang['displays most commented pictures'] = 'displays most commented pictures'; 5 5 6 6 ?> -
extensions/MostCommented/language/es_ES/plugin.lang.php
r5788 r27196 1 1 <?php 2 $lang[' most_commented_cat'] = 'Las más comentadas';3 $lang[' most_commented_cat_hint'] = 'Visualizar las imágenes más comentadas';2 $lang['Most commented'] = 'Las más comentadas'; 3 $lang['displays most commented pictures'] = 'Visualizar las imágenes más comentadas'; 4 4 ?> -
extensions/MostCommented/language/fr_FR/plugin.lang.php
r3609 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Plus commentées';4 $lang[' most_commented_cat_hint'] = 'afficher les images les plus commentées';3 $lang['Most commented'] = 'Plus commentées'; 4 $lang['displays most commented pictures'] = 'afficher les images les plus commentées'; 5 5 6 6 ?> -
extensions/MostCommented/language/hu_HU/plugin.lang.php
r7217 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Legtöbb hozzászólás';4 $lang[' most_commented_cat_hint'] = 'Megjeleníti a legtöbb hozzászólással rendelkező képeket';3 $lang['Most commented'] = 'Legtöbb hozzászólás'; 4 $lang['displays most commented pictures'] = 'Megjeleníti a legtöbb hozzászólással rendelkező képeket'; 5 5 6 6 ?> -
extensions/MostCommented/language/it_IT/plugin.lang.php
r3478 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Le più commentate';4 $lang[' most_commented_cat_hint'] = 'visualizzare le immagini le più commentate';3 $lang['Most commented'] = 'Le più commentate'; 4 $lang['displays most commented pictures'] = 'visualizzare le immagini le più commentate'; 5 5 6 6 ?> -
extensions/MostCommented/language/lv_LV/plugin.lang.php
r7859 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Visvairāk komentētais';4 $lang[' most_commented_cat_hint'] = 'rāda visvairāk komentētos attēlus';3 $lang['Most commented'] = 'Visvairāk komentētais'; 4 $lang['displays most commented pictures'] = 'rāda visvairāk komentētos attēlus'; 5 5 6 6 ?> -
extensions/MostCommented/language/nb_NO/plugin.lang.php
r9099 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Mest kommenterte';4 $lang[' most_commented_cat_hint'] = 'vis de mest kommenterte bilder';3 $lang['Most commented'] = 'Mest kommenterte'; 4 $lang['displays most commented pictures'] = 'vis de mest kommenterte bilder'; 5 5 6 6 ?> -
extensions/MostCommented/language/nl_NL/plugin.lang.php
r10593 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Meeste commentaar';4 $lang[' most_commented_cat_hint'] = 'toont meest becommentarieerde afbeeldingen';3 $lang['Most commented'] = 'Meeste commentaar'; 4 $lang['displays most commented pictures'] = 'toont meest becommentarieerde afbeeldingen'; 5 5 6 6 ?> -
extensions/MostCommented/language/pl_PL/plugin.lang.php
r9319 r27196 1 1 <?php 2 $lang[' most_commented_cat'] = 'Najczęściej komentowane';3 $lang[' most_commented_cat_hint'] = 'wyświetla najczęściej komentowane zdjęcia';2 $lang['Most commented'] = 'Najczęściej komentowane'; 3 $lang['displays most commented pictures'] = 'wyświetla najczęściej komentowane zdjęcia'; 4 4 ?> -
extensions/MostCommented/language/ru_RU/plugin.lang.php
r7695 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Самые комментируемые';4 $lang[' most_commented_cat_hint'] = 'Смотреть часто комментируемые фотографии';3 $lang['Most commented'] = 'Самые комментируемые'; 4 $lang['displays most commented pictures'] = 'Смотреть часто комментируемые фотографии'; 5 5 6 6 ?> -
extensions/MostCommented/language/sk_SK/plugin.lang.php
r9524 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Najviac komentované';4 $lang[' most_commented_cat_hint'] = 'zobraziť najviac komentované fotografie';3 $lang['Most commented'] = 'Najviac komentované'; 4 $lang['displays most commented pictures'] = 'zobraziť najviac komentované fotografie'; 5 5 6 6 ?> -
extensions/MostCommented/language/sv_SE/plugin.lang.php
r10495 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Mest kommenterade';4 $lang[' most_commented_cat_hint'] = 'Visar mest kommenterade bilder';3 $lang['Most commented'] = 'Mest kommenterade'; 4 $lang['displays most commented pictures'] = 'Visar mest kommenterade bilder'; 5 5 6 6 ?> -
extensions/MostCommented/language/tr_TR/plugin.lang.php
r9133 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'En çok yorumlananlar';4 $lang[' most_commented_cat_hint'] = 'En çok yorumlanan resimleri gösterir';3 $lang['Most commented'] = 'En çok yorumlananlar'; 4 $lang['displays most commented pictures'] = 'En çok yorumlanan resimleri gösterir'; 5 5 6 6 ?> -
extensions/MostCommented/language/vi_VN/plugin.lang.php
r10148 r27196 1 1 <?php 2 2 3 $lang[' most_commented_cat'] = 'Bình luận nhiều nhất';4 $lang[' most_commented_cat_hint'] = 'hiển thị ảnh được bình luận nhiều nhất';3 $lang['Most commented'] = 'Bình luận nhiều nhất'; 4 $lang['displays most commented pictures'] = 'hiển thị ảnh được bình luận nhiều nhất'; 5 5 6 6 ?> -
extensions/MostCommented/main.inc.php
r7198 r27196 2 2 /* 3 3 Plugin Name: Most Commented 4 Version: 2.0.a4 Version: auto 5 5 Description: Add a "Most Commented" link in "Specials" menu. 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=1456 Plugin URI: auto 7 7 Author: P@t 8 8 Author URI: http://www.gauchon.com 9 9 */ 10 10 11 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 13 define('MOSTCOMMENTED_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 14 15 16 add_event_handler('init', 'init_mostcommented'); 17 18 19 function init_mostcommented() 20 { 21 global $conf; 22 23 if ($conf['activate_comments']) 24 { 25 load_language('plugin.lang', MOSTCOMMENTED_PATH); 26 27 add_event_handler('blockmanager_apply' , 'add_link_mostcommented'); 28 add_event_handler('loc_end_section_init', 'section_init_mostcommented'); 29 } 30 } 14 31 15 32 function add_link_mostcommented($menu_ref_arr) … … 17 34 global $conf; 18 35 19 $menu = & 36 $menu = &$menu_ref_arr[0]; 20 37 $position = (isset($conf['mostcommented_position']) and is_numeric($conf['mostcommented_position'])) ? $conf['mostcommented_position'] : 3; 21 38 22 if (($block = $menu->get_block('mbSpecials')) != null 39 if (($block = $menu->get_block('mbSpecials')) != null) 23 40 { 24 load_language('plugin.lang', MOSTCOMMENTED_PATH);25 26 41 array_splice($block->data, $position-1, 0, array('most_commented' => 27 42 array( 28 43 'URL' => make_index_url(array('section' => 'most_commented')), 29 'TITLE' => l10n(' most_commented_cat_hint'),30 'NAME' => l10n(' most_commented_cat')44 'TITLE' => l10n('displays most commented pictures'), 45 'NAME' => l10n('Most commented') 31 46 ) 32 47 ) … … 35 50 } 36 51 37 function section_init_most _commented()52 function section_init_mostcommented() 38 53 { 39 global $tokens; 40 if (in_array('most_commented', $tokens)) 41 include(MOSTCOMMENTED_PATH . 'most_commented.php'); 54 global $tokens, $page, $conf; 55 56 if (!in_array('most_commented', $tokens)) 57 { 58 return; 59 } 60 61 $page['section'] = 'most_commented'; 62 $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('Most commented') . '</a>'; 63 $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>' 64 . $conf['level_separator'] . $page['title']; 65 66 $query = ' 67 SELECT DISTINCT image_id 68 FROM ' . IMAGE_CATEGORY_TABLE . ' 69 WHERE ' . 70 get_sql_condition_FandF( 71 array( 72 'forbidden_categories' => 'category_id', 73 'visible_categories' => 'category_id', 74 'visible_images' => 'image_id', 75 ), 76 '', true 77 ) 78 . ' 79 ;'; 80 81 $img = query2array($query, null, 'image_id'); 82 83 if (empty($img)) 84 { 85 $page['items'] = array(); 86 } 87 else 88 { 89 $query = ' 90 SELECT 91 img.id, 92 COUNT(*) AS count 93 FROM ' . IMAGES_TABLE . ' AS img 94 INNER JOIN ' . COMMENTS_TABLE . ' AS com 95 ON com.image_id = img.id 96 WHERE 97 img.id IN (' . implode(',', $img) . ') 98 AND com.validated = "true" 99 GROUP BY img.id 100 ORDER BY count DESC, img.hit DESC 101 LIMIT ' . $conf['top_number'] . ' 102 ;'; 103 $page['items'] = query2array($query, null, 'id'); 104 } 105 106 add_event_handler('loc_end_index_thumbnails', 'add_nb_comments_mostcommented'); 42 107 } 43 108 44 add_event_handler('blockmanager_apply' , 'add_link_mostcommented'); 45 add_event_handler('loc_end_section_init', 'section_init_most_commented'); 109 function add_nb_comments_mostcommented($tpl_thumbnails_var) 110 { 111 global $template, $user, $selection; 46 112 47 ?> 113 // unsed sort order 114 $template->clear_assign('image_orders'); 115 116 // display nb comments if hidden by user 117 if (!$user['show_nb_comments']) 118 { 119 $query = ' 120 SELECT image_id, COUNT(*) AS nb_comments 121 FROM '.COMMENTS_TABLE.' 122 WHERE validated = \'true\' 123 AND image_id IN ('.implode(',', $selection).') 124 GROUP BY image_id 125 ;'; 126 $nb_comments_of = query2array($query, 'image_id', 'nb_comments'); 127 128 foreach ($tpl_thumbnails_var as &$row) 129 { 130 $row['NB_COMMENTS'] = $nb_comments_of[$row['id']]; 131 } 132 unset($row); 133 } 134 135 return $tpl_thumbnails_var; 136 } -
extensions/MostCommented/maintain.inc.php
r3609 r27196 4 4 { 5 5 $q = pwg_query('SHOW COLUMNS FROM ' . HISTORY_TABLE . ' LIKE "section"'); 6 $section = mysql_fetch_array($q);6 $section = pwg_db_fetch_array($q); 7 7 $type = $section['Type']; 8 8 9 9 if (substr_count($type, 'most_commented') == 0) 10 { 10 11 $type = strtr($type , array(')' => ',\'most_commented\')')); 12 } 11 13 12 14 pwg_query('ALTER TABLE ' . HISTORY_TABLE . ' CHANGE section section ' . $type . ' DEFAULT NULL'); 13 15 } 14 15 ?>
Note: See TracChangeset
for help on using the changeset viewer.