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' );
if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {
Replace with:/*
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
*/
//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
/*
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("\"", """, $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> </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> </td>\n";
$list .= "<td colspan=\"2\">".$lang['add_new']." <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> </td>\n";
$list .= "<td> </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
*/
if (!empty($user_info['lightbox_image_ids'])) {
$image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
Replace with:/*
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
*/
show_image($image_row, "lightbox");
Replace with:/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
show_image($image_row, "lightbox".(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""));
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
$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:/*
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
*/
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:/*
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
*/
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:/*
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
*/
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:/*
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
*/
$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:/*
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
*/
$link_arg = $site_sess->url(ROOT_PATH."lightbox.php");
Replace with:/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$link_arg = ROOT_PATH."lightbox.php".(($lightbox_id) ? "?lightbox_id=".$lightbox_id : "");
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
show_image($image_row, $mode, 0, 1);
Replace with:/*
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
*/
if (!empty($user_info['lightbox_image_ids'])) {
$image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
Replace with:/*
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
*/
$next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
Replace with:/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : "") : ""));
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
$prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
Replace with:/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : "") : ""));
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];
Replace with:/*
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
*/
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
Find in 4images v1.7.7 or newer: $user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;
/*
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
*/
$user_invisible = (isset($HTTP_POST_VARS['user_invisible'])) ? intval($HTTP_POST_VARS['user_invisible']) : 0;
Insert below:/*
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
*/
if (empty($user_info['lightbox_image_ids']) || !function_exists("gzcompress") || !function_exists("crc32")) {
Insert above:/*
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
*/
$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)/*
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
*/
$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)/*
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
*/
$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:/*
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
*/
/*
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("&", "&", $text);
if ($quote) $text = str_replace("\"", """, $text);
$text = str_replace("<", "<", str_replace(">", ">", $text));
return $text;
}
/*
MOD MULTI-LIGHTBOXES
END INSERT
*/
/*
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
*/
$msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
Replace with:/*
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
*/
$msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
Replace with:/*
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
*/
$msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
Replace with:/*
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
*/
//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
Insert above:/*
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
*/
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!)/*
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
*/
$user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
Insert below:/*
MOD MULTI-LIGHTBOXES
START INSERT
*/
$user_info['user_lightbox'] = 0;
$user_info['lightboxes'] = array();
$user_info['lightboxes_list'] = array();
/*
MOD MULTI-LIGHTBOXES
END INSERT
*/
/*
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
*/
show_form_footer($lang['save_changes'], "", 2);
Insert above 4images 1.7-1.7.1:/*
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
*/
/*
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
*/
/*
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/*
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
*/
{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:{if lightbox_notin_manage}And
block that you DONT want to show on "lightbox manager" page
{endif lightbox_notin_manage}
{if lightbox_in_manage}
block that you want to show ONLY on "lightbox manager" page
{endif lightbox_in_manage}
{if user_lightbox}
<tr>
<td class="row1"><b>{lang_user_lightbox}</b></td>
<td class="row1">{user_lightbox}</td>
</tr>
{endif user_lightbox}
{if user_lightbox_form}{user_lightbox_form}{endif user_lightbox_form}
.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;
}
$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
$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
WHERE user_id = ".$image_row['user_id'];
WHERE lightbox_id = '".$image_row['lightbox_id']."'";
ALTER TABLE `4images_lightboxes` CHANGE `lightbox_name` `lightbox_name` VARCHAR( XX ) NOT NULL
where XX is the limit number $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!).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 |
$page_url .= ($lightbox_id) ? (($page_url) ? "&" : "?")."lightbox_id=".$lightbox_id : "";
but i have one problem with this mod :) . i have install this one -> http://www.4homepages.de/forum/index.php?topic=9288.0I've added Step 2.5c (not tested it though)
and now i canґt made the changes in step 2.5b
and now in step 7.1 & 7.2 there are two instances of this line. change both???Can't be.
and in step 3.5 i dpnґt have this lineOuch...I've added this line in the wrong place, thats one of the replacement lines, not seeking...updated it.Code: [Select]$page_url .= ($lightbox_id) ? (($page_url) ? "&" : "?")."lightbox_id=".$lightbox_id : "";
Has any other this problem, too??yes, you're right, i have this problem, too!
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.Oh, right, forgot that I've used the same function for colored type messages in PM mod...in includes/functions.php removeCode: [Select]function get_msg($msg) {
You should already have this function from PM mod.
$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;
}
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?
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.
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 ;)
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..
Hello,Are you a superstitions person, trying to avoid Step 13? ;)
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
another little problem: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.
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
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,Are you a superstitions person, trying to avoid Step 13? ;)
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 511another little problem: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.
the downloads are not count anymore :?
[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:
if ($action != "" || $user_info['user_level'] == GUEST || $action == "addtolightbox" || $action == "removefromlightbox")
{
$action = "show";
}
elseif ($action == "clearlightbox")
{
$action = "manage";
}
Replace with:if ($user_info['user_level'] == GUEST || ($action != "manage" && $action != "save"))
{
$action = ($action == "clearlightbox" && $user_info['user_level'] >= USER) ? "manage" : "show";
}
.lightboxidropdown {
font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
color: #0f5475;
font-size: 11px;
width: 95px;
}
$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";
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.Added Step 2.6
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
unset($private_new, $name_new);
Insert below:$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") : "",
));
$user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
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;
}
$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"
);
$config['lightbox']
in Step 4: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" :)
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 linesCode: [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 ^^
file attached to the first topic now.
@darkness
see on page one (after code)
download the file
greets ivan
<div>
<form method="post" action="{self}" name="lightbox" style="margin: 0px 0px 0px 0px;">
<img border="0" src="{template_url}/images/active_favourites.jpg" align="absmiddle">{user_lightbox_dropdown}<noscript> <input type="submit" value="{lang_lightbox_select}" class="lightboxibutton"></noscript>
<input name="mode" value="{mode}" type="hidden">
</form>
</div>
.lightboxibutton {
font-family: Tahoma,Verdana,Arial, Helvetica, sans-serif;
background-color: Black;
color: #fcdc43;
font-weight: bold;
font-style: normal;
font: 10px;
}
<a class="menu" href="http://www.photofront.ch/lightbox.php?lightbox_id=6c92dcb37bc7e3c6c77f868b2a8b73ca">Lightbox1</a>
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.
The download link doesn't work !
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.
multilightboxes v1.03.zip (3.31 KB - downloaded 137 times.)
I'd like to show the name of the lightbox, defined in the lightbox settings.
$lang['lightbox'] = "lightbox";
would not be needed any more.And in the titel (orange bar) you see the word "Album". That is the text defines in main.php for $lang['lightbox'] = "Album";
<font color="#353535">{lang_lightbox}
$lightbox_name = stripslashes($row['lightbox_name'])." (".$row['user_name'].")";
$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) . ") " : "";
if (isset($lightbox_name) && !empty($lightbox_name)) {
$lightbox_name_for_all = $lightbox_name;
}
"lang_lightbox" => $lang['lightbox'],
"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'],
$lang['lightbox'] = "Album";
$lang['lightbox'] = "Album of: {lightbox_name}";
$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) . ") " : "";
$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) : "";
{if user_loggedin}Delete Link{endif user_loggedin}
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
<tr>
<td height="20" width="55%">
<font color="#353535">{lang_lightbox}
</td>
<td height="20" width="500" align="right" >
{if url_lightbox_manage}
<img border="0" src="./picture_library/pfeil.gif"> <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>
... 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
... 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.
... 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:
... es noch mehr Infos nötig ...
Du kannst in eine 1.8.0 schauen :wink:
... 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 ...
... aber das Text-Editieren in einer thumbnail_bit.html wird problematisch ...
... und bitte auf die Zehen treten ... ;)
... na dann werde ich mal einen Schlachtplan entwickeln, der dann umzusetzen wäre ...
... und bitte auf die Zehen treten ... ;)
... aber das Text-Editieren in einer thumbnail_bit.html wird problematisch ...
Und, hat vieleicht jemand eine Übersetzung von der Lightbox? Also in Deutsch? main.php ?
//-----------------------------------------------------
//--- 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 />» <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ö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 ";
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."'";
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;
}
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.
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>";
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>";
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
$user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;
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
{if lightbox_added}This image is in following lightbox(es): {lightbox_added}{endif lightbox_added}
Notice: Undefined offset: 0 in /home/users2/d/drandrew/domains/skyphotos.ru/includes/functions.php on line 376
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...
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 ;)
{if user_lightbox}
<tr>
<td class="row1"><b>{lang_user_lightbox}</b></td>
<td class="row1">{user_lightbox}</td>
</tr>
{endif user_lightbox}
Thanks for any ideas or thoughts.
Error with deleting photo and refresh ligthbox(for deleting i use [MOD] Batch Copy/Move/Edit Images).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?)
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?)My happen when admin delete photo via ACP.
Now lightboxses are not change: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).
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.
No, sir... Before this line:Really? your code in previous reply speaks otherwise... Check again.
$user_homepage = (isset($user_row['user_homepage'])) ? format_text(format_url($user_row['user_homepage']), 2) : REPLACE_EMPTY;
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...
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.
Notice: Undefined variable: config in C:\Users\***\Desktop\Server\root\includes\sessions.php on line 367
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' )