Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 07-22-2011, 04:59 PM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hook for custom block in UserCP

Hello,

I'm trying to add a custom block with menu options in usercp, but I can't find the right hook name to show it as seperate block (if possible first, or under PMs). The only that I succeeded to do, as you can see in the attached screenshot, is to add it at the bottom of the block My Setting.

Thank you
C.T
Attached Images
File Type: jpg usercp.jpg (17.0 KB, 0 views)
Reply With Quote
  #2  
Old 07-22-2011, 05:23 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this and place it accordingly in your USERCP_SHELL template.

HTML Code:
<div class="block">
<h2 class="blockhead">Your Custom Block title</h2>
<div class="blockbody">
{vb:raw template_hook.usercp_navbar_miscellaneous}</div>
</div>
You can also replace the variable hook with your own code. Just remember to add the appropriate class to the <ul> and <li>.
Reply With Quote
  #3  
Old 07-22-2011, 06:08 PM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EquinoxWorld View Post
Try this and place it accordingly in your USERCP_SHELL template.

HTML Code:
<div class="block">
<h2 class="blockhead">Your Custom Block title</h2>
<div class="blockbody">
{vb:raw template_hook.usercp_navbar_miscellaneous}</div>
</div>
You can also replace the variable hook with your own code. Just remember to add the appropriate class to the <ul> and <li>.
Thank you for your time to reply, but this is something that I already did as you can see in the screenshot. The problem is that as this is part of custom mod, I want to place it automatically without asking the enduser to edit any template.
Reply With Quote
  #4  
Old 07-22-2011, 06:30 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr.Classifieds View Post
Thank you for your time to reply, but this is something that I already did as you can see in the screenshot. The problem is that as this is part of custom mod, I want to place it automatically without asking the enduser to edit any template.
Ahh I get cha. Well you can always register your menu content as a variable then parse it in that hook I mentioned, but that would not solve where it is actually placed. To move the hook you need something else, or create your own hook. Sorry I couldn't be much help. :erm:

P.S.: If you find documentation on how to create your own hook please share
Reply With Quote
  #5  
Old 07-22-2011, 07:41 PM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1. Open Template USERCP_SHELL and choose any hook which u want.

for ex:

Code:
usercp_navbar_myaccount

2. Create New Plugin

Plugin Hook: usercp_nav_complete
Title: Ur wish

Code

Code:
$template_hook['usercp_navbar_myaccount'] .= vB_Template::create('mytemplate')->render();
where mytemplate is name of ur template.


and save the plugin. (don't forget to select yes)
Reply With Quote
  #6  
Old 07-23-2011, 04:25 AM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
1. Open Template USERCP_SHELL and choose any hook which u want.

for ex:

Code:
usercp_navbar_myaccount
Thank you for answering but this is something that I already did, but is not what I want. All the hooks in the template USERCP_SHELL are reffering to add data within the "My Settings" block, while I want a seperate block. My current plugin is:
Code:
<plugin active="1" executionorder="40">
<title>Classifieds: User CP Navbar Link</title>
<hookname>usercp_nav_complete</hookname>
<phpcode><![CDATA[
$template_hook['usercp_navbar_bottom'] .= vB_Template::create('microclassifieds_usercp_links')->render();
]]></phpcode>
</plugin>
This add my block at the end of My Settings. I know that by changing the hook name I can move it up, but still will be inside My Settings block.

C.T.
Reply With Quote
  #7  
Old 07-23-2011, 05:16 AM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr.Classifieds View Post
Thank you for answering but this is something that I already did, but is not what I want. All the hooks in the template USERCP_SHELL are reffering to add data within the "My Settings" block, while I want a seperate block. My current plugin is:
Code:
<plugin active="1" executionorder="40">
<title>Classifieds: User CP Navbar Link</title>
<hookname>usercp_nav_complete</hookname>
<phpcode><![CDATA[
$template_hook['usercp_navbar_bottom'] .= vB_Template::create('microclassifieds_usercp_links')->render();
]]></phpcode>
</plugin>
This add my block at the end of My Settings. I know that by changing the hook name I can move it up, but still will be inside My Settings block.

C.T.

ya thats simple.


Have this plugin which u created

Code:
<plugin active="1" executionorder="40">
<title>Classifieds: User CP Navbar Link</title>
<hookname>usercp_nav_complete</hookname>
<phpcode><![CDATA[
$template_hook['usercp_navbar_bottom'] .= vB_Template::create('microclassifieds_usercp_links')->render();
]]></phpcode>
</plugin>
Now Open Template microclassifieds_usercp_links

At Top add this

Code:
  </ul></div>
                
        </div>

After This U can create ur block and note at last don't add

Code:
  </ul></div>
                
        </div>
as it is already there in USERCP_SHELL
Reply With Quote
Благодарность от:
EquinoxWorld
  #8  
Old 07-23-2011, 07:05 AM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
ya thats simple.


Have this plugin which u created

Code:
<plugin active="1" executionorder="40">
<title>Classifieds: User CP Navbar Link</title>
<hookname>usercp_nav_complete</hookname>
<phpcode><![CDATA[
$template_hook['usercp_navbar_bottom'] .= vB_Template::create('microclassifieds_usercp_links')->render();
]]></phpcode>
</plugin>
Now Open Template microclassifieds_usercp_links

At Top add this

Code:
  </ul></div>
                
        </div>

After This U can create ur block and note at last don't add

Code:
  </ul></div>
                
        </div>
as it is already there in USERCP_SHELL
System Teaser . I'll try it right now. Sorry for my delay on replying, but I've stucked building the page.

Thank you
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 04:23 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.04549 seconds
  • Memory Usage 2,267KB
  • Queries Executed 12 (?)
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
  • (11)bbcode_code
  • (2)bbcode_html
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete