Jump to content
php.lv forumi

Hey ;)


Southwind*

Recommended Posts

Nesen piereģistŗejos , rakņājos pa šo forumu meģināju kautko macīties ir mazs progress , bet tomēr dažas lietas nevarēju atrast..

 

- ķeros pie lietas.

 

Vajdzētu video skriptu. - Lai foruma lietotājs varētu ievietot video no youtubes. [bez upload uz hosta]

 

 

Un jaunumu skriptā vajag izvadīt avatāru, bet niebraucu kā to izdarīt

http://paste.php.lv/a0e19b13b158c417f15656239c06fd92?lang=php kods.

http://img.bagem.lv/images/189361861.png bilde.

 

Ceru uz atsaucību. :)

Edited by Southwind*
Link to comment
Share on other sites

varbut Tev nav uz to attelu noradita pareiza direktorija. foruma jutuuba video var iemest veesi, ja ir jau gatava foruma sistema, tad uzmet pluginu, bet, ja pashtaisits, tad izveido ko lidzigu bbkodam.. [videotags]jutubavideolinks[/videotags]

Link to comment
Share on other sites

ob_start();
       $vid=htmlspecialchars($_POST['youtube']);
       $get=array(
       "/\[youtube\](.*?)\[\/youtube\]/"
       );
       $replace=array(
       '
<object width="480" height="385"><param name="movie" value="$1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="$1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
'
       );
       $vid = preg_replace($get,$replace,$vid);
echo $vid;

TIkai piemērs!

Link to comment
Share on other sites

<?php
if($_POST['add']){
mysql_query("INSERT INTO video(video) VALUES('".$_POST['video']."')");
}
?>
<form method="post">
ID: <input name='video' type='text'><br/>
<input name='add' type='submit'>
</form>

un izvāda

<?php
$sql = mysql_query("SELECT video FROM video");
while($v = mysql_fetch_assoc($sql)){
echo $v['video'];
}
?>

 

??

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...