I have a Tumblr site where I can edit the HTML and CSS. They have this variable which is called {Permalink} which refers to the current post's link.
Since PHP is not allowed, I had to host a script externally and put it in my site through an iframe. The problem is that the script contains this:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="YOUR URL" num_posts="1" width="460"></fb:comments>
where I would like to replace "YOUR URL" with {Permalink}. Since the PHP file is hosted externally it wouldn't work. So what I'm looking for is to put a undefined variable there, and define that variable through my iframe, like so:
<iframe src="my.php" width: "460" data-urlvariable: "{Permalink}"></iframe>
and in my .php file:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="$_data-urlvariable" num_posts="1" width="460"></fb:comments>
I figured the php GET method would do the job, but I'm not so sure how to use it in a <div><script>
.
So is there a way to define a variable within my tumblr site and put it in my externally hosted php file?
Anyway here's part of the .php file.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="YOUR URL" num_posts="1" width="460"></fb:comments>
<div style="visibility:hidden">
<?php
$STD_PATTERN = "<img src='@@userpicture@@'/><a href='@@userlink@@'>@@username@@</a> <BR> @@message@@ <BR> @@formatteddate@@<HR>";
/* PLEASE DON'T MODIFY THE CODE BELOW THIS COMMENT */
class SEO_FBComments {
const GRAPH_COMMENTS_URL = "https://graph.facebook.com/comments/?ids=";
private $pattern;
private $pageUrl;