Changeset 1815 for trunk/include/ws_functions.inc.php
- Timestamp:
- Feb 14, 2007, 2:37:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.