Merge pull request #1814 from nrpatten/next

[ADD] IRC chat, Edit Donors
This commit is contained in:
Sebastian Grewe 2014-02-24 11:23:30 +01:00
commit 2fc9056a7b
9 changed files with 69 additions and 23 deletions

View File

@ -250,6 +250,13 @@ $aSettings['acl'][] = array(
'name' => 'acl_contactform', 'value' => $setting->getValue('acl_contactform'),
'tooltip' => 'Make the contactform private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Live Chat Page', 'type' => 'select',
'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ),
'default' => 2,
'name' => 'acl_chat_page', 'value' => $setting->getValue('acl_chat_page'),
'tooltip' => 'Make the chat page private (users only) or public.'
);
$aSettings['system'][] = array(
'display' => 'E-mail address for system error notifications', 'type' => 'text',
'size' => 25,
@ -341,6 +348,13 @@ $aSettings['system'][] = array(
'name' => 'disable_transactionsummary', 'value' => $setting->getValue('disable_transactionsummary'),
'tooltip' => 'Disable transaction summaries. Helpful with large transaction tables.'
);
$aSettings['system'][] = array(
'display' => 'IRC Chat Channel', 'type' => 'text',
'size' => 25,
'default' => '#lazypoolop',
'name' => 'system_irc_chat', 'value' => $setting->getValue('system_irc_chat'),
'tooltip' => 'Your IRC support channel name.'
);
$aSettings['recaptcha'][] = array(
'display' => 'Enable re-Captcha', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),

View File

@ -0,0 +1,20 @@
<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
// ACL check
switch($setting->getValue('acl_chat_page', 2)) {
case '0':
if ($user->isAuthenticated()) {
$smarty->assign('CHATROOM', $setting->getValue('system_irc_chat', '#lazypoolop'));
$smarty->assign("CONTENT", "default.tpl");
}
break;
case '1':
$smarty->assign('CHATROOM', $setting->getValue('system_irc_chat', '#lazypoolop'));
$smarty->assign("CONTENT", "default.tpl");
break;
case '2':
$_SESSION['POPUP'][] = array('CONTENT' => 'Page currently disabled. Please try again later.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "disabled.tpl");
break;
}

View File

@ -124,6 +124,7 @@ $aGlobal['acl']['graphs']['statistics'] = $setting->getValue('acl_graphs_statist
$aGlobal['acl']['donors']['page'] = $setting->getValue('acl_donors_page');
$aGlobal['acl']['about']['page'] = $setting->getValue('acl_about_page');
$aGlobal['acl']['contactform'] = $setting->getValue('acl_contactform');
$aGlobal['acl']['chat']['page'] = $setting->getValue('acl_chat_page', 2);
// We don't want these session infos cached
if (@$_SESSION['USERDATA']['id']) {

View File

@ -449,7 +449,7 @@ margin-bottom: 8px}
.tablesorter, .tablesorterpager {
width: 100%;
margin: -5px 0 0 0;
margin: -4px 0 0 0;
}
.tablesorter td, .tablesorterpager td{

View File

@ -0,0 +1,9 @@
<h4 class="info">If you have your own irc client feel free to connect to our channel @ <b>IRC.FREENODE.NET {$CHATROOM|default:"#lazypoolop"}</b></h4>
<article class="module width_full">
<header><h3>Web Chat</h3></header>
<div class="module_content">
<table width="100%">
<iframe src="https://webchat.freenode.net/?channels={$CHATROOM|default:"#lazypoolop"}" height="768" width="100%"></iframe>
</table>
</div>
</article>

View File

@ -0,0 +1 @@
0

View File

@ -42,6 +42,7 @@
<li class="icon-desktop"><a href="{$smarty.server.SCRIPT_NAME}?page=gettingstarted">Getting Started</a></li>
{acl_check icon='icon-doc' page='about' action='pool' name='About' acl=$GLOBAL.acl.about.page}
{acl_check icon='icon-money' page='about' action='donors' name='Donors' acl=$GLOBAL.acl.donors.page}
{acl_check icon='icon-megaphone' page='about' action='chat' name='Web Chat' acl=$GLOBAL.acl.chat.page}
</ul>
<h3>Other</h3>
<ul class="toggle">

View File

@ -5,9 +5,9 @@
<thead>
<tr>
<th align="center">Rank</th>
<th align="right"></th>
<th align="left" scope="col">User Name</th>
<th align="right" scope="col">KH/s</th>
<th align="center">Donor</th>
<th align="center" scope="col">User Name</th>
<th align="right" style="padding-right: 7px;" scope="col">KH/s</th>
<th align="right">{$GLOBAL.config.currency}/Day</th>
{if $GLOBAL.config.price.currency}<th align="right" style="padding-right: 25px;">{$GLOBAL.config.price.currency}/Day</th>{/if}
</tr>
@ -19,22 +19,22 @@
{math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate}
<tr{if $GLOBAL.userdata.username|default:""|lower == $CONTRIBHASHES[contrib].account|lower}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td align="right">{if $CONTRIBHASHES[contrib].donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
<td align="right">{$CONTRIBHASHES[contrib].hashrate|number_format}</td>
<td align="right">{$estday|number_format:"3"}</td>
{if $GLOBAL.config.price.currency}<td align="right" style="padding-right: 25px;">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"4"}</td>{/if}
<td align="center">{if $CONTRIBHASHES[contrib].donate_percent > 0}<i class="icon-star-empty"></i>{else}<i class="icon-cancel"></i>{/if}</td>
<td align="center" style="padding-right: 0px;">{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
<td align="right" style="padding-right: 0px;">{$CONTRIBHASHES[contrib].hashrate|number_format}</td>
<td align="right" style="padding-right: 0px;">{$estday|number_format:"3"}</td>
{if $GLOBAL.config.price.currency}<td align="right" style="padding-right: 30px;">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"4"}</td>{/if}
</tr>
{/section}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.rawhashrate|default:"0" > 0}
{math assign="myestday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$GLOBAL.userdata.rawhashrate}
<tr>
<td align="center">n/a</td>
<td align="right">{if $GLOBAL.userdata.donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
<td>{$GLOBAL.userdata.username|escape}</td>
<td align="right">{$GLOBAL.userdata.rawhashrate|number_format}</td>
<td align="right">{$myestday|number_format:"3"|default:"n/a"}</td>
{if $GLOBAL.config.price.currency}<td align="right" style="padding-right: 25px;">{($myestday * $GLOBAL.price)|default:"n/a"|number_format:"4"}</td>{/if}
<td align="center">{if $GLOBAL.userdata.donate_percent > 0}<i class="icon-star-empty"></i>{else}<i class="icon-cancel"></i>{/if}</td>
<td align="center" style="padding-right: 0px;">{$GLOBAL.userdata.username|escape}</td>
<td align="right" style="padding-right: 0px;">{$GLOBAL.userdata.rawhashrate|number_format}</td>
<td align="right" style="padding-right: 0px;">{$myestday|number_format:"3"|default:"n/a"}</td>
{if $GLOBAL.config.price.currency}<td align="right" style="padding-right: 30px;">{($myestday * $GLOBAL.price)|default:"n/a"|number_format:"4"}</td>{/if}
</tr>
{/if}
</tbody>

View File

@ -4,9 +4,9 @@
<thead>
<tr>
<th align="center">Rank</th>
<th align="right"></th>
<th>User Name</th>
<th align="right" style="padding-right: 25px;">Shares</th>
<th align="center">Donor</th>
<th align="center">User Name</th>
<th align="right" style="padding-right: 30px;">Shares</th>
</tr>
</thead>
<tbody>
@ -15,17 +15,17 @@
{section shares $CONTRIBSHARES}
<tr{if $GLOBAL.userdata.username|default:""|lower == $CONTRIBSHARES[shares].account|lower}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td align="right">{if $CONTRIBSHARES[shares].donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
<td align="right" style="padding-right: 25px;">{$CONTRIBSHARES[shares].shares|number_format}</td>
<td align="center">{if $CONTRIBSHARES[shares].donate_percent > 0}<i class="icon-star-empty"></i>{else}<i class="icon-cancel"></i>{/if}</td>
<td align="center">{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
<td align="right" style="padding-right: 30px;">{$CONTRIBSHARES[shares].shares|number_format}</td>
</tr>
{/section}
{if $listed != 1 && $GLOBAL.userdata.username|default:"" && $GLOBAL.userdata.shares.valid|default:"0" > 0}
<tr>
<td align="center">n/a</td>
<td align="right">{if $GLOBAL.userdata.donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
<td>{$GLOBAL.userdata.username|escape}</td>
<td align="right" style="padding-right: 25px;">{$GLOBAL.userdata.shares.valid|number_format}</td>
<td align="center">{if $GLOBAL.userdata.donate_percent > 0}<i class="icon-star-empty"></i>{else}<i class="icon-cancel"></i>{/if}</td>
<td align="center">{$GLOBAL.userdata.username|escape}</td>
<td align="right" style="padding-right: 30px;">{$GLOBAL.userdata.shares.valid|number_format}</td>
</tr>
{/if}
</tbody>