MyBB Community Forums

Full Version: how to adjust this code in plugin ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
i want to adjust this code in my plugin :

http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}

but when i put this code , it makes error because of the single quotation mark in {$thread['tid']} or {$mybb->settings['bburl']}

how can i remove this error ?

thanks
thanks Omar G.
i have another question :
when i put this code :
http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}
everything is OK , but thread id doesn't come at the end of the url
Maybe you have to use $tid

Because that var has added on showthread.php, anyway if this does not work you have to globalize that vars and then maybe use get function if does not work, but i think if you only use $tid have to work xD.

There are two values for some parts of forums as i see.

Try that and told us what happen, maybe if you don't have positive effects can help to you on how to xD.
(2014-04-04, 06:05 AM)MybbCo Wrote: [ -> ]everything is OK , but thread id doesn't come at the end of the url

It depends in which template or plugin hook you want to use the code in.
I want to show the share box in showthread template
I used this hook : showthread_start
global $thread;

echo $thread['tid'];

Should work in that hook.
You want to urlencode the thread URL.

global $thread;
$url = "http://www.facebook.com/share.php?u=" . urlencode($mybb->settings['bburl'] . '/showthread.php?tid=' . $thread['tid']);
Thanks Omar G. & laie_techie