Author Topic: [MOD] - Restrict users to use e-card and download if they have not voted first.  (Read 64785 times)

0 Members and 1 Guest are viewing this topic.

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
thank you for your work!
I try to install the mod but I have several questions:

Q1 - Step 1.2 : i found the code twice in lightbox.php file.  :?:  Do I have to add/replace it twice?

Q2 - Step 2 : you said "In the same file, find :", you mean "in includes/functions.php file, find:" .
 because the indicated code can not be found in lightbox.php file but in includes/functions.php file. ( update after Step 1.1 >> right?  :wink:)

Q3 - still Step 2 :  i found the code twice.  :?:  same question than Q1

Q4 - after aplying v1.0, it seems lightbox  does not work correctly  :?
when a user rates a picture and send it to the lightbox, the lightbox says : no image found!!!  :?:  how can i fix it?

Last point : You blocked access to the lightbox (unless the user rates the pic) while I thought that you would have (only) blocked the ZIP downloading...  :?
ch€ri{Bi}²


TheOracle

  • Guest
Quote

Q1 - Step 1.2 : i found the code twice in lightbox.php file.  Question  Do I have to add/replace it twice?


I only have one result on this one.

Quote

Q2 - Step 2 : you said "In the same file, find :", you mean "in includes/functions.php  file, find:" .
 because the indicated code can not be found in lightbox.php file but in includes/functions.php file. ( update after Step 1.1 >> right?  Wink)


That's a woops and just been edited. ;)

Quote

Q3 - still Step 2 :  i found the code twice.  Question  same question than Q1


Just left a note below that step. That is correct. There were two but forgot to mention to only modify the first one.

Quote

Q4 - after aplying v1.0, it seems lightbox  does not work correctly  Confused
when a user rates a picture and send it to the lightbox, the lightbox says : no image found!!!  Question  how can i fix it?


You made a mistake somewhere. In the mean time - yesterday - I made some corrections so you'd probably want to compare your readings again. ;)

Quote

Last point : You blocked access to the lightbox (unless the user rates the pic) while I thought that you would have (only) blocked the ZIP downloading...


Blocking the ZIP function alone is not an easy task since it has been coded on the same place as the download image (uncompressed) itself. Which is why, I had to block the entire lightbox page ' until ' the users gives their first vote.

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
thank you for your quick answer.

Quote
I only have one result on this one.
perhaps it's about the version. i'm using 1.7.1 and i confirm : i found the code twice in lightbox.php, 1 above line 50 + 1 above line 143.

 :arrow: first :
Quote
//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
  $imgtable_width .= "%";
}

$num_rows_all = 0;
$num_rows = 0;

if (!empty($user_info['lightbox_image_ids']))  {
  $image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));


