4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 19, 2018, 11:14:51 AM

Login with username, password and session length
Search:     Advanced search
4images is now on facebook. Click here and become a fan!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] Rating Button Disabled After Vote
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: «« « 1 2 [3] Print
Current Topic Rating: *****
Author Topic: [Mod] Rating Button Disabled After Vote  (Read 50335 times)
fgabriel
Newbie
*
Offline Offline

Posts: 30

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #30 on: January 19, 2007, 09:36:08 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).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 :

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

Anybody helps please? thanks


im not alone,
i think nobody wants to help orb42  Sad
Logged
orb42
Guest
« Reply #31 on: January 22, 2007, 07:58:49 AM »

For this mod, I really don't understand the way the code was insered in "functions.php".

The code insertion proposed is an aberation because it introduces in a function some variables that are not previously defined in the page.

I would like to know what's thinking about the mod's author..
Logged
urmasmuld
Newbie
*
Offline Offline

Posts: 48

Thank You
-Given: 6
-Receive: 1


View Profile
« Reply #32 on: February 19, 2007, 12:04:36 PM »

I've same problem =(

Notice: Undefined variable: rate_suffix in /www/01/xxx/xxx/xxx/functions.php on line 449

Notice: Undefined variable: rating in /www/01/xxx/xxx/xxx/functions.php on line 449
 
 
Logged
MacroWorld
Pre-Newbie

Offline Offline

Posts: 4

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #33 on: April 30, 2007, 11:35:26 AM »

Open includes/functions.php

Find:
1
if (check_permission("auth_vote", $image_row['cat_id'])) {

Insert Above:
1
2
  $rate_suffix = "";
  $rating = "";

Find Next:
1
2
3
4
5
6
$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 : ""

    ));

Insert Above
1
$image_row = 0;

everything will be OK  Very Happy
Logged

winracer
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 5
-Receive: 0


View Profile WWW
« Reply #34 on: November 18, 2009, 07:15:57 PM »

my page_header.php looks like this because of other mods.

I would like to have greyed out after user votes and do not want to remmeber the users computer just the username. can this be done using both mods?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if ($action == "rateimage" && $id) {
  $rating = intval($HTTP_POST_VARS['rating']);

  if ($user_info['user_level'] != GUEST) {
    $sql = "SELECT user_id, image_id, vote
            FROM ".VOTED_TABLE."
            WHERE image_id = ".$id." AND user_id = ".$user_info['user_id'];
    $rated = $site_db->query_firstrow($sql);
    $rating = ($rated['vote']) ? $rated['vote'] : $rating;
  }else{
    $rated = FALSE;
  }
  $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
  $cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
  if ($rating && $rating <= MAX_RATING && $id) {
    if (!isset($session_info['rated_imgs'])) {
      $session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
    }
    $split_list = array();
    if (!empty($session_info['rated_imgs'])) {
      $split_list = explode(" ", $session_info['rated_imgs']);
    }
    if (!in_array($id, $split_list) && !in_array($id, $cookie_rated) && !$rated) {
      $session_info['rated_imgs'] .= " ".$id;
      $session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      $site_sess->set_session_var("rated_imgs", $session_info['rated_imgs']);
      $cookie_rated[] = $id;
      $cookie_expire = time() + 60 * 60 * 24 * 4;
      setcookie($cookie_name.'rated', serialize($cookie_rated), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
      update_image_rating($id, $rating);
      $msg = $lang['voting_success'];
    }
    else {
      $msg = $lang['already_voted'];
    }
  }
  else {
    $msg = $lang['voting_error'];
  }
}

Logged

winracer
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #35 on: November 19, 2009, 02:13:28 AM »

Sorry, I'm not sure what exactly is your question about...
Logged

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)
winracer
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 5
-Receive: 0


View Profile WWW
« Reply #36 on: November 19, 2009, 02:24:13 PM »

Sorry, I'm not sure what exactly is your question about...

never mind, I changed my mind and installing the star mod. sorry
Logged

winracer
x23piracy
Sr. Member
****
Offline Offline

Posts: 420

Thank You
-Given: 48
-Receive: 41


View Profile WWW
« Reply #37 on: November 23, 2010, 09:53:44 PM »

Hi,

is there an easy way to check before the tag {rate_form} is displayed to check
the user has allready voted before he tries to vote again?

Out of the box he can try it again and the {msg} tag is filled with the you have
allready voted message.

Why the check is not made before a revote try?

Something like: {ifnot user_voted}{rate_form}{endifnot user_voted}


Greetz X23
Logged


Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #38 on: November 24, 2010, 12:10:59 AM »

Your question is not clear. The point of this mod is to disable the rate button after the user's vote...
Logged

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)
x23piracy
Sr. Member
****
Offline Offline

Posts: 420

Thank You
-Given: 48
-Receive: 41


View Profile WWW
« Reply #39 on: November 24, 2010, 12:16:32 AM »

Your question is not clear. The point of this mod is to disable the rate button after the user's vote...

Hi,

you're right but im searching for the right change that makes it possible that the rate_form is
only displayed if the user not allready voted for that image, for example (i wish) with a tag like
{ifnot user_voted}...

Should i start a new thread?


Greetz X23
Logged


Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #40 on: November 24, 2010, 02:31:20 AM »

I see now.
Use {ifno rate_button} ..
Logged

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)
SweD
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 0
-Receive: 1


View Profile
« Reply #41 on: November 02, 2011, 11:06:41 AM »

Great! Work! I liked it!

Demo: http://www.all-live.ru/
Logged
Pages: «« « 1 2 [3] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.047 seconds with 20 queries.
Post your comments here