Reeve of shinra
02-23-2006, 10:00 PM
Give Points from the postbit - Ebux Edition!
** Please not that this is a beta ***
What this hack does: (see screenshots below)
This lets you add/deduct user points directly from the postbit updating your default ebux fields. If your not using the standard ebux fields, or if your using an alternate points system like ucash, its easy to edit the variable for these fields in points.php.
This also adds a field to the post table which will show how many points were given for that particular post.
So for example, I see a post I like and I give that user 5 points. When another mod comes around, he can see that the user now has a total of 20 points and it will show that 5 points was given for that post so he doesn't double credit the user.
Queries:
I have a decent size board and I've been using a variation of this mod since vb2 -- its very friendly. If you have a lot of posts, you may want to turn off your board for the minute it will take for the product to add the new field.
It uses 0 additional queries during regular use.
When your staff gives points, it uses 4 small queries but again thats only when your staff uses this to give points and NOT during regular use.
Why is it beta?
1. If your using a table prefix you need to manually set the field edit points.php and change this $pointstable = 'user'; to including your table prefix.
2. I had to do a very small work around because of a problem I started having as of 3.5... I haven't experienced any issues because of this but others might. Its related to the postbit so if its an issue you can just undo that part and be okay.
3. This doesn't record the points staff give to users in the ebux history log. I may add that if enough people want it.
4. This uses whole numbers and not decimals so they get dropped or rounded up. I have to see about changing that.
Install Instructions:
Step 1:
If your using a table prefix, you will need to edit points.php and add it
in the very begining to the $pointstable so $pointstable = 'prefix_user';
Step 2:
Upload points.php to your estore folder
Upload coin.gif to your images/misc folder
Step 3:
Import shinrapoints.xml as a product in your admincp.
Step 4:
Add the following to your postbit template.
<!-- begin points mod -->
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
<div>
</form> <!-- gets around an error -->
<form action="./estore/points.php" method="post" name="gilform">
<input type="hidden" name="postid" value="$post[postid]">
<input type="hidden" name="userid" value="$post[userid]">
<input type="text" name="amount" size="3">
<input type="image" src="images/coin.gif" border="0" name="submit" alt="Give Points" onClick="javascript:alert('Points Paid!');">
</form>
<br />
<br />
</div>
<div class="smallfont">
Post Points: $post[pointspd]
</div>
</if>
<!-- / end points mod -->
** Please not that this is a beta ***
What this hack does: (see screenshots below)
This lets you add/deduct user points directly from the postbit updating your default ebux fields. If your not using the standard ebux fields, or if your using an alternate points system like ucash, its easy to edit the variable for these fields in points.php.
This also adds a field to the post table which will show how many points were given for that particular post.
So for example, I see a post I like and I give that user 5 points. When another mod comes around, he can see that the user now has a total of 20 points and it will show that 5 points was given for that post so he doesn't double credit the user.
Queries:
I have a decent size board and I've been using a variation of this mod since vb2 -- its very friendly. If you have a lot of posts, you may want to turn off your board for the minute it will take for the product to add the new field.
It uses 0 additional queries during regular use.
When your staff gives points, it uses 4 small queries but again thats only when your staff uses this to give points and NOT during regular use.
Why is it beta?
1. If your using a table prefix you need to manually set the field edit points.php and change this $pointstable = 'user'; to including your table prefix.
2. I had to do a very small work around because of a problem I started having as of 3.5... I haven't experienced any issues because of this but others might. Its related to the postbit so if its an issue you can just undo that part and be okay.
3. This doesn't record the points staff give to users in the ebux history log. I may add that if enough people want it.
4. This uses whole numbers and not decimals so they get dropped or rounded up. I have to see about changing that.
Install Instructions:
Step 1:
If your using a table prefix, you will need to edit points.php and add it
in the very begining to the $pointstable so $pointstable = 'prefix_user';
Step 2:
Upload points.php to your estore folder
Upload coin.gif to your images/misc folder
Step 3:
Import shinrapoints.xml as a product in your admincp.
Step 4:
Add the following to your postbit template.
<!-- begin points mod -->
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
<div>
</form> <!-- gets around an error -->
<form action="./estore/points.php" method="post" name="gilform">
<input type="hidden" name="postid" value="$post[postid]">
<input type="hidden" name="userid" value="$post[userid]">
<input type="text" name="amount" size="3">
<input type="image" src="images/coin.gif" border="0" name="submit" alt="Give Points" onClick="javascript:alert('Points Paid!');">
</form>
<br />
<br />
</div>
<div class="smallfont">
Post Points: $post[pointspd]
</div>
</if>
<!-- / end points mod -->