Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2012, 01:46 PM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Getting the sub forum name from url

If my url looks like this http://www.clubmonza.com/forums/foru...p?2-Main-Forum

How can i get the forum name from the url (Main-Forum)
Reply With Quote
  #2  
Old 04-02-2012, 03:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you talking about getting it in a plugin or in a template? Can you be more specific about what you want. Or do you literally want to take "2-Main-Forum" and turn it into "Main-Forum"? If so, look at this PHP page on string functions - http://www.php.net/manual/en/ref.strings.php
Reply With Quote
  #3  
Old 04-02-2012, 03:44 PM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just want to pull the current sub forum name the the url so i can use it in my external

so $_get["?????"]; will show my the sub forum
Reply With Quote
  #4  
Old 04-02-2012, 09:33 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where is the url coming from? I'm wondering if there could be any other parameters on the url. Also you're saying this is not a vb script, right?
Reply With Quote
  #5  
Old 04-04-2012, 08:17 AM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the url is coming from vbulletin. All i really need to do is if a user is in a sub forum i want to know who to find the sub form name using hard code.
Reply With Quote
  #6  
Old 04-04-2012, 12:46 PM
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$foruminfo['title'] contains the title of the forum a user is in. You'll need to use it in a hook, most likely forumdisplay_start.

There's no reason to try and grab it from the URL, that's just over-complicating it.
Reply With Quote
  #7  
Old 04-04-2012, 03:24 PM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean by a hook??

My code looks like this

PHP Code:
<?php 


session_start
();

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''index');
define('CSRF_PROTECTION'true);
define('CSRF_SKIP_LIST''');
define('VB_ENTRY''forum.php');

// get special data templates from the datastore
$specialtemplates = array(
    
'userstats',
    
'birthdaycache',
    
'maxloggedin',
    
'iconcache',
    
'eventcache',
    
'mailqueue',
    
'activeblocks',
);

// pre-cache templates used by all actions
$globaltemplates = array(
    
'ad_board_after_forums',
    
'ad_board_below_whats_going_on',
    
'block_blogentries',
    
'block_cmsarticles',
    
'block_newposts',
    
'block_sgdiscussions',
    
'block_tagcloud',
    
'block_threads',
    
'block_html',
    
'FORUMHOME',
    
'forumhome_event',
    
'forumhome_subforums',
    
'forumhome_forumbit_level1_nopost',
    
'forumhome_forumbit_level1_post',
    
'forumhome_forumbit_level2_nopost',
    
'forumhome_forumbit_level2_post',
    
'forumhome_lastpostby',
    
'tag_cloud_link',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(
DIR '/includes/functions_bigthree.php');
require_once(
DIR '/includes/functions_forumlist.php');

echo 
"...".$foruminfo['title'] ;
?>


<img src="http://www.clubscuderia.co.uk/forum/sponsors/forums/autoficcinaforum.jpg" />
Reply With Quote
  #8  
Old 04-04-2012, 03:30 PM
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I mean. You're going about this all wrong...

Go to products and plugins -> create new plugin -> hook location: forumdisplay_start
Reply With Quote
  #9  
Old 04-04-2012, 03:45 PM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in my adds i use this to get the add
<center><iframe width="800" frameborder="0" height="110" src="http://www.clubmonza.com/forums/theadds.php"></iframe></center>

now i have made the plugin how to i call it within the Ad HTML section in advertising banners
Reply With Quote
  #10  
Old 04-04-2012, 06:43 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try this: create a new plugin using hook location parse_templates and this code:

Code:
global $foruminfo;
vB_Template::preRegister('ad_global_above_footer', array('foruminfo' => $foruminfo));


Then in your ad html, put {vb:raw foruminfo.title} where you want to use it.

ETA:...you also need to change the template name (in red) to the template for the ad location you're using - ad_global_above_footer was just an example.
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 01:09 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.06269 seconds
  • Memory Usage 2,260KB
  • 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
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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
  • (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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete