Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Posts posted by cmgmyr

  1. Well my code right now is structured well and is easy to maintain and reuse. Usually I have something like this:

     

    /css

    --style.css

    /includes

    --/classes

    ----class.mysql.php

    ----class.functions.php

    ----ect.

    --/nav

    ----header.php

    ----footer.php

    --includes.php <- this is to include all of the classes and config file

    /js

    --main.js

    about.php

    contact.php

    index.php

     

    but it's not as dynamic as it could be

  2. I've been reading up on MVC though some posts on here and some other site with tutorials on them. I also downloaded CodeIgniter and have been playing around with that a little. I was wondering how many people use these frameworks and why? I would rather make my own once I know how they work a little more, any insight on this? Pro's/Con's with using MVC?

     

    Thanks,

    -Chris

  3. @bills - The next time you feel like that why don't you just sit down and try to meditate (just thinking to yourself in a calm manner) and try and connect with this spirit. It might sound cheesy but if you try and make friends with it, it might make the situation better. It's probably feeling your uneasiness and anxiety about IT being there. If you calm yourself and the spirit then the spirit might feel better about you.

  4. I think it's a cool fact that they did that. Being a musician the "digital download" has always been a topic since back when Napster first started. I know that there are a few other musicians here, so I'm sure they will appriciate this. On one hand I like downloading tunes to check something out...or to learn it. With playing in a cover band it's insane to think to go out and buy 30 different CD's to learn all the songs you need to fill a set. BUT on the other hand downloading the mp3 is taking some money out of the bands' hands. I think that it's insane that CD's cost $16+ each and some are a lot more. Who ever figures out the balance between physical CD's and digital downloads are going to make a TON of $$$

  5. I like helping here and there where I can. I don't know everything, but I do know a lot. Learning something is easy, using it for something useful isn't that bad, but you don't really KNOW it until you can teach someone else how to do it. Thats the only way that you can master something. It can be as simple as knowing what an IF statement is and how to use it, or it could be a whole programming language.

  6. I've been working on an admin section that I've been using in a handful of websites so far. I have a structure that works pretty well so far. I would like some insight on how to make a "module". Right now I have a few options in my admin section:

    - Catalog/Products

    - Customers

    - Orders

    - Files

    ect...

     

    I would like to make these more modular...almost like a plugin where I can upload a directory into "plugins" or something like that and that whole plugin with function 100% (something like wordpress?).

     

    Have you guys done something like this before? Any ideas? Suggestions? Problems?

     

    Thanks!

    -Chris

  7. I had a project a little while ago that I had to re-create a front end and back end of a site while keeping the same type of database structure/column names. After I got done my client came to me and said that they wanted certain column names changed after I got done with the work. They pretty much wanted:

     

    dealers

    =======

    dname

    daddress

    demail

    ect...

     

    turned into:

    dealers

    =======

    name

    address

    email

    ect...

     

    So I had to do back through and change all of those references in a bunch of pages and then re-test everything. So I was wondering if there was a way (easily and efficiently) to make some sort of database map so that I could just change these values in one spot instead of many spots. I was thinking of putting this in some sort of array? So I would have:

    <?php
    $dealers = array('dname', 'daddress', 'demail');
    $sql = "INSERT INTO dealers (".$dealers[0].",".$dealers[1].",".$dealers[2].") VALUES ('$name','$address','$email')";
    //OR
    $dealers = array('name' => 'dname', 
    'address' => 'daddress', 
    'email' => 'demail');
    $sql = "INSERT INTO dealers (".$dealers['name'].",".$dealers['address'].",".$dealers['email'].") VALUES ('$name','$address','$email')";
    ?>

     

    so then I could change that array to:

    <?php
    $dealers = array('name' => 'name', 
    'address' => 'address', 
    'email' => 'email');
    ?>

    in about 3 keystrokes.

     

    I hope this makes sense how I explained it. Any ideas? Suggestions? Problems with this? Anything else?

     

    Thanks!

    -Chris

  8. Now just try this on one page:

    <?php 
    
    define(BANNER,  "images/top.jpg");
    
    ?>
    <div id="PageTitle">
       <img src="<?php echo BANNER ?>" alt="Banner">
    </div>
    
    

     

    Then if that works do:

    defaults.inc

    <?php 
    
    define(BANNER,  "images/top.jpg");
    
    ?>
    

     

    and your index page:

    <?php 
    
    include "defaults.inc";
    
    ?>
    <div id="PageTitle">
       <img src="<?php echo BANNER ?>" alt="Banner">
    </div>
    
    

     

    and you shouldn't have to do this:

    $banner = BANNER;

    it kind of defeats the purpose of your defaults file

×
×
  • Create New...

Important Information

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.