Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #41  
Old 08-06-2005, 07:33 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
  #42  
Old 08-06-2005, 08:11 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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).
Attached Files
File Type: zip ds4plugins.zip (3.8 KB, 7 views)
  #43  
Old 08-06-2005, 10:47 PM
phlogiston's Avatar
phlogiston phlogiston is offline
 
Join Date: Feb 2003
Location: Woodlands
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
  #44  
Old 08-07-2005, 12:21 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #45  
Old 08-07-2005, 07:05 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
  #46  
Old 08-08-2005, 08:42 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Monday has almost passed ... at least in my Timezone
  #47  
Old 08-08-2005, 08:48 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
  #48  
Old 08-16-2005, 09:55 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*bump*

?
  #49  
Old 08-16-2005, 11:09 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]
  #50  
Old 08-16-2005, 11:32 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's basically my idea

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:35 PM.


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.04676 seconds
  • Memory Usage 2,260KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete