Jump to content

Jack.C

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Posts posted by Jack.C

  1. <?php
    session_start();
    DEFINE('movies', 'access');
    DEFINE('witAdmin', '1');
    require_once('witadmin/conf/config_u.php');
    require_once('classes/common.php');
    $p = new output();
    
    require_once('classes/movies.php');
    $m = new movies();
    
    if(isset($_GET['handle_ajax']))
    {
    if(isset($_GET['view_links'], $_GET['category_id']))
    {
    	$m->show_links($_GET['category_id']);
    }
    elseif(isset($_GET['add_link'], $_GET['category_id'], $_GET['title'], $_GET['link']))
    {
    	$m->add_link($_GET['category_id'], $_GET['link'], $_GET['title']);
    }
    else
    	die('No result');
    }
    else
    {
    if(isset($_GET['movie_id']))
    	$m->show_movie();
    else
    	$m->movie_list();
    }
    if(isset($m) && is_object($m)) 
    {
    $p->output = $m->output;
    }
    $p->show_overall();
    ?>
    
    

  2. You cannot place PHP code within .tpl files as by default PHP code is only parsed within .php files. If you want to parse PHP code within any other file you'll have to modify the servers configuration.

     

    The easiest way is to do this using an .htaccess file. First create a new file called .htaccess in your sites root directory (where you upload your site files to). And add the following configuration.

    AddType application/x-httpd-php .php .tpl

    If your hosts allows this change to me made your site should load without any errors appearing. If an Error 500 is displayed then you are unable to modify the servers configuration. In which case you'll have no other option but to modify your script so it uses .php files rather than .tpl files

     

     

    The servers configuration is already configured as above. as I've said, I've gotten PHP code to work properly inside of a .tpl file. And all I'm trying to accomplish here is find a simple and easy way to make it so I don't have to create several files with the same exact code.

     

    I did not do this script, therefore I don't have a clue.

     

    What is the simple way to include a header in several .tpl files without having to add it to each and every .tpl file?

     

    For instance, here is a .tpl file with PHP code inside of it working: http://watch.thetvstop.com/templates/stats.tpl

     

    The problem is, when I use <?php include ("/file.tpl or /file.php");?> it won't display anything.

  3. Umm, looking at the source code of your site. The PHP code is visible.

     

    Which means,

     

    1. Your webhost/hosting account does not support PHP. Check this with your webhost. Or,

    2. The file you have placed your PHP code in does not end in an .php extension, eg  you have added the code to index.html rather than index.php. PHP code will only be parsed within .php files.

     

    It's a tpl file, that's what this whole discussion has been about. How do you include php in tpl files, I did what you said, and thus got that result.

     

    So:

     

    1. PHP is allowed on my webhost, infact everything there IS php.

    2. It does not end in .php because I did exactly as you said above.

     

    Point blank, I asked how to include php files  using

     

    <?php include("file.php");?>

     

    Inside of a tpl file.

  4. It also depends on the type of site. I know from experience. I run a tv show news,rumor,promo pic site etc. And we all feed off one another. As long as we link back to the original content provider we're all happy.

     

    But that varies based on the site. Also the website you will be using the content from would benefit from your site linking to theirs, and them not linking to yours. So I would imagine they would be ok with it.

  5. When using PHP code ensure you place it within PHP tags (<?php ?>)

     

    Also when using include you'll need to use the absolute/relative path to the file you're including, not just state the filename. In your case the path will be templates/stats.tpl

     

    <?php include 'templates/stats.tpl'; ?>

     

    I have done this, and it doesn't display anything from the stats file where it is included. It's supposed to show on http://watch.thetvstop.com in the right sidebar, under "stats" and as you can see it's blank.

     

    <?php include 'templates/stats.tpl'; ?>

     

    Is the code.

  6. By display do you mean have PHP code visible on the page? Or have PHP code run within a .tpl

     

    For the latter you can just use include to parse PHP code within a .tpl eg

     

    include 'file_with_php_code.tpl';

     

    The include doesn't work. see the rightsidebar "stats" here: http://watch.thetvstop.com/

     

    If you go directly to the .tpl file however it works. http://watch.thetvstop.com/templates/stats.tpl

     

    The problem lies within including, how do I fix that?

  7. The .tpl files are in a templates directory. Where movies_list.tpl serves as the index. As I have not written this script myself, somebody else did, I have no clue as to how the tpl files are being called. I just know how to edit them, and what they edit. I have never worked with tpl files before.

     

    I have searched all the files that are not in the admin directory, template files and php files and did not find "$template = new HTML_Template_ITX" anywhere. So I would assume they are not being included?

     

    The template files structure are like:

     

    movies.tpl (this is the template that styles/displays) the content of a single movie.

    movies_list.tpl (this file serves as the index page.)

    links.tpl (this file serves as the way to style each link once "view link" is clicked.

    overall.tpl (I would assume this is the main file, as it has the html doctype etc.)

     

     

     

     

  8. What I have is a script that was built in/around .tpl files. http://watch.thetvstop.com/

     

    I want to display the results of total links, and total episodes in the right sidebar of the above page, within <div> tags like the rest of the sidebar.

     

    So would I just create a .tpl file with the php code to display the results from the db, and with the style of the box for the right sidebar?

     

    I have tried many times to insert php into a .tpl and had no success. =/ So I assume creating a .tpl with just php would work?

  9. Hello all, Happy Holidays!

     

    I have a question here, and I'm sure it has been answered before, but I couldn't find it via the search. So sorry if it has been answered before.

     

    What I have is a script that displays full episodes of tv shows, where each episode is a category added to a tv show, or in this case a "movie".

     

    What I would like to accomplish is show the total number of episodes (every category on the site.) and the total number of tv shows (every movie added.)

     

    To display something like this:

     

     

    Total TV Shows: 1,000 (where the total comes from the amount of Movies added to the database.)

     

    Total Episodes: 1,000 (where the total comes from the amount of categories added to the database.)

     

    And also if possible. a way to show the last five items added in the category table.

     

    Thanks,

    Jack

  10. I don't expect anybody to do this for me, I asked if anybody could point me in the right direction to doing it myself. which means tutorials on the stuff I would need to learn to be able to do it.

     

    Thanks!

  11. Definitely a scam.  I've received about 15 of those exact messages from different email addresses.  They vary in the person's name and country.

     

    My only question is how does this scam work?  They're offering to send you both the computers and the money.  I don't see how you could lose here.  Unless they're like trying to smuggle cocaine across borders and are using you as the scapegoat or something.

     

    It could simply be credit card fraud. They've stolen many credit cards, which they purchased all these computers with, and they are trying to unload them all over the world so they can not be caught with the computers. They are willing to pay 4,100.00 upfront for a reason. If there isn't illegal drugs inside, there is credit card fraud for sure going on.

     

    I've seen stuff like this on MSNBC almost every week. They used to do this with radios.

×
×
  • 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.