[DEV] phpBBToGo 1.1.5

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
zone97
Registered User
Posts: 76
Joined: Thu Jul 24, 2003 4:00 pm
Contact:

Post by zone97 »

Also i noticed it only gets the first post, now this could be that its overlooking "sticky" posts? dunno..
timconstan
Registered User
Posts: 62
Joined: Tue Oct 29, 2002 5:50 pm
Contact:

Post by timconstan »

What version of phpBB are you using? Are you using something other than "standard" phpBB - that is, are you using any other add-on's. If the database query failed, it usually means that the database structure has been changed.

If it's not displaying your sticky posts, make sure

Code: Select all

$CFG['show_sticky'] = 1;
in phpbbtogo.php.
User avatar
zone97
Registered User
Posts: 76
Joined: Thu Jul 24, 2003 4:00 pm
Contact:

Post by zone97 »

I have added quite a few mods, the only ones i can remeber that had installers for SQL changes were "php calendar" and "Chatbox" if you and im running 2.0.5 could you help me sort out this. Id love to make my board PDA friendly.
timconstan
Registered User
Posts: 62
Joined: Tue Oct 29, 2002 5:50 pm
Contact:

Post by timconstan »

Open phpbbtogo.php in your favorite text editor.

Look for the _fetch() function. It's a line that looks like this:

Code: Select all

function _fetch($sql_where = '')
Within the _fetch() function, find this line:

Code: Select all

//
// Query the database.
//
$CFG['sql'] = $sql;
After that line, add this line:

Code: Select all

echo $sql;
Now, upload phpbbtogo.php to your web site, and browse to your mobile forums. The SQL Select statement that phpBBToGo executes to select information from your phpBB database will be displayed in your web browser. You can compare the select statement to the structure of your database to pinpoint where the problem lies.
User avatar
zone97
Registered User
Posts: 76
Joined: Thu Jul 24, 2003 4:00 pm
Contact:

Post by zone97 »

here is what i got...

Code: Select all

SELECT f.forum_name, p.post_id, p.post_time, p.poster_id, pt.bbcode_uid, pt.post_id, pt.post_text, pt.post_subject, t.forum_id, t.topic_first_post_id, t.topic_last_post_id, t.topic_id, t.topic_poster, t.topic_replies, t.topic_status, t.topic_title, t.topic_type, t.topic_vote, t.topic_moved_id, u.username, u.user_aim, u.user_avatar, u.user_avatar_type, u.user_email, u.user_from, u.user_icq, u.user_id, u.user_interests, u.user_msnm, u.user_occ, u.user_rank, u.user_website, u.user_yim FROM phpbb_topics AS t, phpbb_users AS u, phpbb_posts_text AS pt, phpbb_posts AS p, phpbb_forums AS f WHERE t.topic_id = 3 AND p.post_id IN () AND p.poster_id = u.user_id AND p.post_id = pt.post_id AND p.post_time <= 1059478021 AND t.forum_id = f.forum_id ORDER BY p.post_time
phpBB Fetch Posts Error: Database query failed.
but I have no idea what im looking at or for?
timconstan
Registered User
Posts: 62
Joined: Tue Oct 29, 2002 5:50 pm
Contact:

Post by timconstan »

zone97 wrote: here is what i got...

Code: Select all

SELECT f.forum_name, p.post_id, p.post_time, p.poster_id, pt.bbcode_uid, pt.post_id, pt.post_text, pt.post_subject, t.forum_id, t.topic_first_post_id, t.topic_last_post_id, t.topic_id, t.topic_poster, t.topic_replies, t.topic_status, t.topic_title, t.topic_type, t.topic_vote, t.topic_moved_id, u.username, u.user_aim, u.user_avatar, u.user_avatar_type, u.user_email, u.user_from, u.user_icq, u.user_id, u.user_interests, u.user_msnm, u.user_occ, u.user_rank, u.user_website, u.user_yim FROM phpbb_topics AS t, phpbb_users AS u, phpbb_posts_text AS pt, phpbb_posts AS p, phpbb_forums AS f WHERE t.topic_id = 3 AND p.post_id IN () AND p.poster_id = u.user_id AND p.post_id = pt.post_id AND p.post_time <= 1059478021 AND t.forum_id = f.forum_id ORDER BY p.post_time
phpBB Fetch Posts Error: Database query failed.
but I have no idea what im looking at or for?



