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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2007, 11:41 PM
mistyPotato mistyPotato is offline
 
Join Date: Dec 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Does $Post[Posts] return a String or Numeric ?

Hello All!

I would appreciate anyone giving me a bit of advice on this.....

I cannot get the value of $Post[Posts] to act like a number so I'm beginning to wonder if maybe this variable needs to be converted to a number for certain operations to work on it?

Thanks for your time :up:
Reply With Quote
  #2  
Old 07-31-2007, 11:46 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It returns an integer. Where are you trying to use it?

Keep too in mind, that $Post and $post are two totally different variables. If you're using $Post[Posts], you should be using $post[posts].
Reply With Quote
  #3  
Old 08-01-2007, 12:00 AM
mistyPotato mistyPotato is offline
 
Join Date: Dec 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Kirk and thanks for the reply :up:

Gee, you're the first to tell me that Post and post are different variables. Now I'll go back and see if maybe that's been the problem. I've been trying to use a post count conditional in the post bit legacy template to place a graphic on the left (in the Users information box) based on their post count but so far I haven't been able to get it to work.

Here's the suspect code....

<if condition="$post[posts] > 1000"><img src="images/misc/Contributor1.gif"></if>

I've tried changin this every way I could imagine but it still doesn't work. Should I be using the CAPITAL P?

Thanks a million!
MP
Reply With Quote
  #4  
Old 08-01-2007, 12:08 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, that's how it should be. Make sure you've got the image pointing to the correct path. You should also be using a self-closing tag: <img src="/image/gif.gif" />; but that wouldn't affect it displaying either way.
Reply With Quote
  #5  
Old 08-01-2007, 12:36 AM
mistyPotato mistyPotato is offline
 
Join Date: Dec 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow.

This is my dilemma. Everyone's told me "Yep. it's correct"....but it doesn't work :erm:

If I change the condition to something other than > 1000, such as == 1000, then it works...
so I know the image location is correct.

Seems the conditional does not like the greater than symbol
Reply With Quote
  #6  
Old 08-01-2007, 12:44 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you certain that the user's have more than 1,000 posts?
Reply With Quote
  #7  
Old 08-01-2007, 12:47 AM
mistyPotato mistyPotato is offline
 
Join Date: Dec 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We'll, their post count says over 3000 and when I look in the SQL tables I see members with over 1000 posts.

Isn't this odd ?
Reply With Quote
  #8  
Old 08-01-2007, 01:05 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... quite.

Okay, let's try going about this another way. Create a new plugin using hook location "postbit_display_start" with the following:
Code:
if ($this->post['posts'] > 1000){
$image = '<img src="images/misc/Contributor1.gif" />';
}
Place $image in your postbit where you'd like the image.
Reply With Quote
  #9  
Old 08-01-2007, 01:17 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Once it hits 1000 it is "1,000" so the comma is messing up your comparison.
Reply With Quote
  #10  
Old 08-01-2007, 01:20 AM
mistyPotato mistyPotato is offline
 
Join Date: Dec 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks again for your help Kirk. It's VERY nice of you to give of your time like this.
It is definitely appreciated.:up:

I added the plug in in hook but I wasn't sure how to add the $Image in the Post Bit Template.
(Did I mention I'm using the Legacy Post Bit Template?)

Do I just put $Image in the template where I want the image to appear?

Sir Adrian, I was Wondering about that. But if that were the case, anything UNDER 1000 should work...but it doesn't seem to either.

What's the difference between posts and postcount?

MP
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:16 PM.


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.04922 seconds
  • Memory Usage 2,245KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete