Results 1 to 5 of 5

Thread: Theme programming

  1. #1
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Theme programming

    Hi guys,

    I am programming a simple script. I made my codes in css. then I called all my php codes from other folder to my index.php. Then I link my index.php page with this css directory (Themes/ default/style.css). It works fine, but I think it is very stupid way. I know some people use index.php and index.template.php files in theme folder.
    but for me all I have in themes folder are only style.css, header and footer in theme folder.

    Plz explain to me in general how can I make a theme. and how can I include it in my index.php page.

  2. #2
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    use a setting like
    $themefolder = "";

    store a cookie on there computer with a number or something to do with what theme they have loaded

    then use the $themefolder setting to change where some images load and css.

  3. #3
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by zeromadpeter View Post
    use a setting like
    $themefolder = "";

    store a cookie on there computer with a number or something to do with what theme they have loaded

    then use the $themefolder setting to change where some images load and css.
    Thank you for your help
    I am using only css. Do you mean the directory to css files???

    Thank in advance again, Zeromadpeter

  4. #4
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    PHP Code:
    themes (folder)
         
    jamesbond (folder)
                  
    theme.css (file)
                  
    header_layout.php (file
                  
    footer_layout.php (file)
                  
    images (folder)
                         
    banner.jpg (file)
                         
    background.png (file)
                         
    iconthing.gif (file
    - index.php
    PHP Code:
    <?php
    // get the theme in use
    $selected_theme "jamesbond";
    if(
    is_dir("themes/".$selected_theme."") == true)
    {
            
    // if the folders there go ahead and load (no other checks on files)
            
    include("themes/".$selected_theme."/header.php");
            echo 
    "main page loads here yay";
            include(
    "themes/".$selected_theme."/footer.php");
    }
    else
    {
          
    // maybe put an error message here.
          
    exit;
    }
    ?>
    this will give you the basic frame work for a theme's enabled site (thou the user cant change theme ^_^)
    if you update header and footer to use $selected_theme you would not need to put a copy in each folder.

  5. #5
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oooh zeromadpeter
    you simplify the matter wonderfully
    deeply thanx

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
  •