HabboxWiki needs you!
Are you a Habbo buff? Or maybe a rare trader with a bunch of LTDs? Get involved with HabboxWiki to share your knowledge!
Join our team!
Whether you're raving for rares, excited for events or happy helping, there's something for you! Click here to apply
Need a helping hand?
Check out our guides for all things to help you make friends, make rooms, and make money!


Page 2 of 6 FirstFirst 123456 LastLast
Results 11 to 20 of 58
  1. #11
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,131

    Latest Awards:

    Default

    PHP Code:
    <?php
    /**
     #######################################################################
     # Miscellaneous Class - For use with RVS
     #######################################################################
     # @copyright    The original creator of this script (Invent!) reserves
     #                 the right to be able to cease any use of this panel by
     #                 anyone at any time. The copyright must also stay intact
     #                 on every page the panel uses.
     # @author       Invent!/Simon Fletcher
     # @version      1 (BETA)
     #######################################################################
    **/ 

    class misc
    {

        
    /**
        ### Print Headers function    
        ###        This is used to print all the information that goes in the <head> tags of any document.
        **/

        
    function printHeaders()
        {
        
            
    $db = new db;  # Initializes the Database class for use with queries, etc.
            
            
    $query $db->query"SELECT `head`, `meta`, `css`, `js` FROM `configuraton`" );  # Grabs all configuration data.
            
            
    $fetch $db->fetch$query );  # Fetches the data found in the Query.
            
            
    $returns .= $fetch["head"]; # Grabs header data such as DOCTYPE, TITLE, etc.
            
    $returns .= $fetch["meta"]; # Grabs meta data such as Robots information, etc.
            
    $returns .= $fetch["extcss"];  # Grabs external CSS data such as links to external stylesheets.
            
    $returns .= $fetch["intcss"];  # Grabs internal CSS data such as quick styles.
            
    $returns .= $fetch["extjs"];   # Grabs external JS data such as links to external javascript files.
            
    $returns .= $fetch["intjs"];   # Grabs internal JS data such as fixes etc.
        
            
    return $returns# Returns all the header data back to the script
            
        
    }
        
        
    /**
        ### Cleaning function    
        ###        This is used to clean specified variables so they are fit to be used in an SQL Query, etc.
        **/
        
        
    function clean$variable )
        {
        
            
    $variable htmlspecialchars$variableENT_QUOTES);    # Converts html markup into entities.
            
            
    if( get_magic_quotes_gpc( ) )
            {
            
                
    $variable stripslashes$variable );    # Removes all slashes added because of form submittion (This could be a potential security risk without
                                                        # the added use of mysql_real_escape_string, do not keep this if you remove that cleaning line!
                
            
    }
            
            
    $variable htmlentities$variable );    # Does the same job as htmlspecialchars except with htmlentities(), all characters which have HTML character entity                 equivalents are translated into these entities.
        
            
    $variable mysql_real_escape_string$variable );    # Cleans a variable completely so it can be used in an SQL Query
            
            
    return $variable;    # Output the cleaned variable back to the script
            
        
    }
        
        
    /**
        ### Encrypting function    
        ###        This is used to encrypt specified variables so they are safe to be stored in SQL Tables, etc.
        **/
        
        
    function encrypt$variable )
        {
        
            
    $salt "jDu3Jop92xN"    # Random variable to make the MD5 Encryption harder, customize this if you so wish.
            
            
    $variable md5$variable.$salt )    # MD5 Encrypts the variable with an added salt (see above).
            
            
    $variable mcrypt_ecbMCRYPT_3DES$salt$variableMCRYPT_ENCRYPT );    # Mcrypts the variable using the salt
            
            
    $variable md5$variable );    # To be on the safe side :P
            
            
    return $variable;    # Output the encrypted variable back to the script
            
        
    }    

    }

    ?>
    ! Sorry, bored

  2. #12
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    You should use a dynamic salt (ie. salt is randomly generated and stored in user's entry in the database).

    Also, make sure it has a 'last edited' entry for each value. Nothings worse than viewing rare values you thought were recent, but haven't been edited in like three months.

  3. #13
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,131

    Latest Awards:

    Default

    You should use a dynamic salt (ie. salt is randomly generated and stored in user's entry in the database).
    That was my original idea, but I haven't coded it like yet as I haven't set up the SQL yet

    Also, make sure it has a 'last edited' entry for each value. Nothings worse than viewing rare values you thought were recent, but haven't been edited in like three months.
    There is an ALT text field which you need to edit every time you update a value.

  4. #14
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,165
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    Make a thing saying last edited at:
    Damn already said :[

  5. #15
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,131

    Latest Awards:

    Default

    PHP Code:
    <?php
    <?php
    /**
     #######################################################################
     # Rares Class - For use with RVS
     #######################################################################
     # @copyright    The original creator of this script (Invent!) reserves
     #                 the right to be able to cease any use of this panel by
     #                 anyone at any time. The copyright must also stay intact
     #                 on every page the panel uses.
     # @author       Invent!/Simon Fletcher
     # @version      1 (BETA)
     #######################################################################
    **/ 

    class rares
    {

        
    /**
        ### Add category function    
        ###        This is used to add a new category into the SQL Table.
        **/
        
        
    function addCategory$name$currency )
        {
        
            
    $misc = new misc;
            
    $db = new db;

            
    $name $misc->clean$name );
            
    $currency $misc->clean$currency );
            
            
    $query $db->query"INSERT INTO `categories` (`name`, `currency`) VALUES ('".$name."', '".$currency."'" );
            
            return 
    "The category (".$name.") has been added successfully!";
            
        }
        
        
    /**
        ### Remove category function    
        ###        This is used to remove a category from the SQL Table.
        **/

        
    function removeCategory$id )
        {
        
            
    $misc = new misc;
            
    $db = new db;
            
            
    $id $misc->clean$id );
            
            
    $query $db->query"DELETE FROM `categories` WHERE `id` = '".$id."'" );
            
            return 
    "The category has been removed successfully!";
            
        }
        
        
    /**
        ### Add rare function    
        ###        This is used to add a new 'rare' into the SQL Table.
        **/

        
    function addRare$name$category$img$price$currency$alt )
        {
        
            
    $misc = new misc;
            
    $db = new db;
            
            
    $name $misc->clean$name );
            
    $category $misc->clean$category );
            
    $img $misc->clean$img );
            
    $price $misc->clean$price );
            
    $alt $misc->clean$alt );
            
    $currency $misc->clean$currency );
            
            if(
    $currency != "T" && $currency != "HC")
            {
            
                die(
    "Invalid currency parameter!");
                
            }
            
            
    $query $db->query"INSERT INTO `rares` (`name`, `category`, `img`, `price`, `currency`, `alt`) VALUES ('".$name."', '".$category."', '".$img."', '".$price."', '".$alt."', '".$currency."'" );
            
            return 
    "The rare (".$name.") was added successfully!";            

        }
        
        
    /**
        ### Remove rare function    
        ###        This is used to remove a 'rare' from the SQL Table.
        **/

        
    function removeRare$id$category )
        {
        
            
    $misc = new misc;
            
    $db = new db;
            
            
    $id $misc->clean$id );
            
    $category $misc->clean$category );

            
    $query $db->query"DELETE FROM `".$category."` WHERE `id` = '".$id."'" );
            
            return 
    "The category has been removed successfully!";
            
        }
        
        
    /**
        ### Update rare function    
        ###        This is used to update a 'rare' from the SQL Table.
        **/

        
    function updateRare$name$id$category$img$price$currency$alt )
        {
        
            
    $misc = new misc;
            
    $db = new db;
            
            
    $name $misc->clean$name );
            
    $category $misc->clean$category );
            
    $id $misc->clean$id );
            
    $img $misc->clean$img );
            
    $price $misc->clean$price );
            
    $alt $misc->clean$alt );
            
    $currency $misc->clean$currency );
            
            
    $query $db->query"UPDATE `rares` SET `name` = '".$name."', `category` = '".$category."', `img` = '".$img."', `price` = '".$price."', `alt` = '".$alt."', `currency` = '".$currency."' WHERE `id` = '".$id."'" );
            
            return 
    "The rare (".$name.") was updated successfully!";
        
        
        }

    }

    ?>
    Bah.
    I have no idea why I'm posting these classes.
    Last edited by Invent; 19-11-2007 at 09:23 PM. Reason: New function in class, see 'updateRare'.

  6. #16
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,131

    Latest Awards:

    Default

    Update:
    I've added an 'updateCategory' function to the 'rares' class.

  7. #17
    RedCrisps Guest

    Default

    HOW ABOUT selecting how many rares viewed per line :]

  8. #18
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,131

    Latest Awards:

    Default

    You can already choose how many rares per line to display as the display rares page just has this:

    PHP Code:
    <?php
    /**
     #######################################################################
     # Display Rares - For use with RVS
     #######################################################################
     # @copyright    The original creator of this script (Invent!) reserves
     #                 the right to be able to cease any use of this panel by
     #                 anyone at any time. The copyright must also stay intact
     #                 on every page the panel uses.
     # @author       Invent!/Simon Fletcher
     # @version      1 (BETA)
     #######################################################################
    **/ 

    require("class/db.inc.php");
    require(
    "class/rares.inc.php");
    require(
    "class/misc.inc.php");

    $rares = new rares;
    $rares->category($_GET["category"]);
    $rares->per_line "5";
    $rares->showRares();

    ?>

  9. #19
    Join Date
    Jan 2007
    Location
    England, Uk, World, Universe,
    Posts
    1,012
    Tokens
    0

    Latest Awards:

    Default

    i look forward to using this
    Your just too smart
    my sig ran away,

  10. #20
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,131

    Latest Awards:

    Default

    http://invent.no-ip.org/rvs/display_...p?category=reg

    Basic look so far. I haven't made a design for it yet, just a quick CSS style

Page 2 of 6 FirstFirst 123456 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •