Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: Ported  (Read 10714 times)

0 Members and 1 Guest are viewing this topic.

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Ported
« on: January 28, 2011, 08:09:46 pm »

Hi @ all,

I wanted to ask here whether the specified plug-in in the version 1.5x can be ported, would have great interest in it.

Regards
CMFA :P
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Ported
« Reply #1 on: January 29, 2011, 09:04:44 am »

I'm nearly sure it can be ported but I doubt one of the devs here will do it. And the author didn't came here the past 6 month.

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #2 on: January 29, 2011, 09:25:44 am »

Hi,

thanks for the info, this is not good.

Of this Plugin this belongs, perhaps, to the basic equipment of the gallery ode siehts you differently?

CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #3 on: January 29, 2011, 11:08:42 am »

Of this Plugin this belongs, perhaps, to the basic equipment of the gallery ode siehts you differently?
I'm not really sure what you ask for. Do you want this as a core feature of Coppermine?

Regarding the porting of that plugin, I haven't looked at it. But in the most cases all you have to do is to 'Inspektify' the plugin (means that you have to replace the access to superglobals with some Inspekt code). It's highly recommended to use Inspekt, but a quick & dirty way would be to re-globalize the superglobals, e.g. the external tracker plugin does it that way:
Code: [Select]
    $_GET=$superCage->get->_source; //these are needed for the 3rd party php files
    $_POST=$superCage->post->_source;
    $_COOKIE=$superCage->cookie->_source;
    $_ENV=$superCage->env->_source;
    $_FILES=$superCage->files->_source;
    //$_SESSION=$superCage->session->_source; $_SESSION isn't yet supported by makeSuperCage
    $_SERVER=$superCage->server->_source;
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #4 on: January 29, 2011, 11:22:37 am »

Hi,

I'm not really sure what you ask for. ?

yes,  core feature of Coppermine!

I have not completely understood the code yet where should I search him and what exactly should I change?

CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #5 on: January 29, 2011, 11:35:56 am »

Just have a look at the plugin. All occurrences of $_ have to be replaced with Inspekt code, or the quick & dirty method I just mentioned.

Please post your feature request in the feature requests board.
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #6 on: January 29, 2011, 01:40:55 pm »

Hi,

so I get the right start here is my first attempt. Can you please see if the approach is right?

old
Code: [Select]
function rank_install() {
global $CONFIG;
    // Install
if ($_POST['submit'] == 'submit') {

 return true;

    // Loop again
    } else {

        return 1;
    }

}   

new
Code: [Select]
function rank_install() {
global $CONFIG;
 $superCage = Inspekt::makeSuperCage();
    // Install
 if ($_Post=$superCage->post->('submit')) {

 return true;

    // Loop again
    } else {


        return 1;
    }

}

Error Message
Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in E:\Server\root\Coppermine\plugins\CopperRank\codebase.php on line 44

CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #7 on: January 29, 2011, 08:06:27 pm »

Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #8 on: January 30, 2011, 07:28:57 pm »

hi,

thanks for the link, about that I was already about that.
Now, however, I do not get another mistake I can arrange.

Code: [Select]
$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); 
and
Error Message
Code: [Select]
mySQL error: Duplicate entry 'rank1' for key 'PRIMARY'
VG
CMFA
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Ported
« Reply #9 on: January 31, 2011, 08:06:14 am »

Means you've run that query before and the key already exists (see error message). You'll have to delete that entry from the config table or check if the key exists before running the query.

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #10 on: January 31, 2011, 11:40:02 am »

Hi@all,

so true was already there, I deleted them out.
But it remains the problem comes as soon as the submit button is pressed.
Times have attached the function, possibly there are still some other error which I do not see.

Code: [Select]
// 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;
}

VG

CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #11 on: January 31, 2011, 12:33:49 pm »

Attach the whole plugin or post the complete error message if you need help.
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #12 on: January 31, 2011, 01:26:16 pm »

hi,

In the Plugin Manager will call the:

Code: [Select]
mySQL error: Duplicate entry 'rank1' for key 'PRIMARY'
When commenting on the $ query I get the press of not more submit.

Vg

Code: [Select]
<?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
?>

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #13 on: January 31, 2011, 02:07:34 pm »

Code: [Select]
mySQL error: Duplicate entry 'rank1' for key 'PRIMARY'
That's not the whole error message. It lacks of a lot of information. So again,
Attach the whole plugin or post the complete error message
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #14 on: January 31, 2011, 02:28:14 pm »

Hi,

Entries in the Config table have been deleted in the Plugin Manager has been pressed install. It appears the submit button and then comes the appended error message.

Vg
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #15 on: January 31, 2011, 03:31:28 pm »

Well, that's still not what I asked for, but enough information. Your script dies at line 79, which uses the query string of line 78:
Code: [Select]
$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\"\" />\");";
Try to replace that line with the following line
Code: [Select]
$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\" />');";

If you still get an error, copy everything that's in the white error box to your reply. Not just the last line, as it's mostly useless without the context.
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #16 on: January 31, 2011, 05:07:37 pm »

Hi,
sorry that I had misunderstood the error message. What I have now seen the entries are already created when calling from the plugin manager. It looks like there is a problem with the submit button. When this is pressed, the error message.

Code: [Select]
While executing query 'INSERT INTO cpg15x_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" />');' in plugins\CopperRank\codebase.php on line 82

mySQL error: Duplicate entry 'rank1' for key 'PRIMARY'

VG
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Ported
« Reply #17 on: January 31, 2011, 05:12:24 pm »

Please attach the plugin as zip file.
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #18 on: January 31, 2011, 05:19:48 pm »

hi,

yes

VG
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Ported
« Reply #19 on: February 03, 2011, 11:43:07 am »

hi,
in the porting I've come a long way advanced. Creating tables is now error free. The delete function of the tables I have taken purely. Only when I try to access the Configuration is the error message below. The configuration is index.php?file=CopperRank/config eye call

Code: [Select]
Fatal error: Cannot redeclare cpgGetMicroTime() (previously declared in E:\Web_portable\www\coppermine\include\init.inc.php:27) in E:\Web_portable\www\coppermine\include\init.inc.php on line 29
Now where is the problem?

LG

CMFA
Logged
Pages: [1] 2   Go Up
 

Page created in 0.027 seconds with 20 queries.