vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Creating a Custom Template with Member Variables (https://vborg.vbsupport.ru/showthread.php?t=196148)

cinnamonbits 11-13-2008 06:54 AM

Creating a Custom Template with Member Variables
 
Hey everyone, I was wondering if I could get some guidance on how I would code a member box of sorts. It would be custom template, I think, and it would sit between the forums and the navbar on the forum home template and the show forum template. In this box, it would contain the user's profile picture, their most recent visitor comment, a "status"-like profile field that they can change, and a member search box. Any guidance is well appreciated, as I've spent a lot of times on these forums and have dabbled in custom templates, and haven't had much success. Thank you!

Lynne 11-13-2008 03:10 PM

First, you'll need a plugin that will get all that information for you for the user.

Then, you'll need to 'make' the box in your FORUMHOME template. I don't think there is a template_hook in the area you are talking about. You may make one of your own and then put this new code into a new template. Then at the end of your plugin, you can just eval the template - eval('$template_hook[your_template_hook] .= " ' . fetch_template('your_template') . '";');

cinnamonbits 11-13-2008 04:31 PM

Fantastic! In this plugin, to generate a working member search box, an editable profile field, the most recent visitor message, and profile picture code, would I simply reference and take the code from the member page, the user cp, and the member info template, or would I need to create all new code with new database queries?

Lynne 11-13-2008 04:51 PM

You can try just referencing it to see if it's already available. But, you'll have to pick a hook location for your plugin that evals *after* that information is generated. So, look in your index.php file and find a plugin near the end and maybe that one will work for you.

cinnamonbits 11-13-2008 04:56 PM

Thank you so much for your help Lynne. I'll give it a shot.


All times are GMT. The time now is 05:05 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.01002 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete