Jump to content

PHP Script Installation. File Modding


mrjohn117

Recommended Posts

Everywhere where installing is going to modify the file put a character tht is unused (Like ¶ or $chr(173), which is an invisible character that takes up no space.). Then load the file into a variable; explode("¶", $var-name) or explode($chr(173), $var-name) into another variable. for example:

 

TitlePage.html contains:

<html>
<title>¶</title>
<body><h1><center>Welcome To ¶ </center></h1></body>
</html>

 

you will:

 

<?php
$new_title = "Page Title";
$site_name = "Site Name";
$base = fread(fopen("TitlePage.html", "r"), filesize("TitlePage.html"));
$data = explode("¶", $base);
$ret = $data[0] . $new_title . $data[1] . $site_name . $data[2];
@fwrite(fopen("TitlePage.html", "w"), $ret) or die("Failed to edit TitlePage.html");
echo "Title Page Editted.";
?>

 

 

From ehre you should be able to understand and modify what you need. If you need further help, feel free to post!

 

-T`L

 

[First psot since July 2006... who remembers me? :o!]

Alright heres the thing.

 

I need it to insert the same MYSQL details as this file  (details arn't real)

 

$dbhost = "localhost";  // DATABASE HOST IT IS USUALLY LOCALHOST
$dbuser = "mrjohn1_btcs";	    // DATABASE USERNAME
$dbpass = "startrek";			// DATABASE PASSWORD
$dbname = "mrjohn1_bcstcs";		// DATABASE NAME
$dbprefix = "";			// DATABASE PREFIX (if needed, used for multiple sites and 1 database)

Then they have to goin into this

// ***** Config ****************************************************************

// The list of admin users.
// To add multiple admins, use a code like this: array('admin1', 'admin2', 'admin3');
$chat_admins    = array('admin');

// The number of messages to keep
$chat_histlen   = 1000;

// Interval in seconds to wait before setting status to away
$chat_t_away    = 30;

// Interval in seconds to wait before disconnecting a user
$chat_t_logout  = 9;

// Interval in seconds between refreshes
$chat_t_refresh = 1;

// Messages sent to the users
$chat_err_inval = 'Invalid username or password!';
$chat_err_inuse = 'The username you selected is already in use!';
$chat_err_kick  = 'You are not allowed to enter   the chat. Contact admin for explanation.';
$chat_err_mute  = 'You are not allowed to post in the chat. Contact admin for explanation.';

// Use this function to validate registered users' login information.
function chat_chk($username, $password, &$gender, &$status)
{
  $gender = 'none';
  $status = 'none';

  // Remove this line
  return true;

  // Enter MySQL access information
  $MySQL_username = '';
  $MySQL_password = '';
  $MySQL_database = '';

  // Enter the location of user data in MySQL database
  $MySQL_table          = '';
  $MySQL_username_field = '';
  $MySQL_password_field = '';

 

 

This is Ajax chat board i think its name is.

 

Please help. 

 

 

 

 

 

 

  • 2 weeks later...

Try this:

 

 

in "phpdata.php" put

 

<?php
/*---¶
$dbhost = "localhost";  // DATABASE HOST IT IS USUALLY LOCALHOST
$dbuser = "mrjohn1_btcs";	    // DATABASE USERNAME
$dbpass = "startrek";			// DATABASE PASSWORD
$dbname = "mrjohn1_bcstcs";		// DATABASE NAME
$dbprefix = "";			// DATABASE PREFIX (if needed, used for multiple sites and 1 database)
¶--*/
?>

 

then in your isntall script:

 

$phpdata = "";
$php_get_data1 = fread(fopen("phpdata.php", "r") filesize("phpdata.php"));
$php_get_data2 = explode("¶", $php_get_data1);
$phpdata .= $php_get_data2[1];

$ret .= "<?php\r\n" . $phpdata . "\r\n ?>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.