Changeset 12728
- Timestamp:
- Dec 13, 2011, 4:00:32 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r12726 r12728 1768 1768 } 1769 1769 1770 $url_params = array('image_id' => $image_id); 1771 1770 1772 // let's add links between the image and the categories 1771 1773 if (isset($params['categories'])) 1772 1774 { 1773 1775 ws_add_image_category_relations($image_id, $params['categories']); 1776 1777 if (preg_match('/^\d+/', $params['categories'], $matches)) { 1778 $category_id = $matches[0]; 1779 1780 $query = ' 1781 SELECT id, name, permalink 1782 FROM '.CATEGORIES_TABLE.' 1783 WHERE id = '.$category_id.' 1784 ;'; 1785 $result = pwg_query($query); 1786 $category = pwg_db_fetch_assoc($result); 1787 1788 $url_params['section'] = 'categories'; 1789 $url_params['category'] = $category; 1790 } 1774 1791 } 1775 1792 … … 1784 1801 1785 1802 invalidate_user_cache(); 1803 1804 return array( 1805 'image_id' => $image_id, 1806 'url' => make_picture_url($url_params), 1807 ); 1786 1808 } 1787 1809
Note: See TracChangeset
for help on using the changeset viewer.