View Full Version : minor or equal / greater or equal operators in template
White_Snake
05-25-2009, 11:56 PM
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!
Dismounted
05-26-2009, 07:01 AM
You can use them in the same way you do in PHP.
<if condition="$var1 < 2">
<if condition="$var1 =< 2">
<if condition="$var1 == 2">
White_Snake
05-26-2009, 02:24 PM
You can use them in the same way you do in PHP.
<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 :D
--------------- Added 1243358250 at 1243358250 ---------------
You can use them in the same way you do in PHP.
<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
<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>
Dismounted
05-27-2009, 07:20 AM
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.
White_Snake
06-02-2009, 08:07 PM
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
Dismounted
06-03-2009, 06:23 AM
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.
White_Snake
06-03-2009, 05:40 PM
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 :D
Dismounted
06-04-2009, 05:48 AM
postbit_display_start
if (!empty($this->post['userid']))
{
$rawposts = $this->post['posts'];
}
else
{
$rawposts = 0;
}
White_Snake
06-04-2009, 07:36 PM
postbit_display_start
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!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.