Jump to content
php.lv forumi

Video skripts


dulais

Recommended Posts

Nu precīzāk gan varēji paskaidrot.

 

Apbrīnojami :))

 

Skriptu nepētīju, bet to noteikti var(un vajag) atrisināt ar tīru CSS

 

Saliec video div'os, pieškir klasi un nodefinē stilu

div.video_klase{
float:left;
width:200px;
height:200px;
}

 

Pēc tiem video div'iem neaizmirsti nolikt kādu block veida elementu ar stilu clear:both;

Edited by briedis
Link to comment
Share on other sites

Apbrīnojami :))

 

Skriptu nepētīju, bet to noteikti var(un vajag) atrisināt ar tīru CSS

 

Saliec video div'os, pieškir klasi un nodefinē stilu

div.video_klase{
float:left;
width:200px;
height:200px;
}

 

Pēc tiem video div'iem neaizmirsti nolikt kādu block veida elementu ar stilu clear:both;

 

Kaut kas nesanāk rekur style.css video daļa

 

#vf {
float:left;
width:200px;
height:200px;
}

#videoframe {
margin: 0px auto;
padding: 0px auto;
width: 98%;
text-align: center;
}

#video {
float: left;
background: #A3B1B8;
margin: 8px;
height: 145px;
width: 130px;
}

#video:hover {
border:1px solid #ececec;
text-decoration:none;
}

#video span {
width:124px;
font-size:10px;
margin-top:5px;
display:block;
background:#eee;
padding-top:0px;
margin-left:3px;
margin-right:3px;
}

#vidtit {
padding-top: 6px;
}

#vidtit2 {
padding-top: 0px;
padding-bottom:4px;
}

#vidurl {
padding-top: 4px;
height: 94px;
}

 

video.php

 

echo <<< HTML
<tr>
<td>
<div id="vf">
<div id="videoframe">
<b>$video_arr[3]</b>
<div id="vidurl"><a href="videos.php?video=$video_arr[0]" title="$video_arr[3]">
<img src="http://i.ytimg.com/vi/$video_arr[1]/default.jpg" width="80" height="80" border="0">
</a></div>
<div id="vidtit2"><a href="videos.php?video=$video_arr[0]" title="$video_arr[3]"></a></div> 
Pievienoja: <b>$video_arr[2]</b><br>
<a href="videos.php?video=$video_arr[0]">Apskatīt</a><br />
</div>
</div>
</td>
</tr>
HTML;

 

Apskatīt te

Edited by dulais
Link to comment
Share on other sites

Tātad sāku pārveidot skriptu uz mysql jeb lai saglabā video datubāzē, jo marcis teica ka savādāk šis lapaspušu skripts nestrādās. Sataisīju jau ka viņš saglabā datubāzē, bet nesanāk izvilkt uz lapu.

 

video_adder.php

 

<?

include('config.php');

$video_id = time()+($config_date_adjust*60);


$add = "INSERT INTO video ( video_id, embed, autors, nosaukums)
VALUES('$video_id', '$_POST[embed]', '$_POST[autors]', '$_POST[nosaukums]')";
mysql_query($add) or die(mysql_error());
mysql_close();


echo <<< HTML
<table>
<tr>
<td>Video veiksmīgi pievienots</td>
</tr>
</table>

<table>
<tr>
<td>Doties atpakaļ pie <a href="http://revenge.lv/?kur=video"><span style="color:#FF0000">video saraksta</span></a></td>
</tr>
<tr>
<td>Doties<a href="http://revenge.lv/?kur=video_add"><span style="color:#FF0000">pievienot </span></a>vēlvienu video</td>
</tr>
</table>
HTML;
?>

 

un video.php

 

<?

error_reporting(E_ALL);
ini_set("display_errors", 1); 


$file = file("video/video.php"); 
$filesCount = "0";
for($line = 0; $line < sizeof($file); $line++) { if(@"guest" == substr($file[$line], 0, 5)) $filesCount++; else $filesCount++; }

$file = file("video/video.php");
$totalLines = sizeof($file);
for($line = 0; $line < $totalLines; $line++)
{
$video_arr = explode("|", $file[$line]);


echo <<< HTML
<div id="vf">
<div id="videoframe">
<b>$video_arr[3]</b>
<div id="vidurl"><a href="videos.php?video=$video_arr[0]" title="$video_arr[3]">
<img src="http://i.ytimg.com/vi/$video_arr[1]/default.jpg" width="80" height="80" border="0">
</a></div>
<div id="vidtit2"><a href="videos.php?video=$video_arr[0]" title="$video_arr[3]"></a></div> 
Pievienoja: <b>$video_arr[2]</b><br>
<a href="videos.php?video=$video_arr[0]">Apskatīt</a><br />
</div>
</div>
HTML;

}


if($filesCount == "0") { echo "<tr><td>Nav neviens video</td></tr>"; }
?>

 

kur tad man likt SELECT vai ko tur tad vajag??

Edited by dulais
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...