Conquer Website part 2

05/06/2012 21:39 BioHazarxPaul#16
Theres not a need for one, its going to use information from your conquer database. My guess is you will need to change the mysql statements to fit ur database though.
05/07/2012 00:43 warzie005#17
Quote:
Originally Posted by BioHazarxPaul View Post
Theres not a need for one, its going to use information from your conquer database. My guess is you will need to change the mysql statements to fit ur database though.
I changed some of it to fit it to the Hellmouth Database.
05/07/2012 18:22 Zeroxelli#18
I'd say just make a variety of arrays containing the table names/etc of the different sources, and just have them change a single variable at the top to point to which source they're running. And, of course, their database information. But you get the point.

EDIT:
PHP Code:
$currentSource 'someSource5095';

$sourceVars = array();

$sourceVars['someSource5095'] = array
(
    
'database_host' => 'localhost',
    
'database_name' => 'my5095server',
    
'database_user' => 'myUserName',
    
'database_pass' => 'myDbPassword',
    
'account_table' => array
    (
        
'tableName' => 'accounts',
        
'account_field' => 'AccountID',
        
'password_field' => 'Password',
        
// ...etc
    
),
    
'character_table' => array
    (
        
'tableName' => 'characters',
        
'name_field' => 'Name',
        
'level_field' => 'Level',
        
'class_field' => 'Class',
        
// ...etc
    
),
    
'friends_table' => array
    (
        
'tableName' => 'friends',
        
// ...etc
    
),
    
'enemies_table' => array
    (
        
'tableName' => 'enemies',
        
// ...etc
    
),
    
// ...etc
);

mysql_connect($sourceVars[$currentSource]['database_host'], $sourceVars[$currentSource]['database_user'], $sourceVars[$currentSource]['database_pass']); 
Something along those lines.
05/07/2012 20:13 BioHazarxPaul#19
this is a bit more where object oriented programming comes into play, it would look a bit cleaner and easier to understand when reading just the mysql_connect line..
05/07/2012 23:43 Zeroxelli#20
Either way, it would help out the nooblets who don't even know what this does:
PHP Code:
echo("This is a test\n"); 
05/09/2012 00:42 turk55#21
Quote:
Originally Posted by Zeroxelli View Post
Either way, it would help out the nooblets who don't even know what this does:
PHP Code:
echo("This is a test\n"); 
They wont know how to use it.
this way they might know

<?php
echo "Hello World";
?>
05/09/2012 00:49 Zeroxelli#22
Quote:
Originally Posted by turk55 View Post
They wont know how to use it.
this way they might know

<?php
echo "Hello World";
?>
You can change a variable name or even the contents of a string to something more distinguishable, but that won't make it easier for them to understand. You still have to write some kind of small guide to tell them the meaning of the string, the value, and the variable itself. And the problem after that? You're betting on the fact that they might want to learn, which most of them do not. They take code, copy paste it, and wonder why it doesn't work. Not everything can be copy/pasted. Obtaining a source is just getting a source. Attaining a source, is getting something you truly worked for.