Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)
Author Message
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Tue Nov 02, 2004 12:46 pm Reply with quote

There is a time listed on any block reason default page. Mine is showing:
Date Blocked: 1969-12-31 18:00:00 I looked in the .tpl and it is pulling a _time field from somewhere. Where can I find this value so I can change it? There is also a grammatical error in the referrer .tpl page it reads:
Your Referrer in not allowed to refer to this site.
It should read:
Your Referrer is not allowed to refer to this site.
thanks!
 
View user's profile Send private message Visit poster's website
BobMarion
Former Admin in Good Standing



Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)

PostPosted: Sat Dec 04, 2004 12:14 pm Reply with quote

Code:
function abget_template($template="") {

  global $nuke_config, $ab_config, $bantime, $db, $prefix, $ip;
  if($template=="") { $template = "abuse_default.tpl"; }
  $sitename = $nuke_config['sitename'];
  $adminmail = $nuke_config['adminmail'];
  $adminmail = str_replace("@", "(at)", $adminmail);
  $adminmail = str_replace(".", "(dot)", $adminmail);
  $adminmail2 = urlencode($nuke_config['adminmail']);
  $agent = get_user_agent();
  $querystring = get_query_string();
  $x_forwarded = get_x_forwarded();
  $client_ip = get_client_ip();
  $remote_addr = get_remote_addr();
  $remote_port = get_remote_port();
  $script_name = get_script_name();
  $request_method = get_request_method();
  $http_host = get_http_host();
  $filename = "abuse/".$template;
  if(!file_exists($filename)) { $filename = "abuse/abuse_default.tpl"; }
  $handle = fopen($filename, "r");
  $display_page = fread($handle, filesize($filename));
  fclose($handle);
  $display_page = str_replace("__SITENAME__", $sitename, $display_page);
  $display_page = str_replace("__ADMINMAIL1__", $adminmail, $display_page);
  $display_page = str_replace("__ADMINMAIL2__", $adminmail2, $display_page);
  $display_page = str_replace("__REMOTEPORT__", $remote_port, $display_page);
  $display_page = str_replace("__REQUESTMETHOD__", $request_method, $display_page);
  $display_page = str_replace("__SCRIPTNAME__", $script_name, $display_page);
  $display_page = str_replace("__HTTPHOST__", $http_host, $display_page);
  $display_page = str_replace("__USERAGENT__", $agent, $display_page);
  $display_page = str_replace("__CLIENTIP__", $client_ip, $display_page);
  $display_page = str_replace("__FORWARDEDFOR__", $x_forwarded, $display_page);
  $display_page = str_replace("__REMOTEADDR__", $remote_addr, $display_page);
  return $display_page;
}


This routine is in the includes/sentinel.php file around line 815. This routine reads in hte template file. The next routine does the date:
Code:
function blocked($blocked_row="", $blocker_row="") {

  global $nuke_config, $ab_config, $bantime, $db, $prefix, $ip;
  include("includes/counter.php");
  if(!$bantime OR $bantime == "") { $bantime = time(); }
  if($blocked_row=="") { $blocked_row = abget_blocked($ip); }
  if($blocked_row=="") { $blocked_row['reason'] = 0; }
  if($blocker_row=="") { $blocker_row = abget_blockerrow($blocked_row['reason']); }
  if(($blocker_row['activate'] == 2 OR $blocker_row['activate'] == 4 OR $blocker_row['activate'] == 6) AND $blocker_row['forward'] != "") {
    header("Location: ".$blocker_row['forward']);
    die();
  } elseif($blocker_row['activate'] == 3 OR $blocker_row['activate'] == 5 OR $blocker_row['activate'] == 7) {
    $display_page = abget_template($blocker_row['template']);
    $display_page = str_replace("__TIMEDATE__", date("Y-m-d H:i:s", $blocked_row['date']), $display_page);
    if($blocked_row['expires']>0) {
      $display_page = str_replace("__DATEEXPIRES__", date("Y-m-d H:i:s", $blocked_row['expires']), $display_page);
    } else {
      $display_page = str_replace("__DATEEXPIRES__", _AB_PERMENANT, $display_page);
    }
    $display_page .= "<hr noshade>\n<div align='right'>"._AB_NUKESENTINEL." ".$ab_config['version_number']." "._AB_BYNSN."</div>\n";
    die($display_page);
  } else {
    $display_page = abget_template();
    $display_page = str_replace("__TIMEDATE__", date("Y-m-d H:i:s", time()), $display_page);
    if($blocked_row['expires']>0) {
      $display_page = str_replace("__DATEEXPIRES__", date("Y-m-d H:i:s", $blocked_row['expires']), $display_page);
    } else {
      $display_page = str_replace("__DATEEXPIRES__", _AB_PERMENANT, $display_page);
    }
    $display_page .= "<hr noshade>\n<div align='right'>"._AB_NUKESENTINEL." ".$ab_config['version_number']." "._AB_BYNSN."</div>\n";
    die($display_page);
  }
}

_________________
Bob Marion
Codito Ergo Sum
http://www.nukescripts.net 
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©