vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   pring_delete_confirmation help (https://vborg.vbsupport.ru/showthread.php?t=197834)

ptmuldoon 12-02-2008 04:22 PM

pring_delete_confirmation help
 
I'm trying to use the print_delete_confirmation function, but can't seem to get it work.

Per the vbulletin API, I've learned that it uses 8 inputs as such:
Quote:

Prints a dialog box asking if the user is sure they want to delete the specified item from the database
void print_delete_confirmation (string $table, mixed $itemid, string $phpscript, string $do, [string $itemname = ''], [mixed $hiddenfields = 0], [string $extra = ''], [string $titlename = 'title'])

* string $table: Name of table from which item will be deleted
* mixed $itemid: ID of item to be deleted
* string $phpscript: PHP script to which the form will submit
* string $do: 'do' action for target script
* string $itemname: Word describing item to be deleted - eg: 'forum' or 'user' or 'post' etc.
* mixed $hiddenfields: If not empty, an array containing name=>value pairs to be used as hidden input fields
* string $extra: Extra text to be printed in the dialog box
* string $titlename: Name of 'title' field in the table in the database
Based on the above, I've created the following:
PHP Code:

print_delete_confirmation('table'$variable'phpscript''dorequest'0'''Delete Comment''column2' ); 

My Table includes both an ID column and the column2 column. Yet attempts to use the function keep giving an sql error. And I noticed the attempted query is always something like "SELECT tableid, column2"

I assume that the 'id' is automatically added by the function. But it appends it to table like it does, I don't know.

Does anyone have any ideas or can lend any help or advice?

Dismounted 12-03-2008 02:27 AM

In vBulletin the primary ID field of a table is usually the table name with "id" tacked on the end (see post, thread, etc.). This is why it automatically adds the ending onto the field.

ptmuldoon 12-04-2008 01:09 PM

Thanks for the help. With your input and a look at some of the other vbulletin tables, I got that figured out.

But I can't seem to figure out how to add a custom message to the confirmation box? I just get a yes and no option. I thought the string $extra should show the message?

Dismounted 12-05-2008 04:46 AM

Have a look in the actual function file to see what happens - it would probably be better than me explaining it. :p


All times are GMT. The time now is 09:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01035 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete