Jump to content
MakeWebGames

Fejail help


Veramys

Recommended Posts

So on one hand, we publically renounce people who have ""stolen"" scripts, on the other, we blatantly disregard the copyright rules..

Still, as CE/MWG has never really had that much of a clean record, and even a casual glance around these forums is sufficient to build an almost 100% complete (ignoring staff functions) McCodes V1 & V2, I guess posting such material can really be considered "fair use".

Discuss ;)

I suppose it's more the principle, than anything. A product which is that to be bought for a license to use (stock files), shouldn't really be posted giving the availability to the file(s) to those non-license holders. However, the way the product has been created, and the amount of modifications freely available to the public, one "could" rebuild the source (to some limit) with scripts found around here; to which you could argue that someone could obtain it via warez.

Link to comment
Share on other sites

@jcvenom:

I removed your last post because I dont think that file should be posted since its part of the core mccodes.

I just did a soft delete so if I am wrong then it can be restored but if he is a license holder he can go and download the updated version of mccodes which comes with the global non auth file. and if he's not a license holder then, well tough luck :p

Ah it's fine being there ( restored ), there's nothing of value from it really.

Unless we get a complaint from MCCodes, it's fine to stay.

As for the rest, well yeah that is common sense but it seems to be somewhat limited at the moment. ;)

Link to comment
Share on other sites

To get us back on topic, this system I use for "Fed Reports" is simple to use.

Here's what I've got in my "header"

 

if($ir['fedjail']) {
$q = $mtg->query(sprintf("SELECT `fed_days`, `fed_reason` FROM `fedjail` WHERE (`fed_userid` = %u)", $ir['userid']));
$r = $mtg->fetch_row($q);
if($_SERVER['PHP_SELF'] != '/fedreport.php') {
	$mtg->error(sprintf("You have been put in the %s Federal Jail for %s day%s.<br />Reason: %s<br /><br /><a href='fedreport.php'>Appeal against this</a>", $mtg->gameSettings('game_name'), $mtg->output($r['fed_days']), $mtg->s($r['fed_days']), $mtg->output($r['fed_reason'])));
} else {
	$mtg->notice(sprintf("You have been put in the %s Federal Jail for %s day%s.<br />Reason: %s", $mtg->gameSettings('game_name'), $mtg->output($r['fed_days']), $mtg->s($r['fed_days']), $mtg->output($r['fed_reason'])));
}
}
Edited by Magictallguy
I know there's a fair amount of sprintf(), deal with it!
Link to comment
Share on other sites

  • 11 months later...

I figured you could put the functions under header in the part where it calls to them being in fedjail and work with it that way. I've not done so yet cause I've been working on other things but if I do I'll make sure to let you use it.

Link to comment
Share on other sites

So far I have this -

 

Add this to the global_func.php -

 

function redirect($url, $permanent = false)
{
   header('Location: ' . $url, true, $permanent ? 301 : 302);
   exit();
}

 

Add this to the header -

 

    if($ir['fedjail']) {
    if($_SERVER['PHP_SELF'] != '/fedsupport.php') {
        redirect('fedsupport.php', false);

    }
 }

 

Create a new file called fedsupport.php -

 

<?php

require('globals.php');

echo '<h3><u>Federal Jail</u></h3>';

if ($ir['fedjail'] == 0) {
   echo'Your not in federal jail.';
   exit($h->endpage());
}

if (!isset($_GET['action'])) {
   $_GET['action'] = '';
}
switch ($_GET['action']) {
   case 'reply':
       reply();
       break;

   default:
       index();
       break;

}

function index()
{
   global $db, $ir, $h, $userid, $set;



   $q = $db->query("SELECT *
                            FROM `fedjail`
                            WHERE `fed_userid` = $userid");
   $r = $db->fetch_row($q);



   if ($ir['fed_lock'] != 0) {
       echo "<hr width='100%'><span style='font-weight: bold; color:red;'>
                   You have been put in the {$set['game_name']} Federal Jail
                    for {$r['fed_days']} day(s).<br />
                   Reason: {$r['fed_reason']}
                   </span><hr width='100%'>";
   } else {



       echo "<hr width='100%'><span style='font-weight: bold; color:red;'>
                   You have been put in the {$set['game_name']} Federal Jail
                    for {$r['fed_days']} day(s).<br />
                   Reason: {$r['fed_reason']}
                   </span><hr width='100%'>";


       echo "<table width='100%' cellspacing='1' class='table'><tr>
<th>User</th><th>Comment</th></tr><tr>";


       $q = $db->query("SELECT `userid`,`username`,`frTEXT`,`frTIME`,`frUSER`,`frUSERTO`,
                    `u1`.`username` AS `frUSER`
                    FROM `fedjail_reports` AS `a`
                    INNER JOIN `users` AS `u1`
                    ON `a`.`frUSER` = `u1`.`userid`");


       while ($p = $db->fetch_row($q)) {



           echo "<td width='40%'>{$p['frUSER']} - " . date('j F, Y, g:i a', $p['frTIME']) . "</td>
<td>" . strip_tags($p['frTEXT']) . "</td></tr><tr>";
       }

       echo "</tr></table><hr width='100%'>";

       echo '
	<form action="fedsupport.php?action=reply" method="post">


	Reply (You can only send a message every 20 minutes.):<br />
	<textarea name="comment" rows="10" cols="60" placeholder="Enter text here"></textarea>
	<br /><br />

	<input type="submit" value="Add Comment!" />
	</form>';

       echo " <hr width='100%'><a href='logout.php'>>Logout</a><hr width='100%'>";
   }
}
function reply()
{
   global $db, $ir, $h, $userid, $set;



   if ($ir['fedjail'] == 0) {
       echo'Your not in federal jail.';
       exit($h->endpage());
   }
   if ($ir['fed_lock'] != 0) {
       echo'Your locked out from here.';
       exit($h->endpage());
   }
   $q = $db->query("SELECT `frUSERTO`, `frTIME` FROM `fedjail_reports` WHERE `frUSERTO` = $userid AND `frTIME` > unix_timestamp()-1200");
   if ($db->num_rows($q) >= 1) {
       echo'You can only send one message every 20 minutes.';
       exit($h->endpage());
   }

   $_POST['comment'] = (isset($_POST['comment']) && is_string($_POST['comment'])) ? $db->escape(strip_tags(stripslashes($_POST['comment']))) : '';

   if ($_POST['comment']) {
       if (strlen($_POST['comment']) < 10) {
           echo'Sorry, the comment is too short. Minimum of 10 words.';
           exit($h->endpage());
       }


       $db->query("INSERT INTO fedjail_reports (`frID`, `frUSER`, `frTIME`, `frTEXT`, `frUSERTO`) VALUES ('', '{$userid}', unix_timestamp(), '{$_POST['comment']}', '{$userid}')");


       echo'Comment added!';
       exit($h->endpage());
   } else {
       echo'You have not entered any text at all.';
       exit($h->endpage());
   }




}
$h->endpage();
?>

 

SQL -

 

CREATE TABLE IF NOT EXISTS `fedjail_reports` (
 `frID` int(11) NOT NULL AUTO_INCREMENT,
 `frUSER` int(11) NOT NULL,
 `frTIME` int(11) NOT NULL,
 `frTEXT` text NOT NULL,
 `frUSERTO` int(11) NOT NULL,
 PRIMARY KEY (`frID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

ALTER TABLE users ADD fed_lock INT(11) DEFAULT 0 ;

 

Can someone make the staff file...?

It will be a big help?

Users, can reply to appeal to their suspension. Staff can lock them out of the area.

I just need help with the staff area. How should I make it?

Edited by Samurai Legend
Link to comment
Share on other sites

Not bad but there are errors just from what I can see by glancing on my phone.

You are using grabbing some global variables that I don't believe exist like the $goback? I have never seen that var before and also you have a function called confirmation() which doesn't exist in the global funcs file either and same with the error() function

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...