• [Mod] Rating Button Disabled After Vote 5 0 5 1
Currently:  

Author Topic: [Mod] Rating Button Disabled After Vote  (Read 64116 times)

0 Members and 1 Guest are viewing this topic.

Offline por4a

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #15 on: December 01, 2005, 11:22:50 PM »
Hello, V@no!

How I can do it your code for my template 'rate-form.html'?

Preview my vote:


I have this code:
Quote
<!-- start rate_form.html -->
<table border="0" align="left" cellpadding="1" cellspacing="0">
              <tr>
      <form method="post" action="{self}">
                <td>
                    <input type="hidden" name="action" value="rateimage" />
                    <input type="hidden" name="id" value="{image_id}" />                   
                  <input type="hidden" name="rating" value="1" />
                    <input src="{template_url}/images/1.gif" type="image" name="Mangelhaft" value="Mangelhaft" alt="Mangelhaft" title="1"/>
                  </td></form><form method="post" action="{self}">
                <td>
                    <input type="hidden" name="action" value="rateimage" />
                    <input type="hidden" name="id" value="{image_id}" />
                    <input type="hidden" name="rating" value="2" />
                    <input src="{template_url}/images/2.gif" type="image" name="Ausreichend" value="Ausreichend" alt="Ausreichend" title="2"/>
                  </td></form><form method="post" action="{self}">
                <td>
                    <input type="hidden" name="action" value="rateimage" />
                    <input type="hidden" name="id" value="{image_id}" />
                    <input type="hidden" name="rating" value="3" />
                    <input src="{template_url}/images/3.gif" type="image" name="Befriedigend" value="Befriedigend" alt="Befriedigend" title="3"/>
                  </td></form><form method="post" action="{self}">
                <td>
                    <input type="hidden" name="action" value="rateimage" />
                    <input type="hidden" name="id" value="{image_id}" />
                    <input type="hidden" name="rating" value="4" />
                    <input src="{template_url}/images/4.gif" type="image" name="Gut" value="Gut" alt="Gut" title="4"/>
                  </td></form><form method="post" action="{self}">
                <td>
                    <input type="hidden" name="action" value="rateimage" />
                    <input type="hidden" name="id" value="{image_id}" />
                    <input type="hidden" name="rating" value="5" />
                    <input src="{template_url}/images/5.gif" type="image" name="Sehr gut" value="Sehr gut" alt="Sehr gut" title="5"/>
              </td></form></tr>
             </td>
      </table>
<!-- end rate_form.html -->

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Rating Button Disabled After Vote
« Reply #16 on: December 02, 2005, 12:19:00 AM »
mmm...did u try add {rate_button} inside your "image" button?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline por4a

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #17 on: December 02, 2005, 12:50:22 AM »
Yes!

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [Mod] Rating Button Disabled After Vote
« Reply #18 on: December 02, 2005, 07:07:54 AM »
this is the first time you post in this thread, so we donīt now your Problem... (o:

I posted this problem before forum was hecked ;)

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #19 on: February 06, 2006, 10:35:57 PM »
Hi V@no, hi  mawenzi

I have implemented the following MOD:
Votes saved in DB / Version A
http://www.4homepages.de/forum/index.php?topic=6123.0

Now I have installed this MOD.

Now, the vote is stored in the DB, but after deleting Cookies, it is possible to vote again (although the vote is stored in the DB).

Is it possible, that a user can vote only once and disabled the dropdown after voting?

Thanks for helping me!

TIMT

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #20 on: February 08, 2006, 09:11:17 PM »
Anyone else who can give me an answer?
Thanks!

Offline fgallery

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ::: F-Gallery :: Photobank :::
http://f-gallery.com.ua
Artistic Photography, Fashion Photography, Cities and Streets of The World, Personal Photos of Livejournal Users.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #23 on: February 11, 2006, 04:06:13 PM »
I wanted to show the download button after rating, like with an info:

please rate this image to get the download link  (before rating)
Thank you for rating this image, your donwload link:  (after rating)

how can i do this ;)

Offline Amosnet

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • Bilder verkaufen
Re: [Mod] Rating Button Disabled After Vote
« Reply #24 on: September 14, 2006, 10:48:45 PM »
Thanks for this great Mod!  :P

I use the phpbb Mod and if i logout, and login i can vote again.
Seems like the cookie is not really stored.

The phpBB Mod dont use the 4image_ Cookie.

 :?: How can i store the Cookie that i rated at my 4images - phpBB Gallery?
How do i set the rate in the phpBB Cookie?

Thank you
I love 4images! http://www.fotos-verkaufen.de Fotos verkaufen online Tips und Tricks und http://www.fotoskaufen.de

Offline hyde101

  • Sr. Member
  • ****
  • Posts: 410
  • 34TR.COM (Running 4images)
    • View Profile
    • Nostalgia Istanbul
