Quote:
Originally Posted by Paul M
There is also a premissions problem - you cannot pdf threads unless they are viewable by guests, and also a slight error in the url build as well.
I think I have fixed these problems locally, but need to test them, and I have to go out now for a few hours.
|
JFYI - I've changed the following in threadtopdf.php
PHP Code:
$htmlFile = $vbulletin->options['bburl'] . '/threadtopdf.php?t=' . $threadid . '&pdf=1';
to
PHP Code:
$htmlFile = $vbulletin->options['bburl'] . '/threadtopdf.php?t=' . $threadid;
and
PHP Code:
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
{
print_no_permission();
}
if ($threadinfo['open'] == 10)
{
exec_header_redirect('threadtopdf.php?' . $vbulletin->session->vars['sessionurl_js'] . "t=$threadinfo[pollid]");
}
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
to
PHP Code:
if ($threadinfo['open'] == 10)
{
exec_header_redirect('threadtopdf.php?' . $vbulletin->session->vars['sessionurl_js'] . "t=$threadinfo[pollid]");
}
if ($_SERVER['SERVER_ADDR'] != IPADDRESS)
{
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
{
print_no_permission();
}
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
}
Apart from the missing images, I now have a fully operational Thread > PDF (on my test forum).
If I decide to make this live I will probably do custom templates instead of using the printthread templates.