hi,
In the Plugin Manager will call the:
mySQL error: Duplicate entry 'rank1' for key 'PRIMARY'
When commenting on the $ query I get the press of not more submit.
Vg
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2007 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 version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.4.13
$Source$
$Revision: 3912 $
$Author: gaugau $
$Date: 2007-08-24 16:48:44 +0200 (Fr, 24 Aug 2007) $
**********************************************/
/************************************************
CopperRank plugin
*************************************************
by just_some_guy - www.mysimtractor.com
*************************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
global $CONFIG, $lang_plugin_CopperRank_table, $lang_plugin_CopperRank;
require ('plugins/CopperRank/include/init.inc.php');
// Add an install action
$thisplugin->add_action('plugin_install','rank_install');
$thisplugin->add_action('plugin_configure','rank_configure');
$thisplugin->add_action('page_start','rank_page_start');
// Install function
// Checks if uid is 'foo' and pwd is 'bar'; If so, then install the plugin
function rank_install() {
global $CONFIG;
$superCage = Inspekt::makeSuperCage();
// Install
if ($superCage->post->getInt('submit')) {
return true;
// Loop again
} else {
return 1;
}
}
// add config button
function rank_config_button($href,$title,$target,$link)
{
global $CONFIG, $lang_plugin_CopperRank_how, $lang_plugin_CopperRank , $lang_plugin_CopperRank_table;
global $template_gallery_admin_menu;
$new_template = $template_gallery_admin_menu;
$button = template_extract_block($new_template,'documentation');
$params = array(
'{DOCUMENTATION_HREF}' => $href,
'{DOCUMENTATION_TITLE}' => $title,
'target="cpg_documentation"' => $target,
'{DOCUMENTATION_LNK}' => $link,
);
$new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->
";
template_extract_block($template_gallery_admin_menu,'documentation',"<!-- BEGIN documentation -->" . $button . "<!-- END documentation -->
" . $new_button);
}
// add admin button to start of each page
function rank_page_start()
{
global $CONFIG, $lang_plugin_CopperRank_how, $lang_plugin_CopperRank , $lang_plugin_CopperRank_table;
if (GALLERY_ADMIN_MODE) {
rank_config_button('index.php?file=CopperRank/config',$lang_plugin_CopperRank_table['ranks'],'',$lang_plugin_CopperRank_table['ranks']);
}
}
// Configure function
function rank_configure() {
global $CONFIG, $lang_plugin_CopperRank_how, $lang_plugin_CopperRank , $lang_plugin_CopperRank_table;
$superCage = Inspekt::makeSuperCage();
$request_uri = $superCage->server->getEscaped('REQUEST_URI');
/*
$query= "INSERT INTO ".$CONFIG['TABLE_CONFIG']." (name, value) VALUES (\"rank1\", \"Newbie\"), (\"rank2\", \"Member\"), (\"rank_image1\", \"<img src=\"\"plugins/CopperRank/images/rank1.jpg\"\" />\"), (\"rank_image2\", \"<img src=\"\"plugins/CopperRank/images/rank2.jpg\"\" />\"),(\"rank_image3\", \"<img src=\"\"plugins/CopperRank/images/rank3.jpg\"\" />\"), (\"rank_image4\", \"<img src=\"\"plugins/CopperRank/images/rank4.jpg\"\" />\"), (\"rank_image5\", \"<img src=\"\"plugins/CopperRank/images/rank5.jpg\"\" />\");";
cpg_db_query($query);
$query= "INSERT INTO ".$CONFIG['TABLE_CONFIG']." (name, value) VALUES (\"rank3\", \"Extreme Member\"), (\"rank4\", \"Power Member\");";
cpg_db_query($query);
$query= "INSERT INTO ".$CONFIG['TABLE_CONFIG']." (name, value) VALUES (\"rank_value3\", \"35\"), (\"rank_value4\", \"45\");";
cpg_db_query($query);
$query= "INSERT INTO ".$CONFIG['TABLE_CONFIG']." (name, value) VALUES (\"rank_value1\", \"10\"), (\"rank_value2\", \"25\");";
cpg_db_query($query);
$query= "INSERT INTO ".$CONFIG['TABLE_CONFIG']." (name, value) VALUES (\"rank5\", \"Addict\"), (\"rank_value5\", \"50\");";
cpg_db_query($query);
*/
echo <<< EOT
{$lang_plugin_CopperRank_table['start']} </br>
<form name="submit" id="submit" action="$request_uri" method="post">
<input id="submit" name="submit" type="submit" value="submit" />
</form>
EOT;
}
// Displays the form
?>