vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Fetch current node and channelid (https://vborg.vbsupport.ru/showthread.php?t=325321)

delicjous 07-04-2017 07:08 AM

Fetch current node and channelid
 
Hi everyone,

I want to do my first real mod includes an API call.
I read about a mod-request which should list all Moderators of a Forum.
Thought it should be easy enough to start with.

But I did'nt find the API-call of the current channel and nodeid.
I need to set the current nodeid and current channelid to a variable

$nodeid =?
$channelid =?

I would show all usernames where moderator for nodeid and nodeid = channelid.
So if the User is moderator in nodeid = 3 (db-table moderator) the Moderatorbar should be visible at channel 3 pages.

Could anybody help me please :-)

delicjous 07-09-2017 04:28 PM

nobody?

Ok, I will explain it a little bit more specific.

I want to use the hook 'forumitem_below_description' to show a list of the forums mods.
But to use the class "vB_Library::instance('node')->getNodeModerators($nodeid);" I need the forum.nodeid of each forum.

PHP Code:

$channels vB::getDbAssertor()->getRows('vBForum:getChannelTree', array());
         
$nodeid $channels['nodeid']
        
        
$moderators vB_Library::instance('node')->getNodeModerators($nodeid);
            foreach (
$moderators as $moderator)
            {
                
$mod_id $moderator['userid']
                
$mod_name vB_Api::instanceInternal("user")->fetchMusername($moderator['userid']);
                
$mods[] = ['mod_id' => $$mod_id'mod_name' => $mod_name];
            } 

Could I fetch one nodeid by this and get it to getNodeModerators or do I have to do one more foreach?

I spend ours on it and don't know how to do it... :confused:

Edit: And how could I put an argument like forum=forum to the hook at product-file .
Edit and try this, because I found it at vbulletin_styles:
HTML Code:

<arguments><![CDATA[a:1:{s:8:"forum";a:1:{s:8:"forum";i:1;}}]]></arguments>
Edit 2.0:
Got it all by my self spending one day with vBulletin stuff!

After I got it I saw the mod already exist:
vbmods.rocks - Forum moderator-list


All times are GMT. The time now is 04:03 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.01643 seconds
  • Memory Usage 1,722KB
  • 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)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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