phpBBHacks.com - Rewrite TV-Guide script
Bad Boy Blog, an unofficial Diddy and Bad Boy fan blog
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Username:    Password:
Remember Me?    
   I Lost My Password!
Rewrite TV-Guide script
Goto page 1, 2, 3, 4  Next
 
Bookmark and Share
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Requests and Development
 See a User Guidelines violation? Please contact us.
Author Message

Maxx
Not So New User

Joined: 13 Jul 2003
Posts: 67

PostPosted: March 31st 2007, 8:45 am    Post subject: Rewrite TV-Guide script Reply with quote

Hi,

I've a site about TV-series (Dutch) and I've found a PHP-script by a guy named Flesh [Belgium] for a TV-Guide (mainly Dutch and Belgium networks). One of my crewmembers, Feolener, rewrote the script a little to make it suitable for our site. The rewritten result looks like this, but I want to let it look something like this (I used my limited html and php-skills for this last example).

My question: is there anybody here who can rewrite te script below into a true phpBB-script with a corresponding tpl-file? I would be very thankful for this.

Code:
<?
//Instellingen:
   //vul hier de zenders in welke je wilt showen..
   $arDisplayZenders = array('Nederland 1', 'Nederland 2', 'Nederland 3', 'RTL 4',
                       'RTL 5', 'RTL7', 'Net 5', 'SBS 6', 'Veronica', 'Tien', 'Nickelodeon',
                       'Een', 'Ketnet/Kanvas', 'The Box', 'TMF', 'MTV', 'BBC 1', 'BBC 2');
   //Aantal kolommen breed
   $columns = 4;


if(!$_GET['tvall'])
{
    //Bron openen of foutmelding geven
    $bron = @file("http://www.tvgids.nl/nustraks/index.php?volledig=1");
   $found = 0;

    //Variabelen Declareren
    $gevonden = 0;
    $originalzender = '';
    $programmanaam = array();
    $programmatijd = array();
   $teller = 0; // wordt gebruikt voor het tellen van het aantal zenders om de kolommen te bepalen
   
   echo "<table><tr>";
   foreach ($arDisplayZenders as $zender)
   //while ($zender = each ($arDisplayZenders))
   {


      $zender = str_replace(' ', '', $zender);
      $zender = str_replace('é', 'e', $zender);
      $zender = strtolower($zender);
      if (($zender == 'nederland1') || ($zender == 'nederland2') || ($zender == 'nederland3') || ($zender == 'z@ppelin')){ $tabblad = 0; }
      if (($zender == 'rtl4') || ($zender == 'trl5') || ($zender == 'yorin')){ $tabblad = 1; }
      if (($zender == 'sbs6') || ($zender == 'net5') || ($zender == 'veronica')){ $tabblad = 2; }
      if (($zender == 'nickelodeon') || ($zender == 'cartoonnetwork') || ($zender == 'tien')){ $tabblad = 3; }
      if (($zender == 'bnv') || ($zender == 'een') || ($zender == 'ketnet/canvas')){ $tabblad = 4; }
      if (($zender == 'bbc1') || ($zender == 'bbc2') || ($zender == 'bbcprime')){ $tabblad = 5; }
      if (($zender == 'bbcworld') || ($zender == 'cnn') || ($zender == 'eurosport')){ $tabblad = 6; }
      if (($zender == 'discoverychannel') || ($zender == 'nationalgeographic') || ($zender == 'animalplanet')){ $tabblad = 7; }
      if (($zender == 'tmf') || ($zender == 'mtv') || ($zender == 'thebox')){ $tabblad = 8; }
      if (($zender == 'ard') || ($zender == 'zdf') || ($zender == 'rdl')){ $tabblad = 9; }
      if (($zender == 'ndrfernsehen') || ($zender == 'sudwestfernsehen') || ($zender == 'wdrfernsehen')){ $tabblad = 10; }
      if (($zender == '3sat') || ($zender == 'sat1') || ($zender == 'pro7')){ $tabblad = 11; }
      if (($zender == 'vtm') || ($zender == 'kanaal2') || ($zender == 'vt4')){ $tabblad = 12; }
      if (($zender == 'rtbfla1') || ($zender == 'rtbfla2') || ($zender == 'tv5')){ $tabblad = 13; }
      if (($zender == 'raiuno') || ($zender == 'trtint.') || ($zender == 'tve')){ $tabblad = 14; }
      if (($zender == 'at5') || ($zender == 'tvnoord-holland')){ $tabblad = 15; }
      if (($zender == 'tvwest') || ($zender == 'regiotvutrecht')){ $tabblad = 16; }
      if (($zender == 'arte') || ($zender == 'tcm') || ($zender == 'mezzo')){ $tabblad = 17; }
      if ($zender == 'spiceplatinum'){ $tabblad = 18; }
      if (($zender == 'canal+rood') || ($zender == 'canal+blauw') || ($zender == 'canal+geel')){ $tabblad = 19; }

      //debug output
     
      if ($_GET['debug']==1)
        echo "<br><b>Debug Zender: ".$zender."</b><br>";

      //Bron uitlezen
      $bron = @file("http://www.tvgids.nl/alleprogrammas/?tab=".$tabblad);
      for($regel=0;count($bron)>$regel;$regel++)
      {
         if ((eregi('<caption>', $bron[$regel])) && $gevonden == 0){
            //Zenders
            $p=strpos($bron[$regel], 'alt="');
            $p2=strpos($bron[$regel], '" />');
            $zenders=substr($bron[$regel], ($p+5), ($p2-$p-5));
            $zenders = str_replace(' ', '', $zenders);
            $zenders = str_replace('&eacute;', 'e', $zenders);
            $zenders = strtolower($zenders);
            //Indien gevonden, switch verzetten
            if ($zender == $zenders){
               $gevonden = 1;
               if (!$originalzender){
                  $originalzender=substr($bron[$regel], ($p+5), ($p2-$p-5));
                  $originalzender = str_replace('&eacute;', 'e', $originalzender);
               }
            }
         }
         //Indien begin nieuwe zender gevonden , stoppen met zoeken
         if ((eregi('<caption>', $bron[$regel+1])) && $gevonden == 1){
            $gevonden = 0;
         }
         //Programmagegevens uitlezen
         if ((eregi('<th width="25">', $bron[$regel])) && $gevonden == 1){
            //Tijd
            $p=strpos($bron[$regel], '<th width="25">');
            $p2=strpos($bron[$regel], '</th>');
            $programmatijd[]=substr($bron[$regel], ($p+15), ($p2-$p-15));   
           
            //Naam
            $bron[$regel+1]=str_replace('<td><div><a href="/programmadetail/', '', $bron[$regel+1]);
            $p=strpos($bron[$regel+1], '>');
            $p2=strpos($bron[$regel+1], '</a></div></td>');
            $programmanaam[]=substr($bron[$regel+1], ($p+1), ($p2-$p-1));           
         }
      }
      if ($teller > 0 && $teller % $columns == 0)
            echo "</tr><td>&nbsp;</td><tr>";
         echo "<td valign=top width=200>";
         $teller++;
      if (count($programmatijd) > 0)
      {
         echo "<strong>".$originalzender."</strong><br>";
         echo "<table>";
         for($nr=0;count($programmatijd)>$nr;$nr++) {
            echo "<tr><td valign=top width=25>";
            echo $programmatijd[$nr] ;
            echo "</td><td>".$programmanaam[$nr];
            echo "</td></tr>";
         }
         echo "</table>";
      } else {
         echo "<strong>".$zender."</strong><br>";
         echo "<table>";
         echo "<tr><td valign=top>";
         echo "Programmering " .$zender. " niet gevonden!";
         echo "</td></tr>";
         echo "</table>";
      }
      $originalzender = '';
      $programmanaam = NULL;
      $programmatijd = NULL;
      echo "</td>";
   }
}   
?>
Back to top
View user's profile Send private message Visit poster's website

Afkamm
Well Known User

Joined: 20 Oct 2004
Posts: 238
Location: Scotland

PostPosted: March 31st 2007, 10:03 am    Post subject: Reply with quote

I'll take a go.
_________________
Marc :0)
My phpBB2 Mods: Autolinks v2.1.4 | Smilies Dropdown Menu v1.0.5 | Smiley Categories v2.0.4
Smiley Pagination v1.0.2 | Smiley Randomisation v1.0.1 | Smiley Limitation v1.0.0
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Maxx
Not So New User

Joined: 13 Jul 2003
Posts: 67

PostPosted: March 31st 2007, 11:16 am    Post subject: Reply with quote

Tnx Afkamm, I really appriciate that!
_________________
SerieJunkies.nl - Nederlands forum over TV-series.
Back to top
View user's profile Send private message Visit poster's website

Afkamm
Well Known User

Joined: 20 Oct 2004
Posts: 238
Location: Scotland

PostPosted: March 31st 2007, 8:58 pm    Post subject: Reply with quote

It's coming along nicely.

I'll have a demo up for you by Sunday night and we can tweak it from there. Like, would you want users to be able to store a number of channels so that those channels appear each time they visit the page?
_________________
Marc :0)
My phpBB2 Mods: Autolinks v2.1.4 | Smilies Dropdown Menu v1.0.5 | Smiley Categories v2.0.4
Smiley Pagination v1.0.2 | Smiley Randomisation v1.0.1 | Smiley Limitation v1.0.0
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Maxx
Not So New User

Joined: 13 Jul 2003
Posts: 67

PostPosted: April 1st 2007, 1:13 am    Post subject: Reply with quote

You mean that users would be able to select which channels should be shown? And that the page 'remembers' their settings? If that's what you mean, I must say I hadn't even thought about such a feature, but a personal TV Guide for every user sounds really cool.

