Topic: "Unable to fetch topic" ?

My server just got hacked, so I uploaded everything again since it was only index* files whom were deleted.
I can watch the forum and it's categories, even the topics.
But when I click on one it stops hmm

What can they have done? Can somebody list all the forum-related tables in your database so I can see if something has vanished..

Re: "Unable to fetch topic" ?

Please enable DEBUG mode and try again. That way, we'll have a more detailed error message.

Do you have any idea how your server got hacked? At first I thought you meant that the forum was hacked somehow, but then I read the part about the deleted files. I believe doing that from within PunBB would be very difficult :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: "Unable to fetch topic" ?

OH! smile Forgot that.. Hold on then smile

Re: "Unable to fetch topic" ?

File: /home/hlcae/public_html/forum/viewforum.php
Line: 149

PunBB reported: Unable to fetch topic list for forum
Database reported: Unknown column 't.replies' in 'field list' (Errno: 1054)

Re: "Unable to fetch topic" ?

Well, it appears that your topics table is somehow corrupt. Do you have access to phpmyadmin? In that case you could export the table structure and paste it here. Here's how:

1. Click "Export" (the top row of links)
2. Click "Select all"
3. Uncheck "Data" (we only want the structure)
4. Finally, click the "Go" button

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: "Unable to fetch topic" ?

CREATE TABLE `topics` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `poster` varchar(25) NOT NULL default '',
  `subject` varchar(70) NOT NULL default '',
  `posted` int(10) unsigned NOT NULL default '0',
  `last_post` int(10) unsigned NOT NULL default '0',
  `last_post_id` int(10) unsigned NOT NULL default '0',
  `last_poster` varchar(25) default NULL,
  `subscribers` text,
  `num_views` mediumint(8) unsigned NOT NULL default '0',
  `num_replies` mediumint(8) unsigned NOT NULL default '0',
  `closed` tinyint(1) NOT NULL default '0',
  `sticky` tinyint(1) NOT NULL default '0',
  `moved_to` int(10) unsigned default NULL,
  `forum_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `topics_forum_id_idx` (`forum_id`)
) TYPE=MyISAM AUTO_INCREMENT=69 ;

Re: "Unable to fetch topic" ?

Hmm, wait a minute. What version are you running? The field is called `num_replies`, not `replies`. Are you perhaps using some old version of viewforum.php?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8 (edited by zapher 2003-12-13 17:08)

Re: "Unable to fetch topic" ?

Hmm, perhaps I am?
The file is 10 473 b big.

9 (edited by zapher 2003-12-13 17:36)

Re: "Unable to fetch topic" ?

I have version 1.0.1 and the only mod I've performed and that has a connection to viewforum.php is EFAM.
So I compared the file with the EFAM-notes and everything checks out.

So, I don't really know what has happened.

Could you isolate the code that has to do with num_replies maybe? So I can check the .php ?

10

Re: "Unable to fetch topic" ?

$result = $db->query('SELECT DISTINCT p.poster_id AS hasposted, m.message, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p'.$useindex.' ON t.id=p.topic_id AND p.poster_id='.$cur_user['id'].' INNER JOIN '.$db->prefix.'posts AS m ON t.first_post_id = m.id WHERE t.id IN('.$threadids.') ORDER BY sticky DESC, last_post DESC' ) or error( 'Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error() );

Is the code I found from the error.
t.replies hmm Should I just change to t.num_replies?

Re: "Unable to fetch topic" ?

Very odd, but yes, try changing that.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

12

Re: "Unable to fetch topic" ?

Tried...
File: /home/hlcae/public_html/forum/viewforum.php
Line: 149

PunBB reported: Unable to fetch topic list for forum
Database reported: Unknown column 't.first_post_id' in 'on clause' (Errno: 1054)

Re: "Unable to fetch topic" ?

Try replacing all your scripts with the ones from the 1.0.1 archive.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

14

Re: "Unable to fetch topic" ?

It's really weird. Can't remember why it would have changed that line, must have been an old mod ?

Anyways. I took a brand new from the 1.0.1 zip and made the modification(locked forum etc) that I wanted and now it works!
At least I think it does. Bbl if it's cranky.
Thx for the help!

Re: "Unable to fetch topic" ?

No problem :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."