Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2007, 10:25 AM
Stickers Stickers is offline
 
Join Date: Mar 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how to add $foruminfo[forumid] in a plugin

Hi,

I was wondering if this is possible.. can i use this in a plugin
Code:
<if condition="in_array($foruminfo[forumid], array(1,2,3,4,5,6))">
Best regards
Reply With Quote
  #2  
Old 09-09-2007, 10:38 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Plugins use PHP code, not a wrapper like the one you've shown. Use this:
PHP Code:
if (in_array($foruminfo['forumid'], array(1,2,3,4,5,6)))
{
    
INSERT TRUE CODE
}
else
{
    
INSERT FALSE CODE

Reply With Quote
  #3  
Old 09-09-2007, 12:10 PM
Stickers Stickers is offline
 
Join Date: Mar 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Dismounted,

Do you know how i can display the child-forum id's? like if main forum id is 1 and the child-forums are 2,3,4,5

if (in_array($foruminfo['forumid'], array(1)))
{
$subforums.= "$child-forumid's from forumid 1";
}
or is this not possible?

Best regrads,
Reply With Quote
  #4  
Old 09-09-2007, 12:15 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll have to query for the ids then display them. What are you trying to do exactly with this?
Reply With Quote
  #5  
Old 09-09-2007, 12:29 PM
Stickers Stickers is offline
 
Join Date: Mar 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i want to add the child-forumid automatically

like if put this in my template <if condition="in_array($foruminfo[forumid], array(1,$child-forumid))">
that $child-forumid add the child-forums id's

I have in forum id 1 more then 150 child forums and i want to save some time to add them all in the "<if condition="in_array($foruminfo[forumid], array(1,2,3,4,etc,))">

Best regards
Reply With Quote
  #6  
Old 09-10-2007, 01:22 PM
Stickers Stickers is offline
 
Join Date: Mar 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

someone an idea how to do this?
Reply With Quote
  #7  
Old 10-06-2007, 01:38 AM
Pale Jewel Pale Jewel is offline
 
Join Date: Apr 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Stickers,
That sounds pretty much exactly what I'm trying to do. I've used the Ultimate Side Columns hack I got here to put a right side column in my forum home pages. What I want is to display links in that column to information pertaining to the subforums of the parent forum. i.e. Mexico has 2 subforums: Acapulco and Cancun. When your're in the Mexico forum, I want to see links to the Travel Guides for Acapulco and Cancun in that right column. Then when those individual links are clicked, it will show hotel information etc specific to those areas.

I've created a plugin that hooks into cache_templates. I can get it to display the childlist in an array as forumids.


$childlist_title = $foruminfo['childlist'];

foreach ($childlist_title AS $val)
{

// And then there is a piece of code that filters the ids of the main forum and the parent forum.


if ($val == -1 OR $val == $foruminfo[forumid])
{
"don't print";
}
else
{
"print";
}
}

But this is where I've gotten hung up. I'm not really experienced with PHP but I try awfully hard. And it's probably pretty basic PHP stuff but I can't seem to figure out how to put this into a code that will loop through the other values in the array and spit them out as $foruminfo[title]. I've tried both a for loop and foreach but my coding experience is not extensive enough for me to figure out what I'm doing wrong. It either prints nothing, or it prints the array. Have you gotten anywhere with your problem? Maybe what I've done might help you. Or better yet, maybe you can help me! Any ideas?

Thanks!

PJ
Reply With Quote
Reply


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 12:28 AM.


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.03589 seconds
  • Memory Usage 2,216KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete