Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   FreeTSP (http://www.bvlist.com/forumdisplay.php?f=120)
-   -   TV Guide-- Requested by graaf (http://www.bvlist.com/showthread.php?t=9950)

firefly007 8th July 2014 16:55

TV Guide-- Requested by graaf
 
3 Attachment(s)
Add this to your css

Code:


.tvg {
    width: 600px;
    margin-right: auto;
    margin-left: auto;
}
.cal_tv {
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
}

Add this to main function

Code:



function re_brac($string){
$data =  preg_replace("/\([^)]+\)/","",$string);
$originals = array("-");
$replacements = array("");   
return str_ireplace($originals, $replacements, $data);   
}

if (!isset($HTTP_POST_VARS) && isset($_POST))
{
    $HTTP_POST_VARS = $_POST;
    $HTTP_GET_VARS = $_GET;
    $HTTP_SERVER_VARS = $_SERVER;
    $HTTP_COOKIE_VARS = $_COOKIE;
    $HTTP_ENV_VARS = $_ENV;
    $HTTP_POST_FILES = $_FILES;
}

Create a new file called " tv_guide.php " and copy and save the below code.

Code:


/**
 **************************
 ** FreeTSP Version: 1.0 **
 **************************
 ** http://www.freetsp.info
 ** https://github.com/Krypto/FreeTSP
 ** Licence Info: GPL
 ** Copyright (C) 2010 FreeTSP v1.0
 ** A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 ** Project Leaders: Krypto, Fireknight.
 **/

require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR . 'function_main.php');
require_once (FUNC_DIR . 'function_vfunctions.php');
require_once (FUNC_DIR . 'function_user.php');
require_once (FUNC_DIR . 'function_bbcode.php');

db_connect();
logged_in();

site_header();
$action = $HTTP_GET_VARS["date"];

switch ($action)
{
case tomorrow:
  $wd = 'Tomorrow';
  $feedUrl = 'http://www.tvrage.com/myrss.php?date=tomorrow';
  break;
case yesterday:
  $wd = 'Yesterday';
  $feedUrl = 'http://www.tvrage.com/myrss.php?date=yesterday';
  break;
default:
  $wd = 'Today';
  $feedUrl = 'http://www.tvrage.com/myrss.php';
}

echo "

TvGuide ($wd)

";
echo '
';

echo '
 
   
   
   
 
yestotom
';

$rawFeed = file_get_contents($feedUrl);
//print($rawFeed);
$anobii = new SimpleXmlElement($rawFeed);
$breakholder = 0;

foreach ($anobii->children() as $channel) {
    echo "
    ";
        foreach ($channel->item as $node) {
            $itemcount2 = $node -> count();
            if ($breakholder == 0) {
                if ($itemcount2 < 3) {
                    $image = $node -> image;
                    echo "
  • link . "\">" . $node -> title . "

      \n";
                  } else {
                      echo "
    • link . "\">" . $node -> title . "
    • \n";
                      $breakholder = 1;
                  }

              } else {
                  if ($itemcount2 < 3) {
                      echo "
  • " . $node -> title . "

      \n";
                  } else {    $name = $node -> title;

                      echo '
    • ' . $name . '

    • ';
                  }

              }

          }
          echo "
";
}
echo '
';

site_footer();
?>

Screen

http://lookpic.com/O/i2/1784/MFphoxBm.png

The icons are in the attachment

hatijahat 10th September 2014 07:10

1 question, can this script be use by other site other then tvrage?
example : http://malaysiantvonline.com/Regular.../wednesday.htm

firefly007 10th September 2014 07:17

No because it doesn't seem to have xml feeds

You can use Curl or even better simpledom class.


All times are GMT +2. The time now is 11:47.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.