Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2010-04-20 09:50:25
- sereal
- Member
- From: Indonesia
- Registered: 2010-02-18
- Posts: 55
what is wrong with this Tweet tag ?
hi
please point me what is wrong with this tag, it doesn’t show properly on browser :(
<a href="http://twitter.com/home?status=Sedang%20membaca%20@mywebsite%20%3Ca%20href='<txp:php>echo file_get_contents("http://tinyurl.com/api-create.php?url=".permlink(array())).'\'%3E'.$thisarticle['url_title'];</txp:php>%3C/a%3E" title="Twit this!" class="tooltip" onclick="window.open(this.href); return false;">+ Tweet!</a>
thanks
$(mydocument).notyetready(function() {});
dowebsitesneedtolookexactlythesameineverybrowser ?
Offline
Re: what is wrong with this Tweet tag ?
Does your host support file_get_contents()? Sometimes it’s disabled for security reasons…
Last edited by JanDW (2010-04-23 16:23:03)
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: what is wrong with this Tweet tag ?
JanDW wrote:
Does your host support file_get_contents()? Sometimes it’s disabled for security reasons…
Yep. Plus, the script doesn’t make that much sense. Sereal, you are calling a global, but you are not really referencing it. You can’t past the global from function to other with out calling the global keyword properly. And actually the global is really not required.
<txp:php>
echo
file_get_contents(
"http://tinyurl.com/api-create.php?url=".
permlink(array())
);
</txp:php>
If cleaner code markup is required, rah_function might come handy. It allows users to execute functions with TXP’s syntax.
<txp:rah_function call="file_get_contents" url='http://tinyurl.com/api-create.php?url=<txp:permlink />' />
As for the Twitter’s status update url, you probably do not want try to add HTML to Twitter. Twitter will automatically link URIs in status messages.
<a href="http://twitter.com/home?status=Sedang%20membaca%20@mywebsite%20<txp:rah_function call="file_get_contents" url='http://tinyurl.com/api-create.php?url=<txp:permlink />' />">
+ Tweet!
</a>
Offline
#4 2010-04-24 17:40:32
- sereal
- Member
- From: Indonesia
- Registered: 2010-02-18
- Posts: 55
Re: what is wrong with this Tweet tag ?
hi JanDW & Gocom
Thanks for the reply,
Yes that Tag is a mess :(
but I already change the tag using what Hick used on his site LevelMag, he gave me the tag couple days ago, and its simpler than that
here’s the new tag I used now
<a href=“http://twitter.com/home?status=Currently reading <txp:permlink/>” target=”_blank”>+ Tweet</a>
@Gocom
I will absolutely test your tag suggestion Sir, because I really need to use short URL
Last edited by sereal (2010-04-24 17:45:07)
$(mydocument).notyetready(function() {});
dowebsitesneedtolookexactlythesameineverybrowser ?
Offline
Pages: 1