MyBB Community Forums

Full Version: Why some variables not work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Regards.

I am trying to include a links inĀ  a section of the post, but the variable don't work...

Example:
<a href="http://www.facebook.com/share.php?u=https://www.forodinero.us/showthread.php?tid={$tid}">Example</a>


...but the result is:

http://www.facebook.com/share.php?u=https://www.forodinero.us/showthread.php?tid=

Why this is happening?

Thanks for your information.
<a href="http://www.facebook.com/share.php?u=https://www.forodinero.us/showthread.php?tid={$tid}">Example</a>

Hi, your link structure is incorrect,
try this instead,
 http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}
Thank you for your answer, but the variable {$thread['tid']} don't have any value. The link appear as:

http://www.facebook.com/share.php?u=http...ad.php?tid=

Regards.
Are you putting that into a post or a template? Which template?

And try {$thread[tid]}
The variables that are available depend upon the template that you are in. Which template are you trying to add this link to?
What they said, the var works on certain templates, not inside a post

If you are putting this in a single post as a logged in user, it might work like so by just adding the thread i.d like so
http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid=1
or
http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid=2
or
http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid=3

for example.