• [MOD] Multi-Lightboxes v1.03.2 (2011-09-20) 4 0 5 1
Currently:  

Author Topic: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)  (Read 254823 times)

0 Members and 1 Guest are viewing this topic.

Offline NetRebel

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #120 on: July 29, 2008, 12:54:11 AM »
Hi,

Once again, this mod is great! (Just installed it on another board). One question though. Well, actually it's three questions, but if one gets answered, I pretty much can find out the others myself. ;-)

- Can I have "normal" or at least some shorter lightbox ID's? id=de40091253f62f2d2baf1fe89cca47ef isn't really "user friendly".
- Is there some "info" coded in this ID, or is it just randomly generated?
- Where is this lightbox ID generated?

I'm thinking about making the lightbox ID just a user_id followed by a lightbox number. Like if user 30 wants to publicly display his sixth lightbox, it would just be lightbox ID 00300006 or something even shorter depending on the expected max. number of users and the max number of allowed lightboxes. It could as well be as short as 0306 for small sites with just 9 lightboxes per use.

[edit]

Okay, I just found out that I can just edit the name directly in the SQL and it seems to work fine. I guess the long generated number is just some "security" so people cannot "quess" lightboxes that are not public? It that so? I am using 4images not for images and the lightbox not as a lightbox, so any "lightbox" should always be visible to everyone. :-)

So the most "important" question (for me) remains: where is this number generated so I can edit it?

Offline NetRebel

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #121 on: August 09, 2008, 05:14:30 PM »
Okay, I REALLY tried, but my PHP and MySQL knowledge is just to limited to figure out this one by myself.

I found that the Lightbox ID is generated in collection.php under:

      $lightbox_id = get_random_key(LIGHTBOX_TABLE, "lightbox_id");

I just want this lightbox ID to be a sequential number. Can someone PLEASE give me the PHP code to read the SQL database for the last record number and then just add one to it?

So basically I want the lightbox_id just to be the same as the ID in the SQL. I know there is some info in the SQL about the next unique number to use. When I look into the database using PhpMyAdmin I can see a "Next Autoindex". Basically all I want is to replace the get_random_key part with this Autoindex, so the lightbox_id will just be the record ID of the record in the SQL.

Can someone please help? It shouldn't be too difficult, but my PHP capabilities are just too limited. :-(

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] Multi-Lightboxes v1.03.1
« Reply #122 on: August 09, 2008, 07:55:25 PM »
you can try this:
in sessions.php find:

$user_info['lightbox_lastaction'] = $this->current_time;


Insert above:$sql "UPDATE ".LIGHTBOXES_TABLE." SET lightbox_id = id WHERE id = ".$site_db->get_insert_id();
$site_db->query($sql);
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 NetRebel

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #123 on: August 09, 2008, 08:54:10 PM »
Thank you very much V@no, you're the best! I already tried to get it working somehow by finding the highest Lightbox ID, add 1 to it and write back the calculation. But that was a lot of (unnessecary) code, yours is WAY better and more reliable when the highest numbered lightbox gets deleted again.

I also had to add your code to the lightbox.php because otherwise new (multiple) lightboxes that were created still had this random number.
I have put your code in lightbox.php after:

     
Code: [Select]
else
      {
        $status[0]['msg'] = preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name_new), $lang['lightbox_create_error']);
        $status[0]['error'] = 1;
      }

I'm not sure if that is the exact correct place to put it, but it al works exactly as I wanted now.

Thank you so much again!

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] Multi-Lightboxes v1.03.1
« Reply #124 on: August 10, 2008, 07:17:33 AM »
You are right, it also should be placed in lightbox.php but, under $id $site_db->get_insert_id();

(you also might want replace $site_db->get_insert_id() from the $sql query with $id, it should speedup the code for about 0.1 milliseconds :))
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 NetRebel

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #125 on: August 10, 2008, 05:37:36 PM »
Thank you once again V@no. You've really been a great help with this and other "problems" we had with changing things in 4Images to suit our needs. Our site is getting closer and closer to what we have in mind thanks to the great 4Images script and your invaluable help. We have added your name in our "Site Credits" page. ;-) Keep up the good work and this great support!

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #126 on: February 04, 2009, 09:32:24 PM »
Hi,
Möchte hier mal ein Lob, und auch eine Frage weitergeben, die schon öffters bei uns gestellt wurde.

