I have a plugin where is displayed some news with a like facebook button.
I would change the width of this like in this site:
(see the right sidebar)
http://www.fanpage.it/moody-s-boccia-anche-la-germania-e-la-prima-volta-per-la-merkel/
This is my site:
http://www.clouderize.it/michele/
For my button I use this url but whatever width value I set, the button dimension not change!
How can I do ?
<iframe
src="http://www.facebook.com/widgets/like.php?href=<? the_permalink(); ?>&layout=button_count&width=450&action=like&colorscheme=light&font&show_faces=false&height=64"
scrolling="no" frameborder="0"
style="border:none;">
</iframe>
try this
#fb-bar iframe{min-height:80px !important;}
<div id="fb-bar">
<fb:like href="link"></fb:like>
</div>
Or
<div id="fb-bar">
<iframe
src="http://www.facebook.com/widgets/like.php?href=<? the_permalink(); ?>&layout=button_count&width=450&action=like&colorscheme=light&font&show_faces=false&height=64"
scrolling="no" frameborder="0"
style="border:none;">
</iframe>
</div>
Related
I want to display the youtube link stored in the database and just call the link but it can't
<div class="divideo">
<iframe width="560" height="315" src="<?php echo $link; ?>" frameborder="0" allowfullscreen></iframe>
</div>
but youtube can't connect
<div class="divideo">
<iframe width="560" height="315" src="<?php echo base_url(); ?>/path/<?php echo $link ?>" frameborder="0" allowfullscreen></iframe>
</div>
You should have to give the proper path of the video link if that link is in your server if you are using an external source then use a proper link in your src tag.
I want to hide iframe if there is no $content present.
<div class="video">
<iframe width="600px" height="400px" src="'.$content.'?autoplay=1" frameborder="0" scrolling="no" allowfullscreen style="visibility:hidden;" onload="this.style.visibility=\'visible\';"></iframe>
</div>
In my case if $content is not present, iframe loads src="?autoplay=1"
I think this will do the trick:
<?php
// Test if variable is set and has content in it
if( isset($content) && $content != "") {
echo '<div class="video"><iframe width="600px" height="400px" src="'.$content.'?autoplay=1" frameborder="0" scrolling="no" allowfullscreen style="visibility:hidden;" onload="this.style.visibility=\'visible\';"></iframe></div>'
}
?>
This way the iframe will not be printed in the html in case of no content.
I have a page called 'mas.php' where i retrieve values from database. An IFrame is present in mas.php page. It is defined as follows:
<iframe width="523" height="234" scrolling="No"
width="500" height="145" src="mail-to.php" frameborder="0"
name="myframe" ></iframe>
Now from mail-to.php page I have to navigate to mail.php for mailing.
The sequence is:
(mas.php-->mail-to.php[iframe]--->mail.php)......
here while using the iframe in 'mas.php' page can i navigate to 'mail-to.php' by defining id in iframe?
<iframe width="523" height="234" scrolling="No"
width="500" height="145" src="mail-to.php?id=<?php echo $row['id'];?>"
frameborder="0" name="myframe" ></iframe>
I have this following code where i cannot play the player in second iframe from first iframe . Although this works fine if the link to play song is in the main page and not inside the first iframe
<script type="text/javascript">
function music(dir) {
alert(dir);
var iframe = document.getElementById("player");
iframe.src = dir;
}
</script>
<iframe src="home.php" frameborder="0" scrolling="no" width="100%" height="100%" style="background:#993333"></iframe>
<iframe id="player" src="player.php" frameborder="0" scrolling="no" width="400px" height="100px" style="background:#66FF99"></iframe>
//home.php
<a href="#" onclick="return music('player.php?item=test2')" >Song2</a>
//player.php
<object type="application/x-shockwave-flash" data="dewplayer.swf?mp3=mp3/music.mp3&autostart=1" width="200" height="20" id="dewplayer"><param name="wmode" value="transparent" />
</object>
Example:
main.php
<script type="text/javascript">
function music(dir) {
alert(dir);
var iframe = document.getElementById("player");
iframe.src = dir;
}
</script>
<iframe src="home.php" frameborder="0" scrolling="no" width="100%" height="100%" style="background:#993333"></iframe>
<iframe id="player" src="player.php" frameborder="0" scrolling="no" width="400px" height="100px" style="background:#66FF99"></iframe>
player.php
<?php if(!empty($_GET['item'])){echo '<div>item = '.$_GET['item'].'</div>';} ?>
<object type="application/x-shockwave-flash" data="dewplayer.swf?mp3=mp3/music.mp3&autostart=1" width="200" height="20" id="dewplayer"><param name="wmode" value="transparent" />
</object>
home.php
<a href="#" onclick="parent.music('player.php?item=test2')" >Song2</a>
First iframe doesn't have an ID.
Both those iframes are not part of each other's document. So if you have to change url of one from the other you have to bring in parent in the picture.
You could use the new window.postMessage API to send a message from one remote frame to it's parent, and then have the parent window proxy that make message back to the other iframe by passing that message onto the other iframe.
For documentation on this, see the Mozilla page (https://developer.mozilla.org/en-US/docs/DOM/window.postMessage)
I'm creating a dynamic site with php/mysql. There are few article. So i want to show a facebook like button for every article. How do i do this.
article show with php:
echo "<h2><a href='readmore.php?post_id= ". $id ."'>$sub</a></h2>";
Anyone can help me.
Add following code for each your article, and like button will show on each article:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo "http://www.yousite.com/$yourArticleUrlHere"; ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;"></iframe>
Hope it helps
echo '<iframe src="http://www.facebook.com/widgets/like.php?href=<?= "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>" scrolling="no" frameborder="0" style="border:none; width: 450px; height: 80px;"></iframe>';
Don't forget to include Facebook JavaScript SDK in the beginning, after opening body tag: http://developers.facebook.com/docs/reference/plugins/like/
I hope this code will help:
<?php
// Facebook Like button HTML 5 syntax
echo '<div class="fb-like" data-href="http://www.yourwebsite.com/readmore.php?post_id='.$id.'" data-send="true" data-width="450" data-show-faces="true"></div>';
// Facebook Like button XFBML syntax
echo '<fb:like href="http://www.yourwebsite.com/readmore.php?post_id='.$id.'" send="true" width="450" show_faces="true"></fb:like>';
?>