vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Creating Custom Datamanagers (https://vborg.vbsupport.ru/showthread.php?t=119376)

Code Monkey 07-09-2006 10:31 PM

Well, I tried it with a simple table and nothing got inserted. So there must be something more to this.

Alan @ CIT 07-10-2006 05:58 AM

Check the $errors array to see if there where any problems.

Alternativly, PM me your datamanager PHP file, and the PHP your using to test it, and I'll take a look.

The code above will (well, works here) work without changes though :)

Thanks,
Alan.

Guest190829 07-10-2006 07:14 AM

Alan,

Shouldn't

PHP Code:

'username' => array(TYPE_STRREQ_YESVF_METHOD), 

be:

PHP Code:

'username' => array(TYPE_STRREQ_YES), 

As verify_username does not exist in the base class. (It does in class_dm_user.php)

Alan @ CIT 07-10-2006 10:05 AM

That'll teach me to base my example of the User DM :D

Edited first post

Antivirus 07-17-2006 06:24 PM

So with the help of this tuitorial, I could create a data manager for creating User Notes about members, correct?

Alan @ CIT 07-17-2006 06:25 PM

Correct.

Thanks,
Alan.

Antivirus 07-17-2006 10:19 PM

sweet, going to give this a try shortly. thanks!

stryka 01-25-2007 08:39 PM

THis was a great tutorial... and I am able to use it for inserting records... But what about the UDPATE function?

Can you spell out how the UPDATE function works when using a Custom DataManager?

I am not sure how it works and how it gets the current record...

I'd like to also know when DM's should be used.... vs a simple INSERT statement within the file...

thanx

harmor19 03-17-2007 04:58 AM

Quote:

Originally Posted by stryka (Post 1167267)
THis was a great tutorial... and I am able to use it for inserting records... But what about the UDPATE function?


Can you spell out how the UPDATE function works when using a Custom DataManager?

I am not sure how it works and how it gets the current record...

I'd like to also know when DM's should be used.... vs a simple INSERT statement within the file...

thanx


I believe you would use $var->condition = "exampleid = 1";

PHP Code:

$example =& vB_DataManager_Example($vbulletinERRTYPE_ARRAY);  
$example->condition "exampleid = 1";
$example->set('userid'1);
$example->set('username''harmor19');
$example->set('exampletext''Testing');
$example->save(); 

If I'm right it should update the table where exampleid is equal to "1".

Antivirus 06-02-2007 02:31 PM

So i have written two custom datamanagers, one saves/updates the main info, while I use the other (within a loop) to update the related records.

I have to call the database from within each of the DMs to update some other tables with related info as well, and while looking at vbulletin's existing datamanagers, i see more than one method of calling the database, for example:

Within class_dm_threadpost some calls to thge database are made like this:
Code:

$this->dbobject->query_write
However within class_dm_infraction, calls are made like this:
Code:

$this->registry->db->query_write
What I want to know, is why is one method used in one instance, and another in another? I think both acheive exactly the same results but why are jelsoft using different methods to call the database?


All times are GMT. The time now is 05:04 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01311 seconds
  • Memory Usage 1,739KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete