Patch SR Castle CMS

Results 1 to 3 of 3
  1. #1
    This is bullshit. alextepes is offline
    MemberRank
    Sep 2006 Join Date
    CanadaLocation
    310Posts

    Patch SR Castle CMS

    So, I decided to try out SR Castle's CMS. It appears a lot of things are missing, so I added some more stuff to it, and fixed some bugs.

    Fix GM Controls:

    Add this to Config.php
    Spoiler:

    Code:
        //Set GM Accounts, ie: array("Alex","MrGM","SomeGuy");
        $gm_accounts = array("Alex");


    Change index.php line 147:
    Code:
    if ($userID == "IDHERE" || $userID == "ANOTHERIDHERE") {
    With
    Code:
    if (in_array($userID,$gm_accounts)) {
    Fixed Nav:

    Change line 83 in index.php
    Code:
    <li><a href="?register" alt="Account">Account</a></li>
    with
    Code:
     
    <?php if(!isset($_SESSION['loggedin'])) { ?>
                   <li><a href="?register" alt="Register">Register</a></li>
                    <?php } else { ?><li><a href="?account" alt="Account">Account</a></li><?php } ?>
    Replace pager.php with:
    Spoiler:

    Code:
    <?php
    ob_start();
        if (isset($_GET['logout'])){
            header("location:/user/logout.php");
        } else if (isset($_GET['chat'])){
            include("modules/chat.php");
            } else if (isset($_GET['register'])){
            include("user/register.php");
        } else if (isset($_GET['regComplete'])) {
            include("user/regComplete.php");
        } else if (isset($_GET['failedLogin'])) {
            include("err/failedLogin.php");
        } else if (isset($_GET['invalidData'])) {
            include("err/invalidData.php");
        } else if (isset($_GET['vote'])) {
            include("modules/vote.php");
        } else if (isset($_GET['download'])) {
            include("modules/download.php");
        } else if (isset($_GET['pwMissmatch'])) {
            include("err/pwMissmatch.php");
        } else if (isset($_GET['noData'])) {
            include("err/noData.php");
        } else if (isset($_GET['pwChange'])) {
            include("user/changePassword.php");
        } else if (isset($_GET['pwChanged'])) {
            include("err/pwChanged.php");
        }  else if (isset($_GET['notLoggedIn'])) {
            include("err/notLoggedIn.php");
        }  else if (isset($_GET['silkCharge'])) {
            include("modules/donate.php");
        } else if (isset($_GET['donateDone'])) {
            include("user/paypal.php");
        } else if (isset($_GET['GMAddSilk'])) {
            include("modules/AddSilk.php");
        } else if (isset($_GET['GMSilkAdded'])) {
            include("err/GMSilkAdded.php");
        } else if (isset($_GET['NameExists'])) {
            include("err/NameExists.php");
        } else if (isset($_GET['GMAddNews'])) {
            include("user/GMAddNews.php");
        } else if (isset($_GET['newsSuccess'])) {
            include("err/newsSuccess.php");
        } else if (isset($_GET['eventInfo'])) {
            include("modules/eventInfo.php");
        } else if (isset($_GET['payments'])) {
            include("modules/payments.php");
        } else if (isset($_GET['alreadyVoted'])) {
            include("err/voteDone.php");
        } else if (isset($_GET['account'])) {
            include("modules/account.php");
        } else if (isset($_GET['editChar'])) {
            include("modules/editChar.php");
        } else {
            include("modules/news.php");
        }
    ob_end_flush();
    ?>


    Add account.php in modules/
    Spoiler:

    Code:
    <?php
        if(!isset($_SESSION['loggedin'])) {
            header("location:./../?notLoggedIn");
        } else {
    ?>
                            <div class="notice">
                            <br><br>
                    <div class="head">
                        <h2>Account Management</h2>
                    </div>
                    <div class="notice-content">
                    <?php $user = $_SESSION['name']; ?>
                    Logged in as <?php echo $user; ?>,<br>
                    <a href='?pwChange'>Change password</a><br><br>
                    Character List:<br>
    <?php
                    //Get CL.
            mssql_select_db($dbName2, $dbConn) or die ("Couln't select database $dbName2");
    // Create a new statement
    $stmt = mssql_init('_QueryUserCharByUserID');
    
    
    // Bind values
    mssql_bind($stmt, '@AccountName',    $user,  SQLVARCHAR,     false,  false,   60);
    // Execute the statement
    $q = mssql_execute($stmt);
    while($row = mssql_fetch_row($q)) {
    echo $row[1] . '<br>';
    }
    mssql_free_statement($stmt);
    ?>
                    <br><br>
                    <a href='?logout'>Logout</a>
                    </div>
                            </div>
    <?php
    }
    ?>
    Last edited by alextepes; 27-11-13 at 12:08 AM.


  2. #2
    SilkRoad loveme is offline
    MemberRank
    Sep 2011 Join Date
    JanganLocation
    498Posts

    Re: Patch SR Castle CMS

    Which website this?

  3. #3
    This is bullshit. alextepes is offline
    MemberRank
    Sep 2006 Join Date
    CanadaLocation
    310Posts

    Re: Patch SR Castle CMS

    SRO Castle released here: http://forum.ragezone.com/f722/compl...ebsite-879850/
    My patch fixed the GM checking and adds a real account page to the nav on login. I didn't release just the files because I've changed the theme. But I could redo the changes and just release all the files with my patch, but I'm doing a complete redo of this CMS as the code is very sloppy/things are broken.



Advertisement