forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: cmfa on February 11, 2011, 03:55:13 pm
-
hi@all,
I am dealing with just another port from 1.4x. The plugin rcmenu (http://forum.coppermine-gallery.net/index.php/topic, 33377.html) has it done to me. Unfortunately I run aground at the time of a SQL query. I come here not keep it up right, so maybe someone has a tip why it jams.
The attached error message does not occur continuously. I suspect that my problem here begins with these lines.
.
.
.
//check posted value for Menu Item creation
$superCage = Inspekt::makeSuperCage();
$ci = $superCage->get->keyExists('create_item');
$c_i =$superCage->get->keyExists('change_items');
$c_l =$superCage->get->keyExists($p_id);
//addslashes
if (isset($ci))
{
$item_title = ($superCage->post->getEscaped('title'));
$item_admin = ($superCage->post->getEscaped('admin_menu'));
$item_hr = ($superCage->post->getEscaped('hr'));
$item_url = ($superCage->post->getEscaped('url'));
$item_target = ($superCage->post->getEscaped('target'));
$item_id = ($superCage->post->keyExists('id')) +1;
$sql = "INSERT INTO cpg15x_plugin_rcmenu (id,title,admin,url,target,hrnext) VALUES ('$item_id','$item_title','$item_admin','$item_url','$item_target','$item_hr')";
cpg_db_query($sql);
}
.
.
.
the rest is running on 1.5xx, Does anyone have a tip for me
CMFA
-
$item_id = ($superCage->post->keyExists('id')) +1;
That looks like it should be
$item_id = ($superCage->post->getInt('id')) +1;
-
hi
changed it with the same success. If I change here
if (($ci) !== TRUE)// no error, no entry
or
if (isset($ci)) // Error!
then the error message doesn't come but nothing is entered
CMFA
-
I haven't looked at the plugin code, but it seems that you need to count up the ID plus one. So please use Nibbler's suggestion and try again. Maybe you also have to change all
->post->
to
->get->
-
Hi,
I made the proposed amendment. Unfortunately without the desired success.
Do as above already described query if and do no page refresh the record is saved. F5 is the critical error.
CMFA
-
Do as above already described query if and do no page refresh the record is saved. F5 is the critical error.
Sorry, but I don't know what you try to tell us.
-
Hi@all
Problem found and fixed. Problem lay in the if condition
@ Andre thanks for the friendly kick ;)
VG
CMFA
-
Is the problem solved in the attached file in the first post?
In other words, will you post the working plugin for cpg 1.5x?
Best regards
Mimer 8)
-
Hi,
yes the problem is solved. Did the topic is not closed
vg
cmfa
-
working plugin for cpg 1.5x
http://forum.coppermine-gallery.net/index.php/topic,70509.0.html
-
Great, tnx. Just what I needed.
Mimer 8)