Jump to content
xisto Community

xClawx

Members
  • Content Count

    9
  • Joined

  • Last visited

Posts posted by xClawx


  1. This tutorial will show you how to create a script so that you can have multiple categories with unlimited sub-categories in each. They can be as deep as you want. This is very useful for organising data/items. A prime example of this is a link directory which has multiple categories.

    Ok first of all I will just briefly explain how this will work - the logic behind it. I will then move on to writing the actual script which will manage the categories and put specific data/information into its category.
    The Logic Behind Categories
    If youve got a fairly decent amount of experience with the php coding language then you more than likely know that it is a very logical language. Because of this you have to try to understand how a script runs in a logical manner. So here is basically how the categories, sub-categories and data is arranged.

    Say for example there is one parent (top/main/root) category which has got a catid of 1. Then there is another category which has got its own catid of 2. The second category however has got an extra value which is a parentid. The value of this is 1. This means that the scond category belongs to whichever category has got a catid of 1.

    Thats basically it - It may seem a bit confusing but it should all become a lot clearer as we go through the code itself... So lets begin...
    The Database

    In this tutorial we will be using a mysql database to store all of the category and item information.

    If you havent already got a mysql database available then you will need to create one. If you do not know how either take a look at some of our other tutorials or contact your webhost admin.

    Once youve got a database sorted you will need to create the tables. There are two. Create them by simply copying and pasting the following SQL queries into phpMyAdmin

    CREATE TABLE `categories` (

    `catid` INT( 11 ) NOT NULL AUTO_INCREMENT ,

    `parentid` INT( 11 ) NOT NULL ,

    `name` VARCHAR( 255 ) NOT NULL ,

    `description` TEXT NOT NULL ,

    PRIMARY KEY ( `catid` )

    );

    The above will create the table to hold the categories. It has got the following fields:

    catid

    parentid

    name

    description

    Now for the item table:

    CREATE TABLE `items` (

    `itemid` INT( 11 ) NOT NULL AUTO_INCREMENT ,

    `itemparentid` INT( 11 ) NOT NULL ,

    `firstname` VARCHAR( 255 ) NOT NULL ,

    `lastname` VARCHAR( 255 ) NOT NULL ,

    PRIMARY KEY ( `itemid` )

    );

    The above will create a table called items with the following fields:

    itemid

    itemparentid

    firstname

    lastname

    Ok thats the database sorted. Now onto the code for managing the categories...

    Managaing & Organising Categories

    The first step we need to do is to connect to the database. This can be done by using the following code:

    mysql_connect('localhost','username','password');

    mysql_select_db('databasename');

    ?>

    You will need to edit the above code and replace the values with your database host, username, password and database name.

    Once done the next step is to show all of the main or root categories. Firstly however we need to insert some categories into our database so that we actually have something to output. Run this SQL query in phpMyAdmin just like before

    INSERT INTO `categories` ( `catid` , `parentid` , `name` , `description` )

    VALUES (

    '', '0', 'Main Category', 'This is the description for the main category'

    );

    You can also create other root categories. To do this simply use the above query and just change the name and description. For it to be a root category however it must have a parentid of 0.

    Now for the script itself...

    $query = "SELECT * FROM 'categories' WHERE 'parentid' = 0 ORDER BY 'catid' ASC";

    $result = mysql_query($query);

    while($cat=mysql_fetch_array($result)){

    echo "$cat[catname]";

    }

    ?>

    The above will simply output all of the parent categories which will have a parentid of 0. Save the above as main.php

    Working With Sub-Categories

    The next step now is to be able to display the subcategories of a particular category when clicked. This is done by using the following code:

    $query = "SELECT * FROM 'categories' WHERE 'parentid' = $c ORDER BY 'catid' ASC";

    $result = mysql_query($query);

    while($cat=mysql_fetch_array($result)){

    echo "$cat[catname]";

    }

    ?>

    Save the above as sub.php

    Basically what happens is main.php will show you all of the main categories which are linked to sub.php. They also pass the value of c over from main.php to sub.php - This value is the catid which you want to get the subcategories for. So when a link is clicked it will go to sub.php and will display all of the categories which have got a parentid of whatever the clicked catid was.

    Ouputting The Correct Items

    Now the whole point of categories is to organise stuff right? Well in this example I have just used peoples names as items which are to be organised into categories. You however can of course use something else.

    What the script now needs to do is get the items from the database which belong to the selected category.
    Here is the code:

    $query = "SELECT * FROM `items` WHERE `itemparentid` = $c";

    $result = mysql_query($query);

    while($item=mysql_fetch_array($result)){

    echo $item[firstname]."
    ".$item[lastname]."";

    }

    ?>

    The above code basically selects all items which belong to the selected category whos value is held within the variable $c. It then outputs these to the browser.

    The Final Script

    Thats pretty much it. We have covered the basics for creating categories with unlimited sub-categories. You should play around a bit with it and customize it to suit your needs. Here is the entire scripts files as a whole:

    Firstly index.php

    // Connect to database

    mysql_connect('localhost','username','password');

    mysql_select_db('databasename');

    // Output main categories

    $query = "SELECT * FROM 'categories' WHERE 'parentid' = 0 ORDER BY 'catid' ASC";

    $result = mysql_query($query);

    while($cat=mysql_fetch_array($result)){

    echo "$cat[catname]";

    }

    ?>

    And now sub.php

    // Connect to database

    mysql_connect('localhost','username','password');

    mysql_select_db('databasename');

    // Ouput sub-categories

    $query = "SELECT * FROM 'categories' WHERE 'parentid' = $c ORDER BY 'catid' ASC";

    $result = mysql_query($query);

    while($cat=mysql_fetch_array($result)){

    echo "$cat[catname]";

    }

    // Output Category Items

    $query = "SELECT * FROM `items` WHERE `itemparentid` = $c";

    $result = mysql_query($query);

    while($item=mysql_fetch_array($result)){

    echo $item[firstname]."
    ".$item[lastname]."";

    }

    ?>


    And thats it. Thats all you need. Good luck and hope it helped!

    Notice from BuffaloHELP:
    Wasn't it easy to post from copied source? Plagiarizm is forbidden! Even if you wrote it, because it was posted elsewhere first, you must use QUOTE tags. For all codes (PHP, JAVA,etc) use CODE tags. For long codes use CODEBOX. For html codes use HTML tags. Only and last verbal warning issued.


  2. Create a new image at 72dpi and RGB color. Place your text using a light grey

    for your color. (Lighter colors work best for this effect.)

     

    Posted Image

     

    Now load the Layer 1 Transparency by clicking on Select >> Load Selection

    Using the glass filter from Eyecandy, select the "Transparent Button"

    preset and apply the filter

     

    Posted Image

     

    Create a new layer then use the Cutout filter from Eyecandy with the

    settings: DIRECTION: 135, DISTANCE: 5, BLUR: 8, OPACITY:80 and black as the shadow color

     

    Posted Image

     

    Create a new layer then use the Cutout filter with the

    settings: DIRECTION: 315, DISTANCE: 5, BLUR: 8, OPACITY:80 and white as the shadow color

     

    Posted Image

     

    Now return to Layer 1 and go to Image >> Adjust >> Hue/Saturation

    to change the color. You can also use Color Balance to fine tune the color to your liking

     

    Posted Image

     

    Notice from KuBi:
    Copied DIRECTLY from https://smallbusiness.yahoo.com/. Bad grammar and all. Issued warning.

  3. PHP is only a scripting language, meaning you will need HTML to make the output look good to the user. However if you insert HTML normally PHP will generate some errors, so read this tutorial to learn exactly how you need to format HTML for it to work with PHP.

     

    Lets say we want to display to our users the following:

     

    Welcome to my website!

     

    In HTML the code for that would be:

     

    Welcome to my website!

     

    However in PHP we need to add a forwards slash () in front of every quotation mark so that we dont interfere with the quotation marks in the PHP functions. Lets take a look at the same code as above, only this time it has been formatted to work with PHP commands:

    Welcome to my website!

     

    Now we can combine that the print() function, like so:

    print("Welcome to my website!");

    ?>

     

    That will produce the following given it is saved on a .php page.

    Welcome to my website!


  4. 1. First of all open the desired picture, you want to change the back ground. done?

    okay.

     

    2. Now Select the Polygonal Lasso Tool (L) and start cutting off the Border of the picture,

    Posted Image

     

    3. After Selecting the Border with Lasso Tool, Press CTRL+C (Copy) it will copy the Selected Area of the Image.

     

    4. Now Open another File i.e Back Ground, i used the following, and Press CTRL+V (Paste) it will Paste the Selected Area of the last picture you edited, example as below.

     

    Posted Image

     

    5. if you want to make more editions in the picture, you can, like double shadowed picture as you seen in pic1. ok Press CTRL+V (Paste) once again, and go to the Layer Panel and change the value of "Opacity & Fill" the default Value is 100% you have to change it to 50%. it will be faded than before like this.

    Posted Image

     

    OK buddies, thats all, hope u will like this trick. my next tutorial will be " Changing Eyes & Lips Colours of a Picture"

    ;)

    Peace

    3111[/snapback]


  5. The hot new Firefox plug-in takes browser customization to a whole new level by letting users filter site content or change page behaviors.
    The glory of open-source software is that it allows anyone with the inclination and the scripting knowledge to get under the hood and hot-rod their computing environment. But most of the time, that advantage is available only to people with the programming skills to make the changes they want. That's where Greasemonkey, a free plug-in for Firefox, comes in -- it simplifies hacking the browser.

    Released at the end 2004, Greasemonkey is the latest in a growing arsenal of Firefox customization tools. It changes how Web pages look and act by altering the rendering process. Greasemonkey is to Firefox what aftermarket parts are to cars -- it lets you personalize your browser by making it faster and more powerful or simply by making browsing more aesthetically pleasing. How and why you will use Greasemonkey (and I predict you will, if you don't already) will depend on how you browse now.

    http://greasemonkey.mozdev.org/


    1) Install the Greasemonkey extension >>
    http://downloads.mozdev.org/greasemonkey/greasemonkey_0.2.6.xpi


    2) Restart Firefox

    3) Go to

    http://rapidshare.de/files/1034529/rapidshare.user.js.html


    4) Right click on rapidshare.user.js and choose "Install User Script".

    Run FireFox.
    From File Menu click on Open File then brouse to whereever you saved the 'greasemonkey.xpi' plug-in. Open it, wait a couple seconds for the install button becomes active. Click on it to install this plug-in then CLOSE FIREFOX.
    Run FireFox again. From the File Menu click on Open File then brouse to whereever you saved the 'rapidshare.user.js'. Open it. Click the Tools Menu then click on Install User Script then click OK.
    Close FireFox.

    The script will let you enjoy "no wait" and multiple file downloads

    Notice from BuffaloHELP:
    Plagiarized from http://forums.xisto.com/no_longer_exists/ Please review the forum terms of service and board rules, again. This is your only and last verbal warning. The next time you pull this kind of hack job your warning will be added and your hosting credits taken away.

    Upon reviewing, this isn't the first plagiarism. Warning issued.


  6. Hopefully someone will find this useful. Ive done this on my machine as well.

     

    To a hide an account to display on the welcome screen of xp here is a nifty way:

    1. Open regedit

     

    2. Browse to

    Hkey_local_machine> software>microsoft>windows nt>winlogon>special Accounts>Userlist

     

    Here you will see a list of all accounts on XP which are hidden and dont display on welcome screen. Yes XP does create useless accounts as you see there.

     

    3. Go on the right pane, right click, create a new dword value with its name as the exact username you want to hide and its value as "0" without the quotes.

     

    Now if you have only one account on XP and you want to hide it, DO NOT DO THE ABOVE! READ BELOW AND FOLLOW A NEW PROCEDURE

     

    If you do this accidently, it will make an infinite restart loop in your computer. If you accidently do it, then just login in safe mode and remove the value you just set in the regedit.

    If you only have one account and want to do this, you will have to disable welcome screen & fast user switching in USERS in control panel.

     

    What I did was: create a dummy limited account for people who want to access my machine sometimes. And I hided my own account using the proceedure mentioned.

     

    To access this hidden account from the welcome screen press CTRL+ALT+DEL twice and you can enter your username and password.

     

     

    Enjoy!

    #Desi

     

     

    ps: Might I add a disclaimer that I take no responsibility if someone manages to mess up their computer using the procedure above. Backup your registry thats all I want to suggest.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.