Changeset 12562


Ignore:
Timestamp:
Nov 6, 2011, 7:38:13 PM (9 years ago)
Author:
mistic100
Message:

minor changes for Piwigo 2.3.1 and Subscribe To Comments plugin

Location:
extensions/Comments_on_Albums
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/include/coa_albums.php

    r11417 r12562  
    4242            array(
    4343              'comment_id' => $_GET['comment_to_edit'],
    44               'image_id' => $category['id'],
     44              'category_id' => $category['id'],
    4545              'content' => $_POST['content']
    4646              ),
     
    130130    'author' => trim( @$_POST['author'] ),
    131131    'content' => trim( $_POST['content'] ),
    132     'image_id' => $category['id'],
     132    'category_id' => $category['id'],
    133133  );
    134134
     
    356356  {
    357357    $template->set_prefilter('index', 'coa_messages');
    358    
    359     function coa_messages($content, &$smarty)
    360     {
    361       $search = '{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}';
    362 
    363   $replacement = $search.'
     358  }
     359 
     360  function coa_messages($content, &$smarty)
     361  {
     362    $replacement = '
    364363{if isset($errors)}
    365364<div class="errors">
     
    381380{/if}';
    382381
    383       return str_replace($search, $replacement, $content);
    384     }
     382    return $replacement.$content;
    385383  }
    386384}
  • extensions/Comments_on_Albums/include/coa_comments_page.php

    r11874 r12562  
    117117            array(
    118118              'comment_id' => $_GET['edit_albums'],
    119               'image_id' => $_POST['image_id'],
     119              'category_id' => $_POST['image_id'],
    120120              'content' => $_POST['content']
    121121              ),
  • extensions/Comments_on_Albums/include/functions_comment.inc.php

    r11327 r12562  
    4343 * Tries to insert a user comment in the database and returns one of :
    4444 * validate, moderate, reject
    45  * @param array comm contains author, content, image_id
     45 * @param array comm contains author, content, category_id
    4646 * @param string key secret key sent back to the browser
    4747 * @param array infos out array of messages
     
    103103  }
    104104
    105   if ( !verify_ephemeral_key(@$key, $comm['image_id']) )
     105  if ( !verify_ephemeral_key(@$key, $comm['category_id']) )
    106106  {
    107107    $comment_action='reject';
     
    141141    \''.($comment_action=='validate' ? 'true':'false').'\',
    142142    '.($comment_action=='validate' ? 'NOW()':'NULL').',
    143     '.$comm['image_id'].'
     143    '.$comm['category_id'].'
    144144  )
    145145';
     
    207207                  ));
    208208  }
     209 
     210  trigger_action('user_comment_deletion', $comment_id, 'category');
    209211}
    210212
     
    225227  $comment_action = 'validate';
    226228
    227   if ( !verify_ephemeral_key($post_key, $comment['image_id']) )
     229  if ( !verify_ephemeral_key($post_key, $comment['category_id']) )
    228230  {
    229231    $comment_action='reject';
     
    373375;';
    374376  pwg_query($query);
     377 
     378  trigger_action('user_comment_validation', $comment_id, 'category');
    375379}
    376380?>
  • extensions/Comments_on_Albums/stuffs_module/main.inc.php

    r12381 r12562  
    4646$clauses[] = get_sql_condition_FandF (
    4747    array ('forbidden_categories' => 'category_id',
    48         'visible_categories' => 'category_id',
    49         'visible_images' => 'ic.image_id'), '', true);
     48        'visible_categories' => 'category_id'), '', true);
    5049
    5150$query = '
Note: See TracChangeset for help on using the changeset viewer.