MuCore Exchange Online Time Into Credits Module , working 100% ,
may need some additional querys in database to count hours , minutes online
Exchange Online Hours for MuCore
Enjoy
Printable View
MuCore Exchange Online Time Into Credits Module , working 100% ,
may need some additional querys in database to count hours , minutes online
Exchange Online Hours for MuCore
Enjoy
Thanks mate!
Here the querys:
Just change the "TotalTime" column if you have different column nameQuote:
CREATE PROCEDURE WZ_DISCONNECT_MEMB
@memb___id varchar(10)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @ConnectStat tinyint
Set @ConnectStat = 0
Set @find_id = 'NOT'
select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
where I.memb___id = @memb___id
if( @find_id <> 'NOT' )
begin
update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), TotalTime = TotalTime+(DATEDIFF(mi,ConnectTM,getdate()))
where memb___id = @memb___id
-- TIMEONLINE MOD by john_d
end
end
GO
also change "(DATEDIFF(mi,ConnectTM,getdate()))" to "(DATEDIFF(hh,ConnectTM,getdate()))" if you want record by hour.
Good luck
Credits - john_d
also works on muweb 0.9, thank you dude
good job.
However you may want to consider rewrite the script so it use ODBC connection or SQLSRV instead of MSSQL(since later versions of PHP/IIS won't support it)
credits to my class mate of university Víctor Gutierrez.
[aporte] Exchange Online hours mucore por UND3R look te date of the post :junglejane:
the post is in spanish but you can use google translator.
this code can create vulnerabilities in the mu core, not worked in adodb which is the characteristic of the core system
Try this (is the same code but work on adodb) - I have not tested it yet
PHP Code:echo "<fieldset>
<legend> ONLINE TO CREDITS EXCHANGER </legend>
<table align=\"center\" border=\"0\" width=\"500\"><tr><td align=\"center\">";
if(!isset($_SESSION['user_auth_id'])) { die("You need to be logged in."); }
$hour = $core_db2->Execute("Select OnlineHours from MEMB_STAT where memb___id=?",array($_SESSION['user_auth_id']));
$hours = $hour->fields[0];
if(!isset($_POST['agree']))
{
echo "<form action=\"\" method=\"post\" name=\"module\">
<table style=\"padding-left: 10px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"4\" width=\"100%\">
<tbody><tr>
<td align=\"left\">Your Online Hours : <b><font color=\"#2e9e1b\">";
echo ($hours == "") ? $hours = "0" : $hours;
echo "</font></b></td>
</tr>
<tr>
<td align=\"left\">You Will Get : <b><em>";
$k = $hours*10;
echo $k;
echo "<font color=\"red\">Credits</font></em></b></td>
</tr>
<tr>
<td align=\"left\"><div align=\"right\"><strong>
<input name=\"agree\" type=\"submit\" id=\"agree\" value=\"Exchange\">
</strong></div></td>
</tr>
</tbody></table>
</form>";
}
else
{
$hr = $core_db2->Execute("Select OnlineHours from MEMB_STAT where memb___id=?",array($_SESSION['user_auth_id']));
$hh = $hr->fields[0];
$mm = $core_db2->Execute("Select connectstat from MEMB_STAT where Memb___id=?",array($_SESSION['user_auth_id']));
if($mm->fields[0] == "1")
{
die("<strong>You need to be <font color=red>OFFLINE</font> before you trade your hours.</strong>");
}
$credit = $core_db2->Execute("Select Credits from MEMB_CREDITS where memb___id=?",array($_SESSION['user_auth_id']));
$k = $hh * 10 + $credit->fields[0];
$core_db->Execute("Update MEMB_CREDITS set Credits=? where memb___id=?",array($k,$_SESSION['user_auth_id']));
$core_db2->Execute("Delete from MEMB_STAT where memb___id=?",array($_SESSION['user_auth_id']));
$hrr = $core_db2->Execute("Select OnlineHours from MEMB_STAT where memb___id=?",array($_SESSION['user_auth_id']));
$hhh = $hrr->fields[0];
echo "<strong>You have now <font color=\"red>\"".$k." Credits</font> and <font color=\"red\">0</font> Online Hours</strong>";
}
echo "</td></tr></table></fieldset>";
works fine with me
how to config or to set a credits reward for this?
If im right tha per 1 hour you can get 10 credits ? By useing first post script!
Please add normaly script not that sh*t
Too old thread, but i think, i should say : Don't use this..., because the author don't know anythink about global variables and syntaxis of SQL... For example :
or for AdoDBQuote:
mssql_query("Update MEMB_CREDITS set Credits='$k' where memb___id='$name'");
...) This thread don't add credits for Online hours, he just SET credits with overwriting olds... It should be :Quote:
("Update MEMB_CREDITS set Credits=? where memb___id=?",array($k,$_SESSION['user_auth_id']))
I know, what it's an old thread, but my reply for all, who think about use this...*script*Quote:
credits = credits + $k