Changeset 8420 for extensions/FacebookPlug/Plugin/include/index.inc.php
- Timestamp:
- Jan 1, 2011, 11:16:52 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Plugin/include/index.inc.php
r8402 r8420 82 82 global $page; 83 83 84 if (count($categories) > 0) 84 $C = count($categories); 85 if ($C > 0) 85 86 { 86 87 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 87 $category = reset($categories); 88 $query = ' 88 //~ $category = reset($categories); 89 $category = $categories[rand(0, $C-1)]; 90 if (is_numeric($category['representative_picture_id'])) 91 { 92 $query = ' 89 93 SELECT id, path, tn_ext 90 94 FROM '.IMAGES_TABLE.' 91 95 WHERE id = '.$category['representative_picture_id'].' 92 96 ;'; 93 $result = pwg_query($query); 94 if($row = pwg_db_fetch_assoc($result)) 95 { 96 set_make_full_url(); 97 $page['fbp']['url_image'] = get_thumbnail_url($row); 98 unset_make_full_url(); 97 $result = pwg_query($query); 98 if($row = pwg_db_fetch_assoc($result)) 99 { 100 set_make_full_url(); 101 $page['fbp']['url_image'] = get_thumbnail_url($row); 102 unset_make_full_url(); 103 } 99 104 } 100 105 } … … 105 110 global $page; 106 111 107 if ( count($pictures) > 0)112 if (isset($page['category']['representative_picture_id'])) 108 113 { 109 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 110 $picture = reset($pictures); 111 set_make_full_url(); 112 $page['fbp']['url_image'] = get_thumbnail_url($picture); 113 unset_make_full_url(); 114 fbp_loc_begin_index_category_thumbnails(array($page['category'])); 115 } 116 else 117 { 118 $C = count($pictures); 119 if ($C > 0) 120 { 121 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 122 $picture = reset($pictures); 123 $picture = $pictures[rand(0, $C-1)]; 124 set_make_full_url(); 125 $page['fbp']['url_image'] = get_thumbnail_url($picture); 126 unset_make_full_url(); 127 } 114 128 } 115 129 }
Note: See TracChangeset
for help on using the changeset viewer.