Log in

View Full Version : Need to redirect GUESTS after post thread to my Support Forum ... which template?


Quarterbore
05-02-2006, 12:33 AM
I needed a support forum where members and guests could post problems (registering, logging in, accessing things, etc) and e-mail via the Contact US form just is less helpful as I have a full staff that can address most issues.

So, I created a forum where anybody can post, registered users can see their own posts, staff can see all posts, but unregistered guests can not see any posts...

So, what happens is the guest enters their trouble ticket (Name, UserName, E-mail, Problem) and then they see the message that they can not see the page because...



You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

You are not logged in. Fill in the form at the bottom of this page and try again.
You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.


I will never allow unregistered users to otherwise post...

Can some help me figure out where I need to redirect the Unregistered user group? Obviously I just need to find the code that executes after the post is submitted that refreshes the browser with the ViewPost and add a conditional that says:

if <usergroup = Unregistered >> Go to Thank You Page I will Create
else <view the new Post>

I really just need some help finding the template because it is just ugly for my guests that are having problems to see that message...

Thanks for any advise!

I am still trying to trace out the code and I would like to know if this is likley the code I need to alter...

In File newthread.php


// ### NOT PREVIEW - ACTUAL POST ###
$threadinfo = fetch_threadinfo($newpost['threadid']); // need the forumread variable from this
mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW);

if ($newpost['postpoll'])
{
$forceredirect = false;
$vbulletin->url = 'poll.php?' . $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]&polloptions=$newpost[polloptions]";
}
else if ($newpost['visible'])
{
$forceredirect = false;
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]#post$newpost[postid]";
}
else
{
$forceredirect = true;
$vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
}

($hook = vBulletinHook::fetch_hook('newthread_post_complete ')) ? eval($hook) : false;
eval(print_standard_redirect('redirect_postthanks' , true, $forceredirect));
} // end if
}


And specifically the following part of that code...


else if ($newpost['visible'])
{
$forceredirect = false;
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]#post$newpost[postid]";
}


Again, all I want to be able to do is add a conditional such as...

else if ($newpost['visible'] and ($vbulletin->userinfo['usergroupid'] == '1')) redirect to Thanks For Contacting Support page (say thanks.php)

else if ($newpost['visible'] and ($vbulletin->userinfo['usergroupid'] != '1')) Uses the code above to allow member to see the post.

I can't FTP from here to see if this works but I figured I would post my guess in case someone with more knowledge could help me with my Syntax or advise if I am looking at the wrong code...

I am also woried that I may be making a mistake doing this but I don't see a likely chance that I will ever let unregistered people post otherwise on my forums...