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 05-25-2009, 11:56 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default minor or equal / greater or equal operators in template

hello!

im looking foward to create a mod for my forum

i want people to have custom ranks based on their gender, and the custom ranks to grow from their postcount like the default ranking system works

so im aware i need the post variable and lots of if/else cases but, to be honest im not sure where to begin, so far i have tried to write the code on a hook in postbit_complete and imput the variable in the postbit template but it doesnt seems to work, thanks for your help!
Reply With Quote
  #2  
Old 05-26-2009, 07:01 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can use them in the same way you do in PHP.
Code:
<if condition="$var1 < 2">
<if condition="$var1 =< 2">
<if condition="$var1 == 2">
Reply With Quote
  #3  
Old 05-26-2009, 02:24 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
You can use them in the same way you do in PHP.
Code:
<if condition="$var1 < 2">
<if condition="$var1 =< 2">
<if condition="$var1 == 2">
that's a new one for me! thanks a lot for your reply

--------------- Added [DATE]1243358250[/DATE] at [TIME]1243358250[/TIME] ---------------

Quote:
Originally Posted by Dismounted View Post
You can use them in the same way you do in PHP.
Code:
<if condition="$var1 < 2">
<if condition="$var1 =< 2">
<if condition="$var1 == 2">
nevermind, disregard my last post, i tried to make it work and its not working

PHP Code:
<if condition="$post[posts] < 2">
my rank is 1 </if>

<if 
condition="$post[posts] =< 20">
my rank is 2 </if>

<if 
condition="$post[posts] =< 30">
my rank is 3 </if> 
Reply With Quote
  #4  
Old 05-27-2009, 07:20 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm assuming you want to add something to postbit - you can just use the user ranks feature for that.

Also, the "posts" number is formatted (e.g. 1,000 instead of 1000) and will fail in number comparisons.
Reply With Quote
  #5  
Old 06-02-2009, 08:07 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
I'm assuming you want to add something to postbit - you can just use the user ranks feature for that.

Also, the "posts" number is formatted (e.g. 1,000 instead of 1000) and will fail in number comparisons.
how do i get the number raw instead? without format to use them in the template, and what im trying to do, is to generate the ranks based on the members gender, for example, when the male users reaches 500 posts their rank becomes "prince" and when the female users reaches 500 posts their rank become "princess" and on untill they reach king/queen, emperor/emperess
Reply With Quote
  #6  
Old 06-03-2009, 06:23 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't get the number raw without using plugins. What you can do is setup a rank, and use conditionals on that rank's content.
Reply With Quote
  #7  
Old 06-03-2009, 05:40 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
You can't get the number raw without using plugins. What you can do is setup a rank, and use conditionals on that rank's content.
alright, thanks for your patience so far <: i appreciate it!

now i been trying to add the plugin as requested, i suppose i need to find the variable vbulletin uses to extract the userposts from the table and make a new variable with the stripped commas from the userposts, what i have tried so far is this:

plugin: showthread_postbit_create
$rawpost = str_replace(",", "", $bbuserinfo[posts]);

im not sure if i have to se $bbuserinfo[post] or the variable $post that appears in showthread.php

as well i suppose i need to find a way to fit $rawpost in either the global vbulletin array or in the $post[] array that the template uses

thanks again for your time and patience
Reply With Quote
  #8  
Old 06-04-2009, 05:48 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

postbit_display_start
PHP Code:
if (!empty($this->post['userid']))
{
    
$rawposts $this->post['posts'];
}
else
{
    
$rawposts 0;

Reply With Quote
  #9  
Old 06-04-2009, 07:36 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
postbit_display_start
PHP Code:
if (!empty($this->post['userid']))
{
    
$rawposts $this->post['posts'];
}
else
{
    
$rawposts 0;

worked like magic!

thanks a lot! you have helped me a lot and at the same time i have realized i have a LONG LONG LONG road ahead to cross in this little vbulletin modification world; thanks again!
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 11:02 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.04016 seconds
  • Memory Usage 2,257KB
  • 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
  • (3)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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