[feladat @ 122]
authorrejo
Sun, 17 Feb 2008 15:28:21 +0000
changeset 75 a53200a76f9d
parent 74 43c31dc98305
child 76 0748816801b2
[feladat @ 122] Fixing a number of 'division by zero' errors introduced changeset:121. Changed from constant to a normal variable. May need to be reviewed in a future cleanup.
edit.php
inc/config-me.inc.php
inc/toolkit.inc.php
list_zones.php
users.php
--- a/edit.php	Mon Feb 11 19:52:20 2008 +0000
+++ b/edit.php	Sun Feb 17 15:28:21 2008 +0000
@@ -242,7 +242,7 @@
         </div> <?php // eo div meta ?>
        <div class="showmax">
 <?php
-show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
+show_pages($info["numrec"],$rowamount,$_GET["id"]);
 ?>
         </div> <?php // eo div showmax ?>
          <form action="<?php echo $_SERVER["PHP_SELF"]?>?id=<?php echo $_GET["id"]?>" method="post">
@@ -250,7 +250,7 @@
           <table>
 <?php
 $countinput=0;
-$rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
+$rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,$rowamount);
 if($rec_result != -1)
 {
 ?>
--- a/inc/config-me.inc.php	Mon Feb 11 19:52:20 2008 +0000
+++ b/inc/config-me.inc.php	Sun Feb 17 15:28:21 2008 +0000
@@ -64,9 +64,9 @@
 // will be included, it will be used like: "style/$STYLE.css.php".
 $STYLE = "example";
 
-// $ROWAMOUNT
+// $rowamount
 // Define which rowamount should be used in the listing of records.
-$ROWAMOUNT = 50;
+$rowamount = 50;
 
 /* DNS Record information */
 
--- a/inc/toolkit.inc.php	Mon Feb 11 19:52:20 2008 +0000
+++ b/inc/toolkit.inc.php	Sun Feb 17 15:28:21 2008 +0000
@@ -41,10 +41,9 @@
 /*************
  * Constants *
  *************/
-define(ROWAMOUNT, $ROWAMOUNT);
 
 if (isset($_GET["start"])) {
-   define(ROWSTART, (($_GET["start"] - 1) * ROWAMOUNT));
+   define(ROWSTART, (($_GET["start"] - 1) * $rowamount));
    } else {
    define(ROWSTART, 0);
 }
--- a/list_zones.php	Mon Feb 11 19:52:20 2008 +0000
+++ b/list_zones.php	Sun Feb 17 15:28:21 2008 +0000
@@ -28,10 +28,10 @@
    <h2><?php echo _('List all zones'); ?></h2>
 <?php
         echo "<div class=\"showmax\">";
-        show_pages($doms,ROWAMOUNT);
+        show_pages($doms,$rowamount);
         echo "</div>";
 
-if ($num_all_domains > ROWAMOUNT)
+if ($num_all_domains > $rowamount)
 {
         echo "<div class=\"showmax\">";
         show_letters(LETTERSTART);
@@ -49,10 +49,10 @@
     <tr>
 
 <?php
-if ($num_all_domains < ROWAMOUNT) {
-   $doms = get_domains(0,"all",ROWSTART,ROWAMOUNT);
+if ($num_all_domains < $rowamount) {
+   $doms = get_domains(0,"all",ROWSTART,$rowamount);
 } else {
-   $doms = get_domains(0,LETTERSTART,ROWSTART,ROWAMOUNT);
+   $doms = get_domains(0,LETTERSTART,ROWSTART,$rowamount);
    $num_show_domains = ($doms == -1) ? 0 : count($doms);
 }
 
@@ -108,7 +108,7 @@
    </table>
 
 <?php
-if ($num_all_domains < ROWAMOUNT) {
+if ($num_all_domains < $rowamount) {
 ?>
    <p><?php printf(_('This lists shows all %s zones(s) you have access to.'), $num_all_domains); ?></p>
 <?php
--- a/users.php	Mon Feb 11 19:52:20 2008 +0000
+++ b/users.php	Sun Feb 17 15:28:21 2008 +0000
@@ -81,7 +81,7 @@
         <th><?php echo _('Status'); ?></th>
        </tr>
 <?php
-$users = show_users('',ROWSTART,ROWAMOUNT);
+$users = show_users('',ROWSTART,$rowamount);
 foreach ($users as $c)
 {
         $domains = get_domains_from_userid($c["id"]);
@@ -111,7 +111,7 @@
       <p><?php echo _('Number of users') ;?>: <?php echo count($users); ?>.</p>
       <div class="showmax">
 <?php
-show_pages(count($users),ROWAMOUNT);
+show_pages(count($users),$rowamount);
 ?>
       </div> <?php // eo div showmax ?>