View Single Post
  #6  
Old 01-21-2015, 09:04 AM
Medi0cr3 Medi0cr3 is offline
 
Join Date: Aug 2014
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
If you're doing your add in a plugin or a custom page using vbulletin code, then you should use the forum datamanager (in includes/class_dm_forum.php). You can see how to use it in by looking in admincp/forum.php, the section that starts with:
Code:
// ###################### Start update #######################
if ($_POST['do'] == 'update')

I don't know the answer to your question offhand, but looking at that code a little bit and when the datamanager saves a forum it calls build_forum_permissions() in includes/adminfunctions.php, and I believe that also rebuilds the forumcache, which is probably your problem. If you can't include the vbulletin code so that you can use those fucntions, then you might want to look in there and see what it's doing.
Thanks kh99,
The I saw the do:update thing last night as I was cruisin through the code. I'm just not sure how to supply information to the datamanager and haven't yet tried to utilize it via PHP only. It looks like it should be included in my custom page and then supplied the do=update (however I am going to guess that update is an array with all the data I want in it.) This is just a theory right now and I've got a lack of knowledge basis of how to interact with the datamanager to do a practical test. Looking at class_dm_forum.php I see how its done, but still not sure how to interact with the manager.


Quote:
Originally Posted by bridge2heyday View Post
PHP Code:
$vbulletin->forumcache 
is pulled from datastore ..
You should run function
PHP Code:
build_forum_permissions() 
after your query to update datastore
So after I do an INSERT INTO in the "forum" table, i should include adminfunctions.php and call build_forum_permissions() ??? Not quite sure where you are going with that.

Quote:
Originally Posted by ozzy47 View Post
Yeah I don't get it, if you want to add forums, why not just use the forum manager?
Ozzy, I have a custom coded page where I can add a "clan" and assign a usergroup ('leader') to that clan as well as have it automatically generate an X amount of forums and child forums for it. A lot less work and more automation means much more time spent elsewhere.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01205 seconds
  • Memory Usage 1,783KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete