Bitcoin Forum
November 07, 2024, 12:40:54 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CallmeJake BlockCrawler removing Network H/s  (Read 1755 times)
rikkejohn (OP)
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
September 11, 2014, 10:49:32 PM
 #1

I would appreciate a response to this. does anyone know how to remove the function getnetworkhashps?

Basically, so it does not appear on the Crawler.

I've tried doing it, but I seem to slice off the right hand side of the Crawler, so get no information.

The reason I am asking is I do not have that function as an rpc call, so it just shows up as "error", which looks pretty stupid.

Sorry to post the whole file, but if anyone answers, it might be that they spot it right away without ever having used the BC


____________


<?php

   require_once ("bc_daemon.php");
   require_once ("bc_layout.php");
   
   
//   If a block hash was provided the block detail is shown
   if (isset ($_REQUEST["block_hash"]))
   {
      site_header ("Block Detail Page");
      
      block_detail ($_REQUEST["block_hash"], TRUE);
   }
   
//   If a block height is provided the block detail is shown
   elseif (isset ($_REQUEST["block_height"]))
   {
      site_header ("Block Detail Page");
      
      block_detail ($_REQUEST["block_height"]);
   }
   
//   If a TXid was provided the TX Detail is shown
   elseif (isset ($_REQUEST["transaction"]))
   {
      site_header ("Transaction Detail Page");
      
      tx_detail ($_REQUEST["transaction"]);
   }
   
//   If there were no request parameters the menu is shown
   else
   {
      site_header ("Block Crawler Home Page");
      
      echo "   <div id=\"node_info\">\n";
      echo "\n";
      
      $network_info = getinfo ();
      
      echo "      <div class=\"node_detail\">\n";
      echo "         <span class=\"node_desc\">Block Count:</span><br>\n";
      echo "         ".$network_info["blocks"]."\n";
      echo "      </div>\n";
      echo "\n";

      echo "      <div class=\"node_detail\">\n";
      echo "         <span class=\"node_desc\">Difficulty:</span><br>\n";
      echo "         ".$network_info["difficulty"]."\n";
      echo "      </div>\n";
      echo "\n";

      echo "      <div class=\"node_detail\">\n";
      echo "         <span class=\"node_desc\">Connections:</span><br>\n";
      echo "         ".$network_info["connections"]."\n";
      echo "      </div>\n";
      echo "\n";

      $net_speed = getnetworkhashps ();
      
      if ($net_speed != "")
      {
         echo "      <div class=\"node_detail\">\n";
         echo "         <span class=\"node_desc\">Network H/s:</span><br>\n";
         echo "         ".$net_speed."\n";
         echo "      </div>\n";
         echo "\n";
      }
      
      echo "   </div>\n";
      echo "\n";

      echo "   <div id=\"site_menu\">\n";
      echo "\n";
      
      echo "      <div class=\"menu_item\">\n";
      echo "         <span class=\"menu_desc\">Enter a Block Index / Height</span><br>\n";
      echo "         <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
      echo "            <input type=\"text\" name=\"block_height\" size=\"40\">\n";
      echo "            <input type=\"submit\" name=\"submit\" value=\"Jump To Block\">\n";
      echo "         </form>\n";
      echo "      </div>\n";
      echo "\n";

      echo "      <div class=\"menu_item\">\n";
      echo "         <span class=\"menu_desc\">Enter A Block Hash</span><br>\n";
      echo "         <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
      echo "            <input type=\"text\" name=\"block_hash\" size=\"40\">\n";
      echo "            <input type=\"submit\" name=\"submit\" value=\"Jump To Block\">\n";
      echo "         </form>\n";
      echo "      </div>\n";
      echo "\n";

      echo "      <div class=\"menu_item\">\n";
      echo "         <span class=\"menu_desc\">Enter A Transaction ID</span><br>\n";
      echo "         <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
      echo "            <input type=\"text\" name=\"transaction\" size=\"40\">\n";
      echo "               <input type=\"submit\" name=\"submit\" value=\"Jump To TX\">\n";
      echo "         </form>\n";
      echo "      </div>\n";
      echo "\n";

      echo "   </div>\n";
      echo "\n";
   }
   
   
   site_footer ();

