vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   CODERS PLEASE DISCUSS!!! Pre-Datastore modifications with XML-files (UPDATE 28-7) (https://vborg.vbsupport.ru/showthread.php?t=93007)

amykhar 08-06-2005 06:33 PM

Look at the top of just about every vbulletin script. You'll see something like this:
Code:

// get special data templates from the datastore
$specialtemplates = array(
        'userstats',
        'birthdaycache',
        'maxloggedin',
        'iconcache',
        'eventcache',
        'mailqueue'
);

That pulls the datastore items into the code you are going to use. All you have to do after that is refer to them.

Andreas 08-06-2005 07:11 PM

1 Attachment(s)
@Marco (and of course also all others interested)
I've re-implemented both Suggestions to cut down File Edits.

Only 1 File Edit (2 Lines) to config.php is required, and it will even survive Upgrades.

What do you think?

For Alternative 2:
Maintaining the Table should be done by Product Install/Uninstall-Codes so we don't have to care for that, except disabling/enabling a Product (which is handled by a Plugin).

I think i'll also implement Revans Idea (var_dump).

phlogiston 08-06-2005 09:47 PM

Quote:

Originally Posted by MarcoH64
I am a bit disappointed at the lack of feedback and discussion in this thread from most coders.

So far I've had to add two datastore items and one phrasegroup via edit to global.php On my site that doesn't bother me, but it will discourage me from sharing which is a shame :(

So you definitely have my full support trying to work this one out, but to be honest my knowledge is more patched together from hacking rather than being up to speed to follow the intricacies of trying to optimise how to do this.

Basically: sorry I ain't much practical help but folk are interested & keen to have a good solution to this (Y)

Revan 08-06-2005 11:21 PM

Quote:

Originally Posted by amykhar
Look at the top of just about every vbulletin script. You'll see something like this:
Code:

// get special data templates from the datastore
$specialtemplates = array(
        'userstats',
        'birthdaycache',
        'maxloggedin',
        'iconcache',
        'eventcache',
        'mailqueue'
);

That pulls the datastore items into the code you are going to use. All you have to do after that is refer to them.

Thanks for the lesson, it worked like a charm :)
I even managed to code a workaround for having to prefix my custom datastore items with 'rpg_' (for ease of uninstall, identification etc) to stop my custom class calls to have to have this prefix as well :)

Marco van Herwaarden 08-07-2005 06:05 AM

Quote:

Originally Posted by phlogiston
So far I've had to add two datastore items and one phrasegroup via edit to global.php

Putting them in global should only be done if they are used everywhere. If they are only used in a few scripts, they should be placed in those scripts, meaning maybe a lot of edits.

Will have a look at your solutions on monday kirby.

Andreas 08-08-2005 07:42 PM

Monday has almost passed ... at least in my Timezone ;)

Marco van Herwaarden 08-08-2005 07:48 PM

Yeah i know, and i didn't hae time today. :(
And i even doubt i will have time tomorrow, but will look as fast as i can.

But this don't need to stop other coders to have a look and comment. :D

Andreas 08-16-2005 08:55 PM

*bump*

?

merk 08-16-2005 10:09 PM

I really think the solution to this problem could be very simple

Datastore class:

[sql]
$dataitems = $db->query_read("
SELECT title, data
FROM " . TABLE_PREFIX . "datastore
# LEFT JOIN " . TABLE_PREFIX . "_NEWTABLE_ ON(datastore.title = _NEWTABLE_.title AND \"" . THIS_SCRIPT . "\" IN(_NEWTABLE_.page)
# LEFT JOIN " . TABLE_PREFIX . "product ON (product.productid = _NEWTABLE_.productid)
WHERE title IN ($itemlist)
# OR ( NOT NULL(_NEWTABLE_.title) AND product.active = true )
");
[/sql]

Andreas 08-16-2005 10:32 PM

That's basically my idea :)

But it does only work for the default Datastore Class - and only for Datastore Items.


All times are GMT. The time now is 06:04 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.01558 seconds
  • Memory Usage 1,738KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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