dulais Posted September 5, 2009 Report Share Posted September 5, 2009 Tātad ir video skripts viss strādā izvada video uz lapu, bet kā man sakārtot piem. lai rindiņā būtu 3 video video.php te Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 5, 2009 Report Share Posted September 5, 2009 Par rindiņu maybe paņem ieliec <div> tagos un saliec tā lai viņi iet tur tai platumā tikai 3, un ja vaig lappaspusēs vēl dalīt pameklē kaut kur forumā par to bija! Ja atradīšu pateikšu, kaut gan man tas lappaspušu skripts ir! Quote Link to comment Share on other sites More sharing options...
dulais Posted September 5, 2009 Author Report Share Posted September 5, 2009 un saliec tā lai viņi iet tur tai platumā tikai 3 Nu precīzāk gan varēji paskaidrot. Quote Link to comment Share on other sites More sharing options...
briedis Posted September 5, 2009 Report Share Posted September 5, 2009 (edited) 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 September 5, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
blackhalt Posted September 5, 2009 Report Share Posted September 5, 2009 Princips: <?php for ($i = 1; $i <= 100; $i++) { $atdalitajs = ($i % 3 ? '' : '<br />'); echo $i.$atdalitajs; } ?> Quote Link to comment Share on other sites More sharing options...
dulais Posted September 6, 2009 Author Report Share Posted September 6, 2009 (edited) 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 September 6, 2009 by dulais Quote Link to comment Share on other sites More sharing options...
euphoric Posted September 6, 2009 Report Share Posted September 6, 2009 Nu tak starp "<tr>" tegiem taisi 3is "<td>" un iekš "<td>" tīru video scriptu. Un tad atkal "<tr>" nakamā rinda.. Quote Link to comment Share on other sites More sharing options...
briedis Posted September 6, 2009 Report Share Posted September 6, 2009 Vienā lapā nevar atrasties elementi ar vienādiem ID. Manuprāt tev vajadzētu sākumā paprovēt salikto tos video vienā rindā bez cikliem, tad pētīt html un štukot ko tur pa vidu būtu jāliek cikls... Quote Link to comment Share on other sites More sharing options...
waplet Posted September 6, 2009 Report Share Posted September 6, 2009 (edited) vai tad if($video['rows'] % 3 == 0) ? "</tr><tr>" : " "; neder? edited... vai šādi? Edited September 6, 2009 by waplet Quote Link to comment Share on other sites More sharing options...
marcis Posted September 6, 2009 Report Share Posted September 6, 2009 waplet, tavs variants ir vairāk kā garām (sintakse un ideja) :) Tāpat arī blackhalt variants. Ir jāpārbauda vai atlikums ir vienāds ar nulli. Quote Link to comment Share on other sites More sharing options...
dulais Posted September 9, 2009 Author Report Share Posted September 9, 2009 Paldies kuri palīdzēja tagad atliek uztaisīt pa lapaspusēm atradu skriptu te, bet nu kaut kas neiznāk. Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted September 9, 2009 Report Share Posted September 9, 2009 Kaut kas nesanāk? Risinājums ir vienkāršs - vajag kaut ko kaut kur izmainīt, tad sanāks! :) Quote Link to comment Share on other sites More sharing options...
dulais Posted September 12, 2009 Author Report Share Posted September 12, 2009 (edited) 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 September 12, 2009 by dulais Quote Link to comment Share on other sites More sharing options...
dulais Posted September 13, 2009 Author Report Share Posted September 13, 2009 BUMP Quote Link to comment Share on other sites More sharing options...
anonīms Posted September 13, 2009 Report Share Posted September 13, 2009 Man rēgojas? o0 echo <<< HTML Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.