TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 07-19-2008, 02:20 AM   #1 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Bug Stuck on a bug [Youtube RSS Grabber] - Credit to person!

  • YOUTUBE RSS GRABBER BUG FIX
(Alpha 0.1.3)
  • **Hello everyone, i am working on a update of Youtube RSS Grabber Alpha 0.1.3
    **stuck on a bug fix if some one can help me you will be greatly credited
    **on the release of the script update.

so what the problem is:
#Note: No Error is given;

I am trying to get the Video Thing open in a box - Like, Lightbox and other Box Type things. but for the record i use vPIP. And here is a link for it to get people up to speed on what it is:
Quote:
vPIP
#Note: The Problem is that it wont open in a box like its suppose to.

::This is the Html set of my page::
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>::Youtube RSS GRABBER::</title>
<meta name="author" content="Codefreek">
<meta name="description" content="youtube rss video grabber">
<meta name="keywords" content="rss">
<link rel="stylesheet" href="css/pageset.css" type="text/css">
<script src="http://localhost/youtube_rss/testarea/vPIP/vpip.js" type="text/javascript"></script>
<style type="text/css" media="all">@import "http://localhost/youtube_rss/testarea/vPIP/vPIPBox.css";</style>
<script src="http://localhost/youtube_rss/testarea/vPIP/jquery.js" type="text/javascript"></script>
<script src="http://localhost/youtube_rss/testarea/vPIP/vpipit.js" type="text/javascript"></script>
</head>

::and this is the rest::
PHP Code:
<img src="./pic_youtubelogo_123x63.gif"/>
    
<?php
     
 
/* Alpha 0.1.3 RSS Grabber From Youtube
    Copyright 08 - 09 by codefreek */ 
    
 //some sites don't let you get rss feeds without broweser so this will help use uncomment the iniset
 //ini_set("user_agent","Internet Explorer");

    
/* Edit here for your rss link */
$location "http://youtube.com/rss/global/top_rated.rss";
        
/* get_contents */
    
$contents file_get_contents($location);
        
/* xml-element */
    
$xml      = new SimpleXMLElement($contents);
    
/* let this be on 0 */
    
$limiter 0;
        
/* change this for the limit you want on description */
    
$desclimit 120// use 0 for no limit
    
                    
echo "<ul>";

    foreach(
$xml->channel->item as $item
{
            

/* pregreplace is to cut out stuff we don't want or at 
better terms change into what we want */

$img preg_replace('/^.*?(<img [^>]+>).*$/is','\1',$item->description);
$imgsrc preg_replace('/^.*?(<img [^>]*?src="([^"]+)"[^>]*>).*$/is','\2',$item->description);
$tmp_desc preg_replace('#.*?(<p>.+?</p>).*#is','\1',$item->description);
$tmp_desc trim(preg_replace('#(<[^>]+>|http://\S+|www\.\S+\.\S{2,3}\S+)#','',$tmp_desc));


        echo 
"<li>";
             

/* put the string in to 2 arrays */

$linkarray explode("=",$item->link);

echo 
"</br>";

            echo 
"</br>";


/* Sanity check */       

$desclimit = ($desclimit != && $desclimit $desclimit +$desclimit);

    

/* output header link and image and description and video */

    
if (isset($_POST['video'])) {
echo 
'<div class="hVlog" style="text-align: center">
<a href="http://www.youtube.com/v/'
.$linkarray[1].'" class="hVlogTarget" type="application/x-shockwave-flash" onclick="vPIPPlay(this, null, null, \'active=true, caption=Youth Wasted\'); return false;">
<img src="http://s2.ytimg.com/vi/'
.$linkarray[1].'" /></a> <br />
<a href="http://www.youtube.com/v/'
.$linkarray[1].'" type="application/x-shockwave-flash" onclick="vPIPPlay(this, null, null, null); return false;">
Video
</div>'
;  
       } else {

       
       echo 
'<a href="',$item->link,'"><img src="http://s2.ytimg.com/vi/',$linkarray[1],'/default.jpg" title="'.$item->title.'" style="float: left;" /></a>';
       
       }


//description limiter & link

echo '<h2><a href="',$item->link,'">',$item->title,'</a>
<p style="clear: both;">'
.((($desclimit != 0) && (strlen($tmp_desc) > $desclimit)) ? substr($tmp_desc,0,$desclimit-3)."..." $tmp_desc).'</p></h2>';
  
echo 
"</li>";

     
$limiter++;

 
//////////////////////////////////////////////////////
//Change the 10 or the 5 or the 2 to what you want///
////////////////////////////////////////////////////

if (isset($_POST['defualt'])) {
    if (
$limiter == 10) break;
  }

  if (isset(
$_POST['subfive'])) 
{
    if (
$limiter == 5) break;
} else {
    if (isset(
$_POST['subten'])) {

        if (
$limiter == 2) break;
    }
}




    }

    echo 
"</ul>";



    
?>


                        <b><center>Youtube RSS Grabber 0.1.3 Alpha - By Codefreek</center></b>


                   <?php
echo "<form action='youtube_rss_grabber.php' name='rss' method='post'>
<input type='submit' name='subten' value='subten'> 
<input type='submit' name='subfive' value='subfive'> 
<input type='submit' name='defualt' value='defualt'> 
</form>"
;
echo 
"<form action='youtube_rss_grabber.php' name='rss' method='post'>
            <input type='submit' name='video' value='video'> 
                        </form>"
;
                        
?>

  • Once more the person who helps me on this is truly a life saver and is in advanced thanked!


-Thank you in advance-

##Codefreek##
codefreek is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:26 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design