Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 [2]   Go Down

Author Topic: Nicer voting in cpg 1.x [Updated]  (Read 43215 times)

0 Members and 1 Guest are viewing this topic.

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: Nicer voting in cpg 1.x [Updated]
« Reply #20 on: August 24, 2007, 11:32:31 pm »

Make sure you are not using internet explorer as the title mentioned
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Nicer voting in cpg 1.x [Updated]
« Reply #21 on: August 25, 2007, 09:44:31 am »

Logged

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
Re: Nicer voting in cpg 1.x [Updated]
« Reply #22 on: February 09, 2008, 05:49:02 pm »

Hello
this is a very nice plugin..but I have a question, when I vote, and than vote encore..than I become a error, that I have voted! Can I remove the error, but the vote dont add!?

sry for my english


Logged

clyde4210

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Nicer voting in cpg 1.x [Updated]
« Reply #23 on: June 03, 2008, 05:12:05 am »

am i missing a folder because 1.4.18 doesn't have a scripts folder
Logged

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: Nicer voting in cpg 1.x [Updated]
« Reply #24 on: June 04, 2008, 02:02:04 pm »

You can just create that folder if it doesn't exist
Logged

comicdom

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Nicer voting in cpg 1.x [Updated]
« Reply #25 on: July 21, 2008, 07:24:40 am »

beautiful voting solution!  Thanks so much for putting this together. =]
Logged

the-evil

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Nicer voting in cpg 1.x [Updated]
« Reply #26 on: September 06, 2008, 06:02:56 pm »

Scipt is great....but i don't understand how i could change the numer of stars
for voting.... ???

Rich
Logged

Crazymodder

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Nicer voting in cpg 1.x [Updated]
« Reply #27 on: November 20, 2008, 07:36:10 pm »

Very great Mod.
I have a question did anyone have an idea how I can include an noscript tag for the standart rating?
So if you have activate javascript you see the nicer voting. And if javascript is deactivated the orginal voting system is shown?
If somebody have an idea it would be very nice if he can help me.
Logged

werool

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 2
    • Art-Club
Re: Nicer voting in cpg 1.x [Updated]
« Reply #28 on: May 27, 2010, 12:15:20 am »

Is it possible to put Your system under image? (not under filmstrip?)


werol.

I've been working on the voting of cpg,
I thought it could use some new voting pic.

Edit:
Before you read any further, this has still a giant bug in it.
In Firefox everything works fine, but IE won't let you vote for the moment.
This is caused by the referer in the code in "ratepic.php" at line 39.
If you comment this out, it will work in both IE and Firefox, but be carefull:
If the referer isn't checked, it is possible to vote from another website!

Solution to this ex-problem can be found at the bottom

To intall this, follow these steps:

First of all, copy the attached files in there corresponding folders:
rating.js -> scripts/rating
new.gif -> images
full.gif -> images
empty.gif -> images

Then in your "template.html" add the following above the </head> tag:

Code: [Select]
<script type="text/javascript" src="scripts/rating/rating.js"></script>


And as a last change, in your "theme.php" file add the following code before "?>"

Code: [Select]
//Rating change
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact">{RATESCRIPT}</td>
        </tr>
</table>
EOT;
function theme_html_rating_box()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR;
    global $template_image_rating, $lang_rate_pic;

    if (!(USER_CAN_RATE_PICTURES && $CURRENT_ALBUM_DATA['votes'] == 'YES')) return '';

    $votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], round($CURRENT_PIC_DATA['pic_rating'] / 2000, 1), $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
    $pid = $CURRENT_PIC_DATA['pid'];

    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $location= $THEME_DIR;
    } else {
        $location= '';
    }

    $params = array('{TITLE}' => $lang_rate_pic['rate_this_pic'],

'{RATESCRIPT}' => '<script type="text/javascript" language="JavaScript">displayStars(' . round($CURRENT_PIC_DATA['pic_rating'] / 2000, 0) . ', ' . $pid . ', "");</script>',
        '{VOTES}' => $votes,
        '{WIDTH}' => $CONFIG['picture_table_width'],
        '{LOCATION}' => $location,        //theme dir or default images directory
        );

    return template_eval($template_image_rating, $params);
}

To escape the ex-problem in IE, just
Change the code in "ratepic.php" at line 39 to
Code: [Select]
// If referer is not displayimage.php we don't accept the vote
$referer = $_SERVER["HTTP_REFERER"];
if (!eregi("displayimage", $referer) & !($referer == "")){
    header('Location: displayimage.php?pos=' . (- $pic));
    exit;
}


Now it works.

Have fun.

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Nicer voting in cpg 1.x [Updated]
« Reply #29 on: May 27, 2010, 10:20:29 am »

You will not be supported, as the gallery from your profile URL http://art-club.pl/ is deliberately hiding the "Powered by Coppermine" footer, which is a license breach. Restore the footer permanently. Respect board rules in the future after having restored the footer. If you don't, then go away and stay away.
Logged

Joerg-Andre

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
Re: Nicer voting in cpg 1.x [Updated]
« Reply #30 on: October 22, 2010, 04:49:34 pm »

I've been working on the voting of cpg,
I thought it could use some new voting pic.

Edit:
Before you read any further, this has still a giant bug in it.
In Firefox everything works fine, but IE won't let you vote for the moment.
This is caused by the referer in the code in "ratepic.php" at line 39.
If you comment this out, it will work in both IE and Firefox, but be carefull:
If the referer isn't checked, it is possible to vote from another website!

Solution to this ex-problem can be found at the bottom

To intall this, follow these steps:

First of all, copy the attached files in there corresponding folders:
rating.js -> scripts/rating
new.gif -> images
full.gif -> images
empty.gif -> images

Then in your "template.html" add the following above the </head> tag:

Code: [Select]
<script type="text/javascript" src="scripts/rating/rating.js"></script>


And as a last change, in your "theme.php" file add the following code before "?>"

Code: [Select]
//Rating change
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact">{RATESCRIPT}</td>
        </tr>
</table>
EOT;
function theme_html_rating_box()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR;
    global $template_image_rating, $lang_rate_pic;

    if (!(USER_CAN_RATE_PICTURES && $CURRENT_ALBUM_DATA['votes'] == 'YES')) return '';

    $votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], round($CURRENT_PIC_DATA['pic_rating'] / 2000, 1), $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
    $pid = $CURRENT_PIC_DATA['pid'];

    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $location= $THEME_DIR;
    } else {
        $location= '';
    }

    $params = array('{TITLE}' => $lang_rate_pic['rate_this_pic'],

'{RATESCRIPT}' => '<script type="text/javascript" language="JavaScript">displayStars(' . round($CURRENT_PIC_DATA['pic_rating'] / 2000, 0) . ', ' . $pid . ', "");</script>',
        '{VOTES}' => $votes,
        '{WIDTH}' => $CONFIG['picture_table_width'],
        '{LOCATION}' => $location,        //theme dir or default images directory
        );

    return template_eval($template_image_rating, $params);
}

To escape the ex-problem in IE, just
Change the code in "ratepic.php" at line 39 to
Code: [Select]
// If referer is not displayimage.php we don't accept the vote
$referer = $_SERVER["HTTP_REFERER"];
if (!eregi("displayimage", $referer) & !($referer == "")){
    header('Location: displayimage.php?pos=' . (- $pic));
    exit;
}


Now it works.

Have fun.


hello,
can this code jump after vote to the next picture to vote?
this is something what i´m loking for.
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.031 seconds with 20 queries.