vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [RESOLVED] Developer postbit image problem (https://vborg.vbsupport.ru/showthread.php?t=209513)

Phantasmagoric 03-26-2009 02:08 PM

[RESOLVED] Developer postbit image problem
 
I'm trying to make an addition to the mod system we have installed on our site and am getting nowhere fast. You see here on vB.org when you post a Skin or Mod thread you get a DEVELOPER image in the sig sort of area of that thread, I'm trying to emulate that.

I have asked the mod system author but my question has got no reply.


This is what I'm using as the code:
Code:

<if condition="in_array($thread['forumid'], array(28,29,32,10,39,43,41,51)) && $threadinfo['postuserid'] == $bbuserinfo['userid']">
    <div><img src="$stylevar[imgdir_misc]/moddev.gif" width="100" height="21" border="0" alt="" class="inlineimg" /></div>
 </if>

The condition has to check if the forumid is a part of the mod systems forums and it has to check if the poster is the thread creator.

I have tried placing it in the postbit here (I don't know the best place to put it!):
Code:

        $template_hook[postbit_signature_start]
        $ad_location[ad_showthread_firstpost_sig]
        <if condition="in_array($thread['forumid'], array(28,29,32,10,39,43,41,51)) && $threadinfo['postuserid'] == $bbuserinfo['userid']">
    <div><img src="$stylevar[imgdir_misc]/moddev.gif" width="100" height="21" border="0" alt="" class="inlineimg" /></div>
</if>
        <if condition="$post['signature']">
        <!-- sig -->
            <div>
                __________________<br />
                $post[signature]
            </div>
        <!-- / sig -->
        </if>

        $template_hook[postbit_signature_end]

The moddev.gif isn't showing in the mod system forum posts so I obviously haven't got it right, does anyone know what the correct conditional should be and where in the postbit template this would be best placed?

Lynne 03-26-2009 02:43 PM

I think this is wrong in your condition:
HTML Code:

$threadinfo['postuserid'] == $bbuserinfo['userid']
That checks to see if the thread poster is *you*, the person viewing the thread. I think you want to use $post['userid'] to check the userid of the poster.

Phantasmagoric 03-26-2009 04:06 PM

I must just be monumentally dim Lynne, I've tried the code below and the image still wont show, is the conditional correct now do you think?

Code:

<if condition="in_array($thread['forumid'], array(28,29,32,10,39,43,41)) && $threadinfo['postuserid'] == $post['userid']">
    <div><img src="$stylevar[imgdir_misc]/moddev.gif" width="100" height="21" border="0" alt="" class="inlineimg" /></div>
</if>


Lynne 03-26-2009 04:53 PM

I have no idea if it's correct because I haven't tested it or anything. However, I do notice you are using both $threadinfo and $thread in the condition. I think $thread is the correct one.

You should print out the variables in the postbit and see what turns up. Print $threadinfo['postuserid'] and $post['userid'] (and $thread['postuserid'] ). That is how I debug conditions.

Phantasmagoric 03-26-2009 05:03 PM

That was it Lynne, thank you very very much for your excellent help. :-)


All times are GMT. The time now is 12:34 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
  • Page Generation 0.01235 seconds
  • Memory Usage 1,722KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (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