Author Topic: disable lightbox feature  (Read 7059 times)

0 Members and 1 Guest are viewing this topic.

Offline joxxxe

  • Pre-Newbie
  • Posts: 8
    • View Profile
disable lightbox feature
« on: September 25, 2007, 09:45:11 PM »
Hello, somebody knows how can i disable lightbox button , i cant find the option in any template, please help. thanx.

Offline joxxxe

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: disable lightbox feature
« Reply #1 on: September 25, 2007, 09:46:33 PM »
je, i found this template

thumbnail_bit.html

and did edit it and all is ok, thanx

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: disable lightbox feature
« Reply #2 on: September 26, 2007, 05:53:05 AM »
Hi,

and don't forget the lightbox-link in the userbox  :wink:

user_logininfo.html
Code: [Select]
      &raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br />

Kurt

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: disable lightbox feature
« Reply #3 on: September 26, 2007, 08:27:26 PM »
I think this need MOD for no play in template ...  :|
Bad for template designer ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: disable lightbox feature
« Reply #4 on: September 26, 2007, 10:24:28 PM »
Is ok - I create.

// Step 1

In includes/page_header.php file,

find:

Quote
"url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),

replace:

Code: [Select]
"url_lightbox" => (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) ? $site_sess->url(ROOT_PATH."lightbox.php") : "",
"use_lightbox" => (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) ? true : false,

Find:

Quote
"lang_lightbox" => $lang['lightbox'],

replace:

Code: [Select]
"lang_lightbox" => (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) ? $lang['lightbox'] : "",

Find:

Quote
//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "removefromlightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "clearlightbox") {
  if ($user_info['user_level'] >= USER) {
    $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}

replace:

Code: [Select]
//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if ($user_info['user_level'] >= USER && defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {
    $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  elseif (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 0) {
    $msg = $lang['lightbox_not_allowed'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "removefromlightbox" && $id) {
  if ($user_info['user_level'] >= USER && defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {
    $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  elseif (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 0) {
    $msg = $lang['lightbox_not_allowed'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "clearlightbox") {
  if ($user_info['user_level'] >= USER && defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {
    $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  elseif (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 0) {
    $msg = $lang['lightbox_not_allowed'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}

// Step 2

In includes/constants.php file,

add top of ?>:

Code: [Select]
define('USE_LIGHTBOX', 1); // 1 for active. 0 for no active.

// Step 3

In includes/functions.php file,

find:

Quote
$num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";

if ($user_info['user_level'] != GUEST) {

replace:

Code: [Select]
$num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";

if ($user_info['user_level'] != GUEST && defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {

Find:

Quote
"lightbox_button" => $lightbox_button,

replace:

Code: [Select]
"lightbox_button" => (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) ? $lightbox_button : "",

// Step 4

In lightbox.php file,

find:

Quote
if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {
  show_error_page($lang['lightbox_register']);
}

add after:

Code: [Select]
if (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 0) {
    show_error_page($lang['lightbox_not_allowed']);
}

// Step 5

In details.php file,

find:

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

replace:

Code: [Select]
if (!empty($user_info['lightbox_image_ids']) && defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {

find:

Quote
if ($mode == "lightbox" && $in_mode) {

replace:

Code: [Select]
if ($mode == "lightbox" && $in_mode && defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {

// Step 6

In download.php file,

find:

Quote
if (!check_download_token($user_info['lightbox_image_ids'])) {
    redirect("index.php");
}

add after:

Code: [Select]
if (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 0) {
      redirect("index.php");
}

// Step 7

In lang/english/main.php file,

find:

Quote
$lang['delete_lightbox_confirm'] = "Do you really want to delete the lightbox?";

add after:

Code: [Select]
$lang['lightbox_not_allowed'] = "Sorry. Lightbox is no active right now. Please check back later.";

// Step 8

In templates/your_template/user_logininfo.html file,

find:

Quote
&raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br />

replace:

Code: [Select]
{if use_lightbox}&raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br />{endif use_lightbox}

// Step 9

In templates/your_template/thumbnail_bit.html file,

find:

Quote
{lightbox_button}

replace:

Code: [Select]
{if use_lightbox}{lightbox_button}{endif use_lightbox}

// Step 10

In includes/sessions.php file,

find:

Quote
if ($user_info) {

add after:

Code: [Select]
if (defined('USE_LIGHTBOX') && USE_LIGHTBOX == 1) {

find:

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

add after:

Code: [Select]
}

This is safe for HTML designer now. You can use {if use_lightbox} {endif use_lightbox} in template and edit includes/constants.php file for active or no active. ;)
« Last Edit: October 02, 2007, 02:38:40 AM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: disable lightbox feature
« Reply #5 on: October 02, 2007, 02:39:15 AM »
Important new step note - do step 10 (includes/sessions.php file).
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?