needphphelp22 Posted February 6, 2011 Share Posted February 6, 2011 Hello I am using joomla with sobi2. im working in the sobi2 details template. I am having some difficulties with the like button. maybe i'm going about it all wrong but ill show you what i got and hopefully you can lend me some advise. This works <?php echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='; ?> <?php echo 'www.google.com'; ?> <?php echo '&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>'; ?> output ---- (working like button) ---- this works <?php $testv='www.google.com' ?> <?php echo $testv ?> <?php echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='; ?> <?php echo $testv; ?> <?php echo '&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>'; ?> output ------ www.google.com (working like button) ------- This doesn't work <?php $testv=$fieldsFormatted['field_street']; ?> <?php echo $testv ?> <?php echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='; ?> <?php echo $testv; ?> <?php echo '&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>'; ?> output ------- www.google.com (not working like button) -------- facebook gives me an error "The page at http://<span%20%20id=/ could not be reached." Quote Link to comment Share on other sites More sharing options...
requinix Posted February 6, 2011 Share Posted February 6, 2011 What exactly is the value of $testv? Do a View Source and see what you echoed out. Quote Link to comment Share on other sites More sharing options...
needphphelp22 Posted February 6, 2011 Author Share Posted February 6, 2011 good tip. in the source its not comming out right. i get <span id="sobi2Details_field_street">www.google.com</span> <p><iframe src="http://www.facebook.com/plugins/like.php?href= <span id="sobi2Details_field_street">www.google.com</span> &layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p> so in guessing the value is <span id="sobi2Details_field_street">www.google.com</span> i need to remove the <span id="sobi2Details_field_street"> and </span>. the url is always going to be differnet lengths. any idea on the best way to fix the var? 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.