PDA

View Full Version : Pig's configurable rep gems


boozehound
01-11-2006, 10:00 PM
A port to 3.5.x of this hack (https://vborg.vbsupport.ru/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
01-12-2006, 05:23 PM
Interesting

nexialys
01-12-2006, 05:51 PM
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
01-12-2006, 05:57 PM
Interesting

I agree...

boozehound
01-12-2006, 06:03 PM
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
01-12-2006, 07:40 PM
Very nice, Installed and works perfect.

WNxWakko
01-12-2006, 08:48 PM
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
01-12-2006, 09:00 PM
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
01-12-2006, 09:06 PM
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
01-12-2006, 09:13 PM
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
01-12-2006, 09:48 PM
This is frustrating. Cant figure out why your mod does this.

boozehound
01-12-2006, 09:55 PM
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
01-12-2006, 10:01 PM
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
01-12-2006, 10:41 PM
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
01-12-2006, 10:45 PM
Alright, I figured out how to fix this.

Change this


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

WNxWakko
01-13-2006, 01:54 AM
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',editpost)))

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
01-13-2006, 02:56 PM
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
01-13-2006, 09:43 PM
Hate to burst your bubble again, lol error message on annoucements,

Need to add one more,

(THIS_SCRIPT == 'announcement')

boozehound
01-13-2006, 11:12 PM
Hate to burst your bubble again, lol error message on annoucements,

Need to add one more,
Cheers, updated.

OAndrea
01-25-2006, 01:08 AM
can I use this hack with the extended reputation hack?

Railen
02-21-2006, 01:42 PM
I'm using this hack along with vBSupport System v1.1:
https://vborg.vbsupport.ru/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
02-21-2006, 02:02 PM
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
02-21-2006, 02:21 PM
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
03-11-2006, 10:31 PM
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
05-15-2006, 12:19 AM
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
01-06-2007, 08:09 PM
damn. i need this for 3.6!!!

any1 can help?

da420
01-07-2007, 02:15 AM
It works for me on 3.6...

zane99
01-12-2007, 12:26 PM
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
01-12-2007, 04:41 PM
Speak for yourself :)

RCWong
01-14-2007, 07:10 PM
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
02-01-2007, 11:32 AM
^ 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
06-03-2007, 11:22 AM
I can't see the download file ;s ? These two files are only gem pic and screenshots .

NVM fixed =)

ahtum
08-03-2007, 04:28 PM
The menu isn't showing up in the ACP... :(

The Fat Boy
10-01-2007, 07:43 PM
? where is it?

dashed
10-03-2007, 04:45 AM
yeah the menu isn't showing up in 3.6.8

111
05-20-2008, 10:43 PM
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