Skip to content

Commit

Permalink
Uploaded Correct MySql file, Add Blog editor to the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenland committed Jul 18, 2011
1 parent 8ddd2fa commit 09442cd
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 41 deletions.
29 changes: 14 additions & 15 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ body{
ubuntu;
}

a{
color:#FFF;
font-weight:bold;
font-size:1.3em;
}
a:hover{
color:#E0E411;
}

#art-main, table
{
font-family: ubuntu, Arial, Helvetica, Sans-Serif;
Expand Down Expand Up @@ -278,7 +269,7 @@ div.art-header
margin: 0 auto;
position: relative;
width:800px;
height: 104px;
height: 106px;
overflow: hidden;
margin-top: 20px;
margin-bottom: -3px;
Expand Down Expand Up @@ -1822,8 +1813,8 @@ div.userInfo {
font-family:ubuntu, Arial, Helvetica, sans-serif;
float:right;
text-align:left;
padding:.2em 1em 0 1.2em;
color:#FFF;
padding:1em 1em 0 1.2em;
color:#6a8397;
}

span.userText{
Expand All @@ -1833,13 +1824,16 @@ span.userText{

/*--User Panel / Text--*/
span.bitcoinWorth{
color: #F1ED05;
/*color: #F1ED05;*/
color:#000;
}
span.estimated{
color:#F1ED05;
/*color:#F1ED05;*/
color:#000;
}
span.unconfirmed{
color:#E0E411;
/*color:#E0E411;*/
color:#000;
}

span.confirmedBalance{
Expand Down Expand Up @@ -1882,3 +1876,8 @@ p.footerText{
font-family: ubuntu;
src: url('/css/fonts/Ubuntu-BI.ttf');
}

.socialBar{
text-align:center;
margin:0 auto;
}
Binary file modified images/Bottom_texture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/contentBox/footer_float.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/contentBox/footer_float.png.background
Binary file not shown.
Binary file modified images/contentBox/headerTcenter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/contentBox/headerTleft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/contentBox/headerTright.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/footer-repeat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/header.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/header.jpg.yep
Binary file not shown.
Binary file modified images/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/header.png.yep
Binary file not shown.
Binary file modified images/nav.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/primaryContentBackground.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions includes/graphs_poolstats.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$poolArray = '';
$userTotalArray = '';
$timeHashArray = '';
$userEfficiencyArray = '';

//Generate pool array from last fifteen mintutes of data
$i = 0;
Expand Down Expand Up @@ -44,14 +45,19 @@
//Add divider(if neccessary)
if($i > 1){
$userTotalArray .= ',';
$userEfficiencyArray .= ',';
}

//Query total mining powa at this timestamp
$miningPowa = mysql_query('SELECT SUM(mhashes) AS `UserTotal` FROM `stats_userMHashHistory` WHERE `username` LIKE "'.$getCredientials->username.'.%" AND `timestamp` = "'.$poolStat["timestamp"].'"');
$miningPowa = mysql_query('SELECT SUM(mhashes) AS `UserTotal` FROM `stats_userMHashHistory` WHERE `username` LIKE "'.$getCredientials->username.'.%" AND `timestamp` = "'.$poolStat["timestamp"].'"')or die(mysql_error());
$miningPowaObj = mysql_fetch_object($miningPowa);

//Query total efficiency at this timestamp
$totalEfficenyQ = mysql_query('SELECT SUM(efficiency) as `TotalEfficency` FROM `stats_userMHashHistory` WHERE `username` LIKE "'.$getCredientials->username.'.%" AND `timestamp` = "'.$poolStat["timestamp"].'"')or die(mysql_error());
$totalEfficenyObj = mysql_fetch_object($totalEfficenyQ);
//Add data to graph
$userTotalArray .= $miningPowaObj->UserTotal;
$userEfficiencyArray .= $totalEfficenyObj->TotalEfficency;


}
Expand Down Expand Up @@ -91,16 +97,16 @@
}
},
series: [{
name: 'Pool ',
name: 'Total Pool',
data: [<?php echo $poolArray; ?>]
},
<?php if($userTotalArray != ''){?>
{
name: 'Pool Valid Shares',
data: [<?php echo $poolArray; ?>]
name: 'Your Total Worker efficiency in %',
data: [<?php echo $userEfficiencyArray; ?>]
}
<?php if($userTotalArray != ''){?>
,{
name: 'Total User',
name: 'Total User Megahashes',
data: [<?php echo $userTotalArray;?>]
}
<?php } ?>]
Expand Down
100 changes: 89 additions & 11 deletions miningfarm_database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 17, 2011 at 04:39 PM
-- Generation Time: Jul 18, 2011 at 12:58 PM
-- Server version: 5.1.41
-- PHP Version: 5.3.2-1ubuntu4.9

Expand Down Expand Up @@ -33,7 +33,15 @@ CREATE TABLE IF NOT EXISTS `accountBalance` (
`threshhold` varchar(5) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `userId` (`userId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `accountBalance`
--

INSERT INTO `accountBalance` (`id`, `userId`, `balance`, `payoutAddress`, `threshhold`) VALUES
(1, 1, '0.00', '', ''),
(2, 2, '0.00', '', '');

-- --------------------------------------------------------

Expand All @@ -49,6 +57,13 @@ CREATE TABLE IF NOT EXISTS `blogPosts` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `blogPosts`
--

INSERT INTO `blogPosts` (`id`, `timestamp`, `title`, `message`) VALUES
(4, 0, 'What we do?', '<div style="float:left;">\r\n<iframe width="360" height="224" src="http://www.youtube.com/embed/Um63OQz3bjo" frameborder="0" allowfullscreen></iframe>\r\n</div>\r\n<div style="padding:1em 1em 1em 1em;">\r\nFirst off welcome to the "Mining Farm" you can run your computer to mine an Internet Commodity known as "Bitcoins". These <i>Bitcoins</i> can be used to purchase many things such as Alpaca socks, Webhosting, or even VOIP phone services, the list goes on.<br/><br/>\r\n\r\nWikipedia explains bitcoins a little bit better by stating: Bitcoin enables rapid payments (and micropayments) at very low cost, and avoids the need for central authorities and issuers. Digitally signed transactions, with one node signing over some amount of the currency to another node, are broadcast to all nodes in a peer-to-peer network. A proof-of-work system is used as measurement against double-spending and initial currency distribution mechanism.<br/>\r\n<a href="http://en.wikipedia.org/wiki/Bitcoin" target="_BLANK">WikiePedia Source</a>\r\n</div>');

-- --------------------------------------------------------

--
Expand All @@ -64,6 +79,15 @@ CREATE TABLE IF NOT EXISTS `donationList` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `donationList`
--

INSERT INTO `donationList` (`id`, `locked`, `display`, `bitcoinAddress`, `coinAddresstype`) VALUES
(2, 1, 'Mining Farm (The software this website runs off of)', 'MwSnUuXvrsfa35BSGMhUymtWUkXKSnJie9', 2),
(3, 1, 'Mining Farm (The website software you are using)', '1Fc2ScswXAHPUgj3qzmbRmwWJSLL2yv8Q', 1),
(4, 1, 'RedCross', '1HRQGDVYvQAkVh5xJetKeNfdKYWcx62cKt', 1);

-- --------------------------------------------------------

--
Expand All @@ -79,7 +103,23 @@ CREATE TABLE IF NOT EXISTS `menuAddition` (
`requireAdmin` int(1) NOT NULL,
`order` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;

--
-- Dumping data for table `menuAddition`
--

INSERT INTO `menuAddition` (`id`, `displayTitle`, `url`, `matches`, `requireLogin`, `requireAdmin`, `order`) VALUES
(1, 'Welcome', '/', 'index.php, /', 0, 0, 1),
(2, 'Account Details', '/accountDetails.php', '/accountDetails.php', 1, 0, 3),
(3, 'Statistics', '/stats.php', '/stats.php', 0, 0, 2),
(4, 'Administration', '/adminPanel.php', '/adminPanel.php', 1, 1, 4),
(5, 'User Privileges', '/adminPanel.php?show=editUsers', '/adminPanel.php?show=editUsers', 1, 1, 5),
(6, 'Workers', '/workers.php', '/workers.php', 1, 0, 7),
(8, 'Download 5.0.5', 'https://github.com/Xenland/MiningFarm/tarball/master', '', 0, 0, 11),
(9, 'Git Hub', 'https://github.com/Xenland/MiningFarm', '', 0, 0, 12),
(11, 'Blog Editor', '/adminPanel.php?show=blogEditor', '/adminPanel.php?show=blogEditor', 1, 1, 12),
(12, 'Forums', '/smf', '', 0, 0, 14);

-- --------------------------------------------------------

Expand All @@ -96,8 +136,11 @@ CREATE TABLE IF NOT EXISTS `networkBlocks` (
`orphan` int(1) NOT NULL,
`serverFeeCollected` int(1) NOT NULL COMMENT 'Lets blockFound.php know that the server fee was collected from this block to prevent multiple server fee collections',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=65 ;

--
-- Dumping data for table `networkBlocks`
--
-- --------------------------------------------------------

--
Expand All @@ -113,6 +156,10 @@ CREATE TABLE IF NOT EXISTS `pool_worker` (
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `pool_worker`
--

-- --------------------------------------------------------

--
Expand All @@ -130,8 +177,11 @@ CREATE TABLE IF NOT EXISTS `shares` (
`reason` varchar(50) DEFAULT NULL,
`solution` varchar(257) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1096 ;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1471 ;

--
-- Dumping data for table `shares`
--
-- --------------------------------------------------------

--
Expand All @@ -151,6 +201,11 @@ CREATE TABLE IF NOT EXISTS `shares_dead` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `shares_dead`
--


-- --------------------------------------------------------

--
Expand All @@ -171,6 +226,11 @@ CREATE TABLE IF NOT EXISTS `shares_history` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3013357 ;

--
-- Dumping data for table `shares_history`
--


-- --------------------------------------------------------

--
Expand All @@ -183,8 +243,11 @@ CREATE TABLE IF NOT EXISTS `stats_bitcoinConversionHistory` (
`mtgox` int(5) NOT NULL,
`timestamp` int(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=404 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=498 ;

--
-- Dumping data for table `stats_bitcoinConversionHistory`
--
-- --------------------------------------------------------

--
Expand All @@ -198,8 +261,11 @@ CREATE TABLE IF NOT EXISTS `stats_poolMHashHistory` (
`totalValidShares` int(255) NOT NULL,
`timestamp` int(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=957 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2184 ;

--
-- Dumping data for table `stats_poolMHashHistory`
--
-- --------------------------------------------------------

--
Expand All @@ -213,8 +279,11 @@ CREATE TABLE IF NOT EXISTS `stats_userMHashHistory` (
`efficiency` varchar(5) NOT NULL,
`timestamp` int(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3477 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4704 ;

--
-- Dumping data for table `stats_userMHashHistory`
--
-- --------------------------------------------------------

--
Expand All @@ -236,8 +305,13 @@ CREATE TABLE IF NOT EXISTS `websiteSettings` (
`enableRequiredEmail` int(1) NOT NULL COMMENT 'Boolean for enabled emails to be authorized',
`coinType` int(3) NOT NULL COMMENT '1=Bitcoin website; 2 = namecoind website'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `websiteSettings` (`noreplyEmail`, `confirmEmailPrefix`, `browserTitle`, `cashoutMinimum`, `serverFeePercentage`, `serverFeeRemoteAddress`, `serverFeeAccountBalance`, `tradeHillWorth`, `mtgoxWorth`, `currencyData`, `stats_showallusers`, `enableRequiredEmail`) VALUES
('[email protected]', 'Welcome to the Pool, You must activate your account before we can progress you any further. Click the link below and type in your credentials(if necessary) then we should be able to activate your account from there and start mining miners. :)\\n', 'Running Mining Farm By MIningFarm.com', '0.02', '1', '', '0', '13.98', '0', 'tradehill-USD', 1, 0);

--
-- Dumping data for table `websiteSettings`
--

INSERT INTO `websiteSettings` (`noreplyEmail`, `confirmEmailPrefix`, `browserTitle`, `cashoutMinimum`, `serverFeePercentage`, `serverFeeRemoteAddress`, `serverFeeAccountBalance`, `tradeHillWorth`, `mtgoxWorth`, `currencyData`, `stats_showallusers`, `enableRequiredEmail`, `coinType`) VALUES
('[email protected]', 'Welcome to the Pool, You must activate your account before we can progress you any further. Click the link below and type in your credentials(if necessary) then we should be able to activate your account from there and start mining miners. :)\\n', 'Mining Farm Official Vendor website', '0.02', '1', '', '211', '12.58', '0', 'btc', 1, 0, 2);

-- --------------------------------------------------------

Expand All @@ -262,4 +336,8 @@ CREATE TABLE IF NOT EXISTS `websiteUsers` (
`failedLoginTimestampLock` int(255) NOT NULL COMMENT 'Epoch time until user is allowed access to page',
`apiToken` varchar(64) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `websiteUsers`
--
10 changes: 5 additions & 5 deletions req/config.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
//Fit to your need variables // These should be the only variables you need to edit
$mysqlUsername = "root";
$mysqlPassword = "13linux13";
$mysqlUsername = "miningfarm";
$mysqlPassword = "fuckthat";
$mysqlDatabase = "miningfarm";
$mysqlHost = "localhost";
$mysqlHost = "216.38.17.198";

//Linkage
$header = $req."header.php";
Expand All @@ -21,7 +21,7 @@

//Bitcoind RPC information
$rpcType = "http";
$rpcUsername = "bitcoins";
$rpcPassword = "lolsalad";
$rpcUsername = "Jl87sibgK29BN3";
$rpcPassword = "9dj4dsdjYbn";
$rpcHost = "127.0.0.1:8362";
?>
9 changes: 5 additions & 4 deletions req/cronjob/statsUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@

//Get efficiency
$efficienctSharesQ = mysql_query("SELECT `id` FROM `shares` WHERE `username` = '".$worker["username"]."' AND `epochTimestamp` >= $fifteenMinutesAgo AND `our_result` = 'Y'");
$inefficienctSharesQ = mysql_query("SELECT `id` FROM `shares` WHERE `username` = '".$worker["username"]."' AND `epochTimestamp` >= $fifteenMinutesAgo AND `our_result` = 'N'");
$totalSharesQ = mysql_query("SELECT `id` FROM `shares` WHERE `username` = '".$worker["username"]."' AND `epochTimestamp` >= $fifteenMinutesAgo");

$numEfficient = mysql_num_rows($efficientSharesQ);
$numIneffecient = mysql_num_rows($ineffiecientSharesQ);
$numEfficient = mysql_num_rows($efficienctSharesQ);
$totalShares = mysql_num_rows($totalSharesQ);

$efficency = $numEfficient/($numEfficient+$numIneffecient);
//Efficency = (Valid Shares / Total Shares ) * 100%
$efficency = ($numEfficient/$totalShares)*100;

//Insert into database
mysql_query("INSERT INTO `stats_userMHashHistory` (`username`, `mhashes`, `efficiency`, `timestamp`) VALUES('".$worker["username"]."', '".$hashesPerSecond."', '".$efficency."', '".$recordedTime."')")or die(mysql_error());
Expand Down

0 comments on commit 09442cd

Please sign in to comment.