Changeset 26859


Ignore:
Timestamp:
Jan 18, 2014, 3:31:03 PM (10 years ago)
Author:
mistic100
Message:

compatibility with guestbook and command on albums

Location:
extensions/rv_akismet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_akismet/check.inc.php

    r18945 r26859  
    11<?php
    2 function akismet_user_comment_check($action, $comment)
     2function akismet_user_comment_check($action, $comment, $where)
    33{
    44  global $conf;
     
    1313
    1414  set_make_full_url();
    15   $url = duplicate_picture_url( array('image_id'=>$comment['image_id']) );
     15  switch($where)
     16  {
     17    case 'guestbook':
     18      $url = defined('GUESTBOOK_URL') ? GUESTBOOK_URL : get_absolute_root_url();
     19      break;
     20    case 'album':
     21      // build category url with minimum data (only id is always known)
     22      $url = duplicate_index_url( array(
     23        'section'=>'categories',
     24        'category'=>array('id'=>$comment['category_id'], 'name'=>'', 'permalink'=>'')
     25        ) );
     26      break;
     27    default:
     28      $url = duplicate_picture_url( array('image_id'=>$comment['image_id']) );
     29  }   
    1630  unset_make_full_url();
     31
    1732  $aki_comm = array(
    1833    'author' => $comment['author'],
  • extensions/rv_akismet/main.inc.php

    r25963 r26859  
    1111define('AKIS_PATH' , PHPWG_PLUGINS_PATH . AKIS_DIR . '/');
    1212
    13 add_event_handler('user_comment_check', 'akismet_user_comment_check_wrapper', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2);
     13add_event_handler('user_comment_check', 'akismet_user_comment_check_wrapper', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 3);
    1414add_event_handler('loc_begin_page_tail', 'akismet_page_tail' );
    1515
     
    3434
    3535
    36 function akismet_user_comment_check_wrapper($action, $comment)
     36function akismet_user_comment_check_wrapper($action, $comment, $where=null)
    3737{
    3838        include_once( dirname(__FILE__).'/check.inc.php' );
    39         $action = akismet_user_comment_check($action, $comment);
     39        $action = akismet_user_comment_check($action, $comment, $where);
    4040        return $action;
    4141}
Note: See TracChangeset for help on using the changeset viewer.