Quote:
|
Quote:
|
i'm still trying to figure out how to export this entire thing (with all my crons/ phrases etc) but no one is helping me out on .com
http://www.vbulletin.com/forum/showthread.php?t=274552 otherwise, i'd just post my entire product. basically, this is what i did. 1) I made a cron job to populate a table from live post/thread table data. (Perhaps this table is useless now altogether, but i like having a table i can reference during testing. next version probably won't include this cache_ table at all) Code:
<?php Set up the cron job to run this script as you like. Run it once manually to make sure you have data in the datastore row. there will actually be a row with the name skm_active_cache in the datastore table. 2) from there, i have 4 plugins in my product Quote:
it contains a simple line: Code:
$globaltemplates[] = 'skm_activethreads24_forumhome'; This file pulls the datastore row into memory: Code:
$datastore_fetch[] = "'skm_active_cache'"; c) forumhome_complete hook : parse the data and print it to the template step. obviously, forumhome_complete should match the area you are trying to hook into. in my case, it was on the forum home. Code:
foreach ($vbulletin->skm_active_cache AS $mycache) Code:
<a href="showthread.php?t=$output[threadid]&goto=newpost"> That's about it. basically, you need to fill the datastore with your query, and pull with a foreach of the array once the data has been initialized. |
Hello,
Thank you so much for your tutorial. This was exactly what I was looking for. I write my own products/plugins (our forums is huge) and I was wondering how to cache stuff around. However I faced one problem: I couldn't read data back. The solution was to add a "1" parameter on the store command: build_datastore('name',serialize($variable),1); When retrieving you don't need to "unserialize" it. Also I was trying to call my cached array inside a class that hasn't had $vbulletin as a global variable, so I needed to add: global $vbulletin; On the top of my plugin. And I also needed to add a plugin for the init_startup hook, adding: $datastore_fetch[]="'name'"; I hope this feedback helps other coders. Cheers, Gabriel. |
Quote:
|
Is there a datastore per user?
|
If you have this, now How can I delete one of the data (red below) ???
Code:
a:3:{ |
it could be possible to fetch more than 1 value
for example (ID: 1) (Title: Dog) (Value: Dog , dog2, dog4) and be able to delete dog4 (ID: 1) (Title: Dog) (Value: Dog , dog2) or add more any ideas? maybe first check if its empty or :S? |
Hello,
I seem to be unable to persist the values in datastore. Variables built and stored to datastore in global_start plugin are lost in subsequent requests. I wish the purpose, usage, lifecycle, limitations and performance of datastore would be discussed more in the article. -Pete |
Quote:
That's what i was missing :) |
All times are GMT. The time now is 04:47 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|