Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-03-2009, 06:12 AM
DJ29Joesph DJ29Joesph is offline
 
Join Date: Jan 2009
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hooks Question

I have a hook that I want to add to the admincp login page. I know I have to use adminfunctions.php. The question I have is I have a hook that usually goes in the navbar near the login and submit buttons. Anyway I'm trying to add the hook and I know I have to use
PHP Code:
($hook vBulletinHook::fetch_hook('hook_name_here')) ? eval($hook) : false
But the question I have is how do I add it so it is in php? Do I have to do it in php? Mainly, what am I doing wrong?

Heres what I think it is (yes I know I did change hook_name_here):

PHP Code:
<!-- submit row -->
        <tbody>
        <tr>
            <td colspan="3" align="center"><div style="float: right">
            <?php ($hook vBulletinHook::fetch_hook('hook_name_here')) ? eval($hook) : false?></div>
                <input type="submit" class="button" value="  <?php echo $vbphrase['log_in']; ?>  " accesskey="s" tabindex="3" />
                <?php if ($showoptions) { ?><input type="button" class="button" value=" <?php echo $vbphrase['options']; ?> " accesskey="o" onclick="js_show_options('loginoptions', this)" tabindex="4" /><?php ?>
            </td>
        </tr>
        </tbody>
        <!-- /submit row -->
The main thing I'm changing (or adding) is:

PHP Code:
<div style="float: right">
            <?php ($hook vBulletinHook::fetch_hook('hook_name_here')) ? eval($hook) : false?></div>
Any help would be great, thanks!
Reply With Quote
  #2  
Old 07-03-2009, 02:12 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to add a file to the includes/xml directory that defines your hook so it will show up in the hook location dropdown. Take a look at the existing files in there and you should get a good idea of what to do. Post back if you can't figure it out.
Reply With Quote
  #3  
Old 07-03-2009, 03:12 PM
DJ29Joesph DJ29Joesph is offline
 
Join Date: Jan 2009
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to take the wildest guess here, I'm guessing in the adminfunctions.php I have to put:

PHP Code:
<?php ($hook vBulletinHook::fetch_hook('xml_file_here')) ? eval($hook) : false?>
and in the xml file I have to put:

PHP Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<hooks>

    <hooktype type="another_name_here">
<hook>hook_name_here</hook>
</hooktype>

</hooks>
Am I anywhere close? Thanks Lynne!
Reply With Quote
  #4  
Old 07-03-2009, 08:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It looks right - just try it and you'll see.
Reply With Quote
  #5  
Old 07-03-2009, 10:01 PM
DJ29Joesph DJ29Joesph is offline
 
Join Date: Jan 2009
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It still doesn't work. Any other ideas?

Also is it...

PHP Code:
<?php ($hook vBulletinHook::fetch_hook('xml_file_here')) ? eval($hook) : false?>
or

PHP Code:
<?php echo ($hook vBulletinHook::fetch_hook('xml_file_here')) ? eval($hook) : false?>
either way I tried both ways!
Reply With Quote
  #6  
Old 07-04-2009, 12:55 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are creating a php hook, then you need to add it to the php page. You just make it look like any other evaled hook in a php page. You should not be echoing the hook like you are.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:48 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.03805 seconds
  • Memory Usage 2,213KB
  • 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
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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