forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Thu May 24, 2018 5:32 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Sep 22, 2009 11:22 am 
Offline

Joined: Sun Nov 23, 2008 5:44 pm
Posts: 64
Spring 1901 order of Russia was missing.
Code:
diff -r 0ef4f4ebbc43 board/info/orders.php
--- a/board/info/orders.php
+++ b/board/info/orders.php
@@ -183,7 +221,7 @@
 }
 
 if( isset($orderLogs))
-       outputOrderLogs($orderLogs);
+       $buffer .= outputOrderLogs($orderLogs);
 else
        print '<p>No order logs to output</p>';


No index for Diplomacy phase(since its always there and country index/anchor does almost same..), and don't show empty(no orders) retreats and unit-placing phase.
also, I think it would be better if you mark failed orders and dislodges. see example
Code:
diff -r 0ef4f4ebbc43 board/info/orders.php
--- a/board/info/orders.php
+++ b/board/info/orders.php
@@ -79,8 +79,21 @@
 
        foreach($types as $phase=>$orderTypes)
        {
-               $buffer .= '<li>'.orderIndex($phase, 3).'<strong>'.$phase.'</strong></li>
-                       <ul>';
+               if ($phase == 'Diplomacy' ) {
+                       $buffer .= '<li><strong>'.$phase."</strong></li>\n\t\t\t<ul>";
+               } else {
+                       $orderFound=0;
+                       foreach($orderTypes as $t) {
+                               if (array_key_exists($t, $orders)) {
+                                       $orderFound=1;
+                                       break;
+                               }
+                       }
+                       if ($orderFound)
+                               $buffer .= '<li>'.orderIndex($phase, 3).'<strong>'.$phase."</strong></li>\n\t\t\t<ul>";
+                       else
+                               continue;
+               }
 
                foreach($orderTypes as $orderType)
                {
@@ -90,6 +103,9 @@
                        {
                                $buffer .= '<li>';
 
+                               if ($order['dislodged'] == 'Yes' || ($order['success'] == 'No' && $order['type'] != 'hold'))
+                                       $buffer .= '<u>';       // underline failed orders
+
                                if ( $phase == 'Retreats' )
                                {
                                        switch($order['type'])
@@ -123,8 +139,30 @@
                                                ($order['fromTerr'] ? " from ".$order['fromTerr'] : '').
                                                ($order['viaConvoy'] == 'Yes' ? " via convoy" : '');
                                }
+
+                               $buffer .= '.';
 
-                               $buffer .= '.</li>';
+                               if ($order['dislodged'] == 'Yes' || ($order['success'] == 'No' && $order['type'] != 'hold')) {
+                                       $buffer .= '</u>';
+
+                                       if ($order['success'] == 'No') {
+                                               /*
+                                               if ($order['type'] == 'move')   // not sure its good idea to say 'bounce'
+                                                       $buffer .= ' (bounce)';   // when you don't really know cause of failure
+                                               else if ($order['type'] == 'retreat')
+                                                       $buffer .= ' (fail)';
+                                               else if ($order['type'] != 'hold')// supports and convoy
+                                                       $buffer .= ' (cut)';
+                                               */
+                                               if ($order['type'] != 'hold')
+                                                       $buffer .= ' (fail)';
+                                       }
+
+                                       if ($order['dislodged'] == 'Yes')
+                                               $buffer .= ' (dislodged)';
+                               }
+
+                               $buffer .= '</li>';
                        }
                }
 
@@ -137,7 +175,7 @@
 
 print '<h3>Order history</h3>';
 
-$tabl = $DB->sql_tabl("SELECT turn, country, LOWER(unitType) as unitType, LOWER(type) as type, terr, toTerr, fromTerr, viaConvoy
+$tabl = $DB->sql_tabl("SELECT turn, country, LOWER(unitType) as unitType, LOWER(type) as type, terr, toTerr, fromTerr, viaConvoy, success, dislodged
                FROM wD_MovesArchive WHERE gameID = ".$Game->id."
                ORDER BY turn DESC, country ASC");
 
@@ -172,7 +210,7 @@
 
                $buffer .= orderIndex($row['country'], 2);
 
-               $buffer .= '<strong>'.$row['country'].":</strong><br />";
+               $buffer .= '<strong><span class="'.$row['country'].'">'.$row['country']."</span>:</strong><br />";
                $lastCountry = $row['country'];
        }
 


Top
 Profile  
 
PostPosted: Wed Sep 30, 2009 9:41 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Haven't filtered through to see exactly what you did, but I applied the patch and definitely like the results, nicely done


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group