diff options
author | z0rglub <z0rglub@piwigo.org> | 2003-05-21 17:46:57 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2003-05-21 17:46:57 +0000 |
commit | df0d5d19054bca46a2bcc2f9d8bee136ffa8c8ad (patch) | |
tree | 32b1bba469ba6408efcdbc8e520a4481bff82fc4 | |
parent | aac81a8a382f7ec527e22d6dee959400d77e1a21 (diff) |
*** empty log message ***
git-svn-id: http://piwigo.org/svn/trunk@15 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/infos_images.php | 3 | ||||
-rw-r--r-- | include/functions.inc.php | 32 | ||||
-rw-r--r-- | template/default/admin/edit_cat.vtp | 48 | ||||
-rw-r--r-- | template/default/admin/infos_image.vtp | 58 |
4 files changed, 132 insertions, 9 deletions
diff --git a/admin/infos_images.php b/admin/infos_images.php index 92a7a3885..546234189 100644 --- a/admin/infos_images.php +++ b/admin/infos_images.php @@ -163,7 +163,8 @@ if ( isset( $page['cat'] ) ) if ( is_numeric( $_GET['num'] ) and $_GET['num'] >= 0 ) { - $page['start'] = floor( $_GET['num'] / $page['nb_image_page'] ) * $page['nb_image_page']; + $page['start'] = + floor( $_GET['num'] / $page['nb_image_page'] ) * $page['nb_image_page']; } // retrieving category information $result = get_cat_info( $page['cat'] ); diff --git a/include/functions.inc.php b/include/functions.inc.php index 41611df86..5ff119f29 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -101,23 +101,39 @@ function get_elapsed_time( $start, $end ) // - This function was created because IE5 does not respect the // CSS "white-space: nowrap;" property unless space and minus // characters are replaced like this function does. +// - Example : +// <div class="foo">My friend</div> +// ( 01234567891111111111222222222233 ) +// ( 0123456789012345678901 ) +// becomes : +// <div class="foo">My friend</div> function replace_space( $string ) { - //return $string; - $return_string = ""; + //return $string; + $return_string = ''; + // $remaining is the rest of the string where to replace spaces characters $remaining = $string; - + // $start represents the position of the next '<' character + // $end represents the position of the next '>' character $start = 0; $end = 0; - $start = strpos ( $remaining, '<' ); - $end = strpos ( $remaining, '>' ); + $start = strpos ( $remaining, '<' ); // -> 0 + $end = strpos ( $remaining, '>' ); // -> 16 + // as long as a '<' and his friend '>' are found, we loop while ( is_numeric( $start ) and is_numeric( $end ) ) { + // $treatment is the part of the string to treat + // In the first loop of our example, this variable is empty, but in the + // second loop, it equals 'My friend' $treatment = substr ( $remaining, 0, $start ); + // Replacement of ' ' by his equivalent ' ' $treatment = str_replace( ' ', ' ', $treatment ); $treatment = str_replace( '-', '−', $treatment ); - $return_string.= $treatment.substr ( $remaining, $start, - $end - $start + 1 ); + // composing the string to return by adding the treated string and the + // following HTML tag -> 'My friend</div>' + $return_string.= $treatment.substr( $remaining, $start, $end-$start+1 ); + // the remaining string is deplaced to the part after the '>' of this + // loop $remaining = substr ( $remaining, $end + 1, strlen( $remaining ) ); $start = strpos ( $remaining, '<' ); $end = strpos ( $remaining, '>' ); @@ -125,7 +141,7 @@ function replace_space( $string ) $treatment = str_replace( ' ', ' ', $remaining ); $treatment = str_replace( '-', '−', $treatment ); $return_string.= $treatment; - + return $return_string; } diff --git a/template/default/admin/edit_cat.vtp b/template/default/admin/edit_cat.vtp new file mode 100644 index 000000000..56ec99505 --- /dev/null +++ b/template/default/admin/edit_cat.vtp @@ -0,0 +1,48 @@ +<!--VTP_confirmation--> +<div style="color:red;text-align:center;"> + {#editcat_confirm} [ <a href="{#back_url}">{#editcat_back}</a> ]</div> +<!--/VTP_confirmation--> +<form action="{#form_action}" method="post"> + <table style="width:100%;"> + <tr> + <th colspan="2">{#editcat_title1} "{#cat:name}" [ {#cat:dir} ]</th> + </tr> + <!--VTP_server--> + <tr> + <td style="width:20%;">{#remote_site}</td> + <td class="row2">{#url}</td> + </tr> + <!--/VTP_server--> + <tr> + <td style="width:20%;">{#editcat_name}</td> + <td class="row2"> + <input type="text" name="name" value="{#name}" maxlength="255"/> + </td> + </tr> + <tr> + <td style="width:20%;">{#editcat_comment}</td> + <td class="row2"> + <textarea name="comment" rows="5" cols="50" style="overflow:auto">{#comment}</textarea> + </td> + </tr> + <tr> + <td style="width:20%;">{#editcat_status}</td> + <td class="row2"> + <select name="status"> + <!--VTP_status_option--> + <option{#selected}>{#option}</option> + <!--/VTP_status_option--> + </select> + {#editcat_status_info} + </td> + </tr> + <tr> + <td colspan="2"> </td> + </tr> + <tr> + <td colspan="2" align="center"> + <input type="submit" name="submit" value="{#submit}" /> + </td> + </tr> + </table> +</form>
\ No newline at end of file diff --git a/template/default/admin/infos_image.vtp b/template/default/admin/infos_image.vtp new file mode 100644 index 000000000..c6f3db7f1 --- /dev/null +++ b/template/default/admin/infos_image.vtp @@ -0,0 +1,58 @@ +<form method="post" action="{#form_action}"> + <table width="100%"> + <tr> + <th colspan="3">{#infoimage_general} "{#cat_name}"</th> + </tr> + <tr> + <td><div style="margin-left:50px;">{#author}</div></td> + <td style="text-align:center;"> + <input type="text" name="author_cat" value="" maxlength="255" /> + </td> + <td style="text-align:left;"> + <input type="checkbox" name="use_common_author" value="1" /> + {#infoimage_useforall} + </td> + </tr> + <tr> + <td> + <div style="margin-left:50px;">{#infoimage_creation_date} [DD/MM/YYYY]</div> + </td> + <td style="text-align:center;"> + <input type="text" name="date_creation_cat" value="" size="12" maxlength="10"/> + </td> + <td style="text-align:left;"> + <input type="checkbox" name="use_common_date_creation" value="1" /> + {#infoimage_useforall} + </td> + </tr> + </table> + <table width="100%"> + <tr> + <th colspan="5">{#infoimage_detailed}</th> + </tr> + <tr> + <td colspan="5" align="center">{#navigation_bar}</td> + </tr> + <tr> + <td class="row2" style="text-align:center;">{#thumbnail}</td> + <td class="row2" style="text-align:center;">{#infoimage_title}</td> + <td class="row2" style="text-align:center;">{#author}</td> + <td class="row2" style="text-align:center;">{#infoimage_comment}</td> + <td class="row2" style="text-align:center;">{#infoimage_creation_date}</td> + </tr> + <!--VTP_picture--> + <tr> + <td style="text-align:center;"><a name="{#link}"><img src="{#thumbnail_url}" alt="" class="miniature" title="{#filename}" /></td> + <td style="text-align:center;">{#default_name}<br /><input type="text" name="name-{#id}" value="{#name}" maxlength="255"/></td> + <td style="text-align:center;"><input type="text" name="author-{#id}" value="{#author}" maxlength="255"/></td> + <td style="text-align:center;"><textarea name="comment-{#id}" rows="3" cols="40" style="overflow:auto">{#comment}</textarea></td> + <td style="text-align:center;"><input type="text" name="date_creation-{#id}" value="{#date_creation}" maxlength="10" size="12" /></td> + </tr> + <!--/VTP_picture--> + <tr> + <td colspan="5" style="text-align:center;"> + <input type="submit" value="{#submit}" name="submit" /> + </td> + </tr> + </table> +</form>
\ No newline at end of file |