Help Random youtube filmpje

Gestart doorOne2xs37 reacties14 weergaven

38 berichten · pagina 2 van 3

Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Oh en btw, je php moet nou dit worden:

[COLOR= #0000BB]<?php
$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT youtubelink FROM filmpjes WHERE actief = 1 ORDER BY RAND() LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]youtubelink[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]youtubelink[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]=nl_NL&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>[/COLOR][COLOR= #007700];
      }[/COLOR]
?>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Nicknl:
Rik schreef:
Klein foutje, als je even had gekeken zag je dat er een komma teveel nog stond emo
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

@tom, ik ga kijken

Heb je de oude tabel verwijderd? emo
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Rik schreef:
Nicknl:
Rik schreef:
Klein foutje, als je even had gekeken zag je dat er een komma teveel nog stond emo
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

@tom, ik ga kijken

Heb je de oude tabel verwijderd? emo
Jaah emo
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Ik haat ook het opknappen van andermans code, je moet van de ID nog PRIMARY KEY maken.

CREATE TABLE IF NOT EXISTS `youtube` (
  `filmid` int(11) NOT NULL auto_increment,
  `youtubelink` varchar(255) NOT NULL,
  `actief` int(1) NOT NULL default 1,

  PRIMARY KEY `filmid` ( `filmid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


Als ik me niet vergis.
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Doet die van anouksweb het nou of niet?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Tom schreef:
Doet die van anouksweb het nou of niet?
Nope yummie
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Rik schreef:
Ik haat ook het opknappen van andermans code, je moet van de ID nog PRIMARY KEY maken.
CREATE TABLE IF NOT EXISTS `youtube` (
  `filmid` int(11) NOT NULL auto_increment,
  `youtubelink` varchar(255) NOT NULL,
  `actief` int(1) NOT NULL default 1,

  PRIMARY KEY `filmid` ( `filmid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


Als ik me niet vergis.

Thx biggrin
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
lol, hij zou het gewoon moeten doen.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Nu heb ik:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/fskpro/domains/fskproductie.nl/public_html/indextest.php on line 530

en line 530 is:
while($row = mysql_fetch_assoc($sql)) {
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Je moet youtube link vervangen doro die gehele embeded zooi, dan doet hij het.

probeer anders dit is:

[COLOR= #0000BB]<?php
$film[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/JhiKHjEEyC0&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/JhiKHjEEyC0&hl=nl_NL&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$film[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/mq1hF8ZN1yY&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mq1hF8ZN1yY&hl=nl_NL&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$film[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/hqlObmXfZA8&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/hqlObmXfZA8&hl=nl_NL&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$film[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700])];[/COLOR]
?>


Dan moet die embeded dingen vervangen door je eigen.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Die werkt tom, thx
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Alsje, als het goed is moet die 1e ook werken, maar dat weet ik niet zeker.
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
sorry voor mijn bagger script ik wist niet dat hij half af was ik kwam hem opeens tegen op mijn pc
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb em zo:

MYSQL:

CREATE TABLE IF NOT EXISTS `youtube` (
  `id` int(25) NOT NULL AUTO_INCREMENT,
  `code` text NOT NULL,
  `titel` varchar(9999) NOT NULL,
  `duur` int(255) NOT NULL DEFAULT 0,
  `duurmin` varchar(9999) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;


duur is de lengte van het filmpje in seconden
duurmin is de echte tijd die wordt weergeven op de pagina

PHP:

[COLOR= #0000BB]<?php
        $getyt[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM youtube ORDER BY RAND() LIMIT 1"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
        [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$yt[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$getyt[/COLOR][COLOR= #007700])) {[/COLOR]
        ?>

        <meta http-equiv="refresh" content="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$yt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]duur[/COLOR][COLOR= #007700]];[/COLOR] ?>">

        <div id="yttop" class="column">
        <b>Random Song:</b> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$yt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]];[/COLOR] ?>:
        </div>
        <div id="ytduur" class="column">
        <b>Duur:</b> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$yt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]duurmin[/COLOR][COLOR= #007700]];[/COLOR] ?>
        </div>

<object width="100%" height="25"><param name="movie" value="http://www.youtube.com/v/[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$yt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]];[/COLOR] ?>&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$yt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]];[/COLOR] ?>&hl=nl_NL&fs=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="25"></embed></object>

        [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR] ?>


Klein stukje style:

/**YOUTUBE**/
#yttop {
    width: 87%;
}

#ytduur {
    width: 13%;
}
/**YOUTUBE**/


Als het filmpje is afgelopen springt hij naar de volgende yummie
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Superb:
Als het filmpje is afgelopen springt hij naar de volgende yummieNee, hij springt naar de volgende als er een x aantal seconden voorbij zijn, dus als je hem pauzeert springt ie nog naar de volgende
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren