View Full Version : Creating a Custom Template with Member Variables
cinnamonbits
11-13-2008, 06:54 AM
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.