vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   DataMan post_save_once... is there post_delete_once? (https://vborg.vbsupport.ru/showthread.php?t=239664)

Jaxel 04-02-2010 12:52 PM

DataMan post_save_once... is there post_delete_once?
 
In my dataman, I have this function...

Code:

function post_save_once()
{
        build_comment_count($this->fetch_field('mediaID'));
        return true;
}


And it works GREAT! So my question of course, from the title... is there a function for running post delete? I tried both post_delete() and post_delete_once() and neither of them did anything. Is there something I am missing, or am I just out of luck?

Code:

function post_delete_once()
{
        build_comment_count($this->fetch_field('mediaID'));
        return true;
}


Basically, right now, whenever I post a comment to my mod, it will run the build_comment_count script, and update the number of comments in my database. However, when I delete a comment, I wish it to also run the build_comment_count script, so that it can update the number of comments again; but I doesn't seem to do it with the code above.

BTW, are there any comprehensive guides on datamanagers? The manual is a little lacking.

--------------- Added [DATE]1270223838[/DATE] at [TIME]1270223838[/TIME] ---------------

Looking at the datamanager class... yes, post_delete does exist...

However, it seems that $this->fetch_field fails, since the data entry no longer exists.

Would there be a viable solution to this problem?


All times are GMT. The time now is 06:57 PM.

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.00965 seconds
  • Memory Usage 1,708KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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