Is phpBB running in a MySQL Database, and if so, do you have access to phpMyAdmin - that will make the browsing of your database structure much easier.

If you do have phpMyAdmin running, try coping the above SQL and pasting into phpMyAdmin and running it and see what results you get.

You can also:

Look at your database structure to see that these tables exist:
phpbb_topics
phpbb_users
phpbb_posts_text
phpbb_posts
phpbb_forums

If so, do these fields exist within their specified table:

Does the phpbb_topics table have:
forum_id, topic_first_post_id, topic_last_post_id, topic_id, topic_poster, topic_replies, topic_status, topic_title, topic_type, topic_vote, & topic_moved_id

Does the phpbb_users table have:
username, user_aim, user_avatar, user_avatar_type, user_email, user_from, user_icq, user_id, user_interests, user_msnm, user_occ, user_rank, user_website, user_yim

Does the phpbb_posts_text table have:
bbcode_uid, post_id, post_text, post_subject,

Does the phpbb_posts table have:
post_id, post_time, poster_id,

Does the phpbb_forums table have:
forum_name
McBain
Registered User
Posts: 23
Joined: Wed Oct 16, 2002 9:46 pm
Location: London, UK
Contact:

Post by McBain »

fishfreek wrote: Right now I can do it with one of the mostly text templates but you still end up doing the left to right scroll alot.


Where would I get one of these? I would rather have to scroll left and right a little if I could actually post.

I understand it being an advantage to be able to read your forum while out and about...but to me it is a bit pointless if I can't post replies... :(
Ice to see you...
Irfaan
Registered User
Posts: 99
Joined: Fri May 24, 2002 11:26 pm
Contact:

Post by Irfaan »

posting replies from a PDA NOT connected to the net at that time would mean that during sync, the pda would have to send the replies to the post THEN. Also... you'd have to set a check to make sure that the actual topic has not been deleted -- so your "delayed" reply would not return an error.
No Fear
Irfaan.com - Relax.
Irfaan
McBain
Registered User
Posts: 23
Joined: Wed Oct 16, 2002 9:46 pm
Location: London, UK
Contact:

Post by McBain »

Who is talking about delayed replies? I need a connection to be able to read the posts...I then reply while still connected....job done :?
Ice to see you...
Irfaan
Registered User
Posts: 99
Joined: Fri May 24, 2002 11:26 pm
Contact:

Post by Irfaan »

alright.. but what about those that are on the run? And don't have the wireless modem? They sync, download their "favorite forums/topics" and read while on the road etc... then reply.. sync, upload the replies.
No Fear
Irfaan.com - Relax.
Irfaan
User avatar
zone97
Registered User
Posts: 76
Joined: Thu Jul 24, 2003 4:00 pm
Contact:

Post by zone97 »

I checked couldnt find any missing, if you need my board is fairly fresh (no posts as such) I could get you any data you might need to help trouble shoot this. I feel its a conflict with a mod.
timconstan wrote:
zone97 wrote:here is what i got...

Code: Select all

SELECT f.forum_name, p.post_id, p.post_time, p.poster_id, pt.bbcode_uid, pt.post_id, pt.post_text, pt.post_subject, t.forum_id, t.topic_first_post_id, t.topic_last_post_id, t.topic_id, t.topic_poster, t.topic_replies, t.topic_status, t.topic_title, t.topic_type, t.topic_vote, t.topic_moved_id, u.username, u.user_aim, u.user_avatar, u.user_avatar_type, u.user_email, u.user_from, u.user_icq, u.user_id, u.user_interests, u.user_msnm, u.user_occ, u.user_rank, u.user_website, u.user_yim FROM phpbb_topics AS t, phpbb_users AS u, phpbb_posts_text AS pt, phpbb_posts AS p, phpbb_forums AS f WHERE t.topic_id = 3 AND p.post_id IN () AND p.poster_id = u.user_id AND p.post_id = pt.post_id AND p.post_time <= 1059478021 AND t.forum_id = f.forum_id ORDER BY p.post_time
phpBB Fetch Posts Error: Database query failed.
but I have no idea what im looking at or for?



Is phpBB running in a MySQL Database, and if so, do you have access to phpMyAdmin - that will make the browsing of your database structure much easier.

If you do have phpMyAdmin running, try coping the above SQL and pasting into phpMyAdmin and running it and see what results you get.

