Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
1.8 $thread['url']
#1
Please add a variable $thread['url'], that give us the URL of the current thread. I asked for this, because I'm struggling to setup a Facebook Comment Box that needs the URL of the current thread (v1.6.9).
Thanks
Reply
#2
There is a function for this to create the URL: get_thread_link($tid, $page=0, $action='')
Support PMs will be ignored!
Reply
#3
I think he means to add that variable to be used in the showthread templates, currently it is not possible to get the thread url in that templates on a default installation.
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#4
Ah ok but I don't think we should add this because it requires many changes (in templates and in our core).
Support PMs will be ignored!
Reply
#5
How come? Just ad a new line in the showthread.php file before the breadcrumb and update the self:
$threadurl = get_thread_link($thread['tid']);

Anyone will be able to use it in the templates if the wish to.
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#6
But what if you want to load threads somewhere else? So I don't think it should be core, if you want to have the link just add the line above where you need it Wink
Support PMs will be ignored!
Reply
#7
I don't think he means to save the url in the DB, just to make it accessible in the showthread templates.
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#8
(2013-02-18, 08:51 PM)Omar G. Wrote: I think he means to add that variable to be used in the showthread templates, currently it is not possible to get the thread url in that templates on a default installation.

Yes, That's what I mean, thanks Omar for explanation.
Reply
#9
Why not use PHP super globals? Templates allow you to use PHP variables and $_SERVER is a variable...

$_SERVER['REQUEST_URI']

(I haven't tested it)
Reply
#10
I'm not sure but I think the MyBB template system wont allow that variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)