1PkwpyTLo5TfagzCPgjdvQFNVzuEyHViGt
Willisius
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250

I'm really quite sane!


View Profile
September 12, 2014, 01:35:11 AM
 #2

Can't you just do this? (Look for the long strings of asterisks)

Code:
<?php

require_once (
"bc_daemon.php");
require_once ("bc_layout.php");


// If a block hash was provided the block detail is shown
if (isset ($_REQUEST["block_hash"]))
{
site_header ("Block Detail Page");

block_detail ($_REQUEST["block_hash"], TRUE);
}

// If a block height is provided the block detail is shown
elseif (isset ($_REQUEST["block_height"]))
{
site_header ("Block Detail Page");

block_detail ($_REQUEST["block_height"]);
}

// If a TXid was provided the TX Detail is shown
elseif (isset ($_REQUEST["transaction"]))
{
site_header ("Transaction Detail Page");

tx_detail ($_REQUEST["transaction"]);
}

// If there were no request parameters the menu is shown
else
{
site_header ("Block Crawler Home Page");

echo " <div id=\"node_info\">\n";
echo "\n";

$network_info getinfo ();

echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Block Count:</span><br>\n";
echo " ".$network_info["blocks"]."\n";
echo " </div>\n";
echo "\n";

echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Difficulty:</span><br>\n";
echo " ".$network_info["difficulty"]."\n";
echo " </div>\n";
echo "\n";

echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Connections:</span><br>\n";
echo " ".$network_info["connections"]."\n";
echo " </div>\n";
echo "\n";
                
//******************************************************************/
                //Cut below here
                //******************************************************************/
[b]$net_speed getnetworkhashps ();[/b]

if ($net_speed != "")
{
echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Network H/s:</span><br>\n";
echo " ".$net_speed."\n";
echo " </div>\n";
echo "\n";
}
//******************************************************************/
                //Cut above here
                //******************************************************************/
echo " </div>\n";
echo "\n";

echo " <div id=\"site_menu\">\n";
echo "\n";

echo " <div class=\"menu_item\">\n";
echo " <span class=\"menu_desc\">Enter a Block Index / Height</span><br>\n";
echo " <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
echo " <input type=\"text\" name=\"block_height\" size=\"40\">\n";
echo " <input type=\"submit\" name=\"submit\" value=\"Jump To Block\">\n";
echo " </form>\n";
echo " </div>\n";
echo "\n";

echo " <div class=\"menu_item\">\n";
echo " <span class=\"menu_desc\">Enter A Block Hash</span><br>\n";
echo " <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
echo " <input type=\"text\" name=\"block_hash\" size=\"40\">\n";
echo " <input type=\"submit\" name=\"submit\" value=\"Jump To Block\">\n";
echo " </form>\n";
echo " </div>\n";
echo "\n";

echo " <div class=\"menu_item\">\n";
echo " <span class=\"menu_desc\">Enter A Transaction ID</span><br>\n";
echo " <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
echo " <input type=\"text\" name=\"transaction\" size=\"40\">\n";
echo " <input type=\"submit\" name=\"submit\" value=\"Jump To TX\">\n";
echo " </form>\n";
echo " </div>\n";
echo "\n";

echo " </div>\n";
echo "\n";
}


site_footer ();
Blazr2
Full Member
***
Offline Offline

Activity: 218
Merit: 115



View Profile
September 12, 2014, 03:49:49 AM
 #3

We second what Willisius says; but rather than cut we just // those lines out.
rikkejohn (OP)
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
September 15, 2014, 04:18:53 PM
 #4

Thank you, Willisius, you are right.

I really appreciate your help.

1PkwpyTLo5TfagzCPgjdvQFNVzuEyHViGt
rikkejohn (OP)
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
September 15, 2014, 04:20:06 PM
 #5

We second what Willisius says; but rather than cut we just // those lines out.

I was trying with the // but I must have always gone too far, or missed one out. :-)

1PkwpyTLo5TfagzCPgjdvQFNVzuEyHViGt
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!