Changeset 26641


Ignore:
Timestamp:
Jan 12, 2014, 12:46:45 AM (7 years ago)
Author:
ddtddt
Message:

[extensions] - see_my_photos

Location:
extensions/see_my_photos
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_my_photos/language/en_UK/plugin.lang.php

    r26634 r26641  
    11<?php
    22$lang['My photos'] = 'My photos';
    3 
    43?>
  • extensions/see_my_photos/language/fr_FR/plugin.lang.php

    r26634 r26641  
    11<?php
    22$lang['My photos'] = 'Mes photos';
    3 
    43?>
  • extensions/see_my_photos/main.inc.php

    r26634 r26641  
    2020
    2121function add_link_SMP($menu_ref_arr)
    22 {
     22 {
    2323  global $conf, $user;
    24 
    25      $query = '
    26 SELECT DISTINCT(id)
     24   $query = '
     25  SELECT DISTINCT(id)
    2726  FROM '.IMAGES_TABLE.'
    2827  INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
    2928  WHERE added_by = \''.$user['id'].'\'
    3029;';
    31         $result = pwg_query($query);
    32         $row = pwg_db_fetch_assoc($result);
    33 
    34   if (!is_a_guest() and !empty($row))
    35 
     30  $result = pwg_query($query);
     31  $row = pwg_db_fetch_assoc($result);
     32 if (!is_a_guest() and !empty($row))
     33  { 
    3634  $menu = & $menu_ref_arr[0];
    37  
    3835  if (($block = $menu->get_block('mbSpecials')) != null)
    39   {
    40     load_language('plugin.lang', SMP_PATH);
    41 
    42     $position = (isset($conf['SMP_position']) and is_numeric($conf['SMP_position'])) ? $conf['SMP_position'] : count($block->data)+1;
    43 
    44     array_splice($block->data, $position-1, 0, array('see_my_photos' =>
     36   {
     37   load_language('plugin.lang', SMP_PATH);
     38   $position = (isset($conf['SMP_position']) and is_numeric($conf['SMP_position'])) ? $conf['SMP_position'] : count($block->data)+1;
     39   array_splice($block->data, $position-1, 0, array('see_my_photos' =>
    4540      array(
    4641        'URL' => make_index_url(array('section' => 'see_my_photos')),
     
    5045      )
    5146    );
    52   }}
     47   }
     48        }
    5349}
    5450
    5551function section_init_SMP()
    56 {
    57   global $tokens;
     52 {
     53 global $tokens;
    5854  if (in_array('see_my_photos', $tokens))
    59     include(SMP_PATH . 'pagessmp.php');
    60 }
     55  include(SMP_PATH . 'pagessmp.php');
     56 }
    6157
    6258
  • extensions/see_my_photos/pagessmp.php

    r26634 r26641  
    11<?php
    2 
    32load_language('plugin.lang', SMP_PATH);
    43
    54global $page, $conf, $user;
    6 
    75        $forbidden = get_sql_condition_FandF(
    86              array( 'visible_images' => 'id' ),
    97              'AND'
    108          );
    11 
    129$page['section'] = 'see_my_photos';
    1310
    14     $query = '
     11 $query = '
    1512SELECT DISTINCT(id)
    16   FROM '.IMAGES_TABLE.'
    17   INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
    18   WHERE added_by = \''.$user['id'].'\'
    19     '.$forbidden.'
    20     '.$conf['order_by'].'
     13 FROM '.IMAGES_TABLE.'
     14 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
     15 WHERE added_by = \''.$user['id'].'\'
     16 '.$forbidden.'
     17 '.$conf['order_by'].'
    2118;';
    22 
    23     $page = array_merge(
    24       $page,
    25       array(
    26         'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'.l10n('See photos by author').'</a>',
    27         'items' => array_from_query($query, 'id'),
    28         )
    29       );
    30 
    31 
     19 $page = array_merge
     20 (
     21 $page,
     22  array
     23        (
     24  'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'.l10n('See photos by author').'</a>',
     25  'items' => array_from_query($query, 'id'),
     26  )
     27 );
    3228?>
Note: See TracChangeset for help on using the changeset viewer.