You can also:

Look at your database structure to see that these tables exist:
phpbb_topics
phpbb_users
phpbb_posts_text
phpbb_posts
phpbb_forums

If so, do these fields exist within their specified table:

Does the phpbb_topics table have:
forum_id, topic_first_post_id, topic_last_post_id, topic_id, topic_poster, topic_replies, topic_status, topic_title, topic_type, topic_vote, & topic_moved_id

Does the phpbb_users table have:
username, user_aim, user_avatar, user_avatar_type, user_email, user_from, user_icq, user_id, user_interests, user_msnm, user_occ, user_rank, user_website, user_yim

Does the phpbb_posts_text table have:
bbcode_uid, post_id, post_text, post_subject,

Does the phpbb_posts table have:
post_id, post_time, poster_id,

Does the phpbb_forums table have:
forum_name
McBain
Registered User
Posts: 23
Joined: Wed Oct 16, 2002 9:46 pm
Location: London, UK
Contact:

Post by McBain »

Then don't reply until you have a connection :?

What an odd arguement for it not to allow posting?
Ice to see you...
User avatar
zone97
Registered User
Posts: 76
Joined: Thu Jul 24, 2003 4:00 pm
Contact:

Took your advice.

Post by zone97 »

I used phpmyadmin and ran some test.. this is the part of the code thats giving me problems.

Code: Select all

    $posts_list = '';
    // Put results into a list
	while ($row = $db->sql_fetchrow($result))
	{
       $posts_list .= $row[0] . ',';
    }
    $posts_list = substr($posts_list, 0, strlen($posts_list) -1);

	//
    // Create the sql statement (WHERE clause).
    //
    
   $sql = ' t.topic_id = ' . $topic_id . ' AND
             p.post_id IN (' . $posts_list . ') AND
             p.poster_id = u.user_id AND
             p.post_id = pt.post_id AND ';
    
if i take out the line.

Code: Select all

IN (' . $posts_list . ')
it works but displays every post for every forum. instead of just the ones its supposed to. the var $posts_list is coming back empty in the query. this may be my problem, but i dont know enough to correct it.
timconstan
Registered User
Posts: 62
Joined: Tue Oct 29, 2002 5:50 pm
Contact:

Re: Took your advice.

Post by timconstan »

zone97 wrote: I used phpmyadmin and ran some test.. this is the part of the code thats giving me problems.

Code: Select all

    $posts_list = '';
    // Put results into a list
	while ($row = $db->sql_fetchrow($result))
	{
       $posts_list .= $row[0] . ',';
    }
    $posts_list = substr($posts_list, 0, strlen($posts_list) -1);

	//
    // Create the sql statement (WHERE clause).
    //
    
   $sql = ' t.topic_id = ' . $topic_id . ' AND
             p.post_id IN (' . $posts_list . ') AND
             p.poster_id = u.user_id AND
             p.post_id = pt.post_id AND ';
    
if i take out the line.

Code: Select all

IN (' . $posts_list . ')
it works but displays every post for every forum. instead of just the ones its supposed to. the var $posts_list is coming back empty in the query. this may be my problem, but i dont know enough to correct it.


Sorry it's been a while, I've been out of town.

Anyway, it's must be the select statement that's used to gather the data to fill in the var $posts_list. You'll have to do something like you did before to narrow it down some more.

Open phpbbtogo.php in your favorite text editor.

Look for the function phpbb_fetch_thread function. It's a line that looks like this:

Code: Select all

function phpbb_fetch_thread($topic_id = '')
Within the phpbb_fetch_thread function, find this line:

Code: Select all

$CFG['sql'] = $sql;
After that line, add this line:

Code: Select all

echo $sql;
Now, upload phpbbtogo.php to your web site, and browse to your mobile forums. The SQL Select statement that phpBBToGo executes to select the list of posts from your phpBB database will be displayed in your web browser. You can compare the select statement to the structure of your database to pinpoint where the problem lies.
User avatar
zone97
Registered User
Posts: 76
Joined: Thu Jul 24, 2003 4:00 pm
Contact:

Post by zone97 »

sorry to take so long to get back to you as well. here is there error i get this time.

Code: Select all

SELECT post_id FROM phpbb_posts AS p WHERE p.topic_id = 25
any clue?
Post Reply

Return to “[2.0.x] MODs in Development”