Author Topic: [FIX] - lightbox.php - delete link  (Read 30220 times)

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[FIX] - lightbox.php - delete link
« on: August 14, 2007, 02:30:01 PM »
In lightbox.php file,

find:

Quote
"lang_delete_lightbox" => $lang['delete_lightbox'],
"url_delete_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php?action=clearlightbox"),

replace:

Quote
"url_delete_lightbox" => (isset($num_rows) && $num_rows > 0) ? $site_sess->url(ROOT_PATH."lightbox.php?action=clearlightbox") : 0,
"num_rows" => (isset($num_rows) && $num_rows > 0) ? (int)$num_rows : 0,

In includes/page_header.php file,

find:

Quote
$msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];

replace:

Quote
$msg = (isset($HTTP_POST_VARS['num_rows']) && $HTTP_POST_VARS['num_rows'] > 0 && clear_lightbox()) ? $lang['lightbox_delete_success'] : redirect($url);

In templates/your_template/lightbox.html file,

find:

Quote
<script language="JavaScript">
                    function clearlightbox() {
                        if (confirm('{lang_delete_lightbox_confirm}')) {
                         location.href = "{url_delete_lightbox}";
                        }
                       }
                    </script>
                        <a href="javascript:clearlightbox()"><b>{lang_delete_lightbox}</b></a>

replace:

Quote
{if num_rows}
                        <script language="JavaScript">
                    function clearlightbox() {
                        if (confirm('{lang_delete_lightbox_confirm}')) {
                         location.href = "{url_delete_lightbox}";
                        }
                       }
                    </script>
                        <form method="post" action="{url_delete_lightbox}">
                        <input type="hidden" name="action" value="clearlightbox">
                        <input type="hidden" name="num_rows" value="{num_rows}">
                        <input type="image" src="{template_image_url}/delete_lightbox.gif" onClick="javascript:clearlightbox()" />
                        </form>
                        {endif num_rows}

Thank to Mawenzi for draw button:

http://www.4homepages.de/forum/index.php?topic=18408.msg98456#msg98456

No show delete lightbox button if quant is 0 + chek for user try to use URL for delete. If num_rows no find, redirect to index.php file. ;)
« Last Edit: August 15, 2007, 12:32:02 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 mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [FIX] - lightbox.php - delete link
« Reply #1 on: August 14, 2007, 02:46:54 PM »
@thunderstrike
... the fix works perfect ... thanks ...
@all
... you can use that fix in 4images version 1.7.0 - 1.7.4 ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [FIX] - lightbox.php - delete link
« Reply #2 on: August 14, 2007, 02:49:03 PM »
Thank Mawenzi.

Suggestion: Use POST form + image button so no URL can use for user. ;)
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: [FIX] - lightbox.php - delete link
« Reply #3 on: August 14, 2007, 04:39:38 PM »
1st topic update. ;)
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: [FIX] - lightbox.php - delete link
« Reply #4 on: August 14, 2007, 11:46:12 PM »
No ide german is diff . . . thank for post.
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 mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [FIX] - lightbox.php - delete link
« Reply #5 on: August 15, 2007, 12:29:42 AM »
@ivan / @all
... I think a better solution is ...
... if you have no different template/images folder or use german lanuage version ...
... use {template_image_url} instead of {template_lang_image_url} ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [FIX] - lightbox.php - delete link
« Reply #6 on: August 15, 2007, 12:32:53 AM »
Done !
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 kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.423
    • View Profile
    • 4images - Image Gallery Management System
Re: [FIX] - lightbox.php - delete link
« Reply #7 on: August 16, 2007, 01:38:40 PM »
@ thunderstrike: Thanks for the quick fix.
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [FIX] - lightbox.php - delete link
« Reply #8 on: August 16, 2007, 01:44:25 PM »
@Kai: Is move to fix place in forum ? :)

http://www.4homepages.de/forum/index.php?board=17.0
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: [FIX] - lightbox.php - delete link
« Reply #9 on: August 16, 2007, 08:05:39 PM »
Is no ... what did ? Same 1st post ... :|

axcept: <input type="submit" name="lightbox_button" class="button" id="lightbox_button" onClick="javascript:clearlightbox()" value="{lang_delete_lightbox}" />
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: [FIX] - lightbox.php - delete link
« Reply #10 on: August 16, 2007, 08:13:56 PM »
Only 1 line change ... rest is same!
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: [FIX] - lightbox.php - delete link
« Reply #11 on: August 16, 2007, 08:25:37 PM »
Should target destination ...  browser use ?
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: [FIX] - lightbox.php - delete link
« Reply #12 on: August 16, 2007, 08:38:56 PM »
I no change JS code ... use same from ZIP lightbox.html file ... JS error ?
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: [FIX] - lightbox.php - delete link
« Reply #13 on: August 16, 2007, 08:46:39 PM »
No get ... JS code say: if confirm ... if no .. should no clear ...
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: [FIX] - lightbox.php - delete link
« Reply #14 on: August 16, 2007, 08:49:55 PM »
I mean ... no reproduce ...
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 ?