Location: PHPKode > projects > EverQuest Roster/Gallery > html/includes/read_stats.php
<?
        /**********************************************************************************
        *                                                                                 *
        *                              read_options.php                                   *
        *                            --------------------                                 *
        *                                                                                 *
        * Program           : EverQuest Roster/Gallery v1.7b1                             *
        * Copyright         : (C) 2001 - 2002 BladeTek Internet Services &                *
        *                                                     The EQRG Developement Team  *
        * Website           : http://eqcode.roleplayersinteraction.com                    *
        * Support Website   : http://www.sourceforge.net/projects/eqrostergallery         *
        * Email             : hide@address.com                                        *
        *                                                                                 *
        * For license information, please read the documents directory which              *
        * came with this edition                                                          *
        *                                                                                 *
        **********************************************************************************/

        function read_stats(&$stats) {

                        $query  = "select s.*, u.*";
                        $query .= "  from stats as s";
                        $query .= "  left join users as u on u.login = s.lastmem";
                        $query .= " where s.sid = 1";

                        query_db($query, $stats);

                return $err;
        }

        function read_users1(&$users1, &$users2) {

                        $query  = "select COUNT(id) as max";
                        $query .= "  from users";
                        $query .= " where level = 1";

                        query_db($query, $users1);

                        $query  = "select COUNT(id) as max";
                        $query .= "  from users";
                        $query .= " where level = 34";

                        query_db($query, $users2);

                return $err;
        }

        function read_rstat1(&$rstat1) {

                        $query  = "select COUNT(id) as max";
                        $query .= "  from chars";
                        $query .= " where primary_char = 1 and valid = 1";

                        query_db($query, $rstat1);

                return $err;
        }

        function read_rstat2(&$rstat2) {

                        $query  = "select COUNT(id) as max";
                        $query .= "  from chars";
                        $query .= " where primary_char = 0 and valid = 1";

                        query_db($query, $rstat2);

                return $err;
        }

        function read_rstat3(&$rstat3) {

                        $query  = "select COUNT(id) as max";
                        $query .= "  from chars";
                        $query .= " where valid = 1";

                        query_db($query, $rstat3);

                return $err;
        }

        function read_session1(&$sess1) {

                        $query  = "select COUNT(userid) as max";
                        $query .= "  from sessions";

                        query_db($query, $sess1);

                return $err;
        }

        function read_session2(&$sess2) {

                        $query  = "select *";
                        $query .= "  from sessions";

                        $sess2["count"] = query_db($query, $sess2, true);

                return $err;
        }

        function read_msgst(&$msgs1) {
                 global $SESSION;
                        $sid = $SESSION["uid"];
                        if ($SESSION["uid"]) {
                        $query  = "select *";
                        $query .= "  from privmsg";
                        $query .= " where userid = $sid and viewed = 0";

                        $msgs1["count"] = query_db($query, $msgs1, true);
                        }

                return $err;
        }

        function update_stats($vars) {
                global $SESSION;

                if ($SESSION["level"] != ADMIN) {
                        $err = ERR_NOT_ENOUGH_ACCESS;
                } else {
                        $temp = array_keys($vars);
                        $err = "";
                        $query = "";

                        if (!trim($vars["scriptw"])) {
                                $err = "The Scripts Width field cannot be blank.";
                        } elseif (!trim($vars["tbc"])) {
                                $err = "The Border Color field cannot be blank.";
                        } elseif (!trim($vars["pntf"])) {
                                $err = "The Page Name Face field cannot be blank.";
                        } elseif (!trim($vars["pnts"])) {
                                $err = "The Page Name Size field cannot be blank.";
                        } elseif (!trim($vars["pntc"])) {
                                $err = "The Page Name Color field cannot be blank.";
                        } elseif (!trim($vars["tmf"])) {
                                $err = "The Menu Face field cannot be blank.";
                        } elseif (!trim($vars["tms"])) {
                                $err = "The Menu Size field cannot be blank.";
                        } elseif (!trim($vars["tmc"])) {
                                $err = "The Menu Color field cannot be blank.";
                        } elseif (!trim($vars["aic1"])) {
                                $err = "The List Alt. Color 1 field cannot be blank.";
                        } elseif (!trim($vars["aic2"])) {
                                $err = "The List Alt. Color 2 field cannot be blank.";
                        } elseif (!trim($vars["atf"])) {
                                $err = "The List Text Face field cannot be blank.";
                        } elseif (!trim($vars["ats"])) {
                                $err = "The List Text Size field cannot be blank.";
                        } elseif (!trim($vars["atc1"])) {
                                $err = "The List Text Color 1 field cannot be blank.";
                        } elseif (!trim($vars["atc2"])) {
                                $err = "The List Text Color 2 field cannot be blank.";
                        } elseif (!trim($vars["thc"])) {
                                $err = "The Header Color field cannot be blank.";
                        } elseif (!trim($vars["thtf"])) {
                                $err = "The Header Text Face field cannot be blank.";
                        } elseif (!trim($vars["thts"])) {
                                $err = "The Header Text Size field cannot be blank.";
                        } elseif (!trim($vars["thtc"])) {
                                $err = "The Header Text Color field cannot be blank.";
                        } elseif (!trim($vars["ticl"])) {
                                $err = "The Color Left field cannot be blank.";
                        } elseif (!trim($vars["ttfl"])) {
                                $err = "The Text Face Left field cannot be blank.";
                        } elseif (!trim($vars["ttsl"])) {
                                $err = "The Text Size Left field cannot be blank.";
                        } elseif (!trim($vars["ttcl"])) {
                                $err = "The Text Color Left field cannot be blank.";
                        } elseif (!trim($vars["ticr"])) {
                                $err = "The Color Right field cannot be blank.";
                        } elseif (!trim($vars["ttfr"])) {
                                $err = "The Text Face Right field cannot be blank.";
                        } elseif (!trim($vars["ttsr"])) {
                                $err = "The Text Size Right field cannot be blank.";
                        } elseif (!trim($vars["ttcr"])) {
                                $err = "The Text Color Right field cannot be blank.";
                        } elseif (!trim($vars["nowi"])) {
                                $err = "The Note Width Width field cannot be blank.";
                        } elseif (!trim($vars["nbc"])) {
                                $err = "The Note Border Color field cannot be blank.";
                        } elseif (!trim($vars["nbgc1"])) {
                                $err = "The Note Header Color field cannot be blank.";
                        } elseif (!trim($vars["nbgc2"])) {
                                $err = "The Note Main Color field cannot be blank.";
                        } elseif (!trim($vars["ntf"])) {
                                $err = "The Note Title Face field cannot be blank.";
                        } elseif (!trim($vars["nts"])) {
                                $err = "The Note Title Size field cannot be blank.";
                        } elseif (!trim($vars["ntc"])) {
                                $err = "The Note Title Color field cannot be blank.";
                        } elseif (!trim($vars["ntfa"])) {
                                $err = "The Note Text Face field cannot be blank.";
                        } elseif (!trim($vars["ntsa"])) {
                                $err = "The Note Text Size field cannot be blank.";
                        } elseif (!trim($vars["ntca"])) {
                                $err = "The Note Text Color field cannot be blank.";
                        } elseif (!trim($vars["email"])) {
                                $err = "The e-mail address cannot be blank.";
                        } elseif (validate_email(trim($vars["email"]))) {
                                $err = "The e-mail address is malformed.";
                        }

                        if (!$err) {
                                $query  = "update options";
                                $query .= "   set leaderimg = '" . $vars["leaderimg"] . "', ";
                                $query .= "       officerimg = '" . $vars["officerimg"] . "', ";
                                $query .= "       epicimg = '" . $vars["epicimg"] . "', ";
                                $query .= "       charview = '" . $vars["charview"] . "', ";
                                $query .= "       gzipcom = '" . $vars["gzipcom"] . "', ";
                                $query .= "       scriptw = '" . $vars["scriptw"] . "', ";
                                $query .= "       tbc = '" . $vars["tbc"] . "', ";
                                $query .= "       pntf = '" . $vars["pntf"] . "', ";
                                $query .= "       pnts = '" . $vars["pnts"] . "', ";
                                $query .= "       pntc = '" . $vars["pntc"] . "', ";
                                $query .= "       tmf = '" . $vars["tmf"] . "', ";
                                $query .= "       tms = '" . $vars["tms"] . "', ";
                                $query .= "       tmc = '" . $vars["tmc"] . "', ";
                                $query .= "       aic1 = '" . $vars["aic1"] . "', ";
                                $query .= "       aic2 = '" . $vars["aic2"] . "', ";
                                $query .= "       atf = '" . $vars["atf"] . "', ";
                                $query .= "       ats = '" . $vars["ats"] . "', ";
                                $query .= "       atc1 = '" . $vars["atc1"] . "', ";
                                $query .= "       atc2 = '" . $vars["atc2"] . "', ";
                                $query .= "       thc = '" . $vars["thc"] . "', ";
                                $query .= "       thtf = '" . $vars["thtf"] . "', ";
                                $query .= "       thts = '" . $vars["thts"] . "', ";
                                $query .= "       thtc = '" . $vars["thtc"] . "', ";
                                $query .= "       ticl = '" . $vars["ticl"] . "', ";
                                $query .= "       ttfl = '" . $vars["ttfl"] . "', ";
                                $query .= "       ttsl = '" . $vars["ttsl"] . "', ";
                                $query .= "       ttcl = '" . $vars["ttcl"] . "', ";
                                $query .= "       ticr = '" . $vars["ticr"] . "', ";
                                $query .= "       ttfr = '" . $vars["ttfr"] . "', ";
                                $query .= "       ttsr = '" . $vars["ttsr"] . "', ";
                                $query .= "       ttcr = '" . $vars["ttcr"] . "', ";
                                $query .= "       nowi = '" . $vars["nowi"] . "', ";
                                $query .= "       nbc = '" . $vars["nbc"] . "', ";
                                $query .= "       nbgc1 = '" . $vars["nbgc1"] . "', ";
                                $query .= "       nbgc2 = '" . $vars["nbgc2"] . "', ";
                                $query .= "       ntf = '" . $vars["ntf"] . "', ";
                                $query .= "       nts = '" . $vars["nts"] . "', ";
                                $query .= "       ntc = '" . $vars["ntc"] . "', ";
                                $query .= "       ntfa = '" . $vars["ntfa"] . "', ";
                                $query .= "       ntsa = '" . $vars["ntsa"] . "', ";
                                $query .= "       ntca = '" . $vars["ntca"] . "', ";
                                $query .= "       disign = '" . $vars["disign"] . "', ";
                                $query .= "       diros = '" . $vars["diros"] . "', ";
                                $query .= "       digal = '" . $vars["digal"] . "', ";
                                $query .= "       dibank = '" . $vars["dibank"] . "', ";
                                $query .= "       dieven = '" . $vars["dieven"] . "', ";
                                $query .= "       email = '" . $vars["email"] . "'";
                                $query .= " where id = 1";

                                update_db($query);

                        }
                }


                return $err;
        }
?>
Return current item: EverQuest Roster/Gallery