4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on December 01, 2005, 08:09:49 AM

Title: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: V@no on December 01, 2005, 08:09:49 AM
----------- [ Introduction ] -------------
With this mod members will have ability have more then one lightbox (album) and share them with others (read only).


----------- [ Features ] ------------

Lightbox manager:
(http://img214.imageshack.us/img214/839/lightbox8se.png)

Shared lightboxes from member's profile page:
(http://img214.imageshack.us/img214/9991/lightbox25gk.png)


Before you start the installation process:
- this mod was created on fresh 4images v1.7.1 and has not been tested on v1.7 (done. tested on fresh v1.7)
- I have not tested it against other mods, such as [MOD] Lightbox for GUESTs v1.2 (http://www.4homepages.de/forum/index.php?topic=4826.0) (done. post updated with little modifications for compability with "Lightbox for Guests" mod)


---------- [ Changed files ] ----------

lightbox.php
details.php
download.php
member.php
includes/functions.php
includes/page_header.php
includes/sessions.php
includes/db_field_definitions.php
admin/settings.php
admin/images.php
lang/
<your language>/admin.php
lang/
<your language>/main.php
templates/
<your template>/lightbox.html
templates/
<your template>/member_profile.html
templates/
<your template>/user_logininfo.html
templates/
<your template>/style.css



---------- [ Installation ] -----------

Step 1
Download attached (#post_attachment) package
Unzip it and upload all files, restoring this file tree:

multilightbox_install.php
templates/
<your template>/lightbox_manage.html
templates/
<your template>/lightbox_dropdown.html

Login as administrator and run the multilightbox_install.php (type in your browser: http://youraddress/path-where-this-file-is/multilightbox_install.php[/b])

Alternatively you can run this MySQL query:
Code: [Select]
ALTER TABLE 4images_users ADD user_lightbox MEDIUMINT( 8 ) UNSIGNED NOT NULL;
ALTER TABLE 4images_users ADD user_lightbox_count SMALLINT( 3 ) DEFAULT '0' NOT NULL;
ALTER TABLE 4images_users ADD user_lightbox_private TINYINT( 1 ) UNSIGNED DEFAULT '1' NOT NULL;

ALTER TABLE 4images_lightboxes ADD id MEDIUMINT( 12 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE 4images_lightboxes ADD lightbox_name VARCHAR( 32 ) NOT NULL;
ALTER TABLE 4images_lightboxes ADD lightbox_private TINYINT( 1 ) UNSIGNED DEFAULT '1' NOT NULL;
ALTER TABLE 4images_lightboxes ADD INDEX ( lightbox_private );

INSERT INTO 4images_settings ( setting_name , setting_value ) VALUES ( 'lightbox_count', '5' ), ( 'lightbox_share', '1' );

Ones the database was successfuly updated, delete multilightbox_install.php



Step 2
Open lightbox.php
If you installed [MOD] Lightbox for GUESTs v1.2 (http://www.4homepages.de/forum/index.php?topic=4826.0) MOD, skip this step and continue with Step 2.1
Find:
Code: [Select]
if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
if (($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) && !((isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) || (isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']))) {
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 2.1
Find:
Code: [Select]
//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------

Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
if ($user_info['user_level'] == GUEST || ($action != "manage" && $action != "save"))
{
  $action = ($action == "clearlightbox" && $user_info['user_level'] >= USER) ? "manage" : "show";
}
$txt_clickstream = "";
$lightbox_name = "";

$name_error = 0;
$status = array();
$user_info['user_lightbox'] = ($user_info['user_level'] >= USER && $user_info['user_lightbox']) ? $user_info['user_lightbox'] : 0;
$limit = ($user_info['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_info['user_level'] == ADMIN) ? -1 : (($user_info['user_lightbox_count']) ? $user_info['user_lightbox_count'] : $config['lightbox_count']);
$total = count($user_info['lightboxes']);
$total_update = $total;
unset($private_new, $name_new);
//-----------------------------------------------------
//--- Update Lightboxes Settings ----------------------
//-----------------------------------------------------
if ($action == "save")
{
  for ($i = 1; $i <= $total_update; $i++)
  {
    $name = (isset($HTTP_POST_VARS['name_'.$i])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['name_'.$i])) : "";
    $id = (isset($HTTP_POST_VARS['id_'.$i])) ? $HTTP_POST_VARS['id_'.$i] : 0;
    $delete = (isset($HTTP_POST_VARS['delete_'.$i])) ? 1 : 0;
    $clear = (isset($HTTP_POST_VARS['clear_'.$i])) ? 1 : 0;
    $private = (isset($HTTP_POST_VARS['private_'.$i])) ? 1 : 0;
    if ($delete && !$clear && $id && $id != $user_info['user_lightbox'])
    {
      $sql = "DELETE FROM ".LIGHTBOXES_TABLE." WHERE id = ".$id;
      if ($site_db->query($sql))
      {
        $status[$id]['msg'] = (($status[$id]['msg'] != "") ? "<br />" : "").preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name), $lang['mlightbox_delete_success']);
        $status[$id]['error'] = 0;
        $total--;
        unset($user_info['lightboxes'][$id]);
      }
      else
      {
        $status[$id]['msg'] = (($status[$id]['msg'] != "") ? "<br />" : "").preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name), $lang['mlightbox_delete_error']);
        $status[$id]['error'] = 1;
      }
    }
    else
    {
      if (!empty($name))
      {
        $do_clear = ($clear) ? ", lightbox_image_ids = ''" : "";
        $sql = "UPDATE ".LIGHTBOXES_TABLE." SET lightbox_name = '".$name."', lightbox_private = ".$private.$do_clear." WHERE id = ".$id;
        if ($site_db->query($sql))
        {
          $status[$id]['msg'] = preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name), $lang['lightbox_update_success']);
          $status[$id]['msg'] .= ($clear) ? "<br />".preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name), $lang['lightbox_delete_success']) : "";
          $status[$id]['error'] = 0;
          $user_info['lightboxes'][$id]['name'] = stripslashes($name);
          $user_info['lightboxes'][$id]['private'] = $private;
          $user_info['lightboxes'][$id]['count'] = ($clear) ? 0 : $user_info['lightboxes'][$id]['count'];
        }
        else
        {
          $status[$id]['msg'] = preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name), $lang['lightbox_update_error']);
          $status[$id]['msg'] .= ($clear) ? "<br />".preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name), $lang['lightbox_delete_error']) : "";
          $status[$id]['error'] = 1;
        }
      }
      elseif ($id)
      {
          $name_error++;
          $status[$id]['error'] = 1;
      }
    }
  }
  $name_new = un_htmlspecialchars(trim($HTTP_POST_VARS['name_new']));
  $private_new = (isset($HTTP_POST_VARS['private_new'])) ? 1 : 0;
//  if ($name_new && !$name_error)
  if ($name_new)
  {
    if ($limit == -1 || $total < $limit)
    {
      $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
      $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
              (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids, lightbox_name, lightbox_private)
              VALUES
              ('$lightbox_id', ".$user_info[$user_table_fields['user_id']].", ".time().", '', '".$name_new."', ".$private_new.")";
      if ($site_db->query($sql))
      {
        $total++;
        $id = $site_db->get_insert_id();
        $status[$id]['msg'] = preg_replace("/".$site_template->start."name".$site_template->end."/iU", stripslashes($name_new), $lang['lightbox_create_success']);
        $status[$id]['error'] = 0;
        $user_info['lightboxes'][$id]['name'] = stripslashes($name_new);
        $user_info['lightboxes'][$id]['id'] = $id;
        $user_info['lightboxes'][$id]['lightbox_id'] = $lightbox_id;
        $user_info['lightboxes'][$id]['private'] = $private_new;
        $user_info['lightboxes'][$id]['count'] = 0;
        unset($private_new, $name_new);
      }
      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;
      }
    }
    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;
    }
  }
  else
  {
    unset($private_new, $name_new);
  }

  $name = 0;
  $msg = array("good" => (($msg) ? array($msg) : array()), "error" => array(), "plain" => array());
  foreach ($status as $key)
  {
    if ($key['msg'])
    {
      if ($key['error'])
      {
        $msg['error'][] = $key['msg'];
      }
      else
      {
        $msg['good'][] = $key['msg'];
      }
    }
  }
  if ($name_error)
  {
    $msg['error'][] = preg_replace("/".$site_template->start."lightbox".$site_template->end."/iU", (($name_error > 1) ? $lang['lightbox_plural'] : $lang['lightbox_single']), $lang['lightbox_name_error']);
  }
  $action = "manage";
  $msg = (empty($msg)) ? "" : get_msg($msg);
}

if ($user_info['user_level'] >= USER)
{
  $user_lightbox_dropdown = ($total > 1) ? get_dropdown_options("user_lightbox", $user_info['lightboxes_list'], $user_info['user_lightbox'], 1, 0, 1) : "";
}
else
{
  $user_lightbox_dropdown = "";
}
$site_template->register_vars("user_lightbox_dropdown", $user_lightbox_dropdown);
$user_lightbox_dropdown = ($user_lightbox_dropdown) ? $site_template->parse_template("lightbox_dropdown") : "";
$site_template->register_vars("user_lightbox_form", $user_lightbox_dropdown);

