The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Five star reputation
This is a rough hack using template conditionals. It replaces the standard scheme for displaying reputation, with user defined graphics linked to the reputation levels set in the admincp.
This is how I have set it up. It works but I'm sure it's not the most elegant solution. Anyone is welcome to take the idea and develop it further - I'm not going to! I have nine reputation levels set up. Three negative, one neutral and five positive. Positive reputation has one to five green blobs, negative has one to three red blobs. Neutral is one grey blob. Each level has it's own graphic (instead of repeating elements), which are uploaded to /images/reputation. I've based mine on the standard blobs, but they could be anything. The scores required for each level are controlled in the User Reputation Manager in the admincp. You will need to know the reputationlevelid of each rep level which is not shown on the admincp. You can easily check it by looking at the reputationlevel table using something like phpMyAdmin. The code in the postbit template looks like this: Code:
<if condition="$show['reputation'] AND $post['reputationlevelid']==16">Credibility: <img src="$stylevar[imgdir_reputation]/-3.gif" alt="$post[username] $post[level]" border="0"></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==17">Credibility: <img src="$stylevar[imgdir_reputation]/-2.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==18">Credibility: <img src="$stylevar[imgdir_reputation]/-1.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==19">Credibility: <img src="$stylevar[imgdir_reputation]/0.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==20">Credibility: <img src="$stylevar[imgdir_reputation]/1.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==24">Credibility: <img src="$stylevar[imgdir_reputation]/2.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==21">Credibility: <img src="$stylevar[imgdir_reputation]/3.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==22">Credibility: <img src="$stylevar[imgdir_reputation]/4.gif" alt="$post[username] $post[level]" border="0" /></if> <if condition="$show['reputation'] AND $post['reputationlevelid']==23">Credibility: <img src="$stylevar[imgdir_reputation]/5.gif" alt="$post[username] $post[level]" border="0" /></if> Code:
<if condition="$show['reputation']">$post[reputationdisplay]</if> Reputation is also displayed in the member list (memberlist_resultsbit) and memberinfo The code for this is lightly different and uses Code:
condition="$userinfo['reputationlevelid'] John |
#2
|
|||
|
|||
Quote:
Also, isn't this a template mod for vbulletintemplates.com instead of a hack for vbulletin.org? |
#3
|
||||
|
||||
I agree - this is not a hack.
|
#4
|
||||
|
||||
|
#5
|
|||
|
|||
Sorry, my mistake! I looked at this announcement before I posted and misunderstood "Template modifications that add a new level of functionality to vBulletin through the use of conditionals and PHP Include system." I had requested something similar as a hack and thought this could make the basis of a "proper" hack so I posted in the beta section.
A couple of thoughts though . . . Prior to VB3 the distinction between a template mod and a hack was clear to users: a template modification changed the way it looked, a hack changed the way it worked. IMHO defining a hack as something that requires a PHP file change is creating an artificial distinction. If someone is looking for a modification to how VB works how do they know where to look now? Will they find it here or at vBulletinTemplates.com? Just my 2c John |
#6
|
||||
|
||||
Any thread that is exclusively a template modification for vBulletin 3 should be posted at vBulletinTemplates.com.
If one is looking for a template modification, they should presuppose two things: First, since templates in vB3 can contain conditionals, when looking for a hack the person should consider whether it's a PHP code modification. Second, one should consider whether it's exclusively a template edit, regardless of it using PHP include or conditionals. In the former case, or if the hack contains PHP modifications and templates, one should know to search the vBulletin.org hack database. In the latter, they should refer to vBulletinTemplates.com. |
#7
|
|||
|
|||
That is a classic geek response!
I don't mean that in an offensive way at all, but whilst it's clear that you can see at a glance whether a new feature will require a template mod or a php hack it's not that obvious to most users. Quote:
A quick browse through the Modification Requests forum shows any number of hack requests that can in fact be achieved using template modifications . . . John |
#8
|
||||
|
||||
Heh, but I'm sure most of those template hacks are never released on vBulletin.org, but probably vBulletinTemplates.com or elsewhere.
I'm just voicing the rules. Personally, if I could have it, I'd allow template modifications to be released as hacks, as long as the templates contain conditionals, and the conditionals used are significant in their purpose, or there are enough of them. Conditionals, like PHP, are logic, not presentation that is HTML. |
#9
|
|||
|
|||
Quote:
Quote:
As I understand it, the purpose of vbulletin.org is to help people who want to change the way that their forums work. From what I have seen the majority of these people can't code php, don't understand the power of VB template conditionals, and may not even know how to write html! There is no chance that they will know whether a proposed modification can be done with template conditions or requires a php hack. Pre VB2 the definition of a hack as requiring a php edit was sound, but it's now out of date IMHO. Much better now to look at what a modification does rather than how it does it. I would suggest that vbulletin.org should be for changes to how VB works, and vbulletintemplates.com should be for changes to how it looks. Anyway that's my bit said and I am beginning to repeat myself! It's not my site and there may be good reasons to keep it the way it is. Might be worth some thought from those at the top though . . . Cheers John |
#10
|
|||
|
|||
Update.
Here is a rather more elegant replacement for the awful bit of code in my original post! Make sure that the image names match the ID of the reputation levels and use this instead of the stach of if statements: Code:
<if condition="$show['reputation']">Credibility: <img src="$stylevar[imgdir_reputation]/$post[reputationlevelid].gif" alt="$post[username] $post[level]" border="0"></if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|