SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you think I should set this up?

    Hey, I very recently finished my site www.help4newbies.com (which BTW is up for review in the website review forum). I don't have a great deal of content right now, so organization and updating isn't hard. But I'm worried about when my site starts to get content heavy in the near future.

    I have 4 sections of tutorials: HTML, CSS, JavaScript, and Misc. Right now I have it so that when you go to the section, you see the contents of that section listed at the top. Each is a link to the tutorial on the same page.

    My problem is going to be when I start getting a lot of tutorials. I obviously don't want all of the tutorials on one page, when there get to be a lot, b/c of loading time. So I was thinking and came up with the idea of having a maximum of 4 tutorials per page. Then I'd just keep adding pages to each section.

    But up came another problem. I have the tutorials in alphabetical order. So if I need to add one that's name is somewhere in the middle, than I would have to shift all of them from page to page. I'm definitely not going to do that.

    I could always put each one on it's own page, but will that make the site seem too empty? For example, the Miscellaneous section only has 1 tutorial right now. I don't want someone to go to that section and see this tiny little box with only 1 little name. It would work in the future when I have a list of maybe 20 or more tutorials, but for now it doesn't seem very realistic.

    Does anyone have some other ideas that might work?

    I'll appreciate any and all help that I get. THANKS!

    Sincerely,
    confused
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  2. #2
    differently saned russbellon's Avatar
    Join Date
    Jun 2001
    Location
    alternate dementian
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    don't have the answer for you, but just wanted to say your new design is much better.
    i did a site that had some archived newsletters once and used cold fusion and sql server. the problem was similar to yours, but the way i went about it you would lose most of the formating of your articles. of course you could just database the headlines (and possibly an explanatory subhead ) and then use a record count to only output 4 at a time on your index page.
    אין סוף

  3. #3
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Swimm, you're just now delving into PHP and MySQL, aren't you?

    Well, hell, use those to do all of the work for you!

    I can't give you all of the specifics right this moment, but using a small MySQL database and PHP would fix your problem just fine.

    At least I think so.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  4. #4
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Aes
    Swimm, you're just now delving into PHP and MySQL, aren't you?
    Yep, I am.

    Originally posted by Aes
    I can't give you all of the specifics right this moment, but using a small MySQL database and PHP would fix your problem just fine.
    I had figured that was how I might have to do it. I'm about a quarter of the way through Kevin Yanks' "Building a Database-Driven Web Site Using PHP and MySQL" article. It's really great, but it's hard. You get so much informations, by the time I finish it, I'll have forgotten everything I read in the beginning.

    I'll keep reading. Thanks Aes.

    Anyone else?
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  5. #5
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha Swimm.

    I'm almost done with it! I was having the same problem you're having.

    I still am (a little) with the MySQL stuff -- remembering the commands and stuff.

    But the PHP and MySQL stuff is easy. Just do it slowly as Kevin does it -- and you'll get the hang of that very fast and won't even need to look back at that part.



    But I think PHP/MySQL is the way to go.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  6. #6
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    K, so if I'm going to use PHP/MySQL, how am I going to use it? I don't mean give me the code, just how would I be implementing it onto my page to make it do what I want?
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put all of your tutorials into the database organized by category, submitter, date, etc.

    Then pull them out by category. Heck you could even use the same code for each page like so:

    <?
    code to pull the tutes from the db.

    sort by $category
    ?>

    Then when you list the categories on the left side do this:

    <a href="list_category.php?category=html">HTML</a>
    <a href="list_category.php?category=css">CSS</a>
    <a href="list_category.php?category=javascript">Javascript</a>
    <a href="list_category.php?category=misc">Miscellaneous</a>

    You pass the category type to the page "list_category.php" using the query string. You cut down on codebase, and get good experience with query strings.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by creole
    Put all of your tutorials into the database organized by category, submitter, date, etc.

    Then pull them out by category. Heck you could even use the same code for each page like so:

    <?
    code to pull the tutes from the db.

    sort by $category
    ?>

    Then when you list the categories on the left side do this:

    <a href="list_category.php?category=html">HTML</a>
    <a href="list_category.php?category=css">CSS</a>
    <a href="list_category.php?category=javascript">Javascript</a>
    <a href="list_category.php?category=misc">Miscellaneous</a>

    You pass the category type to the page "list_category.php" using the query string. You cut down on codebase, and get good experience with query strings.
    Whoa. I think I better finish up Kevin Yanks' tutorial, then I'll come back to this post.

    I understand a little of it...... let's see.

    Does the "sort by $category" make them in ABC order?

    Also, is there any way to make the tutorials for each section span across a number of pages?

    Thanks creole
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  9. #9
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's ABC order, you can easily change that if you want to, I usually use.

    PHP Code:
    <?php

    settype
    ($sortby,"string");
    if (
    $sortby == "") {
      
    $sortby Category;
      }
    if ((
    $sortby == "Date") OR ($sortby == "Rating")) {
      
    $sortbyOrder "DESC";
      }
    else {
      
    $sortbyOrder "ASC";
      }

    ?>
    And then let MySQL query like this.

    PHP Code:
    <?php

    $TutList 
    mysql_query("SELECT * FROM Tutorials order by $sortby $sortbyOrder LIMIT $startpoint,4");
    $TutListNext mysql_query("SELECT * FROM Tutorials order by $sortby $sortbyOrder LIMIT $startpointNext,4");

    $totalNext mysql_num_rows($TutListNext);

    ?>
    I included the LIMIT $startpoint,4 part to show you how you can do that smoothing tutorials out over several pages

    PHP Code:
    <?php

    settype
    ($page"integer"){

    $startpoint $page 4;
    $startpointNext $startpoint 4;

    ?>
    Then with a WHILE loop you can call the tutorials.
    To make those Previous and Next links.

    PHP Code:
    <?php

    if ($page 0) {

    ?>
    <a href="<? print $PHP_SELF ?>?page=<? print $page-1 ?>&sortby=<? print $sortby ?>"><<< Previous 4</a>

    <?
    }
                
    if ((
    $page 0) && ($totalNext 0)) print " - ";
                
      if (
    $totalNext 0) {
                  
    ?>

    <a href="<? print $PHP_SELF ?>?page=<? print $page+1 ?>&sortby=<? print $sortby ?>">Next <? print $totalNext ?> >>></a>

    <?

    ?>
    I'm not sure if I'm right, I'm not a PHP expert but do know some things.
    And I know you didnt want to code be written out, but I think this is the best way to learn =\

    Other people probably do it different, but I do it like this.

    Anyways, good luck

    *keeps thumbs crossed and hopes he's right*

    EDIT: Whooops, forgot one thing, your URL would look like:

    http://www.yourdomain.com/list_categ...ry=HTML&page=0
    Last edited by JMulder; Aug 13, 2001 at 08:39.
    Jeroen Mulder

    w: www.jeroenmulder.com

  10. #10
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WOW, tons of stuff to look at!

    Thanks JMulder, I'll come back when I finish Kevin Yanks' tutorial.

    Thanks again guys, great stuff!
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  11. #11
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, hope you understand it, most of the things are pretty easy to understand, everyone with some basic English knowledge should know what "if" means, right?

    Anyway, it's basic and all I know
    Jeroen Mulder

    w: www.jeroenmulder.com

  12. #12
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, how about like this?

    Code:
    |ID|Category|Date Submitted|SigID|Title|Tutorial|
    -------------------------------------------------
    |&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
    |&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
    |&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
    etc.
    -------------------------------------------------
    Then I will pull out the tuts by Category.
    Last edited by Adam P.; Sep 22, 2001 at 07:31.
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  13. #13
    SitePoint Zealot sonique's Avatar
    Join Date
    Sep 2001
    Location
    Missouri [U.S.]
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by swimm5001
    OK, how about like this?

    Code:
    |ID|Category|Date Submitted|SigID|Title|Tutorial|
    -------------------------------------------------
    |&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
    |&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
    |&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
    etc.
    -------------------------------------------------
    Then I will pull out the tuts by Category.
    is that how you make tables for information in MySql?
    if so what do i save the file as and where should it be placed??
    jmulder[THE MENTOR]'s nice guy online!
    Rig: AMD Athlon 800mhz; 384mb SDRam; 32mb nVidia @ 1024x768; ie 6; Windows ME; 15 gig; Cd-RW


Bookmarks

Posting Permissions

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