vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Set setting during product install based with value from query (https://vborg.vbsupport.ru/showthread.php?t=253930)

ZexTasy 11-19-2010 07:21 AM

Set setting during product install based with value from query
 
Hi,

For the installation of a product I can write install code. In this install code I can run a query which inserts a record in a table and get the identifier back by using the $db->insert_id() statement. I also create a setting for my product in the product xml file.

Now I want to insert the value from the identifier inserted as default in that setting during installation. Is this possible and how?

Thanks in advance for any help!

- ZexTasy

Lynne 11-19-2010 02:00 PM

I think you would have to do a query to get that id.

ZexTasy 11-19-2010 04:56 PM

The ID I can get during the installation phase where the I run the installation query for the insert. The problem is that I don't know how to put it in the field, because the fields for the settings are created in a later phase and I don't know how to start a new query after that ...

taravasya 09-11-2015 06:10 PM

I have the same problem. With installcode, I create a custom userfiled. Its always have name filedNN where NN incremently added number. It can be field6 or field154 who knows..... Anyway, then I import my product, I also add option field in setting, in which I want to insert value of ID from new added field from userfield table(for use it in my plugins).
Problem in what when I do this with installcode, I dont have yet field in option, and further, then I already HAVE field in option I can`t run installcode.
Ofcause, I always can use another product file to insert new userfield and then fill the needed value to my option field... but I think its inconveniently....

How I can interchange the order of execution: 1) Installcode from my product and 2)Import options from my product during single installation process?
Thanks!


All times are GMT. The time now is 11:39 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.01264 seconds
  • Memory Usage 1,710KB
  • 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)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