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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2015, 04:31 AM
mondingnibai mondingnibai is offline
 
Join Date: Mar 2015
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Calling a plug-in

I am newbie on this kind of field such as editing vbulletin. Right now, Im trying to add a simple plugin which display the message hi, but sad to say when I run it does not give output or result. How to call a plug-in?how to print data in vbulletin?

Here's my plug in message code
$msg = "Test Message"

Now, I want to display this message in the bottom part of my page. How?Please guide me guyz..
Reply With Quote
  #2  
Old 03-06-2015, 10:34 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vbulletin works by having all the output in templates with variables that can be replaced. So to display something you have to choose an existing template (assuming that you're not creating an entirely new page), edit the template to insert your variable, then have your plugin code register the variable to that template. I know, it's too complicated for one sentence.

There are also "template hooks" that let you skip the "register variable" part by using an existing variable, but those are of course limited to where they decided to insert hooks in the templates. For example, there's a hook in the postbit_legacy template that lets you insert things in the user info area of the post. So if your plugin code was $template_hook['postbit_userinfo_left'] = 'Hello";, you'd see Hello in each postbit.

One way to figure out which templates are used on a page is to go to the admincp, and in Settings > Options> General Settings, set "Add Template Name in HTML Comments" to Yes. Then if you view the source of a page in your browser, you'll see "BEGIN TEMPLATE" and "END TEMPLATE" comments in the html, and you can study them and figure out which template was used to display parts of the page.

To edit a template, you would go to Styles & Templates > Style Manager and select "Edit Templates" from the dropdown menu. Then you can double click on a template name from the list to edit it.

To register variables to a template, this article might help: https://vborg.vbsupport.ru/showthread.php?t=228078

And for some of the basics, there's always the online manual in the support section of vbulletin.com (make sure you choose a vb4 version from the dropdown before starting to read).

Edit: Oh, and if you don't care about all that and are just trying to get a message displayed, then you can give us more information about exactly what you're trying to do and we'll tell you how you can do it.
Reply With Quote
  #3  
Old 03-06-2015, 12:59 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check this: https://vborg.vbsupport.ru/showthread.php?t=315845
Reply With Quote
  #4  
Old 03-07-2015, 03:52 AM
mondingnibai mondingnibai is offline
 
Join Date: Mar 2015
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Black Snow View Post
When I check this code and follow the different instructions in here. .
Still my output does not shows up. what's the real problem here. .
Reply With Quote
  #5  
Old 03-07-2015, 04:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let us know the plugin code, what hook you are using, and any template code you have written and/or added.
Reply With Quote
  #6  
Old 03-07-2015, 06:28 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are missing the semi-colon ( after your code. Try adding that.
Reply With Quote
  #7  
Old 03-10-2015, 01:17 AM
mondingnibai mondingnibai is offline
 
Join Date: Mar 2015
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Black Snow View Post
You are missing the semi-colon ( after your code. Try adding that.
when I add the semicolon, still the result does not shows up. I dont know why, in my hook location I used global start.
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 11:14 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.03974 seconds
  • Memory Usage 2,214KB
  • 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
  • (2)bbcode_quote
  • (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