Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2009, 02:08 PM
Phantasmagoric Phantasmagoric is offline
 
Join Date: Feb 2009
Location: United Kingdom
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [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?
Reply With Quote
  #2  
Old 03-26-2009, 02:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-26-2009, 04:06 PM
Phantasmagoric Phantasmagoric is offline
 
Join Date: Feb 2009
Location: United Kingdom
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #4  
Old 03-26-2009, 04:53 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 03-26-2009, 05:03 PM
Phantasmagoric Phantasmagoric is offline
 
Join Date: Feb 2009
Location: United Kingdom
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:23 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.03883 seconds
  • Memory Usage 2,198KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete