Log in

View Full Version : print_delete_confirmation function parameters


rubzebest
09-20-2005, 03:13 AM
in admincalendar.php the code below is used:
if ($_REQUEST['do'] == 'remove')
{
$vbulletin->input->clean_array_gpc('r', array('calendarid' => TYPE_INT));

print_delete_confirmation('calendar', $vbulletin->GPC['calendarid'], 'admincalendar', 'kill', 'calendar', 0);
}
when I use my own admin file (adminfoo.php) this doesn't work :S?
if ($_REQUEST['do'] == 'remove')
{
$vbulletin->input->clean_array_gpc('r', array('foorid' => TYPE_INT));

print_delete_confirmation('foo', $vbulletin->GPC['fooid'], 'adminfoo', 'kill', 'foo', 0);
}
how come? the phrase uses is not bound to the calendar, so why don't i see the message?

when I use this code:
if ($_REQUEST['do'] == 'add' or $_REQUEST['do'] == 'edit')
{
$vbulletin->input->clean_array_gpc('r', array('fooid' => TYPE_INT));
the $vbulletin->GPC['fooid'] doesn't have a value and I have to use this $vbulletin->GPC['fooid'] = intval($_GET['m']); to get the value.
when I use this however:

if ($_POST['do'] == 'update')
{
$vbulletin->input->clean_array_gpc('r', array('fooid' => TYPE_INT));
the $vbulletin->GPC['fooid'] has a value :S...
Anyone that can explain this behavior?
The code is all from vB 3.5 RC3 admincalendar.php...

Marco van Herwaarden
09-20-2005, 05:03 AM
You must add a phrase called 'are_you_sure_want_to_delete_<TABLENAME>_x'

About fooid not having a value, are you passing fooid to the script at that stage?

rubzebest
09-21-2005, 01:04 PM
Thanks for your phrase tip :).

I pass this fooid value to the script indeed. What suprised me is that, depending on which if condition I use, this fooid has an empty value :ermm: ...

I noticed that vBa CMPS circumvents this problem by using it's own function instead of the built in vBulletin function. But to me, that is a strange workaround...

Andreas
09-21-2005, 01:18 PM
doesn't have a value and I have to use this $vbulletin->GPC['fooid'] = intval($_GET['m']); to get the value.
when I use this however:

Do you want m or fooid?

rubzebest
09-22-2005, 07:25 PM
I found the error, in the javascript I defined the variable as m not as fooid :o. Thanks for your help :)!