I am creating a custom mod for my site, at the moment i have done this and only get a white page displayed, but at least the result appears. I am not sure what example to follow so that the rest of the showthread template appears too?
Plugin: Product: vBulletin Hook Location: showthread_post_start Title: galleryimagedisplay Execution Order: 5 PHP Code: Code:
$result = $db->query_first("SELECT * FROM dbtech_gallery_images WHERE roll_id = '$threadid'"); Code:
{vb:raw id} {vb:raw title} |
off hand it's vb:raw in the templates, not vbraw: and there is no $ either.
Code:
Test Text: {vb:raw id} {vb:raw title} |
I'm trying to use several of my user custom fields on a page in profile.php. I've got the template working and the page is displaying ok but I can't get the custom fields to display. I've tried a ton of stuff and just can't get it to work - would GREATLY appreciate any help you could provide. Here's what I'm doing now. This is the plug in code going into profile.php:
if ($_REQUEST['do'] == 'showsubscription') { echo 'test'; $customfields = array(); fetch_profilefields(0); $page_templater = vB_Template::create('showsubscription'); $page_templater->register('customfields', $customfields); } in the template itself I'm putting in: {vb:raw customfields.value11} where I want to use the field. I've also tried customfields.field11 various permutation of userinfo, userfield, etc. I was able to do this in vb3 no problem but having a tough time getting it to work in vB4. |
Do you have the working 3.x code?
|
Yes, in VB3 it was very easy - all I had to do was put $bbuserinfo[field11] on the template. The plugin portion of it was:
// ############################ start show subscription info ########################## if ($_REQUEST['do'] == 'showsubscription') { construct_usercp_nav('showsubscription'); $navbits[''] = 'Subscription Status'; $templatename = 'showsubscription'; $url =& $vbulletin->url; } |
I'm sorry, either I don't understand what you are trying to do or are missing something big.
|
I have a number of custom user fields created and I want for the values of those fields to appear on a profile page. In this case it's a subscription status page that lets the user know when their subscription expires and how many issues they have left remaining on their subscription. In VB3 the profile.php page had $bbuserinfo loaded with those fields and they could be called simply by putting $bbuserinfo[field11] in the template - it would put the value there.
showsubscription was the name of the custom template that I created and it would appear along with all of the profile page navigation around it. I have the showsubscription template appearing in vb4 now but I can't get the values of the custom fields to appear on the page. I'm pretty sure it will involve the {vb raw} function and registering a variable for it to be able to appear in the template but just can't figure it out. profile.php must already be loading the custom user fields somewhere because it's used elsewhere on the page. |
I have this little random banner code I've always used through the plugin system, but I can't seem to get it to work on vb4. Can anyone help?
normally, I call for it below the navbar with this... Code:
<br> Code:
$path = '/forum/images/adbanners/'; |
Quote:
Try using hook parse_templates and at the end of your plugin code add: Code:
vB_Template::preRegister('navbar', array('randombanner' => $randombanner)); Then in the navbar template, use this: Code:
<br> |
Thanks, Kevin. I really appreciate you taking the time to reply.
It seems I have everything right but it's not showing up. I'm not sure what else to do but this is the last thing I need before I can go live with my upgrades. VB is no help because it's custom code. I'm not sure what else to tell you that would be helpful? Would you be willing to hop over to my test forum and have a look? If so send me a pm and I'll give you login info. |
All times are GMT. The time now is 01:15 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|