Add html tags with custom text on facebook sharer link. Link https://www.facebook.com/sharer.php?quote=CUSTOM_TEXT - facebook

I want to use html tags like <a></a>, <br> tags, in custom text like
$text = Hello<br>World
https://www.facebook.com/sharer.php?u=$current_url&t=title&quote=$text

Related

Display Tumblr post content differently using tags

I don't know if what I want it's possible or not, but what I'm looking for is a way of displaying content differently, using tags.
If I have a post with a tag #movies, I would want to display an image of a camera. If the tag is #music, I would like to display an image of a radio.
Try this immediately under {block:Posts}, or before {/block:Posts} depending on where you want the signifier to be.
{block:HasTags}
{block:Tags}
<script type='text/javascript'>
var {Tag} = '{Tag}'; if ({Tag} == 'movies')
{document.write('Movies blah blah');}
</script>
{/block:Tags}
{/block:HasTags}
This should display the text "Movies blah blah" wherever you put the code on posts you tag with the tag "movies" (case sensitive).
Simply repeat for other tags.

Like Box Displays Empty iframe for Some Pages, But Not Others

So the company I work for has a site that has pages for partners, and on those pages, we're displaying the Like Box for the partner's Facebook page. We're using the iframe method of embedding the Like Box, but I get the same results when using the HTML5 method.
Some of the Like Boxes display the iframe, the width and height of the frame take up space on the page, but no content. Inside the empty frame, the HTML tag looks like this:
<html class="no_js" id="facebook" lang="en">
In the ones that do display the Facebook content, it looks like this:
<html lang="en" class="" id="facebook">
It appears to not display the content in all versions of IE and Chrome, but will display for me in Firefox. Others are reporting that it doesn't display the Facebook content in any browser.
I'm at a loss to figure out why this is happening. Any help would be appreciated.
Make sure, that in the iframe
<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2F ...
you are using proper address: "www.facebook" - not for example "web.facebook".
Look also at stackoverflow: "Facebook like button disappears"

need to replace a link in content pulled with file_get_contents & base url

I am using file_get_contents to pull content from an external page. I then use a base tag to fix all broken links and paths. This works perfectly, However, I have javascript tabs in that page with anchor tags that look like this href="#". Problem is, the tab urls are also affected by the base url tag. When you click on it, it opens the tab but also sends you right back to the external page. Can I use a preg_replace to replace all href="#" with href="http://domain.com/page.php#" to fix the tab links? How will I add it to this code of mine?
<?php
$url = 'http://www.externaldomain.com';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>
Try something like this:
$data = preg_replace('/\bhref="#"/', 'href="http://domain.com/page.php#"', $data);
Just replace the href="#" attributes with your desired ones.

Ignore a certain tag in TinyMCE

I'm using TinyMCE editor in my project and I would like to make it ignore the tag <--image-->.
Now, if I write this tag, it replaces it with <p> </p>
Is it possible to do this?
Yes, you will have to add this tag to your valid tinymce tags.
Have acloser look at the tinymce paramter valid_elements and valid_children.

Render FBML in Facebook Dialog Popup

I'm working on a facebook page where there is a table of profile images. Onclick for each of these images, I'm using a facebook dialog to show the name, a picture and a description in a popup.
The name is stored in the <img> name attribute.
The description is stored in the <img> title attribute.
The img src is stored in the <img> src attribute.
So onclick, all of this data is gathered from the image that was clicked on and should be spit out in a dialog.
The problem is I can't get the dialog to render FBML, it just shows it as plain text.
Here's a portion of the FBJS:
function showDialog(element) {
var img_src = element.getFirstChild().getSrc();
var name = element.getFirstChild().getName();
var desc = element.getFirstChild().getTitle();
var msg = '<img src="' + img_src + '" width="160" alt="' + name + '"> ' + desc;
new Dialog().showMessage(name, msg);
}
and the FBML where the function is called:
<img src="http://mydomain.com/path/to/my/image.jpg" border="0" name="myName" title="My Description" width="160">
For example, in this case the dialog would display the following plain text, rather than the rendered FBML I am trying to display:
<img src="http://mydomain.com/path/to/my/image.jpg" width="160" alt="myName"> My Description
How can I get the dialog to render FBML rather than just plain text?
The Facebook Developer Page says "title and content can be either strings or pre-rendered FBML blocks". I'm not really sure what is meant by "pre-rendered". It could be an <fb:js-string>. Unfortunately the fb:js-string does not work in static FBML pages due to a Facebook bug (I think).