Changeset 28262 for extensions/ThumbnailTooltip/include/class.inc.php
- Timestamp:
- Apr 25, 2014, 7:56:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ThumbnailTooltip/include/class.inc.php
r28210 r28262 38 38 foreach($tpl_var as $cle=>$valeur) { 39 39 $query = " 40 SELECT name AS value1, hit AS value2, hit AS value3, comment AS value4, author AS value5, CONCAT('".l10n('Author').' : '."', author,'') AS value6, rating_score AS value7 41 FROM ".IMAGES_TABLE." 40 SELECT name, hit, comment, author, rating_score, CONCAT(width, 'x', height) AS dimensions, filesize FROM ".IMAGES_TABLE." 42 41 WHERE id = ".(int)$tpl_var[$cle]['id']." 43 42 ;"; … … 47 46 $details_param = array(); 48 47 49 $details['tn_type1'] = $row[' value1'];48 $details['tn_type1'] = $row['name']; 50 49 51 if (!empty($row['value2'])) { 52 $details['tn_type2'] = $row['value2'].' '.strtolower(l10n('Visits')); 50 if (!empty($row['hit'])) { 51 $details['tn_type2'] = $row['hit'].' '.strtolower(l10n('Visits')); 52 $details['tn_type3'] = '('.$row['hit'].' '.strtolower(l10n('Visits')).')'; 53 if (!empty($row['rating_score'])) { $type8 = ', '.strtolower(l10n('Rating score')).' '.$row['rating_score']; } else { $type8 = ''; } 54 $details['tn_type8'] = '('.$row['hit'].' '.strtolower(l10n('Visits')).$type8.')'; 53 55 } 54 if (!empty($row['value3'])) { 55 $details['tn_type3'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).')'; 56 if (!empty($row['value7'])) { $type8 = ', '.strtolower(l10n('Rating score')).' '.$row['value7']; } else { $type8 = ''; } 57 $details['tn_type8'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).$type8.')'; 56 if (!empty($row['comment'])) { 57 $details['tn_type4'] = $row['comment']; 58 58 } 59 if (!empty($row[' value4'])) {60 $details['tn_type 4'] = $row['value4'];59 if (!empty($row['author'])) { 60 $details['tn_type5'] = $row['author']; 61 61 } 62 if (!empty($row[' value5'])) {63 $details['tn_type 5'] = $row['value5'];62 if (!empty($row['author'])) { 63 $details['tn_type6'] = (preg_match('#(,|\/)#i', $row['author'])) ? str_replace(array('(',')'), '', ucfirst(l10n('author(s) : %s', $row['author']))) : l10n('Author').' : '.$row['author']; 64 64 } 65 if (!empty($row[' value6'])) {66 $details['tn_type 6'] = $row['value6'];65 if (!empty($row['rating_score'])) { 66 $details['tn_type7'] = strtolower(l10n('Rating score')).' '.$row['rating_score']; 67 67 } 68 if (!empty($row[' value7'])) {69 $details['tn_type 7'] = strtolower(l10n('Rating score')).' '.$row['value7'];68 if (!empty($row['dimensions'])) { 69 $details['tn_type9'] = l10n('Dimensions').' : '.$row['dimensions']; 70 70 } 71 if (!empty($row['filesize'])) { 72 if (($params['separator']=='1') && (!empty($details['tn_type9']))) { $details['tn_type9'].= ' - '; } elseif (($params['separator']!='1') && (!empty($details['tn_type9']))) { $details['tn_type9'].= ' '; } else { $details['tn_type9'] = ' '; } 73 $details['tn_type9'].= l10n('Filesize').' : '.l10n('%d Kb', $row['filesize']); 74 } 71 75 72 76 if ((!empty($details[$values['value1']])) && ($details[$values['value1']]!='none')) { $details_param[] = $details[$values['value1']]; } … … 97 101 if ($params['display_author_cat']==true) { 98 102 foreach($tpl_var as $cle=>$valeur) { 99 $query = "SELECT author FROM ".IMAGE_CATEGORY_TABLE." INNER JOIN ".IMAGES_TABLE." ON image_id = id WHERE category_id = ".(int)$tpl_var[$cle]['id']." LIMIT 1";103 $query = "SELECT author FROM ".IMAGE_CATEGORY_TABLE." INNER JOIN ".IMAGES_TABLE." ON image_id = id WHERE category_id = ".(int)$tpl_var[$cle]['id']." AND author<>'' GROUP BY author"; 100 104 $result = pwg_query($query); 101 105 $row = pwg_db_fetch_assoc($result); 102 106 107 $auteur = ''; 103 108 if (!empty($row['author'])) { 104 if (preg_match('#(,|\/)#i', $row['author'])) { $auteur = str_replace(array('(',')'), '', ucfirst(sprintf($lang['author(s) : %s'],$row['author']))); } else { $auteur = $lang['Author'].' : '.$row['author']; } 109 do { 110 $auteur .= $row['author'].', '; 111 } while ($row = pwg_db_fetch_assoc($result)); 112 $auteur = substr($auteur, 0, -2); 113 if (preg_match('#(,|\/)#i', $auteur )) { $auteur = str_replace(array('(',')'), '', ucfirst(sprintf($lang['author(s) : %s'], $auteur))); } else { $auteur = $lang['Author'].' : '.$auteur ; } 105 114 if (!empty($tpl_var[$cle]['DESCRIPTION'])) { $tpl_var[$cle]['DESCRIPTION'] = $tpl_var[$cle]['DESCRIPTION'].'<br/>'.$auteur; } else { $tpl_var[$cle]['DESCRIPTION'] = $auteur; } 106 115 }
Note: See TracChangeset
for help on using the changeset viewer.