Skip to content

Commit

Permalink
compatibility with Piwigo 12
Browse files Browse the repository at this point in the history
  • Loading branch information
plegall committed Jan 4, 2022
1 parent 129e56f commit 4efd3ed
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
Author: plg
Author URI: http://le-gall.net/pierrick
Has Settings: true
*/

if (!defined('PHPWG_ROOT_PATH'))
Expand Down Expand Up @@ -51,24 +52,6 @@ function ppcredits_init()
load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) );
}

add_event_handler('get_admin_plugin_menu_links', 'ppcredits_admin_menu');
function ppcredits_admin_menu($menu)
{
global $page;

$name = 'Prepaid Credits';

array_push(
$menu,
array(
'NAME' => $name,
'URL' => get_root_url().'admin.php?page=plugin-prepaid_credits'
)
);

return $menu;
}

add_event_handler('loc_end_profile', 'ppcredits_end_profile', 70);
function ppcredits_end_profile()
{
Expand Down Expand Up @@ -171,7 +154,7 @@ function ppcredits_end_profile()
$template->assign_var_from_handle('CREDITS_CONTENT', 'credits');
}

function ppcredits_profile_prefilter($content, $smarty)
function ppcredits_profile_prefilter($content)
{
$pattern = '#\{\$PROFILE_CONTENT\}#';
$replacement = '{$PROFILE_CONTENT}{$CREDITS_CONTENT}';
Expand Down Expand Up @@ -284,7 +267,7 @@ function ppcredits_picture()
$template->assign_var_from_handle('CREDITS_CONTENT', 'credits');
}

function ppcredits_picture_prefilter($content, &$smarty)
function ppcredits_picture_prefilter($content)
{
global $user;

Expand Down Expand Up @@ -379,7 +362,7 @@ function ppcredits_add_users_column()
$template->set_prefilter('user_list', 'ppcredits_add_users_column_prefilter');
}

function ppcredits_add_users_column_prefilter($content, &$smarty)
function ppcredits_add_users_column_prefilter($content)
{
// add the "Credits" column in the user table
$search = '<th>{\'registration date\'|@translate}</th>';
Expand Down

0 comments on commit 4efd3ed

Please sign in to comment.