ti posto il codice di codebase.php
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2006 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
/*********************************************
Plugin Coded by Frantz Based on Gizmo MOD
Fixing contact button positioning & Added CAPTCHA confirmation
by B.Mossavari (Sami)
**********************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
require ('plugins/contact/include/init.inc.php');
// Add an install action
$thisplugin->add_action('plugin_install','contact_install');
// Add a configure action
$thisplugin->add_action('plugin_configure','contact_configure');
// User menus , (fixed by Sami)
$thisplugin->add_action('page_start','contact_page_start');
// Install function
// Checks if uid is 'me' and pwd is 'you'; If so, then install the plugin
function contact_install() {
// Install
if ($_POST['submit']==$lang_plugin_contact['button_install']) {
return true;
// Loop again
} else {
return 1;
}
}
// Configure function
// Displays the form
function contact_configure() {
global $CONFIG, $lang_plugin_contact;
require ('plugins/contact/include/init.inc.php');
echo <<< EOT
<h2>{$lang_plugin_contact['install_click']}</h2>
{$lang_plugin_contact['install_note']}<br />
<br />
<form action="{$_SERVER['REQUEST_URI']}" method="post">
<input type="submit" value="{$lang_plugin_contact['button_install']}" name="submit" />
</form>
EOT;
}
// create button template from current sys menu template (added by Sami)
function contact_add_admin_button($href,$title,$target,$link)
{
global $template_sys_menu, $template_sys_menu_spacer;
$new_template=$template_sys_menu;
$button=template_extract_block($new_template,'home');
$params = array(
'{HOME_LNK}' => $target,
'{HOME_TITLE}' => $title,
'{HOME_TGT}' => $href,
'home' => $link,
);
$new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
template_extract_block($template_sys_menu,'home',"<!-- BEGIN home -->" . $button . "<!-- END home -->\n" .$new_button);
}
// Add contact button after home under sys menu (added by Sami)
function contact_page_start()
{
global $template_sys_menu, $template_sys_menu_spacer, $template_sys_menu_button, $sys_menu_buttons;
global $CONFIG, $lang_plugin_contact;
require ('plugins/contact/include/init.inc.php');
require_once('plugins/contact/include/captcha.class.php');
contact_add_admin_button('index.php?file=contact/contact',$lang_plugin_contact['menu_link'],$lang_plugin_contact['menu_link'],$lang_plugin_contact['menu_link']);
}
?>