Log in

View Full Version : Adding new button, just for posts and encoding issue.


shlomisa
04-16-2009, 11:01 AM
Hi everyone and thanks for your help.
i want to add a button (right next to the quote button) to each post, when a user click on that button he will be transferred to another system that will receive the current page title and postid information.
i tried to edit the 'postbit_legacy' template and added this link:

<a href="mydomain.com/page.php?postId=$post[postid]&postTitle=$post[title] target="_blank">
<img src="$stylevar[imgdir_button]/test.gif" border="0" />
</a>

my problem is that the new button is being displayed in private messages as well.
i have two questions:

1. how can i create a condition that will display the buttons only in posts ?

2. how can i encode the title for sending it in a query string ?

hope i made myself clear.
thanks, Shlomi.

bananalive
04-16-2009, 11:04 AM
<if condition="in_array(THIS_SCRIPT, array('showthread','showpost'))">
<a href="mydomain.com/page.php?postId=$post[postid]&postTitle=$post[title] target="_blank">
<img src="$stylevar[imgdir_button]/test.gif" border="0" />
</a>
</if>

shlomisa
04-16-2009, 11:37 AM
Thanks man, that was a great help.
any info about the encoding issue ? (i need a utf8 encoding for it).
Thanks again.

shlomisa
07-08-2009, 03:01 PM
bumping an old thread.
i wanted to add a link to each post that whenever someone clicks it, it sends the url title and postid to to a different page.

this is what i did :
i added to my postbit legacy template something like this :

<a href="javascript:void(0)" onclick="window.open('someurl.php?postId=$post[postid]&postTitle=$post[title]')">
click
</a>

the problem is that whenever the post title have quotation marks (") or apostrophe (') it mess things up.

do you have any ideas what can i do ?