Since you clearly understand this stuff better then me, I have another question. Would it be possible to filter out the series and soaps and just display those (since that's what the forum is about) or, dare I say it, give the user an option to either "show all" or just "show series\soaps"?

On the site we get the information from, there's a seperate page for that (see here), but we haven't been able to filter that, so the information might come from another sourcepage.
Back to top
View user's profile Send private message Visit poster's website

Afkamm
Well Known User

Joined: 20 Oct 2004
Posts: 238
Location: Scotland

PostPosted: April 1st 2007, 9:06 am    Post subject: Reply with quote

I changed the script back to how it was so that it shows the list of channels next to checkboxes. Currently you select the channels you want and submit, those channels then appear how like on that test page you made. These selected channels are not saved yet, but I was thinking they could be saved in the users table.

It should be possible to get this other page instead and show that. Is that what you'd rather have, or both?
_________________
Marc :0)
My phpBB2 Mods: Autolinks v2.1.4 | Smilies Dropdown Menu v1.0.5 | Smiley Categories v2.0.4
Smiley Pagination v1.0.2 | Smiley Randomisation v1.0.1 | Smiley Limitation v1.0.0
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Maxx
Not So New User

Joined: 13 Jul 2003
Posts: 67

PostPosted: April 1st 2007, 10:51 am    Post subject: Reply with quote

I'm not exactly sure what you meant in your last post. Can you show me an example of what you meant?
Back to top
View user's profile Send private message Visit poster's website

Afkamm
Well Known User

Joined: 20 Oct 2004
Posts: 238
Location: Scotland

PostPosted: April 1st 2007, 7:30 pm    Post subject: Reply with quote

Ok here's the rough draft, note that I didn't know at the time you only wanted the channels that had soaps.

http://mods.afkamm.co.uk/tvguide.php

Notice the link top right.
_________________
Marc :0)
My phpBB2 Mods: Autolinks v2.1.4 | Smilies Dropdown Menu v1.0.5 | Smiley Categories v2.0.4
Smiley Pagination v1.0.2 | Smiley Randomisation v1.0.1 | Smiley Limitation v1.0.0
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Maxx
Not So New User

Joined: 13 Jul 2003
Posts: 67

PostPosted: April 1st 2007, 11:10 pm    Post subject: Reply with quote

That looks amazing!!!
I'll react more tonight (have to go to work now).

Edit: Couldn't do a new post, so I will react here futher:
---------------------
Hi Afkamm,

So far I'm really impressed by you work, it looks incredible. I was wondering if the following changes\extras are possible:

---

1) Instead of a page where the user choses the channels and where 2 programs per channel are displayed, is it possible to make a table on the top of the page with the channels (without any programs) for the user to choose from? And when the user chooses and submits the channels that they would display beneath this table?

2) In the channel-selection-screen, is it possible to have a "Select all"-button there?

3) This one is the hardest (I think), but also the coolest modification. Is it possible that for every program the page displays, the program first looks in the database (within a couple of defined subforums) to see if there's a topic about the program. And if so, that the name of the program is linked to the specific topic?

After a bit of brainstorming we thought there should be a query where it says something like select id from series where name = 'topicname' and then a replace-function where <a href='...php?id=xxx'>programname</a> replaces the actual programname.

Also for programs starting with The or De (which are in our topicnames are defined as for example Deadzone, The) the query should be a bit more advanced, like: where topicname like '%the%' and topicname like '%dead%' and topicname like '%zone%'

4) The forum is about TV-series (including soaps). On the TVGids.nl-page they have a page where they just show the series (and soaps). It would be great if 'our' TV Guide would display only those series (and soaps) and exclude programs as news, sports, movies etc. Or, even better, if the user would be able to choose if they want to "Show series" or "Show all".

---

I know I am asking a lot, but again, the work you did thusfar is awesome and these changes\extras are just possibilities we where wondering about.

Tnx for doing this much already!
Back to top
View user's profile Send private message Visit poster's website

Afkamm
Well Known User

Joined: 20 Oct 2004
Posts: 238
Location: Scotland

PostPosted: April 2nd 2007, 10:49 am    Post subject: Reply with quote

1) By table do you mean one of those multi-selectable form lists? (use ctrl and shift keys whilst clicking) This would save and could be displayed down the side.

2) Not a problem, just needs a little javascript if you stick with the checkboxes.

3) The program name could link to a pre-defined search so when you click it a search wil be carried out and any topics found displayed. That way if there is more than 1 thread they will all get listed.

4) Not a problem.
_________________
Marc :0)
My phpBB2 Mods: Autolinks v2.1.4 | Smilies Dropdown Menu v1.0.5 | Smiley Categories v2.0.4
Smiley Pagination v1.0.2 | Smiley Randomisation v1.0.1 | Smiley Limitation v1.0.0
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Requests and Development All times are GMT - 6 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil - phpBB Portugal - phpBBpersian.com

Network: iFroggy Hosting - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - KarateForums.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Disclosure Policy - Staff - User Guidelines >

Copyright © 2001-2012. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.