4images Forum & Community
4images Issues / Ausgaben => Feedback & Suggestions => Topic started by: thunderstrike on August 14, 2007, 02:30:01 PM
-
In lightbox.php file,
find:
"lang_delete_lightbox" => $lang['delete_lightbox'],
"url_delete_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php?action=clearlightbox"),
replace:
"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:
$msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
replace:
$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:
<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:
{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. ;)
-
@thunderstrike
... the fix works perfect ... thanks ...
@all
... you can use that fix in 4images version 1.7.0 - 1.7.4 ...
-
Thank Mawenzi.
Suggestion: Use POST form + image button so no URL can use for user. ;)
-
1st topic update. ;)
-
No ide german is diff . . . thank for post.
-
@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} ...
-
Done !
-
@ thunderstrike: Thanks for the quick fix.
-
@Kai: Is move to fix place in forum ? :)
http://www.4homepages.de/forum/index.php?board=17.0
-
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}" />
-
Only 1 line change ... rest is same!
-
Should target destination ... browser use ?
-
I no change JS code ... use same from ZIP lightbox.html file ... JS error ?
-
No get ... JS code say: if confirm ... if no .. should no clear ...
-
I mean ... no reproduce ...
-
In german + code repost ... no get.