Quote
Hallo allerseits
Wieder mal ein Lob an den oder die Programmierer. Es wird hier immer besser.
ich arbeite viel mit dem eigenen Bildarchiv und somit auch mit den Leuchtkästen. Eine Super Idee.
Allerdings gibt es auch eine Sache, die mich wirklich stört und unnötig viel Zeit in Anspruch nimmt.

Suche ich mir ein Bild aus, und aktiviere den Leuchtkasten, wird jedesmal die komplette Seite neu
aufgebaut. Jedesmal muß ich wieder nach unten scrollen und das nächste Bild suchen. Wäre es
nicht möglich, daß auf der Seite alle ausgewählten Bilder nur mit einem Haken versehen werden
können und unten am Bildrand eine Option "In den Leuchtkasten" vorhanden wäre. Ein Klick
auf diesen Button befördert somit alle aktivierten Bilder in mein Bildarchiv.

Ich danke schonmal für die Gedanken die Ihr Euch macht ob es in diesem Sinne möglich ist.

vielleicht gibt es ja da eine Idee, wäre jedenfalls eine gute Sache ;)

LG Harald
Danke Harald




Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #127 on: February 04, 2009, 10:29:05 PM »
Hallo Harald,

... das gibt es hier irgendwo im Forum "?...Lightbox without refresh...?" ...
... entweder ein gesamter MOD oder nur ein Snippet ... aber in jedem Fall von V@no ...
... wenn mir was über den Weg läuft, dann melde ich hier ... ;)
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #128 on: February 05, 2009, 07:50:43 AM »
Hi Detlev,
Super, werde heute Abend auch mal suchen, muss aber jetzt erst Arbeiten

LG. Harald
Danke Harald




Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #129 on: February 05, 2009, 03:27:47 PM »
Sorry für das Doppelposting  :wink:

ist es dieses hier ?
http://www.4homepages.de/forum/index.php?topic=5321.0

kennst ja mein englisch, wenn ja, reicht es das im 1 Posting, oder muss ich etwas beachten  :oops:

LG Harald
Danke Harald




Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #130 on: February 05, 2009, 04:14:33 PM »
... genau das was ich meinte ... ;)
... und da der Thread von V@no ist, kannst du davon ausgehen, dass er aktualisiert und auf dem Laufenden ist ...
... der erste Post reicht also ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline keesjansma

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #131 on: March 27, 2009, 03:04:31 PM »
First of all Great mod andgreat assistance,

I need a way to see all not private lightbox per person on a page so people can see it in 1 click.
Does anyone have a way to get this done. My PHP Knwoledge isn't that great(Yet)

Greets kees 

Offline keesjansma

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #132 on: March 28, 2009, 10:31:46 AM »
Another thing, users or unregisterd users can see each others lightboxes. but they also see "clear lightbox" As far as i can see unregisterd users cant clear the album but registerd users can clear "an" album but instead of clearing the album from the users they see they are clearing there own first album.

You would say that that isn't harmfull but what i really want to see is that when you are viewing someone elses album, that the clear button is invissible. 
Further i want to see on the lightbox page the owner of the album on top.
Maybe someone can assist me with this
Thanks in advance

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #133 on: March 30, 2009, 05:47:56 PM »
Step 2.5a.

In lightbox.php i can’t find:
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>";

I find only:
  if ($download_allowed && !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>";
  }

Is it right if I replace this code?
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Multi-Lightboxes v1.03.1
« Reply #134 on: March 30, 2009, 08:02:22 PM »

There are Step 3.3 and Step 3.5 in the first post, but there is not Step 3.4. Is it right?


I install this mod and mod "Dropdown options for custom database fields". I have a few errors  :( :
1. In the user_loginform I didn't see dropdown menu.
2. Manage lightboxes. When I save any changes(for example: new or rename Manage lightboxes), I have error:   
"Fatal error: Call to undefined function get_msg() in C:\Program Files\wamp\www\gallery\lightbox.php on line 185". All chenges was saved.
In the lightbox.php line 185 is "$msg = (empty($msg)) ? "" : get_msg($msg);". This code is a part Step 2.1.

How to fix this?
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.