Changeset 1815
- Timestamp:
- Feb 14, 2007, 2:37:38 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/element_set_global.php
r1609 r1815 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 290 289 { 291 290 $add_tag_selection = get_html_tag_selection( 292 get_all_tags(),291 $all_tags, 293 292 'add_tags' 294 293 ); … … 305 304 { 306 305 // remove tags 307 $query = ' 308 SELECT tag_id, name, url_name, count(*) counter 309 FROM '.IMAGE_TAG_TABLE.' 310 INNER JOIN '.TAGS_TABLE.' ON tag_id = id 311 WHERE image_id IN ('.implode(',', $page['cat_elements_id']).') 312 GROUP BY tag_id 313 ;'; 314 $result = pwg_query($query); 315 316 $tags = array(); 317 while($row = mysql_fetch_array($result)) 318 { 319 array_push($tags, $row); 320 } 321 306 $tags = get_common_tags($page['cat_elements_id'], -1); 322 307 usort($tags, 'name_compare'); 323 308 -
trunk/admin/picture_modify.php
r1609 r1815 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 212 211 { 213 212 $tag_selection = get_html_tag_selection( 214 get_all_tags(),213 $all_tags, 215 214 'tags', 216 215 $selected_tags -
trunk/include/functions_html.inc.php
r1789 r1815 559 559 .'<label>' 560 560 .'<input type="checkbox" name="'.$fieldname.'[]"' 561 .' value="'.$tag[' tag_id'].'"'561 .' value="'.$tag['id'].'"' 562 562 ; 563 563 564 if (in_array($tag[' tag_id'], $selecteds))564 if (in_array($tag['id'], $selecteds)) 565 565 { 566 566 $output.= ' checked="checked"'; -
trunk/include/functions_tag.inc.php
-
Property
svn:keywords
set to
Author Date Id Revision
r1678 r1815 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 9 // | last update : $Date: 2006-03-16 23:58:16 +0100 (jeu, 16 mar 2006) $ 10 // | last modifier : $Author: rub $ 11 // | revision : $Revision: 1085 $ 12 // | revision : $Revision: 1085 $ 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 8 // | last update : $Date$ 9 // | last modifier : $Author$ 10 // | revision : $Revision$ 11 // | revision : $Revision$ 13 12 // +-----------------------------------------------------------------------+ 14 13 // | This program is free software; you can redistribute it and/or modify | … … 42 41 // we can find top fatter tags among reachable images 43 42 $tags_query = ' 44 SELECT tag_id, name, url_name, count(*) counter43 SELECT id, name, url_name, count(*) counter 45 44 FROM '.IMAGE_TAG_TABLE.' 46 45 INNER JOIN '.TAGS_TABLE.' ON tag_id = id'; … … 58 57 ); 59 58 60 if (! is_null($where_tag_img))59 if (!empty($where_tag_img)) 61 60 { 62 61 // first we need all reachable image ids … … 102 101 { 103 102 $query = ' 104 SELECT id AS tag_id,103 SELECT id, 105 104 name, 106 105 url_name … … 246 245 } 247 246 $query = ' 248 SELECT tag_id, name, url_name, count(*) counter247 SELECT id, name, url_name, count(*) counter 249 248 FROM '.IMAGE_TAG_TABLE.' 250 249 INNER JOIN '.TAGS_TABLE.' ON tag_id = id … … 256 255 } 257 256 $query .=' 258 GROUP BY tag_id 259 ORDER BY counter DESC'; 257 GROUP BY tag_id'; 260 258 if ($max_tags>0) 261 259 { -
Property
svn:keywords
set to
-
trunk/include/menubar.inc.php
r1788 r1815 131 131 'URL' => make_index_url( 132 132 array( 133 'tags' => array( 134 array( 135 'id' => $tag['tag_id'], 136 'url_name' => $tag['url_name'], 137 ), 138 ) 133 'tags' => array($tag) 139 134 ) 140 135 ), … … 155 150 'tags' => array_merge( 156 151 $page['tags'], 157 array( 158 array( 159 'id' => $tag['tag_id'], 160 'url_name' => $tag['url_name'], 161 ), 162 ) 152 array($tag) 163 153 ) 164 154 ) -
trunk/include/ws_functions.inc.php
r1781 r1815 538 538 539 539 //-------------------------------------------------------------- related tags 540 $query = ' 541 SELECT id, name, url_name 542 FROM '.IMAGE_TAG_TABLE.' 543 INNER JOIN '.TAGS_TABLE.' ON tag_id = id 544 WHERE image_id = '.$image_row['id'].' 545 ;'; 546 $result = pwg_query($query); 547 $related_tags = array(); 548 while ($row = mysql_fetch_assoc($result)) 549 { 550 $row['url'] = make_index_url( 540 $related_tags = get_common_tags( array($image_row['id']), -1 ); 541 foreach( $related_tags as $i=>$tag) 542 { 543 $tag['url'] = make_index_url( 551 544 array( 552 'tags' => array($ row)545 'tags' => array($tag) 553 546 ) 554 547 ); 555 $ row['page_url'] = make_picture_url(548 $tag['page_url'] = make_picture_url( 556 549 array( 557 550 'image_id' => $image_row['id'], 558 551 'image_file' => $image_row['file'], 559 'tags' => array($ row),552 'tags' => array($tag), 560 553 ) 561 554 ); 562 array_push($related_tags, $row); 555 unset($tag['counter']); 556 $related_tags[$i]=$tag; 563 557 } 564 558 //---------------------------------------------------------- related comments … … 675 669 for ($i=0; $i<count($tags); $i++) 676 670 { 677 $tags[$i]['id'] = (int)$tags[$i][' tag_id'];671 $tags[$i]['id'] = (int)$tags[$i]['id']; 678 672 $tags[$i]['counter'] = (int)$tags[$i]['counter']; 679 unset($tags[$i]['tag_id']);680 673 $tags[$i]['url'] = make_index_url( 681 674 array( … … 703 696 for( $i=0; $i<count($tags); $i++ ) 704 697 { 705 $tags[$i]['tag_id']=(int)$tags[$i]['tag_id']; 706 $tags[$i]['id']=(int)$tags[$i]['tag_id']; //required by make_xxx_url 698 $tags[$i]['id']=(int)$tags[$i]['id']; 707 699 } 708 700 foreach( $tags as $tag ) 709 701 { 710 $tags_by_id[ $tag[' tag_id'] ] = $tag;702 $tags_by_id[ $tag['id'] ] = $tag; 711 703 if ( 712 704 in_array($tag['name'], $params['tag_name']) … … 715 707 ) 716 708 { 717 $tag_ids[] = $tag[' tag_id'];709 $tag_ids[] = $tag['id']; 718 710 } 719 711 } -
trunk/index.php
r1800 r1815 226 226 'URL' => make_index_url( 227 227 array( 228 'tags' => array( 229 array( 230 'id' => $tag['tag_id'], 231 'url_name' => $tag['url_name'], 232 ), 233 ) 228 'tags' => array($tag) 234 229 ) 235 230 ), -
trunk/tags.php
r1677 r1815 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) 8 // | file : $ RCSfile$8 // | file : $Id$ 9 9 // | last update : $Date: 2006-03-22 02:01:47 +0100 (mer, 22 mar 2006) $ 10 10 // | last modifier : $Author: rvelices $ … … 34 34 if ($a['counter'] == $b['counter']) 35 35 { 36 return tag_id_compare($a, $b);36 return id_compare($a, $b); 37 37 } 38 38 … … 40 40 } 41 41 42 function tag_id_compare($a, $b)42 function id_compare($a, $b) 43 43 { 44 return ($a[' tag_id'] < $b['tag_id']) ? -1 : 1;44 return ($a['id'] < $b['id']) ? -1 : 1; 45 45 } 46 46 … … 95 95 'URL' => make_index_url( 96 96 array( 97 'tags' => array( 98 array( 99 'id' => $tag['tag_id'], 100 'url_name' => $tag['url_name'], 101 ), 102 ), 97 'tags' => array($tag), 103 98 ) 104 99 ),
Note: See TracChangeset
for help on using the changeset viewer.