Guest posts can't be converted with submit_post

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

Guest posts can't be converted with submit_post

Postby Globetrotter » Sun Jan 24, 2010 11:45 am

Hi All,

Not sure if this is the correct forum/site to ask, but feel free to move or delete :) I'm writing a convert script for my old site to import all the comments into phpbb. Everything works perfectly for registered userpost but converting guest post completely correct seems impossible. Because I got some great other help here I was wondering if anyone could help me with the code below.

To convert registered users I use the code below, which works:
Code: Select all
<snip>
$user->session_begin();
$user->setup();
$auth->login('user''password'false); //Some valid user username and password
$auth->acl($user->data);
    
$user->data['user_id'] = $arrRow2['userid'];
$user->data['user_ip'] = $arrRow2['ipaddress'];
$user->data['username'] = $arrRow2['name'];
<
snip>
//make post here
  


When I do the same for guest posts I get correct information on the topic overview pages (so you can see who made the first post and the last one) but on the topic page all posts are linked to the user I use at $auth->login('user', 'password', false); When I skip the login part in de code the posts are converted but without the postnames i have stored in my own comment table. I tried to update the posts after they were converted but then the topic overview information seemed to be incorrect.

I used this topic to get the member part working, but unfortunately this isn't working for guests.

Anyone a idea how to solve this?
Globetrotter
 
Posts: 38
Joined: Sat Sep 06, 2008 2:17 pm

Advertisement

Re: Guest posts can't be converted with submit_post

Postby dcz » Sun Jan 31, 2010 1:52 pm

For submit_post, from what is said here :
http://wiki.phpbb.com/Submit_post
you may need to specify a guest user name in the call.

Also, for the user adding part, you may be interested into reading this : http://wiki.phpbb.com/Add_users

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Re: Guest posts can't be converted with submit_post

Postby Globetrotter » Tue Feb 02, 2010 7:19 pm

http://wiki.phpbb.com/Submit_post
I've checked that site a 1000 times and this is the fist time I see where to put the username for a guest!

Thank you very much, for the eye opener :)
For other people with the same problem:
submit_post('post', $argStrTitle, 'YOUR GUEST NAME HERE', POST_NORMAL, $poll, $data);
Globetrotter
 
Posts: 38
Joined: Sat Sep 06, 2008 2:17 pm


Return to phpBB Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Xee and 8 guests