vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Delete attachment one command (https://vborg.vbsupport.ru/showthread.php?t=40387)

XAM 06-28-2002 05:43 AM

Delete attachment one command
 
What variables need to be substituted in string, what to delete the attachment one command?
http://fool.capellan.ru/sm/umn.gif
Quote:

/editpost.php?s=&action=updatepost&attachmentaction =delete&postid=175707&postinfo[attachmentid]=105
Such command throws out in the empty screen, without error messages, but also does not delete.

http://fool.capellan.ru/sm/val.gif

https://vborg.vbsupport.ru/external/2002/06/1.gif

Admin 06-28-2002 08:52 AM

You can't do that, but you can delete the attachment with an SQL query:
[sql]DELETE FROM attachment WHERE attachmentid = XXX;[/sql]

XAM 06-28-2002 09:14 AM

It would be desirable to use possibilities of moduls of a forum. If to use SQL - there is a necessity of creation of all authentications...
in editpost.php unit there is a section
PHP Code:

if ($HTTP_POST_VARS['action']=="updatepost") {
....

    if (
trim($attachmentaction)=="delete") {
      
$attachmentsql=",attachmentid=0";
      
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
      
updatethreadcount($threadinfo[threadid]);
    }
... 

How to use the given possibility?

Admin 06-28-2002 10:56 AM

That section includes many other functions, and to use it as-is you will need to POST data to that page, and that data will need to include the post's message, title, icon, and everything else that the code updates.

You must rewrite it.

XAM 06-28-2002 11:09 AM

Quote:

you will need to POST data to that page, and that data will need to include the post's message, title, icon, and everything else that the code updates.
There are no problems!
I have all attributes of the message, and also a thread and forum. Prompt as to generate string(command) - that not calling the web-form "editing post" to delete attachmen... Not forcing the user to press "Save Changes" button.


All times are GMT. The time now is 01:41 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.02884 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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