Login   Register  
PHP Classes
elePHPant
Icontem

File: process.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jim Worthen  >  EMovies  >  process.php  >  Download  
File: process.php
Role: Example script
Content type: text/plain
Description: Processes the queries sent to the script via get and post.
Class: EMovies
Retrieve information about movies from Yahoo
Author: By
Last change:
Date: 2006-11-06 12:03
Size: 3,508 bytes
 

Contents

Class file image Download
<?php
###########################
#
#    EMovies Pro
#    Coder: FrosT
#    EMail: Frost110@gmail.com
#    File: process.php
#    Description: 
#        Handles SEO urls and outputs,
###########################

// Process Search Engine Friendly URLs
if(getenv("PATH_INFO") != "" && !getenv("REQUEST_METHOD") != "POST") { 
    
// put the data into variables =)
    
$vardata explode('/'substr(getenv("PATH_INFO"),1));
    
$num_param count($vardata);

    for(
$i 0$i $num_param$i+=2) {
        if (
$vardata[$i] != "") {
            
$key =  strtolower($vardata[$i]);
            
$_GET[$key] = $vardata[($i+1)];
        }
    }
    
extract($_GETEXTR_OVERWRITE);
}

include(
'config.php');
include(
'ets.php');

// Do the actual processing
if (isset($_GET['reviews'])) {
    require(
'erevfunc.php');
    
$movReviews = new movieReviews();
    
$movReviews->url 'http://movies.yahoo.com/movie/'.$_GET['reviews'].'/info';
    
$movReviews->useCurl $CONFIG['use_curl'];
    
$movReviews->getMovieInfo();
    
    
$movReviews->ets->head_title $movReviews->ets->title " Movie Review";
    
$movReviews->ets->SERVER_URL $CONFIG['server_url'];
    
$title_desc ereg_replace("and|The|And|the"""$movReviews->ets->head_title);
    
$movReviews->ets->page_title "Reviews for " $title_desc;
    
    
printt($movReviews->ets'templates/revtemp.tpl');
    die();
}elseif (isset(
$_GET['zip']) || isset($_POST['zip'])) {
    
$revLs false;
    require(
"emovfunc.php");
    
$movList = new movieListings();
    
$movList->SERVER_URL $CONFIG['server_url'];
    
    if (isset(
$_POST['zip'])) {
        
$zip $_POST['zip'];
    }
        
    if(
strstr($zip",")) {
        list(
$city$state) = split(","$zip);
        
$city2 ereg_replace(" |-""+"$city);
        
$city ereg_replace("-"" "$city);
        
$state ereg_replace(" """$state);
        
$zip $city2 "%2c+" $state;
        
$cityDisp $zipDisp $city ", " $state;
        
        
$movList->ets->head_title $city " " $state;
        
$movList->ets->zipcode $cityDisp;
    }elseif(
ereg("([0-9]){5}"$zip))    {
        
$movList->ets->head_title $CONFIG['head_title'] . " for Zip Code " $zip;
        
$movList->ets->zipcode "Zip Code: " $zip;    
        
$zipDisp $zip;
    }
    
    
$movList->ets->page_title ereg_replace("%zip%"$zipDisp$CONFIG['custom_title']);
    
$movList->ets->SERVER_URL $CONFIG['server_url'];
    
$movList->url "http://movies.yahoo.com/showtimes/showtimes.html?z=" $zip "&r=sim";
    
$movList->useCurl $CONFIG['use_curl'];
    
$movList->getTheater();

    
printt($movList->ets"templates/lstemp.tpl");
    die();
}else {
    
$title $CONFIG['head_title'];
    
$zipForm 
<!-- // Start Lookup Form -->
<table cellpadding="4" cellspacing="1" border="0" width="75%" align="center">
    <tr><td class="categorybackcolor" align="center"><b>Emovie\'s Movie Listings</b></td>
    </tr>
    <tr>
        <td class="firstaltcolor">
            <div align="center">
                Enter your Zip Code or City, State<br /><br />
                <table border="0">
                    <tr><td class="td_body">
                        <form action="index.php" method="POST" name="firstzip">
                        Zip Code or City & State (abbv.):</td><td> <input type="text" size="10" class="zip_inp" name="zip"> <input type="submit" value=" Go " class="zip_sub">
                        <input type="hidden" name="listings" value="movie">
                        </form>
                    </td></tr>
                    <tr><td></td></tr>
                    <tr><td></td></tr>
                    <tr><td class="td_footer">
                        Powered by <a href="http://www.emocium.com/" target="_blank">Emocium</a>
                    </td></tr>
                </table>
            </div>
        </td>
    </tr>
</table>
<!-- // End Lookup Form -->'
;
}
?>