and second:
Quote
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$download_button = "";
if (function_exists("gzcompress") && function_exists("crc32")) {
  if (!empty($user_info['lightbox_image_ids'])) {
    $download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox")."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";
  }
  else {
well, i modifyed the two lines  :roll:

Quote
You made a mistake somewhere. In the mean time - yesterday - I made some corrections so you'd probably want to compare your readings again
i began the installation this morning... but i only installed first part! Is there a relation with my lightbox which does not work any more?  :(

for the last point (bloking zip download), i saw this code in lightbox.php:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$download_button = "";
if (function_exists("gzcompress") && function_exists("crc32")) {
  if (!empty($user_info['lightbox_image_ids'])) {
    $download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox")."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";
  }
  else {
    $download_button = "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />";
  }
}

  :?: is there a way to make a verification  about user's rate (with all pics in lightbox) on this part of lightbox.php file ?

Regards.
ch€ri{Bi}²


TheOracle

  • Guest
Quote

perhaps it's about the version. i'm using 1.7.1 and i confirm : i found the code twice in lightbox.php, 1 above line 50 + 1 above line 143.


 :oops: I have 4images v1.7. I'm so sorry for not having specified this in the first place.

Quote

Is there a relation with my lightbox which does not work any more?


Yes, it might ... I did not thought of that when I posted these codes the first time.

Quote

is there a way to make a verification  about user's rate (with all pics in lightbox) on this part of lightbox.php file ?


Try this :

Quote

if (!empty($user_info['lightbox_image_ids'])) {


for :

Code: [Select]

if (!empty($user_info['lightbox_image_ids']) && !empty($image_row['image_votes'])) {


Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
i have a problem with lightbox.php file with 4images v1.71  in Step 1.2.

the code is present twice.

Pb1 - if i modify the first part  :arrow:  my lightbox does not work any more (message : no picture in lightbox)
Pb2 - if i modify the second part  :arrow: lightbox works but ZIP download does not work even if all the images in the lightbox are rated by the user (button is disabled)
Pb3 - if i modify the 2 lines  :arrow:  same as Pb1

 :?:  any idea about the cause?

I would have wished that at this first part of the mod, it already works but... :?  i will complete the installation to know if everything is good at the end.

ch€ri{Bi}²


TheOracle

  • Guest
Quote

Pb2 - if i modify the second part  Arrow lightbox works but ZIP download does not work even if all the images in the lightbox are rated by the user (button is disabled)


I was hoping that I would be the only one having this issue. Unfortunitely, I will have to work on this part again since ' two seperated ' process must be added in order to not affect each other's functions. The thing is, the ZIP download is the same function from the lightbox page as the details page.

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
all the mod installed : stll not working  :( 

the second part (in function.php) enables all buttons except lightbox  8O

Is there anybody who installed this mod (working) with 4images1.7.1?
ch€ri{Bi}²


Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
i found the error  for:
Quote
the second part (in function.php) enables all buttons except lightbox 8O

 :arrow: in v1.1 STEP 3  you should replace $config['details_vote_download_options'] == "1"   by   $config['details_vote_download_restriction_options'] == 1

still testing  :wink:
ch€ri{Bi}²


TheOracle

  • Guest
Thanks for mentionning this. You are absolutely right. All statements with quotes must be removed due to a pre-defined $key statement from your settings. This has already been discussed elsewhere as it will be corrected. ;)

TheOracle

  • Guest
Update :

All quotes has been removed from the $config strings now. ;)

TheOracle

  • Guest
Update :

Further modifications has just been done on step 3 - section 2. Thanks to cheribibi for clairing this out.

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
still testing  :wink:

well i think there is a big problem with empty($image_row['image_votes'])... A more advanced check is absolutely needed !!! 
 :arrow: i think about a check on the vote of the user for the pic and not as now on the presence of a vote on the pic (why not use MOD Votes saved in DB?  :wink:).

I explain : This field remains empty as long as nobody rates the picture. OK?
But as soon as someone rates the pic, this field is not empty any more and this condition comes true systematically... for all the users.
It means that after the first vote of an image, all the users can download, lightbox and send it by ecard  :twisted:

tested with 2 users on several pics : the first rates and the second can download all rated pics (by the first) without rate  8O
ch€ri{Bi}²


TheOracle

  • Guest
Quote

tested with 2 users on several pics : the first rates and the second can download rated pics (by the first) without rate


Thanks for pointing this out. That is definitely a bug. I will look into that and add additional statements into these functions to make sure that each votes are being handled seperately. ;)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Hi,

where is TheOracle???

I want help to this Mod. Now it works for a few days but now some Users say to me it doesn´t work. They can Download Pics whitout a vote.

Can anyone help me or can anyone write the Mod in this Board to check all code?!
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Quote
where is TheOracle???
to know that, you should make a turn in the Chit Chat forum  :roll:

I confirm that full MOD works very well on my site but i don't know exactly what you installed because the published MOD wasn't complete  :?  just see the lasts posts from TheOracle and me.

 :arrow: well, I will publish this MOD again but for the moment I do not have time yet to reconstitute it.
ch€ri{Bi}²