Re: [Mod] Rating Button Disabled After Vote
« Reply #25 on: September 23, 2006, 03:46:14 AM »
i think last version has this already built in, but it does not gray out the vote after the first vote..

Please Vote for my site: Here

Offline fgabriel

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #26 on: January 07, 2007, 08:40:27 PM »
V@no
i installed the mod now when i access for search.php this give me many errors on functions.php
?
do you know wath is this, page_header?


Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined offset: 1 in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 492

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Offline fgabriel

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #27 on: January 07, 2007, 09:09:34 PM »
V@no
i installed the mod now when i access for search.php this give me many errors on functions.php
?
do you know wath is this, page_header?


Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined offset: 1 in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 492

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509



when i go to:
search.php?search_new_images=1

errors:

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined offset: 1 in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 492

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464


functions.php 451-516

  if (!empty($additional_image_fields)) {
    $additional_field_array = array();
    foreach ($additional_image_fields as $key => $val) {
      $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }

  $rate_form = "";
  if (check_permission("auth_vote", $image_row['cat_id'])) {
    $rate_form = rate_form($image_row['image_id'], $rate_suffix, $rating);
  }
  $site_template->register_vars("rate_form", $rate_form);

  return true;
}

function rate_form($id, $rate_suffix = "", $rating = ""){
 global $site_template, $session_info, $lang, $site_sess, $HTTP_COOKIE_VARS, $rate_suffix;

  //----- Settings ------------

  //change to $rate_show = 0; if u dont want to show what was your vote for an image
  $rate_show = 1;

  //--- End Settings ----------

  $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
  $cookie_rated_array = isset($HTTP_COOKIE_VARS[$cookie_name.'rated'.$rate_suffix]) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'.$rate_suffix])) : array();
  $split_list_array = array();
  if (!empty($session_info['rated_imgs'.$rate_suffix])) {
    $split_list_array = explode(" ", $session_info['rated_imgs'.$rate_suffix]);
  }
  $cookie_rated = array();
  foreach ($cookie_rated_array as $key) {
    $split = explode(",", $key);
    $cookie_rated[] = $split[0];
    if ($id == $split[0]) {
      $rating = $split[1];
    }
  }
  $split_list = array();
  foreach ($split_list_array as $key) {
    $split = explode(",", $key);
    $split_list[] = $split[0];
    if ($id == $split[0]) {
      $rating = $split[1];
    }
  }
  $no_rateform = (in_array($id, $split_list) || in_array($id, $cookie_rated)) ? "disabled" : 0;
  $rate_options = "<option value=\"\">--</option>\n";
  for ($i = MAX_RATING; $i; $i--){
    $rate_options .= "<option value=\"".$i."\"".(($i == $rating && $rate_show) ? "selected" : "").">".$i."</option>\n";
  }
  $site_template->register_vars(array(
          "rate" => ($no_rateform && !(check_permission("auth_vote", $image_row['cat_id']) && $no_rateform)) ?  "rated" : $lang['rate'],
          "rate_options" => $rate_options,
          "rate_button" => ($no_rateform) ? $no_rateform : ""

    ));
  $rate_form = $site_template->parse_template("rate_form");
  return $rate_form;
}





Offline fgabriel

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Rating Button Disabled After Vote
« Reply #28 on: January 07, 2007, 11:25:14 PM »
  $rate_form = "";
  $image_row = "";
  $rating = "";
  $rate_suffix = "";

  if (check_permission("auth_vote", $image_row['cat_id'])) {  -------------------------------------------this is 466
    $rate_form = rate_form($image_row['image_id'], $rate_suffix, $rating);
  }
  $site_template->register_vars("rate_form", $rate_form);

  return true;
}

i insert this variables but a error stills:

Notice: Uninitialized string offset: 0 in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 466



V@no
i installed the mod now when i access for search.php this give me many errors on functions.php
?
do you know wath is this, page_header?


Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined offset: 1 in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 492

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509

Notice: Undefined variable: rate_suffix in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: rating in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 464

Notice: Undefined variable: image_row in /home/nfnorte/public_html/galerianfn/includes/functions.php on line 509


orb42

  • Guest
Re: [Mod] Rating Button Disabled After Vote
« Reply #29 on: January 19, 2007, 04:57:52 PM »
Hi,

I got the same error as fgabriel does when I call "New images" link   (http://www.xx.com/search.php?search_new_images=1).

Code: [Select]
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rate_suffix in /mnt/107/sdc/a/1/x/includes/functions.php on line 446
Notice: Undefined variable: rating in /mnt/107/sdc/a/1/x/includes/functions.php on line 446

This "functions.php" line 445/446 :

 
Code: [Select]
if (check_permission("auth_vote", $image_row['cat_id'])) {
    $rate_form = rate_form($image_row['image_id'], $rate_suffix, $rating);

Anybody helps please? thanks