MyBB Community Forums

Full Version: Custom Postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I've been trying to figure out how to allow members the ability to have a unique postbit, but I can't seem to call my custom template correctly.

I put this in global.php
eval("\$user_bg = \"".$templates->get('postbit_custom_user_bg')."\";");

and am using
{$user_bg}

To call it, but its not working at all.
Any suggestions as to why?
Can you post all the code? As I guess this isnt all of it Toungue

We may be able to see what you need to do better.
(2010-05-19, 06:55 AM)Tommyk Wrote: [ -> ]Can you post all the code? As I guess this isnt all of it Toungue

We may be able to see what you need to do better.

Well to test to see if the idea would work, I changed the tr background in the postbit template to this:

<tr bgcolor="{$user_bg}">

And made a new template as stated in my first post, with just
red
in it's context.

Then like I stated I put:
eval("\$user_bg = \"".$templates->get('postbit_custom_user_bg')."\";");

In global.php

And If Im not mistaken it should have turned the postbit table red.
But it didn't.

Before that, I was using a if statement, within the postbit template:

<if $uid == 1 then>
$user_bg = "red";
<else />
$user_bg = "#232323"
</if>

I left it basic for testing purposes, but it still didn't work.
Thanks for your help Tommyk.
Any ideas?
Im guessing you have the PHP in templates plugin installed? I have never done it this way, I have simply made a plugin for it Toungue
Why are you loading a template if you're trying to set a class....??
I think they are trying to load a class into the template :

tbh im quite confused
If you want them to be able to choose the colour of their posts, just add a custom profile field and put class={$post['fidX']}" in the templates, changing X to the ID of the custom profile field. I see no reason whatsoever for any templates for this.
I got it to work, using the class.
Thanks for the replies and help.