Changeset 11327
- Timestamp:
- Jun 12, 2011, 12:29:11 AM (13 years ago)
- Location:
- extensions/Comments_on_Albums
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Comments_on_Albums/include/coa_admin_comments.php
r11267 r11327 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 5 global $template, $conf ;5 global $template, $conf, $user; 6 6 load_language('plugin.lang', COA_PATH); 7 7 … … 11 11 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 12 12 13 $tabs = array( 14 array( 15 'code' => 'pictures', 16 'label' => l10n('COA_comments_photos'), 17 ), 18 array( 19 'code' => 'albums', 20 'label' => l10n('COA_comments_albums'), 21 ), 22 ); 23 24 $tab_codes = array_map(create_function('$a', 'return $a["code"];'), $tabs); 25 26 if (isset($_GET['section']) and in_array($_GET['section'], $tab_codes)) 13 if (isset($_GET['section']) and $_GET['section'] == 'albums') 27 14 { 28 $page['tab'] = $_GET['section'];15 $page['tab'] = 'albums'; 29 16 } 30 17 else 31 18 { 32 $page['tab'] = $tabs[0]['code'];19 $page['tab'] = 'pictures'; 33 20 } 34 21 35 22 $tabsheet = new tabsheet(); 36 foreach ($tabs as $tab) 37 { 38 $tabsheet->add( 39 $tab['code'], 40 $tab['label'], 41 get_root_url().'admin.php?page=comments&section='.$tab['code'] 42 ); 43 } 23 $tabsheet->add('pictures', l10n('COA_comments_photos'), get_root_url().'admin.php?page=comments'); 24 $tabsheet->add('albums', l10n('COA_comments_albums'), get_root_url().'admin.php?page=comments&section=albums'); 44 25 $tabsheet->select($page['tab']); 45 26 $tabsheet->assign(); … … 134 115 com.date, 135 116 com.author, 136 '.$conf['user_fields']['username'].' AS username,117 u.'.$conf['user_fields']['username'].' AS username, 137 118 com.content, 138 cat.name 119 cat.name, 120 img.id AS image_id, 121 img.path, 122 img.tn_ext 139 123 FROM '.COA_TABLE.' AS com 140 INNERJOIN '.CATEGORIES_TABLE.' AS cat124 LEFT JOIN '.CATEGORIES_TABLE.' AS cat 141 125 ON cat.id = com.category_id 142 126 LEFT JOIN '.USERS_TABLE.' AS u 143 127 ON u.'.$conf['user_fields']['id'].' = com.author_id 128 LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 129 ON ucc.cat_id = com.category_id AND ucc.user_id = '.$user['id'].' 130 LEFT JOIN '.IMAGES_TABLE.' AS img 131 ON img.id = ucc.user_representative_picture_id 144 132 WHERE validated = \'false\' 145 133 ORDER BY com.date DESC … … 159 147 } 160 148 149 // thumbnail 150 $row['thumb'] = get_thumbnail_url( 151 array( 152 'id' => $row['image_id'], 153 'path' => $row['path'], 154 'tn_ext' => @$row['tn_ext'], 155 ) 156 ); 157 161 158 // comment content 162 159 $template->append( 163 160 'comments', 164 161 array( 162 'ID' => $row['id'], 165 163 'CAT_URL' => PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='.$row['category_id'], 166 'CAT_NAME' => $row['name'],167 ' ID' => $row['id'],164 'CAT_NAME' => trigger_event('render_category_name', $row['name']), 165 'TN_SRC' => $row['thumb'], 168 166 'AUTHOR' => trigger_event('render_comment_author', $author_name), 169 167 'DATE' => format_date($row['date'], true), -
extensions/Comments_on_Albums/include/coa_comments_page.php
r11267 r11327 197 197 com.validated 198 198 FROM '.COA_TABLE.' AS com 199 LEFT JOIN '.USERS_TABLE.' As u200 ON u.'.$conf['user_fields']['id'].' = com.author_id199 LEFT JOIN '.USERS_TABLE.' As u 200 ON u.'.$conf['user_fields']['id'].' = com.author_id 201 201 WHERE '.implode(' 202 202 AND ', $page['where_clauses']).' … … 234 234 cat.permalink, 235 235 cat.uppercats, 236 com.id as comment_id 236 com.id as comment_id, 237 img.id AS image_id, 238 img.path, 239 img.tn_ext 237 240 FROM '.CATEGORIES_TABLE.' AS cat 238 LEFT JOIN '.COA_TABLE.' AS com 239 ON cat.id=com.category_id 241 LEFT JOIN '.COA_TABLE.' AS com 242 ON com.category_id = cat.id 243 LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 244 ON ucc.cat_id = cat.id AND ucc.user_id = '.$user['id'].' 245 LEFT JOIN '.IMAGES_TABLE.' AS img 246 ON img.id = ucc.user_representative_picture_id 240 247 '.get_sql_condition_FandF( 241 248 array( … … 251 258 foreach ($comments as $comment) 252 259 { 253 // category 254 $name = $categories[$comment['comment_id']]['name']; 255 $url = duplicate_index_url( 260 // category url 261 $comment['cat_url'] = duplicate_index_url( 256 262 array( 257 263 'category' => array( … … 263 269 ) 264 270 ); 271 272 // category thumbnail 273 $comment['thumb'] = get_thumbnail_url( 274 array( 275 'id' => $categories[$comment['comment_id']]['image_id'], 276 'path' => $categories[$comment['comment_id']]['path'], 277 'tn_ext' => @$categories[$comment['comment_id']]['tn_ext'], 278 ) 279 ); 265 280 266 281 // comment content 267 282 $tpl_comment = array( 268 283 'ID' => $comment['comment_id'], 269 'CAT_URL' => $url, 270 'CAT_NAME' => $name, 284 'U_PICTURE' => $comment['cat_url'], 285 'ALT' => trigger_event('render_category_name', $categories[$comment['comment_id']]['name']), 286 'TN_SRC' => $comment['thumb'], 271 287 'AUTHOR' => trigger_event('render_comment_author', $comment['author']), 272 288 'DATE' => format_date($comment['date'], true), … … 341 357 342 358 function coa_change_comments_list($content, &$smarty) { 343 $search = '<div class="description"{if isset($comment.IN_EDIT)} style="height:200px"{/if}>'; 344 345 $replacement = '<div class="category-title"> 346 <a href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a> 347 </div> 348 '.$search; 349 359 $search = '<img src="{$comment.TN_SRC}" alt="{$comment.ALT}">'; 360 $replacement = $search.'<br/>{$comment.ALT}'; 350 361 return str_replace($search, $replacement, $content); 351 362 } -
extensions/Comments_on_Albums/include/functions_comment.inc.php
r11267 r11327 154 154 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 155 155 156 $comment_url = get_absolute_root_url().'comments.php? comment_id='.$comm['id'];156 $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&comment_id='.$comm['id']; 157 157 158 158 $keyargs_content = array … … 273 273 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 274 274 275 $comment_url = get_absolute_root_url().'comments.php?display_mode=albums& comment_id='.$comment['comment_id'];275 $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&comment_id='.$comment['comment_id']; 276 276 277 277 $keyargs_content = array -
extensions/Comments_on_Albums/main.inc.php
r11291 r11327 65 65 function COA_comments_page() 66 66 { 67 global $template, $page, $conf ;67 global $template, $page, $conf, $user; 68 68 69 69 if (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') -
extensions/Comments_on_Albums/template/admin_comments.tpl
r11267 r11327 45 45 <td> 46 46 <div class="comment"> 47 <a class="illustration" href="{$comment.CAT_URL}"> {$comment.CAT_NAME}</a>47 <a class="illustration" href="{$comment.CAT_URL}"><img src="{$comment.TN_SRC}"><br/>{$comment.CAT_NAME}</a> 48 48 <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p> 49 49 <blockquote>{$comment.CONTENT}</blockquote>
Note: See TracChangeset
for help on using the changeset viewer.