PDA

View Full Version : Pig's configurable rep gems


boozehound
12 Jan 2006, 19:03
A port to 3.5.x of this hack (http://www.vbulletin.org/forum/showthread.php?t=76586).

Description

Change the amount of reputation needed to acquire each reputation image (gem) as displayed in the postbit among other places
Change the type of image displayed for each level
Optionally insert a line break (or other markup) before one or more of the images


Installing this extension adds:
One database table.
Two plugins.
Two templates.
18 phrases.
One php file.
One xml file.

at a cost of:
One (small) query per page involving display of reputation (showthread, showpost, memberlist, member).


Installation

Download product.zip and unpack it.
Upload the files in the upload directory: admincp/repgems.php
includes/xml/cpnav_pig_rep_gems.xml
Install the product by importing the product-pig_rep_gems.xml file into the product manager in Admin CP

Additionally, you can upload the images in 'additional images.zip' to the images/reputation directory (read 'usage' below).

Usage

(Refer to the screenshots)

After installation reputations will appear as normal. Refresh your Admin CP and you'll find a new link in the 'User Reputations' section of the navigation frame labelled 'Manage Reputation Images'.

(see screen1.png)

Use the upper form to change the settings for each reputation image and the lower form to add new images.
'Minimum reputation' specifies the minimum amount of reputation a user must have to acquire the image. For negative reputations, the values are (-1 * the minimum).
The value of 'Image suffix' determines which type of image is shown for each level. A blank value corresponds to the standard dark green or dark red reputation images. A value of 'high' corresponds to the brighter coloured reputation images. These files are named reputation_highpos.gif and reputation_highneg.gif for positive and negative reputations respectively, whereas the 'blank' images are named reputation_pos.gif and reputation_highpos.gif respectively.
If one wanted to add a new type of image, for example reputation_maxpos.gif and reputation_maxneg.gif as found in 'additional images.zip' then they should be uploaded to images/reputation and the value of 'max' should be used in the 'Image suffix' field.
If you wish to insert a line break before a particular reputation image, change the 'insert break' setting to 'yes'. By default, this will result in the contents of the template 'postbit_pig_reputation_break' being inserted before the reputation image. This template by default contains simply:
<br/>


Screenshots

screen1.png show the Admin CP settings page after a new installation of the product.
screen2.png shows the settings page after two levels have been added, the types of image altered and a break inserted before image 8.
screen3.png shows the effect of the settings shown in screen2.png
screen4.png shows the settings page using two line breaks and a custom image type ('max').
screen5.png shows the effect of the settings shown in screen4.png.

ThePimp
12 Jan 2006, 19:23
Interesting

nexialys
12 Jan 2006, 19:51
very...

/me look at the install button...

to minimalise the change of 1 query, wouldn't it be good to store the data in the cache??

The Chief
12 Jan 2006, 19:57
Interesting

I agree...

boozehound
12 Jan 2006, 20:03
very...

* nexialys look at the install button...


to minimalise the change of 1 query, wouldn't it be good to store the data in the cache??
I don't know how to do that yet.

WNxWakko
12 Jan 2006, 21:40
Very nice, Installed and works perfect.

WNxWakko
12 Jan 2006, 22:48
Ok, when I read a PM, I get this error at the top of my page,

Warning: Invalid argument supplied for foreach() in /includes/functions_reputation.php(140) : eval()'d code on line 14

boozehound
12 Jan 2006, 23:00
Ok, when I read a PM, I get this error at the top of my page,
Update your product with this XML file (also updated in first post zip).

I omitted to include 'private' as one of the scripts that this hack applies to.

WNxWakko
12 Jan 2006, 23:06
Ok there seems to be another problem with this mod. Very strange one at that.

When I use quick reply on any post, I now get the transistion page saying,

This post is a duplicate of a post that you have posted in the last five minutes. You will be redirected to that thread.

Click here if your browser does not automatically redirect you.

However the reply is there.

I know its your mod because when I uninstall your mod, that problem goes away, reinstall mod, problem comes back.

Not on full Reply, Only on Quick reply.

boozehound
12 Jan 2006, 23:13
Ok there seems to be another problem with this mod. Very strange one at that.

When I use quick reply on any post, I now get the transistion page saying,



However the reply is there.

I know its your mod because when I uninstall your mod, that problem goes away, reinstall mod, problem comes back.

Not on full Reply, Only on Quick reply.
I can't reproduce this problem on my system. Does anyone else get this?

WNxWakko
12 Jan 2006, 23:48
This is frustrating. Cant figure out why your mod does this.

boozehound
12 Jan 2006, 23:55
This is frustrating. Cant figure out why your mod does this.
Neither can I, it doesn't have anything to do with posting. Can you try disabling the mod's plugins one by one to determine which one the problem lies with?

WNxWakko
13 Jan 2006, 00:01
Well if I turn off Reputation gem levels - fetch_reputation_image() then i can quick reply. If I turn off the other one, I get all kinds of crazy errors. Not sure if this helps.

WNxWakko
13 Jan 2006, 00:41
Alright, I figured out how to fix this.

Change this
if(in_array(THIS_SCRIPT, array('showthread','showpost','memberlist','member','private')))

to this
if(in_array(THIS_SCRIPT, array('showthread','showpost','memberlist','member','private','newreply')))

boozehound
13 Jan 2006, 00:45
Alright, I figured out how to fix this.

Change this


to this
Aha, schoolboy error on my part. Thanks. Product updated.

WNxWakko
13 Jan 2006, 03:54
Few more things. I noticed when you edit a post using the ajax editing, when you save all the rep images disappear. So you need to add editpost in your array also.

if(in_array(THIS_SCRIPT, array('showthread','showpost','memberlist','member','private','newreply',editpos t)))

Also as a suggestion, I would recommend rather than an array, a comparison as its faster. I have a large board so optimization is important.

If you change what I posted right above with this it will be faster,

if ((THIS_SCRIPT == 'showthread') OR (THIS_SCRIPT == 'showpost') OR (THIS_SCRIPT == 'memberlist') OR (THIS_SCRIPT == 'member') OR (THIS_SCRIPT == 'ajax') OR (THIS_SCRIPT == 'private') OR (THIS_SCRIPT == 'newreply') OR (THIS_SCRIPT == 'editpost'))

boozehound
13 Jan 2006, 16:56
Few more things. I noticed when you edit a post using the ajax editing, when you save all the rep images disappear. So you need to add editpost in your array also.



Also as a suggestion, I would recommend rather than an array, a comparison as its faster. I have a large board so optimization is important.

If you change what I posted right above with this it will be faster,
Nice one.

WNxWakko
13 Jan 2006, 23:43
Hate to burst your bubble again, lol error message on annoucements,

Need to add one more,

(THIS_SCRIPT == 'announcement')

boozehound
14 Jan 2006, 01:12
Hate to burst your bubble again, lol error message on annoucements,

Need to add one more,
Cheers, updated.

OAndrea
25 Jan 2006, 03:08
can I use this hack with the extended reputation hack?

Railen
21 Feb 2006, 15:42
I'm using this hack along with vBSupport System v1.1:
http://www.vbulletin.org/forum/showthread.php?t=94023

When I open a support ticket, I'm getting the same error another user was getting:

Warning: Invalid argument supplied for foreach() in /includes/functions_reputation.php(140) : eval()'d code on line 14
I'll get that error 1-4 times at the top of my page. Any ideas?

Edit: I'll try adding "OR (THIS_SCRIPT == 'vBSupport')"

Edit again: It was actually "support" not "vBSupport". However, this fixed it.

Railen
21 Feb 2006, 16:02
I'm actually looking for how to change the code so each level uses a different image, instead of adding all the images inline.

For example, level three uses "reputation_lev3pos.gif" instead of "reputation_lev1pos.gif reputation_lev2pos.gif reputation_lev3pos.gif"

Could you tell me what code to modify to accomplish this? (I might figure it out before you respond. If I do, I'll post my modification.)

Thanks.

Railen
21 Feb 2006, 16:21
To accomplish this, open the .xml file and find the line:
foreach($vbulletin->repsettings AS $replevel) {
At the end of this foreach statement, you'll find this line:
eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_pig_reputation') . '";');
Change this line to:
eval('$post[\'reputationdisplay\'] = "' . fetch_template('postbit_pig_reputation') . '";');
This will modify this hack to use individual images instead of multiple images.

HHU
12 Mar 2006, 00:31
This is what came up when importing the product...

Database error in vBulletin 3.5.4:

Invalid SQL:

INSERT INTO repgemlevel (minimum, template, suffix) VALUES (1, 0, '');

MySQL Error : Unknown column 'template' in 'field list'
Error Number : 1054
Date : Saturday, March 11th 2006 @ 05:29:46 PM

Zachariah
15 May 2006, 02:19
If you have Photopost vBGallery:

Error:
-- showimage.php

If you look @ a image the page will go white and only pass <body></body> tags.

Fix Add:
(THIS_SCRIPT == 'showimage') OR

zane99
06 Jan 2007, 22:09
damn. i need this for 3.6!!!

any1 can help?

da420
07 Jan 2007, 04:15
It works for me on 3.6...

zane99
12 Jan 2007, 14:26
It works for me on 3.6...

it works BUT when you go to add rep to sum1 with this hack enabled the button doesnt work.

da420
12 Jan 2007, 18:41
Speak for yourself :)

RCWong
14 Jan 2007, 21:10
Also get a Warning:

Invalid argument supplied for foreach() in /includes/functions_reputation.php(139) : eval()'d code on line 14

error when viewing members notes.

Matt_270581
01 Feb 2007, 13:32
^ Replace the following into the plugin code Product : Pig's configurable rep gems: Reputation gem levels - cache levels and it will fix the usernote problem. This will also fix the Rep disapearing problem in 3.6. :D After this modification It's now working fine in 3.6 :D

Replace
(THIS_SCRIPT == 'announcement')


With
(THIS_SCRIPT == 'announcement') OR (THIS_SCRIPT == 'usernote') OR (THIS_SCRIPT == 'reputation')

katie hunter
03 Jun 2007, 13:22
I can't see the download file ;s ? These two files are only gem pic and screenshots .

NVM fixed =)

ahtum
03 Aug 2007, 18:28
The menu isn't showing up in the ACP... :(

The Fat Boy
01 Oct 2007, 21:43
? where is it?

dashed
03 Oct 2007, 06:45
yeah the menu isn't showing up in 3.6.8

111
21 May 2008, 00:43
I can't see the download file ;s ? These two files are only gem pic and screenshots .

NVM fixed =)

Installation

* Download product.zip and unpack it.
* Upload the files in the upload directory:
o admincp/repgems.php
o includes/xml/cpnav_pig_rep_gems.xml
* Install the product by importing the product-pig_rep_gems.xml file into the product manager in Admin CP

yes i cant find those files too