Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member Lucian's Avatar
    Join Date
    Aug 2003
    Location
    tennessee
    Posts
    18
    Member #
    2765
    Hi everyone,

    I'm revamping an old site, that my company recently purchased the source code for. This is really exciting because for us, this means finally moving into the dynamic database driven world of websites.

    The problem that I'm quickly realizing is that I don't have enough knowledge of php and there are certain areas of this stupid program that are kickin my butt. #1, is simple, I just don't know the answer.

    This site is template driven, and has a lot of inconsistency as far as the title bar goes... some pages say one thing, and some say another (this is because we are not the first to try and implement this source code, I guess) The problem is I can never seem to find the right spot to change the title of the site.

    I think it's one place, and then that's not it. I was wondering if anyone here knew a simpler way to figure this out. It's just a stupid title, and I can't find where it's being referenced from

    Thanks!

    Lucian

    P.S. is $tpl a known variable to anyone, here? The only thing I could find on it was a reference to smarty templates? Any way that's another piece of the code that's been confusing me
    Are your website promotion efforts yielding less than satisfactory results? Check out the Website Promotion Tips Blog for help!

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    First:
    PHP Code:
    $tpl "Probably a variable someone created in your source"
    Now, as for the template problems, I suggest doing this: look through all your files and find all the include(); files. List them in a separate document and then look through each of them, one at a time. Figure out what it is that they contain and write a brief description on them in the list file. You should probably also add some documentation within the include file as well... something like this:
    PHP Code:
    /**
     * Copyright MyCorp, inc., all rights reserved
     * 
     * My File
     * Contains all the HTML header information for my site
     * 
     * @path /includes/my_file.inc
     * @version 1.0 12/25/2002
     * @author My Name
     * 
     */ 
    Or, in HTML:
    Code:
    <!--
      -- Copyright MyCorp, inc., all rights reserved
      -- 
      -- My File
      -- Contains all the HTML header information for my site
      -- 
      -- @path /includes/my_file.inc
      -- @version 1.0 12/25/2002
      -- @author My Name
      --
      -->
    The "@" identifiers are javadoc spec. They won't do much for you in PHP or HTML, but they'll come in handy if you ever convert your files to Java. Besides, javadoc is just about the only doc spec I've seen, so I tend to use it for pretty much everything.

  4. #3
    Junior Member Lucian's Avatar
    Join Date
    Aug 2003
    Location
    tennessee
    Posts
    18
    Member #
    2765
    Hey Transio,


    Thanks alot. I've taken your advice, and have begun creating a list with file purposes and descriptions. I think the $tpl variable is an anonymous funtion. The opening of the file that uses it uses: require_once which I would guess calls the file it references template.php,
    I did some research and commented out that require_once line and the $tpl variable showed up undefined. I still haven't managed to find out what exactly $tpl does, but if I keep doing what you suggested I should be able to build a much easier site model to work from.

    thanks again!

    Lucian
    Are your website promotion efforts yielding less than satisfactory results? Check out the Website Promotion Tips Blog for help!

  5. #4
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Hi.
    You probably got your answer, but just to clarify a few things;
    $tpl is not a reserved PHP name. That means it's created by the designer as a variable holder, a string. If the content of that particular string is used many places in different contexts, it is normal to write a file containing the definition of that and other much used variables. You then only need to write include() or require() (where the filename goes between the brackets) in the script that requires these variables defined. (saves you a lot of typing)

    require() and include(), does the same thing except for error reporting. With include, the script continous but will give you a later error in the portion of the code that requires the variable definition (if the file didn't upload), while require() halts the script instantly with a fatal error if the require(file.end) didn't upload.

    Require_once() means the variable should only be defined once by the uploaded file/function. That is to prevent problems later on in the script if variables or functions are to be redefined.

    $tpl is not a function. If it was, it would've been written
    tpl(). It might be defined through an other process or function in the file that are called through the require() function. If you can locate the file beeing called, you should be able to see how $tpl is defined.
    S. Rosland


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:55 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com