(vbulletin) replacing a number with an image

Discussion in 'PHP' started by Kremechoco, Oct 23, 2011.

  1. #1
    I been trying to get this to work but I'm completely lost on how to grab one thing and put it on another place.
    I'm still learning PHP so bare with me.

    Here's the deal, I been messing with vBActivity's activity level display system.
    I changed the template for 'dbtech_vbactivity_postbit_stats' to
    <vb:if condition="!($bbuserinfo['dbtech_vbactivity_settings'] & 128) OR $userinfo[activity]">
    <dd style="font-weight:bold;">Activity Stats<a id="collapse_c_vbactivity_bars_post[postid]" href="{vb:raw relpath}#top" style="position:relative; top:0px; right:0px; float:none;"></a></dd>
    <vb:if condition="!($bbuserinfo['dbtech_vbactivity_settings'] & 8)"><dt>{vb:rawphrase dbtech_vbactivity_level}</dt> <dd>{vb:raw userinfo.activitylevel}</dd></vb:if>
    <dd>
    <dl id="c_vbactivity_bars_post[postid]" style="display:{vb:raw display.bar};">
    <vb:if condition="!($bbuserinfo['dbtech_vbactivity_settings'] & 128)">
    <dt>{vb:rawphrase dbtech_vbactivity_level_percent}</dt> <dd>{vb:raw userinfo.levelpercent}%</dd>
    <dd>{vb:raw activitylevel}</dd>
    </vb:if>
    {vb:raw userinfo.activity}
    </dl>
    </dd>
    </vb:if>  
    HTML:
    And displays as

    [​IMG]

    Now, I want to change it so the '3' shows up as an image instead.
    In this case, the 3 is being shown by '{vb:raw userinfo.activitylevel}' which I have no clue what this would be. Where is it being pulled from? A plugin?

    To make it show up as an image instead, do I make a plugin? If so, how? And what would be the hook?
     
    Solved! View solution.
    Kremechoco, Oct 23, 2011 IP
  2. #2
    <vb:if condition="!($bbuserinfo['dbtech_vbactivity_settings'] & 128) OR $userinfo[activity]">
    <dd style="font-weight:bold;">Activity Stats<a id="collapse_c_vbactivity_bars_post[postid]" href="{vb:raw relpath}#top" style="position:relative; top:0px; right:0px; float:none;"></a></dd>
    <vb:if condition="!($bbuserinfo['dbtech_vbactivity_settings'] & 8)"><dt>{vb:rawphrase dbtech_vbactivity_level}</dt> <dd><img src="images/{vb:raw userinfo.activitylevel}.gif"></dd></vb:if>
    <dd>
    <dl id="c_vbactivity_bars_post[postid]" style="display:{vb:raw display.bar};">
    <vb:if condition="!($bbuserinfo['dbtech_vbactivity_settings'] & 128)">
    <dt>{vb:rawphrase dbtech_vbactivity_level_percent}</dt> <dd>{vb:raw userinfo.levelpercent}%</dd>
    <dd>{vb:raw activitylevel}</dd>
    </vb:if>
    {vb:raw userinfo.activity}
    </dl>
    </dd>
    </vb:if>
    Code (markup):

    This is the line I edited:
    <img src="images/{vb:raw userinfo.activitylevel}.gif">
    Code (markup):
    It should write to your page <img src="images/3.gif">

    You would then need to create numbered images like in your example a 3.gif image or of course whatever extension you want, .png or .jpg etc..

    Is this what you mean?
     
    MyVodaFone, Oct 23, 2011 IP
  3. Kremechoco

    Kremechoco Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Haha oh WOW. I was looking way too much into this, and totally forgot that was possible. Thank you very much. Exactly what I was looking for.
     
    Kremechoco, Oct 23, 2011 IP