//-----------------------------------------------------
//--- Manage Lightboxes -------------------------------
//-----------------------------------------------------
if ($action == "manage")
{
  $txt_clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php")."\">".$lang['lightbox']."</a>".$config['category_separator'].$lang['lightbox_settings'];
  $i = 1;
  $maxlength = 32;
  $list = "";
  foreach ($user_info['lightboxes'] as $key => $val)
  {
    $list .= "<tr".(isset($status[$val['id']]['error']) ? (($status[$val['id']]['error']) ? " class=\"mlightbox0\"" : " class=\"mlightbox1\"") : "")." align=\"center\">\n";
    $list .= "<td>".$i.".</td>\n";
    $list .= "<td><input name=\"name_".$i."\" value=\"".str_replace("\"", "&quot;", $val['name'])."\" maxlength=\"".$maxlength."\" class=\"lightboxinput\" /></td>\n";
    $list .= "<td><a href=\"".$site_sess->url(ROOT_PATH."lightbox.php?user_lightbox=".$val['id'])."\">".$val['count']."</a></td>\n";
    if ($user_info['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN)
    {
      $list .= "<td><input name=\"private_".$i."\" value=\"1\" type=\"checkbox\"".(($val['private']) ? " checked" : "")." /></td>\n";
    }
    $list .= "<td><input name=\"clear_".$i."\" value=\"1\" type=\"checkbox\" /></td>\n";
    if ($key != $user_info['user_lightbox'])
    {
      $list .= "<td><input name=\"delete_".$i."\" value=\"1\" type=\"checkbox\" />\n";
    }
    else
    {
      $list .= "<td>&nbsp;</td>";
    }
    $list .= "<input name=\"id_".$i."\" value=\"".$val['id']."\" type=\"hidden\" /></td>\n</tr>\n";
    $i++;
  }
  if ($limit == -1 || $total < $limit)
  {
    $list .= "<tr>\n";
    $list .= "<td>&nbsp;</td>\n";
    $list .= "<td colspan=\"2\">".$lang['add_new']."&nbsp;<input name=\"name_new\" value=\"".$name_new."\" size=\"12\" maxlength=\"".$maxlength."\" class=\"lightboxinputnew\" /></td>\n";
    if ($user_info['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN)
    {
      $list .= "<td align=\"middle\"><input name=\"private_new\" value=\"1\" type=\"checkbox\"".((isset($private_new)) ? (($private_new) ? " checked" : "") : " checked")." /></td>\n";
    }
    $list .= "<td>&nbsp;</td>\n";
    $list .= "<td>&nbsp;</td>\n";
    $list .= "</tr>\n";
  }
  $list .= "<input type=\"hidden\" name=\"action\" value=\"save\" />";
$limit_prc = ($limit) ? round(($total * 100) / $limit) : 0;
$lang_limit = ($limit != -1) ? preg_replace(array("/".$site_template->start."limit".$site_template->end."/siU", "/".$site_template->start."total".$site_template->end."/siU"), array($limit, $total), $lang['lightbox_limit']) : $lang['lightbox_unlimited'];
  $site_template->register_vars(array(
    "list" => $list,
    "limit_prc" => $limit_prc,
    "lang_limit" => $lang_limit,
    "lang_name" => $lang['name'],
    "lang_private" => ($user_info['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN) ? $lang['private'] : "",
    "lang_delete" => ($total > 1) ? $lang['lang_delete'] : "",
    "lang_images" => $lang['images'],
    "lang_clear" => $lang['clear'],
    "lang_submit" => $lang['save'],
    "lang_reset" => $lang['reset']
  ));
  $site_template->register_vars(array(
    "thumbnails" => $site_template->parse_template('lightbox_manage'),
    "lightbox_in_manage" => 1,
    "lightbox_notin_manage" => 0,
    "lightbox_lastaction" => (empty($user_info['lightbox_lastaction'])) ? format_date($config['date_format']." ".$config['time_format'], $user_info['lightbox_lastaction']) : "n/a",
  ));
  $lightbox_name = $lang['lightbox_settings'];
}
//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
if ($action == "show")
{
  $lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
  $ids = "";
  if ($lightbox_id)
  {
    $sql = "SELECT l.lightbox_id, l.lightbox_name, l.lightbox_private, l.lightbox_image_ids, l.user_id, u.user_name, u.user_lightbox_private
            FROM ".LIGHTBOXES_TABLE." l
            LEFT JOIN ".USERS_TABLE." u ON u.user_id = l.user_id
            WHERE l.lightbox_id = '".$lightbox_id."'";
    if ($row = $site_db->query_firstrow($sql))
    {
      $ids = (!$row['lightbox_private'] && $row['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN ) ? $row['lightbox_image_ids'] : "";//$user_info['lightbox_image_ids'];
      $lightbox_name = stripslashes($row['lightbox_name'])." (".$row['user_name'].")";
    }
    else
    {
      $lightbox_name = "";
    }
  }
  else
  {
    $lightbox_name = $user_info['lightboxes'][$user_info['user_lightbox']]['name'];
  }
  if ($lightbox_name)
  {
    $txt_clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php")."\">".$lang['lightbox']."</a>".$config['category_separator'].$lightbox_name;
  }
  else
  {
    $txt_clickstream = $lang['lightbox'];
  }
  $site_template->register_vars(array(
    "lang_lightbox_manage" => $lang['lightbox_manage'],
    "url_lightbox_manage" => ($user_info['user_level'] >= USER && !$lightbox_id) ? $site_sess->url(ROOT_PATH."lightbox.php?action=manage") : "",
    "lightbox_in_manage" => 0,
    "lightbox_notin_manage" => 1,

  ));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 2.2
Find:
Code: [Select]
if (!empty($user_info['lightbox_image_ids']))  {
  $image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  if (!empty($user_info['lightbox_image_ids']) || $lightbox_id)  {
    $image_id_sql = str_replace(" ", ", ", trim((($lightbox_id) ? $ids : $user_info['lightbox_image_ids'])));
    $image_id_sql = (empty($image_id_sql)) ? 0 : $image_id_sql;
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 2.3
Find:
Code: [Select]
   show_image($image_row, "lightbox");Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
    show_image($image_row, "lightbox".(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 2.4
Find:
Code: [Select]
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['lightbox']."</span>";Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
}
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$txt_clickstream."</span>";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 2.5a (For people without [MOD] Lightbox for GUESTs (http://www.4homepages.de/forum/index.php?topic=4826.0) installed)
4images v1.7 - 1.7.3

Find:
Code: [Select]
 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>";
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  if (($lightbox_id && !empty($ids)) || (!$lightbox_id && !empty($user_info['lightbox_image_ids']))) {
    $download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox".(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""))."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

4images v1.7.4 and newer

Find:
Code: [Select]
 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>";
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  if ($download_allowed && (($lightbox_id && !empty($ids)) || (!$lightbox_id && !empty($user_info['lightbox_image_ids'])))) {
    $download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox".(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""))."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 2.5b (For people with [MOD] Lightbox for GUESTs (http://www.4homepages.de/forum/index.php?topic=4826.0) installed)
Find:
Code: [Select]
 if (!empty($user_info['lightbox_image_ids']) && $user_info['user_level'] != GUEST) {
    $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>";
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  if ($user_info['user_level'] != GUEST && (($lightbox_id && !empty($ids)) || (!$lightbox_id && !empty($user_info['lightbox_image_ids'])))) {
    $download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox".(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""))."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 2.5c (For people with [MOD] - Restrict users to use e-card and download if they have not voted first (http://www.4homepages.de/forum/index.php?topic=9288.0) installed)
Find:
Code: [Select]
$array_lightbox_image_ids = explode(" ", $user_info['lightbox_image_ids']); // put lightboxed pics in an array

foreach ($array_lightbox_image_ids as $element) {
if (!in_array ($element, $rated_images)) { // if current lightboxed pics in not found in rated pics by user
$one_not_rated = 1;
   }
}
   if (!empty($user_info['lightbox_image_ids']) && !$one_not_rated) { // !$one_not_rated  :  means all pics in lightbox have been rated
//-------------------------------------------[/[Mod] Restrict users to use e-card and download if they have not voted first]

   $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>";
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
$array_lightbox_image_ids = explode(" ", (($lightbox_id && !empty($ids)) ? $ids : $user_info['lightbox_image_ids'])); // put lightboxed pics in an array
$one_not_rated = 0;
foreach ($array_lightbox_image_ids as $element) {
if (!in_array ($element, $rated_images)) { // if current lightboxed pics in not found in rated pics by user
$one_not_rated = 1;
   }
}
   if ((($lightbox_id && !empty($ids)) || (!$lightbox_id && !empty($user_info['lightbox_image_ids']))) && !$one_not_rated) { // !$one_not_rated  :  means all pics in lightbox have been rated
//-------------------------------------------[/[Mod] Restrict users to use e-card and download if they have not voted first]

   $download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox".(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""))."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 2.6 (added 19-02-2006)
Find:
Code: [Select]
$link_arg = $site_sess->url(ROOT_PATH."lightbox.php");Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
$link_arg = ROOT_PATH."lightbox.php".(($lightbox_id) ? "?lightbox_id=".$lightbox_id : "");
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/



Step 3
Open details.php
Find:
Code: [Select]
show_image($image_row, $mode, 0, 1);Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
$lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
show_image($image_row, $mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""), 0, 1);
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 3.1
Find:
Code: [Select]
 if (!empty($user_info['lightbox_image_ids'])) {
    $image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $ids = $user_info['lightbox_image_ids'];
  if ($lightbox_id)
  {
    $sql = "SELECT l.lightbox_id, l.lightbox_name, l.lightbox_private, l.lightbox_image_ids, l.user_id, u.user_name, u.user_lightbox_private
            FROM ".LIGHTBOXES_TABLE." l
            LEFT JOIN ".USERS_TABLE." u ON u.user_id = l.user_id
            WHERE l.lightbox_id = '".$lightbox_id."'";
    if ($row = $site_db->query_firstrow($sql))
    {
      $ids = (!$row['lightbox_private'] && $row['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN ) ? $row['lightbox_image_ids'] : "";//$user_info['lightbox_image_ids'];
      $lightbox_name = $row['lightbox_name']." (".$row['user_name'].")";
    }
    else
    {
      $lightbox_name = "";
    }
  }
  else
  {
    $lightbox_name = $user_info['lightboxes'][$user_info['user_lightbox']]['name'];
  }
  $txt_clickstream = $lang['lightbox'].(($lightbox_name) ? " - ".$lightbox_name : "");
  if (!empty($ids)) {
    $image_id_sql = str_replace(" ", ", ", trim($ids));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 3.2
Find:
Code: [Select]
 $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : "") : ""));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 3.3
Find:
Code: [Select]
 $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : "") : ""));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 3.5
Find:
Code: [Select]
 $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $page_url .= ($lightbox_id) ? (($page_url) ? "&" : "?")."lightbox_id=".$lightbox_id : "";
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$txt_clickstream."</a>".$config['category_separator'];
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 4
Open member.php
Find in 4images v1.7-1.7.6:
Code: [Select]
   $user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;Find in 4images v1.7.7 or newer:
Code: [Select]
   $user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;
Insert above:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
    $user_lightbox = "";
    $limit = ($user_row['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_row['user_level'] == ADMIN) ? -1 : (($user_row['user_lightbox_count']) ? $user_row['user_lightbox_count'] : $config['lightbox_count']);
    if ((($user_row['user_lightbox_private'] || $user_row['user_level'] == ADMIN) && $config['lightbox_share']) || $user_info['user_level'] == ADMIN)
    {
      $condition = "";
      if ($limit != -1)
      {
        $condition = " LIMIT ".$limit;
      }
      $condition;
      $sql = "SELECT lightbox_id, lightbox_name, lightbox_private, lightbox_image_ids
              FROM ".LIGHTBOXES_TABLE."
              WHERE user_id = ".$user_row['user_id'].$condition;
      $result = $site_db->query($sql);
      if ($result)
      {
        while ($row = $site_db->fetch_array($result))
        {
          if (!$row['lightbox_private'] || $user_info['user_level'] == ADMIN)
          {
            $user_lightbox .= (($user_lightbox) ? "<br />" : "").(($user_info['user_level'] == ADMIN) ? ((!$row['lightbox_private']) ? "+ " : "- ") : "")."<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php?lightbox_id=".$row['lightbox_id'])."\">".$row['lightbox_name']." (".((trim($row['lightbox_image_ids'])) ? count(explode(" ", trim($row['lightbox_image_ids']))) : 0).")</a>\n";
          }
        }
      }
    }
    $site_template->register_vars(array(
      "user_lightbox" => $user_lightbox,
      "lang_user_lightbox" => $lang['user_lightbox'],
    ));
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

Step 4.1
Find:
Code: [Select]
 $user_invisible = (isset($HTTP_POST_VARS['user_invisible'])) ? intval($HTTP_POST_VARS['user_invisible']) : 0;Insert below:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
//these settings can not be changed by the user, only by administrator from ACP
  if (isset($HTTP_POST_VARS['user_lightbox'])) unset($HTTP_POST_VARS['user_lightbox']);
  if (isset($HTTP_POST_VARS['user_lightbox_private'])) unset($HTTP_POST_VARS['user_lightbox_private']);
  if (isset($HTTP_POST_VARS['user_lightbox_count'])) unset($HTTP_POST_VARS['user_lightbox_count']);
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/



Step 5
Open download.php
Find:
Code: [Select]
 if (empty($user_info['lightbox_image_ids']) || !function_exists("gzcompress") || !function_exists("crc32")) {Insert above:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
  $lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
  if ($lightbox_id)
  {
    $sql = "SELECT l.lightbox_id, l.lightbox_name, l.lightbox_private, l.lightbox_image_ids, l.user_id, u.user_name, u.user_lightbox_private
            FROM ".LIGHTBOXES_TABLE." l
            LEFT JOIN ".USERS_TABLE." u ON u.user_id = l.user_id
            WHERE l.lightbox_id = '".$lightbox_id."'";
    $row = $site_db->query_firstrow($sql);
    $user_info['lightbox_image_ids'] = (!$row['lightbox_private'] && $row['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN ) ? $row['lightbox_image_ids'] : "";//$user_info['lightbox_image_ids'];
  }
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/


Step 6
Open includes/functions.php
Find:
Code: [Select]
 $sql = "UPDATE ".LIGHTBOXES_TABLE."
          SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
          WHERE user_id = ".$user_info['user_id'];
  return ($site_db->query($sql)) ? 1 : 0;
(there are two instances of this block of code, you must do changes from this step only on find the first instance! This block located inside add_to_lightbox function)
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $sql = "UPDATE ".LIGHTBOXES_TABLE."
          SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
          WHERE user_id = ".$user_info['user_id']." AND id = ".$user_info['user_lightbox'];
  if ($site_db->query($sql))
  {
    $user_info['lightboxes'][$user_info['user_lightbox']]['count']++;
    $user_info['lightboxes_list'][$user_info['user_lightbox']] = lightbox_trim($user_info['lightboxes'][$user_info['user_lightbox']]['name'])." (".$user_info['lightboxes'][$user_info['user_lightbox']]['count'].")";
    return true;
  }
  return false;
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 6.1
Find:
Code: [Select]
 $sql = "UPDATE ".LIGHTBOXES_TABLE."
          SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
          WHERE user_id = ".$user_info['user_id'];
  return ($site_db->query($sql)) ? 1 : 0;
(yes, this is the exact same block as in previous step, but this is second instance! This block located inside remove_from_lightbox function)
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $sql = "UPDATE ".LIGHTBOXES_TABLE."
          SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
          WHERE user_id = ".$user_info['user_id']." AND id = ".$user_info['user_lightbox'];
  if ($site_db->query($sql)) {
    $user_info['lightboxes'][$user_info['user_lightbox']]['count']--;
    $user_info['lightboxes_list'][$user_info['user_lightbox']] = lightbox_trim($user_info['lightboxes'][$user_info['user_lightbox']]['name'])." (".$user_info['lightboxes'][$user_info['user_lightbox']]['count'].")";
    return true;
  }
  return false;
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 6.2
Find:
Code: [Select]
 $sql = "UPDATE ".LIGHTBOXES_TABLE."
          SET lightbox_image_ids = '', lightbox_lastaction = $current_time
          WHERE user_id = ".$user_info['user_id'];
  if ($site_db->query($sql)) {
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  $sql = "UPDATE ".LIGHTBOXES_TABLE."
          SET lightbox_lastaction = ".$current_time.", lightbox_image_ids = ''
          WHERE user_id = ".$user_info['user_id']." AND id = ".$user_info['user_lightbox'];
  if ($site_db->query($sql)) {
    $user_info['lightboxes'][$user_info['user_lightbox']]['count'] = 0;
    $user_info['lightboxes_list'][$user_info['user_lightbox']] = lightbox_trim($user_info['lightboxes'][$user_info['user_lightbox']]['name'])." (0)";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 6.3
At the end of the file, above closing ?> insert:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/function lightbox_trim($name)
{
  $max = 10;
  if (strlen($name) > $max)
  {
    $name = substr($name, 0, $max)."...";
  }
  return $name;
}
function fixhtml($text, $quote = 1, $amp = 0)
{
  if ($amp) $text = str_replace("&", "&amp;", $text);
  if ($quote) $text = str_replace("\"", "&quot;", $text);
  $text = str_replace("<", "&lt;", str_replace(">", "&gt;", $text));
  return $text;
}
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/


Step 6.4
If you have PM v2 (http://www.4homepages.de/forum/index.php?topic=6692.msg30078#msg30078) mod installed, skip this step and continue to Step 7
Otherwise at the end of the file, above closing ?> insert:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
function get_msg($msg) {
  $txt = "";
  if (is_array($msg)) {
    $error = implode($msg['error'], "<br />");
    $good = implode($msg['good'], "<br />");
    $plain = implode($msg['plain'], "<br />");
  }
  else {
    $error = $msg;
  }
  if ($error) {
    $txt = "<div class=\"msg_error\">".$error."</div>";
  }
  if ($good) {
    $txt .= "<div class=\"msg_good\">".$good."</div>";
  }
  if ($plain) {
    $txt .= "<div class=\"msg_plain\">".$plain."</div>";
  }
  return $txt;
}
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/



Step 7
Open includes/page_header.php
Find:
Code: [Select]
   $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
    $msg = (add_to_lightbox($id)) ? preg_replace("/".$site_template->start."name".$site_template->end."/iU", $user_info['lightboxes'][$user_info['user_lightbox']]['name'], $lang['lightbox_add_success']) : preg_replace("/".$site_template->start."name".$site_template->end."/iU", $user_info['lightboxes'][$user_info['user_lightbox']]['name'], $lang['lightbox_add_error']);
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 7.1
Find:
Code: [Select]
   $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
    $msg = (remove_from_lightbox($id)) ? preg_replace("/".$site_template->start."name".$site_template->end."/iU", $user_info['lightboxes'][$user_info['user_lightbox']]['name'], $lang['lightbox_remove_success']) : preg_replace("/".$site_template->start."name".$site_template->end."/iU", $user_info['lightboxes'][$user_info['user_lightbox']]['name'], $lang['lightbox_remove_error']);
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/


Step 7.2
Find:
Code: [Select]
   $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
    $msg = (clear_lightbox()) ? preg_replace("/".$site_template->start."name".$site_template->end."/iU", $user_info['lightboxes'][$user_info['user_lightbox']]['name'], $lang['lightbox_clear_success']) : preg_replace("/".$site_template->start."name".$site_template->end."/iU", $user_info['lightboxes'][$user_info['user_lightbox']]['name'], $lang['lightbox_clear_error']);
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 7.3
Find:
Code: [Select]
//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
Insert above:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
//-----------------------------------------------------
//--- Multi-Lightboxes ---------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER && $config['lightbox_count'])
{
  $user_lightbox_dropdown = (count($user_info['lightboxes_list']) > 1) ? get_dropdown_options("user_lightbox", $user_info['lightboxes_list'], $user_info['user_lightbox'], 1, 0, 1, 0, "", "lightboxidropdown") : "";
}
else
{
  $user_lightbox_dropdown = "";
}
$site_template->register_vars(array(
  "user_lightbox_dropdown" => $user_lightbox_dropdown,
  "lang_lightbox_select" => $lang['lightbox_select'],
));
$user_lightbox_dropdown = ($user_lightbox_dropdown) ? $site_template->parse_template("lightbox_dropdown") : "";
$site_template->register_vars("user_lightbox_form", $user_lightbox_dropdown);
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/



Continue next reply
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 03, 2005, 06:22:52 AM
Step 8
Open includes/sessions.php
Find:
Code: [Select]
   if ($user_id != GUEST) {
      $sql = "SELECT u.*, l.*
              FROM ".USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE ".get_user_table_field("u.", "user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.", "user_id");
      $user_info = $site_db->query_firstrow($sql);
      if (!$user_info) {
        $sql = "SELECT *
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_id")." = $user_id";
        $user_info = $site_db->query_firstrow($sql);
        if ($user_info) {
          $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
          $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          $site_db->query($sql);
          $user_info['lightbox_lastaction'] = $this->current_time;
          $user_info['lightbox_image_ids'] = "";
        }
      }
    }
(this block is located inside load_user_info function. MAKE SURE YOU MATCH THE BRACKETS!)
Replace with:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
    if ($user_id != GUEST)
    {
      $sql = "SELECT *
              FROM ".USERS_TABLE."
              WHERE ".get_user_table_field("", "user_id")." = ".$user_id;
      $user_info = $site_db->query_firstrow($sql);
      if (!$user_info['user_id'])
      {
        $this->logout($user_id);
        $user_id = GUEST;
      }
    }
    if ($user_id != GUEST)
    {
      $i = 0;
      $delete = "";
      $update = 0;
      $correct = 0;
      $ids = "";
      $limit = ($user_info['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_info['user_level'] == ADMIN) ? -1 : (($user_info['user_lightbox_count']) ? $user_info['user_lightbox_count'] : $config['lightbox_count']);
      global $HTTP_POST_VARS, $HTTP_GET_VARS;
      if (isset($HTTP_POST_VARS['user_lightbox']) && $HTTP_POST_VARS['user_lightbox'])
      {
        $user_info['user_lightbox'] = $HTTP_POST_VARS['user_lightbox'];
        $update = 1;
      }
      elseif (isset($HTTP_GET_VARS['user_lightbox']) && $HTTP_GET_VARS['user_lightbox'])
      {
        $user_info['user_lightbox'] = $HTTP_GET_VARS['user_lightbox'];
        $update = 1;
      }

      $sql = "SELECT lightbox_id, lightbox_name, lightbox_image_ids, lightbox_private, id, lightbox_lastaction, IF(id = ".$user_info['user_lightbox'].", id, 0) AS num
              FROM ".LIGHTBOXES_TABLE."
              WHERE user_id = ".$user_id."
              ORDER BY id ASC";
      $row = $site_db->query($sql);
      while ($result = $site_db->fetch_array($row))
      {
        $i++;
        if ($limit != -1 && $i > $limit)
        {
          $delete .= (($delete) ? "," : "").$result['id'];
        }
        else
        {
          $user_info['lightboxes'][$result['id']]['name'] = $result['lightbox_name'];
          $user_info['lightboxes'][$result['id']]['private'] = $result['lightbox_private'];
          $user_info['lightboxes'][$result['id']]['lightbox_id'] = $result['lightbox_id'];
          $user_info['lightboxes'][$result['id']]['id'] = $result['id'];
          $user_info['lightboxes'][$result['id']]['image_ids'] = $result['lightbox_image_ids'];
          $user_info['lightboxes'][$result['id']]['lastaction'] = $result['lightbox_lastaction'];
          $user_info['lightboxes'][$result['id']]['count'] = (trim($result['lightbox_image_ids'])) ? count(explode(" ", trim($result['lightbox_image_ids']))) : 0;
          $user_info['lightboxes_list'][$result['id']] = fixhtml(lightbox_trim($result['lightbox_name'])." (".$user_info['lightboxes'][$result['id']]['count'].")");
          if ($i == 1)
          {
            $first = $result['id'];
            $ids = $result['lightbox_image_ids'];
            $lastaction = $result['lightbox_lastaction'];
          }
          if ($result['num'])
          {
            $correct = 1;
            $user_info['lightbox_image_ids'] = $result['lightbox_image_ids'];
            $user_info['lightbox_lastaction'] = $result['lightbox_lastaction'];
          }
        }
      }
      if (!$correct)
      {
        $user_info['user_lightbox'] = $first;
        $user_info['lightbox_image_ids'] = $ids;
        $user_info['lightbox_lastaction'] = $lastaction;
        $update = 1;
      }
      if ($delete)
      {
        $sql = "DELETE FROM ".LIGHTBOXES_TABLE." WHERE id IN (".$delete.")";
        $site_db->query($sql);
      }
      if ($user_info && !$user_info['user_lightbox'])
      {
        $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
        $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
                (lightbox_id, user_id, lightbox_lastaction)
                VALUES
                ('$lightbox_id', ".$user_id.", $this->current_time)";
        $site_db->query($sql);
        $user_info['lightbox_lastaction'] = $this->current_time;
        $user_info['lightbox_image_ids'] = "";
        $user_info['user_lightbox'] = $site_db->get_insert_id();
        $update = 1;
      }
      if ($update)
      {
        $sql = "UPDATE ".USERS_TABLE." SET user_lightbox = ".$user_info['user_lightbox']." WHERE user_id = ".$user_id;
        $site_db->query($sql);
      }
    }
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

Step 8.1
Find:
Code: [Select]
     $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;Insert below:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
      $user_info['user_lightbox'] = 0;
      $user_info['lightboxes'] = array();
      $user_info['lightboxes_list'] = array();
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/



Step 9
Open includes/db_field_definitions.php
At the end, above closing ?> insert:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
$additional_user_fields['user_lightbox_count'] = array($lang['user_lightbox_count'], "text", 0);
$additional_user_fields['user_lightbox_private'] = array($lang['user_lightbox_private'], "radio", 0);
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/



Step 10
Open admin/settings.php
Find the last instance of show_table_separator($setting_group[XX], 2, "#setting_group_XX"); line, where XX is a number. Now, add 1 to that number and write down somewhere the result, you will need this number for next two steps! (EXAMPLE: in fresh 4images the last instance of this line looks like this: show_table_separator($setting_group[7], 2, "#setting_group_[color]7[/color]"); number 7 is what we are looking for. Then 7 + 1 = 8;   8 - is the number we must remmember for next steps[/i])


Step 10.1
Find:
Code: [Select]
 show_form_footer($lang['save_changes'], "", 2);Insert above 4images 1.7-1.7.1:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
  show_table_separator($setting_group[XX], 2, "#setting_group_XX");
  show_setting_row("lightbox_count");
  show_setting_row("lightbox_share", "radio");
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

Insert above 4images 1.7.2 or newer:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
  show_table_separator($setting_group[XX], 2, "setting_group_XX");
  show_setting_row("lightbox_count");
  show_setting_row("lightbox_share", "radio");
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

Replace XX with the number from Step 10



Step 11
Open lang/<your language>/admin.php
At the end, above closing ?> insert:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
/*-- Setting-Group XX--*/
$setting_group[XX]="Multi-lightboxes";
$setting["lightbox_count"] = "Number of allowed lightboxes";
$setting["lightbox_share"] = "Allow share lightboxes";
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/
Replace XX with the number from Step 10



Step 12
Open lang/<your language>/main.php
At the end, above closing ?> insert:
Code: [Select]
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
$lang['lightbox_no_images'] = "No images stored in this lightbox.";
$lang['lightbox_add_success'] = "Image added in <i>{name}</i> lightbox.";
$lang['lightbox_add_error'] = "Error adding image into <i>{name}</i> lightbox!";
$lang['lightbox_remove_success'] = "Image deleted from <i>{name}</i> lightbox.";
$lang['lightbox_remove_error'] = "Error deleting image from <i>{name}</i> lightbox!";
$lang['lang_delete'] = "Delete";
$lang['private'] = "Private";
$lang['clear'] = "Clear";
$lang['add_new'] = "Add new";
$lang['lightbox_manage'] = "Manage lightboxes";
$lang['delete_lightbox'] = "Clear <i>{name}</i> lightbox";
$lang['lightbox_clear_success'] = "Lightbox <i>{name}</i> emptied";
$lang['lightbox_clear_error'] = "Error cleaning <i>{name}</i> lightbox!";
$lang['clear_lightbox_confirm'] = "Do you really want to delete all images from {name} lightbox?";
$lang['lightbox_update_success'] = "Lightbox <i>{name}</i> updated";
$lang['lightbox_update_error'] = "<i>{name}</i> lightbox was not updated";
$lang['mlightbox_delete_success'] = "Lightbox <i>{name}</i> deleted";
$lang['mlightbox_delete_error'] = "<i>{name}</i> lightbox was not deleted";
$lang['lightbox_name_error'] = "Please check name of marked {lightbox}";
$lang['lightbox_single'] = "lightbox";
$lang['lightbox_plural'] = "lightboxes";
$lang['noname'] = "no name";
$lang['lightbox_create_success'] = "Added <i>{name}</i> lightbox";
$lang['lightbox_create_error'] = "Error adding <i>{name}</i> lightbox!";
$lang['user_lightbox'] = "Shared lightboxes:";
$lang['lightbox_settings'] = "Settings";
$lang['lightbox_limit'] = "You have {total} of {limit} avalable lightboxes";
$lang['lightbox_unlimited'] = "You can add unlimited number of lightboxes";
$lang['user_lightbox_count'] = "Number of allowed lightboxes<br /><span class=\"smalltext\"><b><font color=\"red\">0</font></b> - use global settings<br /><b><font color=\"red\">-1</font></b> - unlimited</span>";
$lang['user_lightbox_private'] = "Allow share lightboxes";
$lang['lightbox_select'] = "Go";
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/



Step 13
If you have not installed [MOD] Dropdown options for custom database fields (http://www.4homepages.de/forum/index.php?topic=7112.0) yet, please do now, atleast do the Step 3
If you have installed it, please redo Step 3 again. I just updated it with a little bug fix regarding custom style class being ignored (it will not affect any code that used that mod)



Step 14
The following steps are template-related, so I'll just give information what you need to add, the design is your task ;)

Open templates/<your template>/lightbox.html
Insert:
Code: [Select]
{if url_lightbox_manage}
<a href="{url_lightbox_manage}"><b>{lang_lightbox_manage}</b></a>
{endif url_lightbox_manage}
Also, you can use the following conditional tags:
Quote
{if lightbox_notin_manage}
block that you DONT want to show on "lightbox manager" page
{endif lightbox_notin_manage}
And
Quote
{if lightbox_in_manage}
block that you want to show ONLY on "lightbox manager" page
{endif lightbox_in_manage}



Step 15
Open templates/<your template>/member_profile.html
Insert
Code: [Select]
{if user_lightbox}
        <tr>
          <td class="row1"><b>{lang_user_lightbox}</b></td>
          <td class="row1">{user_lightbox}</td>
        </tr>
{endif user_lightbox}



Step 16
Open templates/<your template>/user_logininfo.html (or any other template where you want to display lightboxes dropdown menu)
Insert:
Code: [Select]
{if user_lightbox_form}{user_lightbox_form}{endif user_lightbox_form}


Step 17
Open templates/<your template>/style.css
Insert:
Code: [Select]
.mlightbox0 {
  background-color: #FFCECE;
  color: #2F6B9D;
  font-weight: bold;
}
.mlightbox1 {
  background-color: #CEFFDD;
  color: #2F6B9D;
  font-weight: bold;
}
.msg_good {
  background-color: #CEFFDD;
  font-weight: bold;
border: 1px solid #5E6C80;
padding: 3px 3px 3px 3px ;
margin: 3px 0px 3px 0px ;
}

.msg_error {
  background-color: #FFCECE;
  font-weight: bold;
border: 1px solid #5E6C80;
padding: 3px 3px 3px 3px ;
margin: 3px 0px 3px 0px ;
}

.msg_plain {
  background-color: transparent;
  font-weight: bold;
border: 1px solid #5E6C80;
padding: 3px 3px 3px 3px ;
margin: 3px 0px 3px 0px ;
}
.lightboxinput {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  color: #0f5475;
  font-size: 11px;
  width: 170px;
}
.lightboxinputnew {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  color: #0f5475;
  font-size: 11px;
  width: 125px;
}
.lightboxidropdown {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  color: #0f5475;
  font-size: 11px;
  width: 95px;
}
.lightboxibutton {
  font-family:  Tahoma,Verdana,Arial, Helvetica, sans-serif;
  background-color: #003366;
  color: #fcdc43;
  font-size: 11px;
  font-weight: bold;
  width: 27px;
}



Step 18
Open admin/images.php[/b]
Find:
Code: [Select]
 $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, l.lightbox_image_ids
Replace with:
Code: [Select]
 $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, l.lightbox_image_ids, l.lightbox_id
Step 18.1
Find:
Code: [Select]
             WHERE user_id = ".$image_row['user_id'];
Replace with:
Code: [Select]
              WHERE lightbox_id = '".$image_row['lightbox_id']."'";


---------- [ Troubleshooting / info ] -----------

- If you see some condition tags when you open lightbox page (or any other) (i.e. {if url_lightbox_manage}{endif url_lightbox_manage} ) Most probably you did not apply this (http://www.4homepages.de/forum/index.php?topic=6806.0) or/end this (http://www.4homepages.de/forum/index.php?topic=7493.0) fix yet.
- The maximum lightbox name lenght is 32 letters, there is no warning if name is longer, it will automaticaly cut to 32 letters. If you want change that limit, you will need manualy run this MySQL query:
Code: [Select]
ALTER TABLE `4images_lightboxes` CHANGE `lightbox_name` `lightbox_name` VARCHAR( XX )  NOT NULL where XX is the limit number
- The maximum lightbox name lenght in dropdown is set to 10, you can adjust it in includes/functions.php
Code: [Select]
 $max = 10;- in v1 the only way add an image to another lightbox is to select the needed lightbox from dropdown before adding image (the page must refresh!).
- In lightbox manager page the number next to lightbox name field represent number of images in the lightbox
- members can see shared lightboxes from member's profile page
- admin can see even not shared lightboxes. At members profile page the shared lightboxes marked with + while not shared marked with -
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 03, 2005, 06:27:13 AM
--------------- [ Version history ] ---------------

1.03.2- fixed misspelled variable in step 6.3
1.03.1- fixed lightboxes being overwritten when an image deleted (added Steps 18.x)
1.03 - changed Step 2.1 (more info here (http://www.4homepages.de/forum/index.php?topic=10625.msg54097#msg54097))
1.02 - fixed apostrophe and quotes in lightbox names issue (redo Step 2.1, 6.3 and 8 )
- in Step 12 fixed "clear lightbox" missing strings
1.01 - fixed MySQL query
1.0 - Initial release

Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 03, 2005, 11:25:06 AM
Hi,

no problem with delete the posts.

but i have one problem with this mod :) . i have install this one -> http://www.4homepages.de/forum/index.php?topic=9288.0

and now i can´t made the changes in step 2.5b

can you help me with this?

and now in step 7.1 & 7.2 there are two instances of this line. change both???

and in step 3.5 i dpn´t have this line

Code: [Select]
$page_url .= ($lightbox_id) ? (($page_url) ? "&" : "?")."lightbox_id=".$lightbox_id : "";
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Loda on December 03, 2005, 03:07:26 PM
no problem, v@no!
my post was:
it works! (version 1.7) you are the best!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 03, 2005, 06:31:13 PM
but i have one problem with this mod :) . i have install this one -> http://www.4homepages.de/forum/index.php?topic=9288.0

and now i canґt made the changes in step 2.5b
I've added Step 2.5c (not tested it though)


and now in step 7.1 & 7.2 there are two instances of this line. change both???
Can't be.
There are simular lines, actualy 3 instances with simular code, one for add to lightbox, second for remove and third for deleting entire lightbox.

and in step 3.5 i dpnґt have this line

Code: [Select]
$page_url .= ($lightbox_id) ? (($page_url) ? "&" : "?")."lightbox_id=".$lightbox_id : "";
Ouch...I've added this line in the wrong place, thats one of the replacement lines, not seeking...updated it.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 05, 2005, 01:23:50 PM
Hi,

i have played with the multi lightbox at v@nos site and i have a question.

When i have a pic in album1 but i want it in album2. is there a way to move the pic from album1 to album2 ????
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 05, 2005, 02:43:31 PM
only manualy removing it from one lightbox, then switching lighbox and adding it to another one.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 05, 2005, 03:58:25 PM
Thanks,

now i have installed it into my galery and i thing it works perfect.....
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 05, 2005, 07:48:33 PM
Hi,

i found a problem. After the installation the PM function is not working. I have blank page when i go the PM and will write some....Has any other this problem, too??
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Loda on December 05, 2005, 08:26:04 PM
Quote
Has any other this problem, too??
yes, you're right, i have this problem, too!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 06, 2005, 12:30:51 AM
Oh, right, forgot that I've used the same function for colored type messages in PM mod...in includes/functions.php remove
Code: [Select]
function get_msg($msg) {
  $txt = "";
  if (is_array($msg)) {
    $error = implode($msg['error'], "<br />");
    $good = implode($msg['good'], "<br />");
    $plain = implode($msg['plain'], "<br />");
  }
  else {
    $error = $msg;
  }
  if ($error) {
    $txt = "<div class=\"msg_error\">".$error."</div>";
  }
  if ($good) {
    $txt .= "<div class=\"msg_good\">".$good."</div>";
  }
  if ($plain) {
    $txt .= "<div class=\"msg_plain\">".$plain."</div>";
  }
  return $txt;
}
You should already have this function from PM mod.

I've updated the tutorial and split step 6.3.

P.S. just out of curiosity how much time did i take for you to install it?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Stoleti on December 06, 2005, 01:34:10 AM
why when we give a album name with ' (i.e :  My Fav's  ) this show after "My Fav/'s" with "/" , this is the same of when we post html codes in profile , and we re-save again ....show ton's of "/"  8O
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 06, 2005, 04:31:26 AM
You are right (exept its \ not / ;))
I think I've fixed it. Redo Step 2.1, 6.3 and 8
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 06, 2005, 06:51:55 AM
Oh, right, forgot that I've used the same function for colored type messages in PM mod...in includes/functions.php remove
Code: [Select]
function get_msg($msg) {
  $txt = "";
  if (is_array($msg)) {
    $error = implode($msg['error'], "<br />");
    $good = implode($msg['good'], "<br />");
    $plain = implode($msg['plain'], "<br />");
  }
  else {
    $error = $msg;
  }
  if ($error) {
    $txt = "<div class=\"msg_error\">".$error."</div>";
  }
  if ($good) {
    $txt .= "<div class=\"msg_good\">".$good."</div>";
  }
  if ($plain) {
    $txt .= "<div class=\"msg_plain\">".$plain."</div>";
  }
  return $txt;
}
You should already have this function from PM mod.

I've updated the tutorial and split step 6.3.

P.S. just out of curiosity how much time did i take for you to install it?

Hi,

i have do this but now i become a blank page when i will edit or create a lightbox. he do what i will (create a lightbox) but he brings me a blank page :(
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 06, 2005, 07:07:23 AM
Ok, if you search in functions.php for function get_msg there should be only one instance of that function. if you see more then one, then remove one (either).
If you cant find any, then add one from Step 6.4.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 06, 2005, 07:17:03 AM
Ok, if you search in functions.php for function get_msg there should be only one instance of that function. if you see more then one, then remove one (either).
If you cant find any, then add one from Step 6.4.

Hi i don´t find the function get_msg in my functions.php. But when i insert the function from Step 6.4 i can´t write or read PM´s.....

*edit*

I have this function in the pm.php !!!!!!!!!!! Can i help you with this to help me???

*edit2*

OK, insert the function get_msg in includes/functions.php and delete it in pm.php. I thing it works.....
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 06, 2005, 08:19:41 AM
OK, insert the function get_msg in includes/functions.php and delete it in pm.php. I thing it works.....
Very good, you've got it right ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Loda on December 06, 2005, 01:17:07 PM
ok, thank you for your help!

a little sip up:  first step i look to a user profil than i want to change my album on the dropdownfield --> i get the lostpassword page..
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: JensF on December 06, 2005, 02:12:56 PM
ok, thank you for your help!

a little sip up:  first step i look to a user profil than i want to change my album on the dropdownfield --> i get the lostpassword page..

That´s my problem, too! When i see a member profile and change the lightbox i come to the lost passwort page  8O

One Problem goes, one Problem comes :)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on December 06, 2005, 08:46:45 PM
Hello,

I have an error:

Fatal error: Call to undefined function: get_dropdown_options() in /homepages/35/d85936339/htdocs/4images/includes/page_header.php on line 511

/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
//-----------------------------------------------------
//--- Multi-Lightboxes ---------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER && $config['lightbox_count'])
{
  $user_lightbox_dropdown = (count($user_info['lightboxes_list']) > 1) ? get_dropdown_options("user_lightbox", $user_info['lightboxes_list'], $user_info['user_lightbox'], 1, 0, 1, 0, "", "lightboxidropdown") : "";
}
else
{
  $user_lightbox_dropdown = "";
}
$site_template->register_vars(array(
  "user_lightbox_dropdown" => $user_lightbox_dropdown,  "lang_lightbox_select" => $lang['lightbox_select'],
));
$user_lightbox_dropdown = ($user_lightbox_dropdown) ? $site_template->parse_template("lightbox_dropdown") : "";
$site_template->register_vars("user_lightbox_form", $user_lightbox_dropdown);
/*
  MOD MULTI-LIGHTBOXES
  END INSERT

This is the line for my error


Help

Greez Darkness
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Loda on December 06, 2005, 09:58:36 PM
another little problem:
the downloads are not count anymore :?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 07, 2005, 12:32:51 AM
The changing lightbox from members profile page is a known bug, but its not exactly bug in this mod itself. It causes by 4images stripping out action= query from {self} tag. Its done to avoid any accidental actions, i.e. double sending emails, or double comments, etc.
I'll see what I can do about it.

Hello,

I have an error:

Fatal error: Call to undefined function: get_dropdown_options() in /homepages/35/d85936339/htdocs/4images/includes/page_header.php on line 511
Are you a superstitions person, trying to avoid Step 13? ;)


another little problem:
the downloads are not count anymore :?
This mod could not possibly affect download function. If I'm not misstaken by default 4images does not count downloads when downloading lightbox. There is patch for that.
[EDIT]
Just checked it, download count works just fine. Make sure you download it as a member, not as admin ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Loda on December 07, 2005, 08:17:03 AM
Quote
This mod could not possibly affect download function. If I'm not misstaken by default 4images does not count downloads when downloading lightbox. There is patch for that.
[EDIT]
Just checked it, download count works just fine. Make sure you download it as a member, not as admin


sorry. i'm stupid...   :oops:
it works...
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on December 07, 2005, 09:15:52 AM
The changing lightbox from members profile page is a known bug, but its not exactly bug in this mod itself. It causes by 4images stripping out action= query from {self} tag. Its done to avoid any accidental actions, i.e. double sending emails, or double comments, etc.
I'll see what I can do about it.

Hello,

I have an error:

Fatal error: Call to undefined function: get_dropdown_options() in /homepages/35/d85936339/htdocs/4images/includes/page_header.php on line 511
Are you a superstitions person, trying to avoid Step 13? ;)


another little problem:
the downloads are not count anymore :?
This mod could not possibly affect download function. If I'm not misstaken by default 4images does not count downloads when downloading lightbox. There is patch for that.
[EDIT]
Just checked it, download count works just fine. Make sure you download it as a member, not as admin ;)

Hello,

thanks I waiting for a massage  :mrgreen:

Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 09, 2005, 01:55:13 AM
I've changed the condition logic in Step 2.1 so it will work properly with other mods that use $action variable.

In lightbox.php find:
Code: [Select]
if ($action != "" || $user_info['user_level'] == GUEST || $action == "addtolightbox" || $action == "removefromlightbox")
{
  $action = "show";
}
elseif ($action == "clearlightbox")
{
  $action = "manage";
}
Replace with:
Code: [Select]
if ($user_info['user_level'] == GUEST || ($action != "manage" && $action != "save"))
{
  $action = ($action == "clearlightbox" && $user_info['user_level'] >= USER) ? "manage" : "show";
}

(or redo Step 2.1 ;))
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on December 09, 2005, 09:51:04 AM
Hello V@no ,

thanks I will test it today.

Greez Darkness  :mrgreen:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on December 12, 2005, 04:14:25 PM
Hello,

all fine works, i have installed the other MOD Lightboxes. Jet is working.

Thanks Darkness  :mrgreen:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 31, 2005, 01:26:36 PM
Hi,

How can I change the fonts size in the dropdownlist for chosing the album.
{user_lightbox_form}{endif user_lightbox_form}

Thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Acidgod on December 31, 2005, 01:33:38 PM
take a look in the new css code... (o:

I think you can change it here:
Code: [Select]
.lightboxidropdown {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  color: #0f5475;
  font-size: 11px;
  width: 95px;
}
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 31, 2005, 02:10:57 PM
super, and where can I change the layout of the lightbox-links in member_profile.html?


Thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on December 31, 2005, 05:39:17 PM
In step 4:
Code: [Select]
           $user_lightbox .= (($user_lightbox) ? "<br />" : "").(($user_info['user_level'] == ADMIN) ? ((!$row['lightbox_private']) ? "+ " : "- ") : "")."<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php?lightbox_id=".$row['lightbox_id'])."\">".$row['lightbox_name']." (".((trim($row['lightbox_image_ids'])) ? count(explode(" ", trim($row['lightbox_image_ids']))) : 0).")</a>\n";
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on January 03, 2006, 11:44:27 PM
may be it is not a problem of this MOD... may be it is a general problem.

When a searchresult is shown (e.g. I was looking for pictures with keyword "tree"), and I click on the button "My Album" (under the thumbnail) the searchform is displayed with the message "picture added to lightbox".
Instead of the searchform, the searchresult should still be displayed.

Thanks for helping me!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on February 19, 2006, 03:52:43 PM
I show 6 pictures on a page. I put 7 pictures in a public album. When a guest click on the album, and goes to the second page, the pictures on the second page aren't shown.

When I click on an album, the adress looks like that:
http://www.example.ch/lightbox.php?lightbox_id=c68751b2382136a0912e5dc89045612b

When I click for the next page, the adress looks like that:
http://www.example.ch/lightbox.php?page=2

Thanks for helping me.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 19, 2006, 06:17:20 PM
I show 6 pictures on a page. I put 7 pictures in a public album. When a guest click on the album, and goes to the second page, the pictures on the second page aren't shown.

When I click on an album, the adress looks like that:
http://www.example.ch/lightbox.php?lightbox_id=c68751b2382136a0912e5dc89045612b

When I click for the next page, the adress looks like that:
http://www.example.ch/lightbox.php?page=2
Added Step 2.6

As of your previous question - I don't understand..
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on February 19, 2006, 06:29:35 PM
Hi V@no

Regarding my first question...

I enter in the search field e.g. "tree". Several pictures containing this Kkyword are shown as a resultset. Now I'd like to put two of this image in my album.
As soon as I click on the "Album Button" below the first of the two thumbnails, the page "extended search" is shown.
Now I have to enter the keyword "tree" again for putting the second picture into my album. It would be easier, when after clicking on the "Album Button" the resultset with the pictures, containign the keyword "tree", would be displayed (not the search.php - page).

TIMT

Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 19, 2006, 07:10:59 PM
Ok, I found a bug in a bug fix...:?
I've added step 3:
http://www.4homepages.de/forum/index.php?topic=10921.msg55617#msg55617
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on February 19, 2006, 09:16:33 PM
Thank you V@no! Now it works perfect!  :D
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Lucifix on March 25, 2006, 03:18:41 PM
V@no do you think it's possible to add to your albums only your own photos?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: boywonder on April 13, 2006, 05:24:49 PM
Hi guys,

 :?: I started to do a test modification on version 1.7.2 and step 2.3 does not seem to fit anywhere as its not found in the code in lightbox.php.
Has anyone had this problem?



Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: boywonder on April 26, 2006, 03:30:42 AM
Hi all,

Can anyone help me with my problem that I posted 2 weeks ago?

Thanks all.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: bigwave on June 19, 2006, 11:35:09 PM
I have version 1.72 installed and was able to do all the tasks (I hope)  except installing the complete mod http://www.4homepages.de/forum/index.php?topic=7112.0 as suggested in step 13 but I did add the code for step 3 as instructed. Unfortunately things aren’t working, for instance, on the members profile the code:
{if user_lightbox}
             <tr>
               <td class="row1"><b>{lang_user_lightbox}</b></td>
               <td class="row1">{user_lightbox}</td>
             </tr>
{endif user_lightbox}

displays this in the source of the page

<tr>
               <td class="row1"><b></b></td>
               <td class="row1"></td>
             </tr>
            
and on the light box page this code

{if url_lightbox_manage}
<a href="{url_lightbox_manage}"><b>{lang_lightbox_manage}</b></a>
{endif url_lightbox_manage}
only displays this:
<a href=""><b></b></a>

It was quite a haul and it would have been easy for me to make mistakes but even with so much tinkering there are no error messages popping up and in admin the 2 lines that refer to the number of light boxes and if multi lightboxs are allowed are there.

I bet I’ve done something dumb or missed something important.  I’ve already added the sitemap mod and am very happy with this whole environment and I realize people like me must frustrate the heck out the programmers who are so creative.  Thanks for the hard work!

Brian :D
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on June 20, 2006, 01:42:11 AM
About member profile, I guess you either missed Step 4 or added new code in the wrong place.
About lightbox page try this.
In lightbox.php find:
Code: [Select]
unset($private_new, $name_new);
Insert below:
Code: [Select]
$lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
$site_template->register_vars(array(
  "lang_lightbox_manage" => $lang['lightbox_manage'],
  "url_lightbox_manage" => ($user_info['user_level'] >= USER && !$lightbox_id) ? $site_sess->url(ROOT_PATH."lightbox.php?action=manage") : "",
));
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: bigwave on June 20, 2006, 02:56:22 AM
Hello Mr. V@no,

Yes, yes, yes!! That was it! :mrgreen:

Thank you for the super fast response!

Now, after a little formatting, I'm ready for prime time.

As they say in the islands, "Mahalo Plenty!"

Aloha,

Brian


Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on July 30, 2006, 12:04:28 AM
hab das jetzt 3x versucht einzubauen, und 3x wieder rausgewurfen, bekomme das einfach nicht hin  :cry:
Im Profil werden bei Usern die Bilder hochgeladen haben, jede Menge nullen angezeigt, die man anklicken kann (zur Lightboxe)
dann gibt es foreach Fehler.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: bigwave on August 06, 2006, 11:44:14 PM
Hello,

Hit a little error here when I try to add or delete lightboxs from the lightbox manage page:
Fatal error: Call to undefined function: get_msg() in /home/iplaceg1/public_html/maui-tropica/maui-tropica-gallery/lightbox.php on line 185

Thanks

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: bigwave on August 06, 2006, 11:51:49 PM
Sorry I forgot to include this in the previous post

This is line 185 that the error in my lightbox.php  refers to:
$msg = (empty($msg)) ? "" : get_msg($msg);

Thanks again!

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on August 07, 2006, 01:31:08 AM
Missed step 6.4
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: bigwave on August 07, 2006, 01:57:40 AM
Hello Mr.V@ao,

Yes sir, that was it!

Back in business--thank you very much!

Aloha,

Brian

Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: ccsakuweb on August 14, 2006, 05:52:19 PM
hi V@no! I have 1.7.3 version.. and I don´t find this line in sessions.php :
Code: [Select]
  $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
only i found the next code with "user_lastvisit" in the lines 300-314:

Code: [Select]
  if ( $user_id != GUEST )
  {
  $last_visit = ( $this->user_info['user_session_time'] > 0 ) ? $this->user_info['user_session_time'] : $this->current_time;

  $sql = "UPDATE " . USERS_TABLE . "
  SET user_session_time = $this->current_time, user_session_page = $page_id, user_lastvisit = $last_visit
  WHERE user_id = $user_id";
  $site_db->query($sql);

  $this->user_info['user_lastvisit'] = $last_visit;

  $sessiondata['autologinid'] = ( $enable_autologin && $this->mode == "cookie" ) ? $auto_login_key : '';
  $sessiondata['userid'] = $user_id;
  }

and this function in 40-59 lines
Code: [Select]
$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "username",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_viewemail",
  "user_allowemails" => "",
  "user_invisible" => "user_allow_viewonline",
  "user_joindate" => "user_regdate",
  "user_activationkey" => "user_actkey",
  "user_lastaction" => "user_session_time",
  "user_location" => "user_session_page",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "",
  "user_homepage" => "user_website",
  "user_icq" => "user_icq"
);

please... could you help me? your mod looks nice  ^^
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: SAD on September 20, 2006, 07:20:19 PM
hi V@no!
Please send file
http://gallery.vano.org/file70dl
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on September 21, 2006, 12:38:16 AM
file attached to the first topic now.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: SAD on September 21, 2006, 06:19:48 AM
Thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: SAD on September 21, 2006, 08:57:48 PM
N@no,

Whence data undertake for 
Code: [Select]
$config['lightbox']
in Step 4:
Code: [Select]
if ((($user_row['user_lightbox_private'] || $user_row['user_level'] == ADMIN) && $config['lightbox_share'] && $user_info['user_level'] >= $config['lightbox']) || $user_info['user_level'] == ADMIN)
in my tables "4images_settings" not setting_name "lightbox" :)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on September 22, 2006, 12:48:15 AM
hmmm...not quiet sure why its there...I've fixed that line in the instrucitons.
Thanks.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: ccsakuweb on September 23, 2006, 06:44:59 PM
hi V@no! I have 1.7.3 version.. and I don´t find this line in sessions.php :
Code: [Select]
  $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
only i found the next code with "user_lastvisit" in the lines 300-314:

Code: [Select]
  if ( $user_id != GUEST )
  {
  $last_visit = ( $this->user_info['user_session_time'] > 0 ) ? $this->user_info['user_session_time'] : $this->current_time;

  $sql = "UPDATE " . USERS_TABLE . "
  SET user_session_time = $this->current_time, user_session_page = $page_id, user_lastvisit = $last_visit
  WHERE user_id = $user_id";
  $site_db->query($sql);

  $this->user_info['user_lastvisit'] = $last_visit;

  $sessiondata['autologinid'] = ( $enable_autologin && $this->mode == "cookie" ) ? $auto_login_key : '';
  $sessiondata['userid'] = $user_id;
  }

and this function in 40-59 lines
Code: [Select]
$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "username",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_viewemail",
  "user_allowemails" => "",
  "user_invisible" => "user_allow_viewonline",
  "user_joindate" => "user_regdate",
  "user_activationkey" => "user_actkey",
  "user_lastaction" => "user_session_time",
  "user_location" => "user_session_page",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "",
  "user_homepage" => "user_website",
  "user_icq" => "user_icq"
);

please... could you help me? your mod looks nice  ^^

V@no... do you know how to help me please? where is the line? please... i need to know it.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: pda on September 25, 2006, 08:57:01 AM
I just realized that there is a big problem caused by this mod.
What is happening when some adds a picture and an admin or someone else deletes it? It is still in the lightbox. But it is not shown, well. That’s OK. But there is still the image_id in the database entry.  In my opinion a very bad solution just to ignore the missing data.
So, I’m asking you (especially vano). Would it be possible to the delete the missing data out of the database?
You could integrate it to the delete function in the admin and user panel, or a daily cleanup? I don’t know.  :?:

Anyway thanks for your great work
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: SAD on October 09, 2006, 02:10:45 PM
V@no
Описываю ситуацию (моделировал на 2-х пользователях имеющих по 2 альбома):
2 пользователя: User1 и User2
у каждого есть по 2 (public) Альбома (Избранное) с внесенными фото:
User1_albom1, User1_albom2
User2_albom1, User2_albom2

Заходим в галерею как User1, в списке Альбомов выбран User1_albom1, по ссылке в профиле User2 заходим в User2_albom2, жмем на ссылку "Очистить альбом" и очищаем свой User1_albom1.
В связи с этим есть необходимость при просмотре чужого Альбома не выводить ссылку "Очистить альбом", что бы случайно не потереть свой :).
И возможно в ссылке "Очистить альбом" следует приписывать Имя очищаемого Альбома.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on October 16, 2006, 11:37:06 AM
file attached to the first topic now.

hi V@no,

please send me the file please http://gallery.vano.org/file70dl

Greez Darkness


Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on October 16, 2006, 12:59:03 PM
@darkness

see on page one (after code)
download the file

greets ivan

Hi ivan,

thanks.. i scroll the page to fast   :mrgreen:

Greez Darkness
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: IWS_steffen on October 17, 2006, 06:19:40 AM
Hi V@no


Danke für den tollen MOD. Genial!!!


Steffen
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: gustav on October 21, 2006, 03:14:25 PM
I know I have once seen a fix somewhere here to make the multi-lightbox recognize all css settings correctly.... and I did the changes listed in there (can't find the post anymore, else I would post in there).... anyway, I still can't get the dropdown button itself to respond to css changes..... the lightbox button always has the look of the other dropdowns.... I can change the font, color etc of the dropdownfield.. but the css class ligboxibutton for the dropdownbutton itself still gets ignored.... my lightbox_dropdown.html looks like this
Code: [Select]
<div>
<form method="post" action="{self}" name="lightbox" style="margin: 0px 0px 0px 0px;">
&nbsp;<img border="0" src="{template_url}/images/active_favourites.jpg" align="absmiddle">{user_lightbox_dropdown}<noscript>&nbsp;<input type="submit" value="{lang_lightbox_select}" class="lightboxibutton"></noscript>
<input name="mode" value="{mode}" type="hidden">
</form>
</div>

The css entry looks like this:
Code: [Select]
.lightboxibutton {
font-family: Tahoma,Verdana,Arial, Helvetica, sans-serif;
background-color: Black;
color: #fcdc43;
font-weight: bold;
font-style: normal;
font: 10px;
}

So completely different from the standart dropdowns..... but still, it looks like them all.....
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Darkness2001 on October 23, 2006, 10:46:08 PM
Hallo,

thanks... greate MOD  :lol:

Grüße Darkness  :mrgreen:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on January 01, 2007, 04:23:06 PM
Hi,

I have the following two Mods integrated:
Multi-Lightboxes v1.03
Lightbox for GUESTs v1.2

On my homepage I define some Lightboxes and show these Lightboxes with a link like that:
Code: [Select]
<a class="menu" href="http://www.photofront.ch/lightbox.php?lightbox_id=6c92dcb37bc7e3c6c77f868b2a8b73ca">Lightbox1</a>
Now I have two questions:
1. Is it possible to show the ligtboxname as a link? Now I have the name of the lightbox fix in the code (e.g. Lightbox 1, see above)

2. I dont want to show the link "Delete Pictures". It is possible to click on this link, but the pictures are not deleted (and that is good so). Is it possible to show the link in the lightbox for guests, but not in the lightbox, defined by me and shown with a link like above?

Thank you for  helping me.

TIMT
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: bigwave on January 07, 2007, 03:03:35 AM
Hi,

I’d like to be able to share the url of one of my lightboxs from a blog but can’t seem to be able to make my multilightbox install for 1.73 cooperate.  This might be the problem the post before me is having.  Is it possible to extract an url for this?  I’ve tried all sorts of combinations but I think only the creator of the lightbox is able to see it.  Actually, my shared lightboxs don’t seem to be showing up in my user profiles so I might be looking at an error in my original install.  I checked and my step 4 looks like it went ok—any hints on looking for other screwups?

Thanks,

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: chull on January 11, 2007, 06:24:18 PM
Hello,

I get this error message:


Fatal error: Call to undefined function: fixhtml() in /home/admn1741/public_html/test/includes/sessions.php on line 362

Thanks and Greetz


Chull
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Parasco on February 17, 2007, 05:00:16 PM
Dead link :(
http://gallery.vano.org/file70dl

Was really looking forward to using the [MOD] too; can someone please post a working link  :roll:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Acidgod on February 17, 2007, 05:46:48 PM
Take a look and the End of the first Post... *ggg*

Good speed! (o:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Parasco on February 17, 2007, 07:45:44 PM
Oups! lol and I did check the whole thread but I guess I didnt check enough, :oops:  thanks Acid
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Acidgod on February 17, 2007, 07:48:03 PM
Take a look at V@nos Signature:
Quote
My site is down. Files for MODs will be attached to the posts uppon requests.
So, please reply to the MODs topic if you need a file. But before you do that, check if file already attached.

For the future when you searching a File for V@nos Mods... (o:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: madmax on April 18, 2007, 12:04:07 AM
Does this Mod work with v1.7.4
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Iba on April 27, 2007, 02:41:36 PM
The download link doesn't work !
Is there any alternitive link, or somebody whos able to send me a link to the file?

thx in advice, Iba
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: CeJay on April 27, 2007, 09:44:57 PM
The download link doesn't work !

Yes it does.  8O
 As stated 2 above your post:
Quote
My site is down. Files for MODs will be attached to the posts uppon requests.
So, please reply to the MODs topic if you need a file. But before you do that, check if file already attached.

So look at the very bottom of the first post by the signature. That is where you can download since it is an attached file.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Iba on April 29, 2007, 11:16:20 PM
thx   :roll:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Iba on May 04, 2007, 10:04:05 AM
How can I share a lightbox with an other user? This feature doesn't want to work ...  :?:

 :?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: SoftDux on May 05, 2007, 04:14:04 PM
Excuse my "dumb" question, but what are the advantages of having a lighbox on a public gallery site?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: The Sailor on June 03, 2007, 03:46:56 PM
from where can i daownload this mod?????

any one tried it with 1.7.4 or not?

Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: KurtW on June 03, 2007, 04:37:01 PM
Hi,

it works with 1.7.4  :wink:
And the download/attachement link can you find at the bottom from the first post in this thread.
Quote
multilightboxes v1.03.zip (3.31 KB - downloaded 137 times.)


cu
KUrt
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: KurtW on June 03, 2007, 04:43:44 PM
Hi,

another problem  :?:

I need for my Mod: flash-mp3-player   a different code...

Version 1.7.4
Mod installed: [MOD] Multi-Lightboxes v1.03

Is it possible to generate by the registration 2 lightboxes for every new member automaticly :?:
- Lightbox with name: Images
- Lightbox with name: MP3

Thanks for a reaply


cu
Kurt
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Iba on October 02, 2007, 04:49:28 PM
Can anybody send me a link to his 4images-board where the MOD is installed?

thx, Iba
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 01, 2007, 09:13:12 PM
Hi,

Ich habe den MOD Multi-Lightboxes v1.03 http://www.4homepages.de/forum/index.php?topic=10625.0 installiert.
Nun möchte ich als Überschrift den Lightbox Name anzeigen. Im Userprofil werden z.B. die öffentlichen Lightboxes mit Name angezeigt.

Vielen Dank!

Gruss TIMT

_________________________________________

Hi,

I have installed MOD Multi-Lightboxes v1.03 http://www.4homepages.de/forum/index.php?topic=10625.0.
When I click on a lightbox, the title "Lightbox" is shown. Instead of "Lightbox" I'd like to show the name of the lightbox, defined in the lightbox settings.

Thanks for helping me.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 01, 2007, 09:36:48 PM
Quote
I'd like to show the name of the lightbox, defined in the lightbox settings.

Name of lightbox ... I no get ... is for lightbox image name or lightbox user name or lightbox name from LIGHTBOXES_TABLE for lightbox you want ? ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 09:49:56 AM
In the lightbox settings there are flags availale like "private", "clear", "deleate" and you can define the name of the ligtbox.
Exampel: I have to Lightboxes "Cars" and "Trees"
In the user profile are the links (name of teh lightbox) to the differet lightboxes shown (unless the lightbox ist not as a private lightbox defined).
Exampel: To links, one "Cars" and one "Trees" are shown.
When I click on one of this link (example: I click on "Cars"), pictures of this lightbox are shown. The title of the page ist for each lightbox the same: LIGHTBOX
LIGHTBOX is defined in the language table.
I'd like to show the name of the lightbox, defined in the lightbox settings.
Exampel:
"Cars" or Lightbox: "Cars"

If you have any questions, let me know - Thanks for helping me.



In den Lightbox Settings kann ich verschiedene Lightboxes verwalten. Jeder Lightbox kann ich einen Namen vergeben.
Diese Namen werden im User Profile angezeigt (sofern in den Settings nicht als Privat gekennzeichnet).
Mit einem Klick auf solche einen Lightbox-Link im Profil, gelange ich zu den Bildern, welche in dieser Lightbox abgelegt sind.
Als Titel dieser Seite wird immer der Text "Lightbox" angezeigt, egal in welcher Lightbox ich gewählt habe.
Der Text ist fix in der Sprachdatei "main.php" erfasst.

Ich möchte nun, dass statt fix Lightbox der Name der Lightbox angezeigt wird. Oder eventuell mit dem Text aus der Sparchdatei und zusätzlich der Name der Lightbox.
Beispiel:
Lightbox: Autos

Wenn noch offene Fragen sind, lass es mich bitte wissen. Vielen Dank!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 01:29:43 PM
Ok so ... this is big MOD ... which file and action you like for edit for LIGHTBOX name ?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 01:46:12 PM
I'm not sure what do you mean...

I think  modifications has to be done in lightbox.php and lightbox.html
Code: [Select]
$lang['lightbox'] = "lightbox"; would not be needed any more.

But I have no idea, was changes have to be done.

Here you will find an example:
http://www.photofront.ch/member.php?action=showprofile&user_id=5 (http://www.photofront.ch/member.php?action=showprofile&user_id=5)

> Empfehlung
> San Francisco
are two lightboxes.

klick on "San Francisco"
Now one image is displayed.
And in the titel (orange bar) you see the word "Album". That is the text defines in main.php for $lang['lightbox'] = "Album";

TIMIT
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 01:57:31 PM
Quote
And in the titel (orange bar) you see the word "Album". That is the text defines in main.php for $lang['lightbox'] = "Album";

Ahh ! so you want "Album" change for lightbox name ?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 02:11:12 PM
Yes - thats it!   :wink:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 02:33:14 PM
You use custom template ... which HTML file use tag for show album ?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 03:14:09 PM
it ist lightbox.html
Code: [Select]
&nbsp;&nbsp;<font color="#353535">{lang_lightbox}   
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 03:35:49 PM
[edit]

In lightbox.php file,

find:

Code: [Select]
$lightbox_name = stripslashes($row['lightbox_name'])." (".$row['user_name'].")";

(and please replace for):

Code: [Select]
$lightbox_name = (isset($row['lightbox_name']) && !empty($row['lightbox_name']) && isset($row[$user_table_fields['user_name']]) && !empty($row[$user_table_fields['user_name']])) ? format_text(trim($row['lightbox_name']), 2) . " (" . format_text(trim($row[$user_table_fields['user_name']]), 2) . ") " : "";

add after:

Code: [Select]
if (isset($lightbox_name) && !empty($lightbox_name)) {
$lightbox_name_for_all = $lightbox_name;
}

after - find:

Code: [Select]
"lang_lightbox" => $lang['lightbox'],

replace:

Code: [Select]
"lang_lightbox" => (isset($lightbox_name_for_all) && !empty($lightbox_name_for_all)) ? preg_replace("/" . $site_template->start . "lightbox_name" . $site_template->end . "/siU", $lightbox_name_for_all, $lang['lightbox']) : $lang['lightbox'],

In lang/main.php file,

Code: [Select]
$lang['lightbox'] = "Album";

for:

Code: [Select]
$lang['lightbox'] = "Album of: {lightbox_name}";

Is work ?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 03:50:48 PM
no - have a look:
http://www.photofront.ch/lightbox.php?action=show&lightbox_id=545b22454ac16273c246a260117cc396 (http://www.photofront.ch/lightbox.php?action=show&lightbox_id=545b22454ac16273c246a260117cc396)

but I dont want to show the user name who has created the lightbox, I want to show the name of the ligthbox - san francisco in this case.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 03:54:37 PM
Ah ! now is clear. :)
I edit post. ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 03:57:49 PM
I edit again. Is ok. ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 04:08:51 PM
I get now following error message:
Parse error: syntax error, unexpected ')', expecting ']' in /home/httpd/vhosts/photofront.ch/httpdocs/lightbox.php on line 279

but bevor your last update it works - than I did the changes again and I get now the error message above.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 04:10:59 PM
This is right. I find error. Try again. ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 04:17:19 PM
same problem: Parse error: syntax error, unexpected ';' in /home/httpd/vhosts/photofront.ch/httpdocs/lightbox.php on line 279
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 04:21:38 PM
Is today my day ?  :|
Try now ...
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 04:26:58 PM
YES - IT WORKS  :D

Last question: what do I have to do if I dont want to show the user in brackets?
instead of
Album: San Franciso (Serge Meier)
new
Album: San Francisco

Thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: thunderstrike on December 02, 2007, 04:29:11 PM
Find:

Code: [Select]
$lightbox_name = (isset($row['lightbox_name']) && !empty($row['lightbox_name']) && isset($row[$user_table_fields['user_name']]) && !empty($row[$user_table_fields['user_name']])) ? format_text(trim($row['lightbox_name']), 2) . " (" . format_text(trim($row[$user_table_fields['user_name']]), 2) . ") " : "";

replace:

Code: [Select]
$lightbox_name = (isset($row['lightbox_name']) && !empty($row['lightbox_name']) && isset($row[$user_table_fields['user_name']]) && !empty($row[$user_table_fields['user_name']])) ? format_text(trim($row['lightbox_name']), 2) : "";

Problem is affect all <<lightbox >> ( word ) ... (word) is remove for all multiboxes ... is ok or is just for this remove ?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on December 02, 2007, 04:36:20 PM
thats ok for me.
another possibility would be:
Ablum: San Francisco erstellt von Serge Meier
means:
Lightbox: San Francisco created by Serge Meier

Thank you very mucht for your support!  :D
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on January 20, 2008, 11:30:07 PM
Hi,

when I click on a lightbox (link is shown in user profile), all images of this lightbox are shown.
Also shown is the link "Delete Lightbox".
This link should only be shown, if I'm the owner of the Lightbox.
Now everybody can click on the link "Delete Lightbox" and the message, that the lightbox is delete, is displayed.
Of corse the lightbox is not deleted, because I'm not the owner, the creater, of the lightbox.
So, this link should not be displayed. How can I get rid of it?

I also have installed the following MOD:
Lightbox for GUESTs v1.2: http://www.4homepages.de/forum/index.php?topic=4826.0
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on March 23, 2008, 08:33:48 PM
Hi, does anybody have a hint for me? How get I rid of the "Delete Link"?

Thanks for helping me!!!
TIMIT
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on April 05, 2008, 08:57:32 AM
Hi,

I have upload an example (please see below).
Here you can see the Link "Bilder löschen" (Delete pictures).
As a guest, I click in the users profile on the link to one of his lightboxes and get the page with his pictures in his lightbox and with this link for deleting pictures.

I can click on the delete link, I'm asked if I realy want to delelte, I say yes and I get the message, that the pictures were deleted. Of course they are not, what is good so.
The only thing is, how get I rid of of the delete link for guests?

Thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: KurtW on April 05, 2008, 06:03:52 PM
Hi TIMT,

i don't now your 4images version, but test/ use this in lightbox.html:

Code: [Select]
{if user_loggedin}Delete Link{endif user_loggedin}



KurtW
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on April 06, 2008, 02:20:46 AM
Hi Kurt

I still run the version 1.7.2

I will check your idea.
But the link shouldn't be displayed at all - or lets say only for the owner of the lightbox.
With your proposal, the links will be displayed for all logged in users, wont't it?

TIMT
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: TIMT on April 06, 2008, 05:39:31 PM
Hi Kurt

I have implemented the following code:

Code: [Select]
<table  width="100%" border="0" cellspacing="0" cellpadding="0"  class="tablebottom">
                    <tr>
                      <td  height="20" width="55%">
                       &nbsp;&nbsp;<font color="#353535">{lang_lightbox}
                      </td>
                      <td height="20" width="500" align="right" >
       {if url_lightbox_manage}
                        &nbsp;&nbsp;<img border="0" src="./picture_library/pfeil.gif">&nbsp;<a  href="{url_lightbox_manage}"><font color="#353535">{lang_lightbox_manage}</a>
                       {endif url_lightbox_manage}
      </td>
                      <td height="20" width="550" align="right" valign="center">
                       {if url_lightbox_manage}
       <font color="#353535">Meine Alben:
                       {endif url_lightbox_manage}
      </td> 
                      <td height="20" width="300"align="left" valign="center">
                       {if url_lightbox_manage}
       <font color="#353535">{user_lightbox_form}{endif user_lightbox_form}
                       {endif url_lightbox_manage}
      </td> 
       {if user_loggedout}
      <td width="500" height="20" align="right"  valign="center"></td>
                      {endif user_loggedout}             

                   </tr>
                  </table>

For guest neather the link for managing the lightboxes not the link for deleting lightboxes is displayed - that's fine (see print screen lightbox1).
A logged in user can not see the two links, if not one of its lightboxes are shown - that's fine (see print screen lightbox1).
If a logged in user click on the numbers of pictures in "managing lightboxes" the lightboxe is shown and the two links are shown - that's also fine (see print screen lightbox2 and lightbox3)..
But if a logged in user click on an lightbox in his own profil, the two links are not displayed, even the same lightbox is shown as mentioned above - that's not OK (see print screen lightbox4 and lightbox5) .

Do you have any idea?

 :thumbup: 13.04.08: I found a solutions - it is no longer an open issue.

Thanks
TIMT
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: NetRebel on April 13, 2008, 02:57:17 AM
Holy sh*t, that was a lot of code editing! 8O Thank God for two displays and the invention of cut-n-paste! :D

Thanks a lot for this great great mod! I just can't believe everything is working without any errors in one time. No debugging, no fuzzy errormessages, it all works right 'out of the box'. Great work, thanks again!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on May 27, 2008, 11:22:18 PM
Hi,
Ist es möglich, zu den Bildern in der Multi-Lightbox einen Text zu schreiben (wie unter description), der aber auch nur dort angezeigt werden soll
Ausserdem soll dieser Text auch nur für die Bilder von dem User angezeigt werden, der diese in der Multi-Lightbox hat.

Also, ich hole mir ein Bild in die Multi-Lightbox, füge meinen persönlichen Text hinzu.
Ein anderer User kann diesen Text dann auch nur unter meinen Bildern lesen (Öffendliche Lightbox)

in der normalen Galerie, soll dieser Text nicht zu sehen sein

Bitte nicht schlagen, bräuchte das wirklich für unseren Katalog  :wink:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mawenzi on May 27, 2008, 11:39:32 PM
@Harald,

... habe mal kurz in eine vers.1.8 geschaut, denn dort läuft auch die Multi-Lightbox ...
... soll die Beschreibung in "Lightbox Settings" editiert werden ... ? ... das geht aber nur für die gesamte Lightbox ...
... ich wüsste nicht, wo dieser Text ... für das Bild ... editiert werden sollte ... und wo das DB-Feld herkommen sollte ...
... denn theoretisch könnten es ja soviel DB-Felder werden, wie du User hast ... pro Bild und User ein Feld ...
... es noch mehr Infos nötig ... ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on May 28, 2008, 12:38:56 AM
Hallo Detlev,

Du kannst in eine 1.8.0 schauen  :wink:

Quote
... soll die Beschreibung in "Lightbox Settings" editiert werden ... ? ... das geht aber nur für die gesamte Lightbox ...
Nein,denn wie Du sagst wäre das für alle, aber jeder User sollte schon seinen eigenen Text bearbeiten können

Quote
... ich wüsste nicht, wo dieser Text ... für das Bild ... editiert werden sollte ... und wo das DB-Feld herkommen sollte ...
Wenn ich es könnte, würde ich das Feld in der Lightbox unter dem Bild erscheinen lassen, so das man den Text unter dem Bild eingeben könnte.

Quote
... denn theoretisch könnten es ja soviel DB-Felder werden, wie du User hast ... pro Bild und User ein Feld ...
Ich wusste das Du das sagen würdest  :wink: Heisst soviel, das die Datenbank abfragen wohl zu hoch werden könnten  :oops:

Quote
... es noch mehr Infos nötig ...

Also, wir wollen die Multi-Lightboxes als Tauschseiten haben
z.B. erstelle ich mir ein Bild Archiv "suche HPF" in diesem Bild Archiv füge ich mir dann die Bilder ein die ich noch in meiner Sammlung benötige.
Zu dem gesuchten Bild, würde ich dann nähere Angaben machen, damit mein Tauschpartner mehr Infos dazu bekommt.

Nur das wären ja spezielle Infos zu meinem Bild was ich suche, darum sollten diese auch nur zu diesem Bild angezeigt werden (in meinem "suche HPF" Bild Archiv.)

Ein anderer User (Sammler) würde bei dem gleichen Bild bestimmt was anderes schreiben wollen

Die Sammler würden dann den Link zu ihrem Bild Archiv in diversen Foren setzen, und andere würden dann genau wissen was er sucht
http://ue-ei-portal-sammlerkatalog.de/katupdate/lightbox.php?lightbox_id=401f14f906de7c84cfb3b8cc5aecb5bc

Edit:
wäre vielleicht zu lösen, wie deine "Neue Bilder - Marquee" denn da hast Du ja auch eine seperate thumbnail_bit.html , wo man dann nur das aktiviert was benötigt wird




Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mawenzi on May 28, 2008, 01:00:52 AM
Du kannst in eine 1.8.0 schauen  :wink:

... ja ...
...
... kann man denn nicht die Kommentarfunktion zum Bild nutzen und mit Hilfe der User_ID nur die gewünschten Kommentare in der Lightbox (ggf. sonst nirgends) anzeigen lassen ...
... so wäre zum Editieren alles geklärt, ggf. müsste man nur ein Feld zu Kommentar einfügen ... z.B. "Lightbox-Kommentar" ...
... und anhand dieser Checkbox und der User_Id kann man dann den Komentar für die Lightbox rausfiltern und in einer speziellen thumbnail_bit.html anzeigen lassen ...
... aber das Text-Editieren in einer thumbnail_bit.html wird problematisch ...
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on May 28, 2008, 05:03:44 PM
Quote
... kann man denn nicht die Kommentarfunktion zum Bild nutzen und mit Hilfe der User_ID nur die gewünschten Kommentare in der Lightbox (ggf. sonst nirgends) anzeigen lassen ...

Klar, wie der Eintrag zum Bild gelangt ist ja eigendlich egal, und man könnte den Text auch noch mit BB Code bearbeiten

Quote
... aber das Text-Editieren in einer thumbnail_bit.html wird problematisch ...

Auch bei dieser Variante  :?:


Harad
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mawenzi on May 28, 2008, 09:24:20 PM
... na dann werde ich mal einen Schlachtplan entwickeln, der dann umzusetzen wäre ...
... und bitte auf die Zehen treten ... ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on May 28, 2008, 10:05:00 PM
... und bitte auf die Zehen treten ... ;)

kennst mich doch  :mrgreen:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sunny C. on June 13, 2008, 05:21:49 PM
Super mod, läuft super unter 1.7.6.
Habs in meiner Liste (Show at Signatur) aufgenommen.

@ mawenzi, wurde die Mod in der neuen 4images version getestet oder wie? Was ist gemein mit 1.8.0 gemeint? Habe mir nicht alle Post hier durchgelesen!

Und, hat vieleicht jemand eine Übersetzung von der Lightbox? Also in Deutsch? main.php ?

Gruß
Phisker
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on June 16, 2008, 12:23:58 PM
... na dann werde ich mal einen Schlachtplan entwickeln, der dann umzusetzen wäre ...
... und bitte auf die Zehen treten ... ;)

Hi Detlev,
Keine Ahnung wie dein Schlachtplan aussieht, aber mir viel da gerade etwas dazu ein  :o
Wie ist es wenn man einen Link einbaut "Text eingeben" das sich dann ein popup öffnet, wo man einen Text eingiebt.
Text eingeben, speichern und vielleicht Seite aktualisieren, das der Text unter dem Bild angezeigt wird.
Nur wie man diesen Text dann genau diesem Bild/User zuordnet  :?:
Aber wäre doch bestimmt einfacher zu lösen als
Quote
... aber das Text-Editieren in einer thumbnail_bit.html wird problematisch ...

LG Harald
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: m.a on July 15, 2008, 05:55:18 PM

Und, hat vieleicht jemand eine Übersetzung von der Lightbox? Also in Deutsch? main.php ?


hi,

dies ist die Übersetzung in Deutsch:
Code: [Select]
//-----------------------------------------------------
//--- Lightbox ----------------------------------------
//-----------------------------------------------------
$lang['lightbox_no_images'] = "Sie haben keine Bilder auf Ihrem Leuchtkasten.";
$lang['lightbox_add_success'] = "Bild erfolgreich hinzugefügt.";
$lang['lightbox_add_error'] = "Fehler beim Hinzufügen!";
$lang['lightbox_remove_success'] = "Bild erfolgreich vom Leuchtkasten entfernt.";
$lang['lightbox_remove_error'] = "Fehler beim Löschen!";
$lang['lightbox_register'] = "Um den Leuchtkasten nutzen zu können, müssen sie registrierter Benutzer sein.<br />&raquo; <a href=\"{url_register}\">Jetzt registrieren</a>";
$lang['lightbox_delete_success'] = "Leuchtkasten erfolgreich gelöscht.";
$lang['lightbox_delete_error'] = "Fehler beim Löschen des Leuchtkastens!";
$lang['delete_lightbox'] = "Leuchtkasten l&ouml;schen";
$lang['lighbox_lastaction'] = "Leuchtkasten zuletzt aktualisiert:";
$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchtkasten wirklich löschen?";


 //--- Show user's lightbox ---------------------------
//-----------------------------------------------------
 $lang['show_user_lightbox'] = "persönliches Leuchtkasten ";

Grüß
m.a
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sunny C. on July 15, 2008, 06:03:00 PM
Hehe,

danke!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on July 16, 2008, 10:29:52 PM
Kann man in der Lightboxes evtl. eine eigene Sortierung erreichen ?
im Moment ist diese ja nach Bild Name sortiert , für unsere Galerie wäre es besser diese nach Kategorien zu sortieren.
finde im Code gerade keine Stelle dazu

Harald
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: KurtW on July 17, 2008, 06:14:31 AM
hallo Jan-Lukas,

ich sehe auch keine Sortierung in dem aktuellen code auf der ersten page:
Code: [Select]
if ($action == "show")
{
  $lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
  $ids = "";
  if ($lightbox_id)
  {
    $sql = "SELECT l.lightbox_id, l.lightbox_name, l.lightbox_private, l.lightbox_image_ids, l.user_id, u.user_name, u.user_lightbox_private
            FROM ".LIGHTBOXES_TABLE." l
            LEFT JOIN ".USERS_TABLE." u ON u.user_id = l.user_id
            WHERE l.lightbox_id = '".$lightbox_id."'";


Kurt
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: NetRebel 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?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: NetRebel 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. :-(
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no 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);
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: NetRebel 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!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no 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 :))
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: NetRebel 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 (http://umdvideo.info/credits.php)" page. ;-) Keep up the good work and this great support!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas 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
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mawenzi 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 ... ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on February 05, 2009, 07:50:43 AM
Hi Detlev,
Super, werde heute Abend auch mal suchen, muss aber jetzt erst Arbeiten

LG. Harald
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas 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
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mawenzi 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 ...
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: keesjansma 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 
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: keesjansma 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
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun 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?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun 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?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@nо on March 30, 2009, 08:34:20 PM
2) make sure you did step 6.4
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on March 30, 2009, 10:12:34 PM
Thank you, V@nо! :)
I skiped step 6.4.   :oops:

1. - i found error by myself


Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on March 31, 2009, 02:19:57 PM
$lang['delete_lightbox'] = "Clear <i>{name}</i> lightbox";

In the Lightbox i see "Clear lightbox" whithout any name. How can I fix it?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: netx_dev on March 31, 2009, 04:35:07 PM
This mod looks promising but where are the files?

It says: Download attached package

There is no attachement.  :?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mawenzi on March 31, 2009, 05:02:56 PM
... please clean your eyes ... ;)
... and see the attached zip-file at the bottom of the first post ....
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: netx_dev on March 31, 2009, 05:06:22 PM
I opened my eyes 8O and found it.

Thanks for the fast support... :D
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on April 02, 2009, 02:03:34 PM
<a href="{url_lightbox_manage}"><b>{lang_lightbox_manage}</b></a>        - it's work in the lightbox.html, but it didn't work in the user_logininfo.html. How can i use it in the user_logininfo.html?

PS ... and please, help me with prev. question 
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on April 07, 2009, 08:50:52 PM
I use mod mini top. When I press button Lightbox it's not refresh, but the changes are saves. When I press button Lightbox in the New-block it's refresh. How can I fix it?


I found this error(may be it's can help samebody):
1. lightbox.php. It's not working(there is no any class):

    $list .= "<tr".(isset($status[$val['id']]['error']) ? (($status[$val['id']]['error']) ? " class=\"mlightbox0\"" : "

class=\"mlightbox1\"") : "")." align=\"center\">\n";

I don't know how fix it and i replace:
$list .= "<tr"." class=\"mlightbox0\" align=\"center\">\n";

2. lightbox.php
this:
    else
    {
      $list .= "<td>&nbsp;</td>";
    }
replace:
    else
    {
      $list .= "<td>&nbsp;";
    }

3. Main.php. Add:
$lang['images'] = "Images";
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on May 22, 2009, 01:05:54 PM
Error with deleting photo and refresh ligthbox(for deleting i use [MOD] Batch Copy/Move/Edit Images).

For example, one user have two ligthbox.

Example 1:
lightbox_image_ids :
1 ligthbox: 62 61
2 ligthbox: 62 61 47 1 38

If i delete foto 61, i see:
1 ligthbox: 62 47 1 38
2 ligthbox: 62 47 1 38

Example 2:
1 ligthbox: 62 1 38 60 33 34
2 ligthbox: 55 12

If i delete foto 38, i see:
1 ligthbox: 55 12
2 ligthbox: 55 12

Could somebody fix this?
If you need another tests - i can do it.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: mirakel on August 03, 2009, 12:23:21 PM
Hallo Zusammen,

ich hoffe es kann mir einer von euch helfen. Habe den Mod eingebaut und mehrfach überprüft, sobald ich eine neue Box anlege und auf speichern gehe, bekomme ich ein error 500.
Ich nutze Version 1.7.7, folgende Mods sind schon vorhanden und laufen. Wiki, BlogMod, MMS

Danke schon einmal im Voraus.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on March 24, 2010, 09:06:00 AM
Ok. I`ve installed this mod, but i can`t understand next:

1. Can i set personal views to show photos, when i in lightbox? Not thumbnail view as thumbnail_bit.html
2. Can i show on detail pages in what albums this foto was added?
3. Can i add template, which will show all albums of users? (i.e links with names of albums)

thanks for this mod!!!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on April 04, 2010, 06:40:30 AM
Had a successful installation. Great MOD. Thanks.

Using v1.7.7

Here is the feedback on the MOD instructions - there are a few text disagreements between the MOD instructions and the code in a fresh v1.7.7:

1. step 2.5a - this has been mentioned here in this forum, on page 9 but I will highlight again:

MOD instructions say to find this:
Quote
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>";

in reality, the lightbox.php file shows this:
Quote
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>";

2. step 4.0 -

MOD instructions say to find this:
Quote
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;

in reality, the member.php file shows this:
Quote
$user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;

3. the admin/settings.php seems to be missing some code:

After the MOD is installed, and you open the ACP and click on settings, you see all the nav tags at the top. The last one says multi-lighboxes and it has a link but when you click on it, you don't go down to the anchor on the page or the anchor is missing, one of the two.

4. One of the other forum posts on here made mention of a long link to a given lightbox. I don't find any link at all, long or short.  The url just points to the domainname/images/lightbox.php address so I can't find a way to 'share' a light box with other users other than to tell them about it. Am I missing something?

All in all, the MOD seems to work great. Thanks for all of your work to create this. I think it really adds to the sharing aspect to a community gallery.

- Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on April 04, 2010, 09:41:39 AM
1,2 and 3 are fixed in the instructions, thanks.

4. - the lightbox url(s) are only displayed under user's profile page and only on lightboxes that are not set as private.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: zakaria666 on August 27, 2010, 05:47:50 PM
@VANO

In step 2, is that for letting guests have permission for lightbox functiaonlity??, if I skip step 2 would it cause any problem?? As i would rather have the user registered and have lightbox functionality. Please get back to me sir thank u and great MOD
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on August 27, 2010, 07:03:37 PM
Yes.
Step 2
If you installed [MOD] Lightbox for GUESTs v1.2 (http://www.4homepages.de/forum/index.php?topic=4826.0) MOD, skip this step and continue with Step 2.1
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on August 30, 2010, 05:38:47 PM
[EDIT] - had a look in the db fields for users. There are three fields for the lightboxes: user_lightbox; user_lightbox_count; user_lightbox_private.   Even though I have the admin cp set for 15 boxes for all users, some of the manually added users have the following settings:

user A (he has three lightboxes)
user_lightbox: 18
user_lightbox_count: 0
user_lightbox_private: 1

user B (he has no lightboxes created)
user_lightbox: 6
user_lightbox_count: 0
user_lightbox_private: 1

user C (he has three lightboxes created)
user_lightbox: 11
user_lightbox_count: 0
user_lightbox_private: 1

user D (he has no lightboxes created)
user_lightbox: 20
user_lightbox_count: 0
user_lightbox_private: 1

All told, 10 users with varying number of a value for the user_lightbox.

Any ideas?

Thanks,

Brian


Hi -

I installed this MOD several months ago and have tested it off and on while I have been installing other MODs and getting our image gallery close to launching.

I am using v1.7.7
I am using mysql 5.1.47
I am using php 5.2.13
current cp Multi Light box setting: 15 boxes

Issues:

Overall problem is that the multiple lightboxes don't stick or hold on to their stashed pics.  At first, everything works great. But over time, as I log in as the admin, as a moderator, as one user, and then another user, the pics in the lightbox for one profile just don't stay.

Let's say User Joex has 3 lightboxes. They are named:

#1 regatta dogs (was the default and is now renamed as such)
#2 sheer blisss (with a space between the words)
#3 maman, j'ai faim (yes just like that)

such that if I click on light box #1 of the user, I see the pics from lightbox #3. Then I click on lightbox #2 and still see the pics from lightbox #3.  

this effect happens as another user clicking on another profile, seeing their user profile and clicking on the link

now I log in as the user with the 3 lightboxes and decide to clear my light box. the one that is selected gets cleared but then I click on Manage my lightboxes and see the three listed, one now empty and two with a summary number of pics to the right, and let's use Vano's example pic, I click on the number to the right of cars that says "1" ... this causes the light box to clear, when it should, I believe, display the current pics in that light box.

So there are two issues, using Vano's example pic in his first posting:

1. If I were to view Vano's user profile and click on Nature, all I would see would be the final light box, whatever123456
2. If I were to log in as Vano and click on clear my light light box, the light box currently selected in the drop down menu would clear but then if I clicked on Lighbox in the user panel which takes me to Manage my Lightboxes, and I clicked on the summary link of pics to the right of the light boxes, all the pics would clear.

The main issue is that somehow the lightboxes lose their function over time. I have tested this over and over.  At first, they work great but as I log in and out as various users and click on their user profile and then click on their shared lightboxes, I can only see the last lightbox in the listing.

Has anyone else experienced this or can some of you test these same conditions by click on your various user profiles and visiting their lightboxes, and also try to clear one lightbox and then go back to manage your lightboxes and click on summary number link and see what happens?

Thanks,

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 17, 2010, 11:19:42 AM
Will be very important and good to addition one little function.

Show on details page, in which albums this photo have been added. If is not difficult, write please code. I think this will be very need not only for me.  :wink:

Would be very grateful if someone could help me!  :!:
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on October 17, 2010, 08:54:28 PM
Not tested.
In includes/functions.php find:
  if (!check_permission("auth_download", $image_row['cat_id'])) {

Insert above :above::
  $added = array();
  foreach($user_info['lightboxes'] as $lb => $info)
  {
    if ($lb == $user_info['user_lightbox'])
      continue;

    $user_info['lightbox_image_ids'] = $user_info['lightboxes'][$lb]['image_ids'];
    if (check_lightbox($image_row['image_id']))
      $added[] = $lb;

  }
  $user_info['lightbox_image_ids'] = $user_info['lightboxes'][$user_info['user_lightbox']]['image_ids'];
  $lightbox_added = "";
  if (!empty($added))
  {
    foreach($added as $lb)
    {
      $lightbox_added .= ($lightbox_added ? ", " : "") . '<a href="' . $site_sess->url(ROOT_PATH."lightbox.php?user_lightbox=" . $lb) . '">' . $user_info['lightboxes'][$lb]['name'] . '</a>';
    }
  }
  $site_template->register_vars(array(
    "lightbox_added" => $lightbox_added,
  ));

In details.html template use something like this:
Code: [Select]
{if lightbox_added}This image is in following lightbox(es): {lightbox_added}{endif lightbox_added}
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 17, 2010, 10:20:06 PM
V@no thank for help, but result is not showing  Sad

Without {if lightbox_added}{endif lightbox_added} - show only "This image is in following lightbox(es): "

With {if lightbox_added}This image is in following lightbox(es): {lightbox_added}{endif lightbox_added} - nothing showing

 Sad

And else, when i logout, index page give me 11 notices:

Code: [Select]
Notice: Undefined offset: 0 in /home/users2/d/drandrew/domains/skyphotos.ru/includes/functions.php on line 376
Line 376, from your code above:

  $user_info['lightbox_image_ids'] = $user_info['lightboxes'][$user_info['user_lightbox']]['image_ids'];
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on October 18, 2010, 03:34:34 AM
How did you test it? It should only show you the name of lightbox when it's different from currently selected lightbox.

As of notice message replace that line with:
  $user_info['lightbox_image_ids'] = @$user_info['lightboxes'][$user_info['user_lightbox']]['image_ids'];
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 18, 2010, 06:04:52 AM
I`m sorry, i can`t understand how it should work. This will not show to users, names of lightboxes which contain this photo?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on October 18, 2010, 06:16:49 AM
This isn't exactly off topic but I believe V@NO can speak Russian.  As much as i would like to follow your conversation on here, perhaps if you posted your request and misunderstanding in Russian, V@NO could understand what it is you want to achieve.

The signature in the MrAndrew profile is a .ru domain so I conclude this is member is Russian.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 18, 2010, 06:22:39 AM
It's not very nice and respectful to write here in Russian, as this forum in English. I could even possibly someone that hurt. English is common, and understand pretty much everything. This is my opinion. :)  I`m not understanding not due to English, i`m not programmer, and it is not so easy for me ;-) But I`m trying! Sorry off
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on October 18, 2010, 07:49:03 AM
I`m sorry, i can`t understand how it should work. This will not show to users, names of lightboxes which contain this photo?
Hmmm then perhaps I didn't understand your request then...

What I understood was to show to currently logged in member in which of his lightboxes the the image is currently in.
So it should work this way:
1) make sure there are more then one lightbox created (let's call them lb1, lb2 and lb3)
2) select lb1
3) open details page of image1 and add image to lightbox
4) select lb3
5) open details page of image1, it should now show you that that image is added in lb1
6) add that image in lightbox
7) select lb2
8) open details page of image1, it should show that image is added in lb1 and in lb3

P.S.
English is common, and understand pretty much everything.
That is exactly the reason I prefer use english on this forum, it would benefit more people in general then if answered in russian ;)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 18, 2010, 08:01:17 AM
Ok. I will use this. This is good change, but not what i asked.

I want to: when visitor or user see a big size photo, below he/she, may see album names, which have this photo. Something like this:

User photo albums containing this photo: then album names

 It`s possible to do?

 Thanks for your patience  :D
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on October 18, 2010, 08:36:22 AM
Other words list of public lightboxes from other users? If so, it would only be possible with a very big hit on server performance and I would not advice for this feature.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 19, 2010, 12:02:07 PM
Where is the problem?

This tags nothing show me:

Code: [Select]
{if user_lightbox}
        <tr>
          <td class="row1"><b>{lang_user_lightbox}</b></td>
          <td class="row1">{user_lightbox}</td>
        </tr>
{endif user_lightbox}

In member.php all stay correct

  /*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
    $user_lightbox = "";
    $limit = ($user_row['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_row['user_level'] == ADMIN) ? -1 : (($user_row['user_lightbox_count']) ? $user_row['user_lightbox_count'] : $config['lightbox_count']);
    if ((($user_row['user_lightbox_private'] || $user_row['user_level'] == ADMIN) && $config['lightbox_share']) || $user_info['user_level'] == ADMIN)
    {
      $condition = "";
      if ($limit != -1)
      {
        $condition = " LIMIT ".$limit;
      }
      $condition;
      $sql = "SELECT lightbox_id, lightbox_name, lightbox_private, lightbox_image_ids
              FROM ".LIGHTBOXES_TABLE."
              WHERE user_id = ".$user_row['user_id'].$condition;
      $result = $site_db->query($sql);
      if ($result)
      {
        while ($row = $site_db->fetch_array($result))
        {
          if (!$row['lightbox_private'] || $user_info['user_level'] == ADMIN)
          {
            $user_lightbox .= (($user_lightbox) ? "<br />" : "").(($user_info['user_level'] == ADMIN) ? ((!$row['lightbox_private']) ? "+ " : "- ") : "")."<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php?lightbox_id=".$row['lightbox_id'])."\">".$row['lightbox_name']." (".((trim($row['lightbox_image_ids'])) ? count(explode(" ", trim($row['lightbox_image_ids']))) : 0).")</a>\n";
          }
        }
      }
    }
    $site_template->register_vars(array(
      "user_lightbox" => $user_lightbox,
      "lang_user_lightbox" => $lang['user_lightbox'],
    ));
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on October 19, 2010, 02:14:26 PM
1) are lightbox shares enabled in the settings?
2) did that user enabled shares of his lightboxes?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on October 19, 2010, 02:30:27 PM
Allow share lightboxes - set yes,
In the user manage albums set - not private
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on October 26, 2010, 04:55:43 PM
The issue of the different saved images not "sticking" after a few days continues.

Using v1.7.7
Php version is 5.2.14
MySQL version is 5.1.47

Problem: A user has 4 lightboxes with different images saved to each of the lightboxes. Yet the same 4 images appear in the first three lightboxes when you click on their profile as another user.  The fourth lightbox has three images that were saved recently. Those still show.

Lightbox 1 - Dogs  (when clicked in the user control panel, it shows the 4 images from the Food lightbox)
Lightbox 2 - Scenery (when clicked in user control panel, it shows the 4 images from the Food lightbox)
Lightbox 3 - Food (when clicked in the user control panel, it shows the 4 images from the Food lightbox)
Lightbox 4 - Friends

When does this happen? After about a week or ten days. Perhaps it is timed to the new images setting, which for our gallery is 10 days.

The multi-lightbox works initially, but then all the most recent images seem to occupy the older boxes after a few days or a week.  To drive home this point, if the second and third lightboxes are deleted, Scenery and Food, the first lightbox still shows the Food images.  

Is this a database sorting problem?

Thanks for any ideas you might have.

[edit]

There is another issue - with another user, the first lightbox is marked public but the second lightbox is marked private. Yet even with those settings, the more recent lightbox or the second lightbox, which is marked as private, displays all of its images to the public.

Here are the admin settings for our image gallery for multi-lightboxes:

- number of allowed lightboxes: 15
- allow share of lightboxes: YES

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on October 30, 2010, 10:43:42 AM
Okay, to follow up on the disappearing lightboxes - I set up three lightboxes exactly 6 days ago as a test case to see how long this problem took.

initial set up
Box A - had 5 dog pics
Box B - had 4 food pics
Box C - had 3 friend pics

Now:

Box A - has 3 friend pics from Box C; all 5 dog pics are gone
Box B - has 3 friend pics from Box C; all 4 food pics are gone
Box C - has 3 friend pics

What a mystery!

Thanks for any ideas or thoughts.

Brian

[edit]

Have spent hours today trying to compare db fields to see if I can find any commanility; nothing to report. 

Has anyone else used this mutli-light box, as in saved images to several boxes, and then revisited the boxes later?  I wonder if this phenomenon is common to every install and no one has actually seen it happening...
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on November 12, 2010, 05:42:52 AM
No word from any folks if they have actually tested this MOD after it has been installed and multi-lightboxes have been saved for a week or two.

The bottom line: the installation and initial operation with the MOD in place work fine but I have to now declare this MOD does NOT work with V1.7.7 after a few weeks of installation and the multi-lightboxes that have saved images are older than  7 - 10 days.

Previous posts detail exact problem.

Such a bummer. This appeared to be a great and useful MOD for members.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on November 17, 2010, 01:04:18 PM
Thanks for any ideas or thoughts.

Look my post #144
If you delete image which was in lightbox, then you will have this error.
I don't know how to fix it. And i don't know how people can use this mode (they don't delete any photo?!)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on November 17, 2010, 03:23:29 PM
Error with deleting photo and refresh ligthbox(for deleting i use [MOD] Batch Copy/Move/Edit Images).

For example, one user have two ligthbox.

Example 1:
lightbox_image_ids :
1 ligthbox: 62 61
2 ligthbox: 62 61 47 1 38

If i delete foto 61, i see:
1 ligthbox: 62 47 1 38
2 ligthbox: 62 47 1 38

Example 2:
1 ligthbox: 62 1 38 60 33 34
2 ligthbox: 55 12

If i delete foto 38, i see:
1 ligthbox: 55 12
2 ligthbox: 55 12

Could somebody fix this?
If you need another tests - i can do it.
Can you confirm if this happens when user himself deletes a photo or admin deletes it via ACP? (if via ACP, do you use default images.php or modified version?)

(asking this, because I don't have the mod installed :oops:)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on November 17, 2010, 05:55:18 PM
Hi -

Thanks for posting. I had not seen your post. What I experience is identical but I have not deleted any images, either as an admin or as a user.

I am happy to have the MOD author log in to our website and try this out as our test user, who has no admin privileges.  Just log in, create 2, 3, or 4 lightboxes, and save a few images. Then let it sit for 7 days and log back in. You'll see that all the images of the most recently created lightbox have populated all the lightboxes.

Thank you.

Brian

[edit]

attached is my images.php file; it appears to be the default, created for v.1.7.6 - I had not seen this file and it is a big one. In scanning the code, I wonder if some of the presets in the code might be causing this problem. I don't have a 'big' folder root address specified, for one thing
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on November 17, 2010, 06:12:32 PM
I now can see where the problem could be when deleting images from ACP. Will try fix it sometimes this week.
The images.php you've attached is little outdated version of [MOD] Batch Copy/Move/Edit Images v4.15.1 (2010-08-14) (http://www.4homepages.de/forum/index.php?topic=6759.0)
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on November 17, 2010, 11:12:37 PM
Can you confirm if this happens when user himself deletes a photo or admin deletes it via ACP? (if via ACP, do you use default images.php or modified version?)
My happen when admin delete photo via ACP.

Now example when user himself deletes a photo:
1 ligthbox: 1399 1394 1393
2 ligthbox: 1399 1396
I delete photo 1399. Photo was deleted, but ligthbox hasn't any changes. It's new error.

My images.php(attach) has this mod: Batch Copy/Move/Edit Images; Multi-Language support for any text.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on November 22, 2010, 05:27:47 AM
The problem with lightboxes being overwritten is fixed in v1.03.1: added steps 18 and 18.1
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on November 22, 2010, 10:14:30 PM
Now lightboxses are not change:
1 ligthbox: 1394 1393 1400
2 ligthbox: 1396 1397
I delete photo 1400 by user. Photo was deleted(i didn't see it in gl_images), but ligthbox hasn't any changes.
I delete photo 1396 by admin(ACP). Photo was deleted, but ligthbox hasn't any changes.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on November 27, 2010, 03:02:20 AM
Hi -

Thanks for the fix V@no. I appreciate your putting in the time to try to solve the problem.

I have logged in as 3 users: 1 @ ACP and 2 @ regular members. I have saved images to several lightboxes and deleted one. Everything seems to be working so far.

As I mentioned in my earlier posts on this page, I am letting the lightboxes "bake" for wont of a better word, to see if the images will remain in their respective lightboxes over a one week period, which for me was the critical time when images from the newer lightboxes began to slip into the older lightboxes.

Thanks again. Will update again on Monday, 29 Nov.

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on November 27, 2010, 06:17:23 AM
Now lightboxses are not change:
1 ligthbox: 1394 1393 1400
2 ligthbox: 1396 1397
I delete photo 1400 by user. Photo was deleted(i didn't see it in gl_images), but ligthbox hasn't any changes.
I delete photo 1396 by admin(ACP). Photo was deleted, but ligthbox hasn't any changes.
4images doesn't update lightboxes when a user deletes a photo (the way lightboxes store image ids it would require scan every single lightbox, that would be very inefficient).
As of ACP, in my tests lightboxes were updated just fine, though I tested only with one user...
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: surferboy on December 03, 2010, 02:26:11 AM
Hi -

Sorry for the late reply on my promised update of 29 Nov.

V@no's fix seems to have worked. After more than 10 days, the images have stayed in the various lightboxes.

Thank you very much for taking the time to correct this issue.  I really appreciate it.

Brian
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on February 11, 2011, 07:08:19 PM
When i save my profile info, it give me this error:

DB Error: Bad SQL Query: SELECT lightbox_id, lightbox_name, lightbox_private, lightbox_image_ids FROM 5images_lightboxes WHERE user_id = LIMIT 5
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 5' at line 3

How to know, what file consist error?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 11, 2011, 08:46:34 PM
The error comes from step 4. Post what you have in your member.php with 100 lines above the new code.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on February 12, 2011, 09:46:23 AM
This is my code, from step 4, and 100 lines above it!

      $msg = $lang['invalid_email'];
    }
  }

  $action = "lostpassword";
}

if ($action == "lostpassword") {
  $txt_clickstream = $lang['lost_password'];
  $user_email = (isset($HTTP_POST_VARS['user_email'])) ? format_text(stripslashes($HTTP_POST_VARS['user_email']), 2) : "";
  $site_template->register_vars(array(
    "lang_email" => $lang['email'],
    "lang_lost_password" => $lang['lost_password'],
    "lang_lost_password_msg" => $lang['lost_password_msg'],
    "lang_submit" => $lang['submit'],
    "user_email" => $user_email,
  ));
  $content = $site_template->parse_template("member_lostpassword");
}

//-----------------------------------------------------
//--- Edit Profile ------------------------------------
//-----------------------------------------------------
$update_process = 0;
$new_email_msg = "";
//-----------------------------------------------------
//--- Show uploaded images from edit profile ----------
//-----------------------------------------------------
if ($action == "show_uploaded_images") {
       
$sql1 = "

SELECT i.image_id, i.image_name, i.image_thumb_file, i.image_media_file, i.cat_id" . get_user_table_field(", u.", "user_name") . "
FROM (" . IMAGES_TABLE . " i, " . CATEGORIES_TABLE . " c)
LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND " . get_user_table_field("u.", "user_id") . " = i.user_id AND i.user_id = " . $user_info['user_id'] . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
ORDER BY i.image_date DESC

";

$result = $site_db->query($sql1);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $uploaded_images_from_edit_profile = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $uploaded_images_from_edit_profile .= $lang['no_new_images'];
  $uploaded_images_from_edit_profile .= "</td></tr></table>";
}
else  {
  $uploaded_images_from_edit_profile = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($uploaded_images_from_edit_profile_row = $site_db->fetch_array($result)) {
      $user_name = format_text(trim(ucfirst($uploaded_images_from_edit_profile_row[$user_table_fields['user_name']]), 2));
     
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $uploaded_images_from_edit_profile .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $uploaded_images_from_edit_profile .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($uploaded_images_from_edit_profile_row);
    $uploaded_images_from_edit_profile .= $site_template->parse_template("thumbnail_bit");
    $uploaded_images_from_edit_profile .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $uploaded_images_from_edit_profile .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $uploaded_images_from_edit_profile .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $uploaded_images_from_edit_profile .= "</tr>\n";
    }
  }
  $uploaded_images_from_edit_profile .= "</table>\n";
} // end else


$site_template->register_vars("lang_uploaded_images_from_edit_profile", $lang['uploaded_images_from_edit_profile']);
$site_template->register_vars("uploaded_images_from_edit_profile", $uploaded_images_from_edit_profile);
$site_template->register_vars("lang_uploaded_images_go_back", $lang['uploaded_images_go_back']);
$content = $site_template->parse_template("member_editprofile");
$txt_clickstream = $lang['show_uploaded_images'];

unset($uploaded_images_from_edit_profile);
}
if ($action == "updateprofile") {
  $txt_clickstream = $lang['control_panel'];
  if ($user_info['user_level'] == GUEST) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $user_email = (isset($HTTP_POST_VARS['user_email'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_email'])) : "";
  $user_email2 = (isset($HTTP_POST_VARS['user_email2'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_email2'])) : "";
/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
    $user_lightbox = "";
    $limit = ($user_row['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_row['user_level'] == ADMIN) ? -1 : (($user_row['user_lightbox_count']) ? $user_row['user_lightbox_count'] : $config['lightbox_count']);
    if ((($user_row['user_lightbox_private'] || $user_row['user_level'] == ADMIN) && $config['lightbox_share']) || $user_info['user_level'] == ADMIN)
    {
      $condition = "";
      if ($limit != -1)
      {
        $condition = " LIMIT ".$limit;
      }
      $condition;
      $sql = "SELECT lightbox_id, lightbox_name, lightbox_private, lightbox_image_ids
              FROM ".LIGHTBOXES_TABLE."
              WHERE user_id = ".$user_row['user_id'].$condition;
      $result = $site_db->query($sql);
      if ($result)
      {
        while ($row = $site_db->fetch_array($result))
        {
          if (!$row['lightbox_private'] || $user_info['user_level'] == ADMIN)
          {
            $user_lightbox .= (($user_lightbox) ? "<br />" : "").(($user_info['user_level'] == ADMIN) ? ((!$row['lightbox_private']) ? "+ " : "- ") : "")."<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php?lightbox_id=".$row['lightbox_id'])."\">".$row['lightbox_name']." (".((trim($row['lightbox_image_ids'])) ? count(explode(" ", trim($row['lightbox_image_ids']))) : 0).")</a>\n";
          }
        }
      }
    }
    $site_template->register_vars(array(
      "user_lightbox" => $user_lightbox,
      "lang_user_lightbox" => $lang['user_lightbox'],
    ));
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

Thanks for help!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 12, 2011, 04:22:40 PM
You've mixed step 4 and step 4.1. It seems you found the needed string for step 4.1 but inserted code from step 4 instead.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on February 12, 2011, 07:53:13 PM
No, sir... Before this line:

$user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;

I`ve entered:

/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
    $user_lightbox = "";
    $limit = ($user_row['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_row['user_level'] == ADMIN) ? -1 : (($user_row['user_lightbox_count']) ? $user_row['user_lightbox_count'] : $config['lightbox_count']);
    if ((($user_row['user_lightbox_private'] || $user_row['user_level'] == ADMIN) && $config['lightbox_share']) || $user_info['user_level'] == ADMIN)
    {
      $condition = "";
      if ($limit != -1)
      {
        $condition = " LIMIT ".$limit;
      }
      $condition;
      $sql = "SELECT lightbox_id, lightbox_name, lightbox_private, lightbox_image_ids
              FROM ".LIGHTBOXES_TABLE."
              WHERE user_id = ".$user_row['user_id'].$condition;
      $result = $site_db->query($sql);
      if ($result)
      {
        while ($row = $site_db->fetch_array($result))
        {
          if (!$row['lightbox_private'] || $user_info['user_level'] == ADMIN)
          {
            $user_lightbox .= (($user_lightbox) ? "<br />" : "").(($user_info['user_level'] == ADMIN) ? ((!$row['lightbox_private']) ? "+ " : "- ") : "")."<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php?lightbox_id=".$row['lightbox_id'])."\">".$row['lightbox_name']." (".((trim($row['lightbox_image_ids'])) ? count(explode(" ", trim($row['lightbox_image_ids']))) : 0).")</a>\n";
          }
        }
      }
    }
    $site_template->register_vars(array(
      "user_lightbox" => $user_lightbox,
      "lang_user_lightbox" => $lang['user_lightbox'],
    ));
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

Then after this line, i`ve insert:

/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/
//these settings can not be changed by the user, only by administrator from ACP
  if (isset($HTTP_POST_VARS['user_lightbox'])) unset($HTTP_POST_VARS['user_lightbox']);
  if (isset($HTTP_POST_VARS['user_lightbox_private'])) unset($HTTP_POST_VARS['user_lightbox_private']);
  if (isset($HTTP_POST_VARS['user_lightbox_count'])) unset($HTTP_POST_VARS['user_lightbox_count']);
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

To my mind it`s correct, but give error :-(
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 12, 2011, 09:43:07 PM
No, sir... Before this line:

$user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;
Really? your code in previous reply speaks otherwise... Check again.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Sun on February 12, 2011, 11:34:02 PM
4images doesn't update lightboxes when a user deletes a photo (the way lightboxes store image ids it would require scan every single lightbox, that would be very inefficient).
As of ACP, in my tests lightboxes were updated just fine, though I tested only with one user...

V@no, извини пока не нашла времени? чтобы составить полный набор тестов и все проверить, а делать тесты "урывками" не хотелось. Но уже хорошо, что при удалении фото лайтбокс не сбрасывается. Спасибо!

If lightboxes doesn't update when a user deletes a photo, then user will see that in lightbox he has, for example, 5 photo(count for each lightbox), but when he open lightbox he can see, for example, 3 photo. May be will be better if sometimes admin run script and it check all lightboxes for absent photo and delete information about it? Could you create this script (my knowlege of php is not good for this )? I'll check it.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on February 13, 2011, 08:34:33 AM
OK, thanks! Another request:

{if user_lightbox}
        <tr>
          <td class="row1"><b>{lang_user_lightbox}</b></td>
          <td class="row1">{user_lightbox}</td>
        </tr>
{endif user_lightbox}

And

{if user_lightbox_form}{user_lightbox_form}{endif user_lightbox_form}

Nothing to show :(

I tried to change number of ID, in this link on any albums ID: http://localhost:8080/lightbox.htm?user_lightbox=50&l=english

(Albums not privates and allowed to share)

This always show me my account album! :-(
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 13, 2011, 05:50:13 PM
Exactly what are you trying to do?
The html code you showed is used to show which lightbox is currently active and to switch to a different lightbox. It doesn't show you the images from lightbox...
Links to other user's shared lightboxes are only available in their profile page.
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on February 13, 2011, 08:10:48 PM
Exactly what are you trying to do?
The html code you showed is used to show which lightbox is currently active and to switch to a different lightbox. It doesn't show you the images from lightbox...
Links to other user's shared lightboxes are only available in their profile page.

Yes, link to user`s lighbox, not shown from his profile... Nothing show. :(
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on February 14, 2011, 01:51:22 AM
If you as admin can't see any links in users profile then re-check Step 4 and 15

Also check your settings in ACP
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on February 14, 2011, 06:01:52 AM
V@no, thanks. It turns i`ve lost a some path of code from my member.php. I found it from original file and corrected. Now work`s fine. Thanks!

IS IT POSSIBLE TO SHOW LIGHBOX HITS??
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: Jan-Lukas on May 09, 2011, 03:26:25 PM
Hi,
ein User hätte zu diesem Mod eine Frage

Und zwar, ob es möglich wäre, einen Ordner an einen anderen anhängen könnte (Also Bilder von Ordner A nach Ordner B verschieben)

evtl. hat V@no ja dazu was geschrieben, dann bitte anschubsen ;)

Danke Harald

Edit:
Habe ihr mehr Ordner zugesteckt, Das sollte erledigt sein.
Trotzdem wäre das doch eine nützliche Erweiterung ?
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: kimchu on August 23, 2011, 08:24:30 AM
V@no,

Another very useful MOD. Thank-you.

Kim
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on September 12, 2011, 09:26:58 AM
Please give me instruction how to do Lightbox Name as required, from manage page? I`ve installed multi-lightboxe mod in my gallery. Please help me.

Thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: MrAndrew on September 20, 2011, 01:57:27 PM
Will it right if i will change in step 6.3 ?????

/*
  MOD MULTI-LIGHTBOXES
  START INSERT
*/function lightbox_trim($name)
{
  $max = 10;
  if (strlen($name) > $max)
  {
    $name = substr($name, 0, $max)."...";
  }
  return $name;
}
function fixhtml($text, $quotes = 1, $amp = 0)
{
  if ($amp) $text = str_replace("&", "&amp;", $text);
  if ($quote) $text = str_replace("\"", "&quot;", $text);
  $text = str_replace("<", "&lt;", str_replace(">", "&gt;", $text));
  return $text;
}
/*
  MOD MULTI-LIGHTBOXES
  END INSERT
*/

This line:
  if ($quote) $text = str_replace("\"", "&quot;", $text);

By this line:
  if ($quotes) $text = str_replace("\"", "&quot;", $text);
Title: Re: [MOD] Multi-Lightboxes v1.03.1
Post by: V@no on September 21, 2011, 01:50:46 AM
Yes, thank you. That would be correct. I've updated step 6.3
Title: Re: More notices due to db_definitions...
Post by: MrAndrew on September 21, 2011, 05:14:32 AM
Help me please, with this problem...

Code: [Select]
Notice: Undefined variable: config in C:\Users\***\Desktop\Server\root\includes\sessions.php on line 367
This is line from sessions:

$limit = ($user_info['user_lightbox_count'] == -1 || !$config['lightbox_count'] || $user_info['user_level'] == ADMIN) ? -1 : (($user_info['user_lightbox_count']) ? $user_info['user_lightbox_count'] : $config['lightbox_count']);

I`ve reviewed installation of the mod, but nothing help!
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: V@no on September 21, 2011, 06:46:02 AM
Did you run the installer from step 1?
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: MrAndrew on September 21, 2011, 03:15:40 PM
I`ve tried to install this again. This is log message:

Code: [Select]
DB Error: Bad SQL Query: ALTER TABLE 5images_users ADD user_lightbox MEDIUMINT( 8 ) UNSIGNED NOT NULL
Duplicate column name 'user_lightbox'

DB Error: Bad SQL Query: ALTER TABLE 5images_users ADD user_lightbox_count SMALLINT( 3 ) DEFAULT '0' NOT NULL
Duplicate column name 'user_lightbox_count'

DB Error: Bad SQL Query: ALTER TABLE 5images_users ADD user_lightbox_private TINYINT( 1 ) UNSIGNED DEFAULT '1' NOT NULL
Duplicate column name 'user_lightbox_private'

DB Error: Bad SQL Query: ALTER TABLE 5images_lightboxes ADD id MEDIUMINT( 12 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
Duplicate column name 'id'

DB Error: Bad SQL Query: ALTER TABLE 5images_lightboxes ADD lightbox_name VARCHAR( 32 ) NOT NULL
Duplicate column name 'lightbox_name'

DB Error: Bad SQL Query: ALTER TABLE 5images_lightboxes ADD lightbox_private TINYINT( 1 ) UNSIGNED DEFAULT '1' NOT NULL
Duplicate column name 'lightbox_private'

DB Error: Bad SQL Query: INSERT INTO 5images_settings ( setting_name , setting_value ) VALUES ( 'lightbox_count', '5' ), ( 'lightbox_share', '1' )
Duplicate entry 'lightbox_count' for key 'PRIMARY'

    Error
      ALTER TABLE 5images_users ADD user_lightbox MEDIUMINT( 8 ) UNSIGNED NOT NULL

    Error
      ALTER TABLE 5images_users ADD user_lightbox_count SMALLINT( 3 ) DEFAULT '0' NOT NULL

    Error
      ALTER TABLE 5images_users ADD user_lightbox_private TINYINT( 1 ) UNSIGNED DEFAULT '1' NOT NULL

    Error
      ALTER TABLE 5images_lightboxes ADD id MEDIUMINT( 12 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST

    Error
      ALTER TABLE 5images_lightboxes ADD lightbox_name VARCHAR( 32 ) NOT NULL

    Error
      ALTER TABLE 5images_lightboxes ADD lightbox_private TINYINT( 1 ) UNSIGNED DEFAULT '1' NOT NULL

    Done
      ALTER TABLE 5images_lightboxes ADD INDEX ( lightbox_private )

    Error
      INSERT INTO 5images_settings ( setting_name , setting_value ) VALUES ( 'lightbox_count', '5' ), ( 'lightbox_share', '1' )

    Done only:

      ALTER TABLE 5images_lightboxes ADD INDEX ( lightbox_private )

But notice active!
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: V@no on September 22, 2011, 12:23:49 AM
Sorry, at the moment I don't have access to the source code, I'll try guess here.
Above the code you've inserted in step 8 add this:
global $config;
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: MrAndrew on September 22, 2011, 11:53:48 AM
Now it work! Thanks!

Is it possible to do Lightbox Name field as required?
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: wassimo on October 09, 2011, 07:35:42 AM
hmmme great mod

 but
how can member  change which lightbox hold image

i mean  move the image from lightbox 1 to 2

thanks
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: MrAndrew on October 09, 2011, 07:39:27 AM
Which album are current active, and there will be added photo.
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: wassimo on October 09, 2011, 07:46:30 AM
wow know how i do it

choice first lightbox from drop down menu after that press on the favortie button

haha
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: Jan-Lukas on December 29, 2011, 09:09:40 PM
auch Version 1.7.10 tauglich

immer diese englischen Mod's  :wink:
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: MrAndrew on January 23, 2012, 05:39:54 PM
Hello! V@no, i think this is question for you!

I have an idea, help me please, realize it! This idea, i`ll call avatar for lightbox!

I have created column in my LIGHTBOX TABLE, which call lightbox_thumb

Is it possible, from details page, use button (i.e. "use as lightbox thumb") , which will add to "lightbox_thumb" "image_thumb_file" path, from IMAGES_TABLE??? I know it possible, using SQL query, but i`m not programmer. It`s difficult for me.

May you help me?

Many thanks!
Title: Re: [MOD] Multi-Lightboxes v1.03.2 (2011-09-20)
Post by: toonks on June 13, 2013, 03:25:30 AM
Hi!
This script is fantastic, but for some reason my footer gets stuck in an inframe on the lightbox_manage page. I can't figure out how fix this as I'm guessing lightbox.html is the problem as it's got {footer} at the end which lightbox_manage.html for some reason uses at the end (along with the dropdown list of folders and the headline). Anyone know how I can fix this?