1 (edited by qubertman 2008-02-06 02:34)

Topic: Management > Reports

A topic has been reported and deleted. In Management > Reports, there is a report for it. In the example below, Posts #5 is hyperlinked to an "incorrect or outdated" link. Should not be hyperlinked.

Test forum » Deleted topic » Post #5


In a similar situation, a posting has been reported and deleted. In this example, Post #8 should not be hyperlinked.

Test forum » Testing2 » Post #8

2 (edited by lie2815 2008-02-06 07:41)

Re: Management > Reports

Just do the same testing you do for the user (if it is deleted or not...)
The following would solve it:

The query should look like this:

$query = array(
         'SELECT'    => 'r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter, p.id AS post_exists',
         'FROM'        => 'reports AS r',
         'JOINS'        => array(
             array(
                 'LEFT JOIN'        => 'topics AS t',
                 'ON'            => 'r.topic_id=t.id'
             ),
             array(
                 'LEFT JOIN'        => 'forums AS f',
                 'ON'            => 'r.forum_id=f.id'
             ),
             array(
                 'LEFT JOIN'        => 'users AS u',
                 'ON'            => 'r.reported_by=u.id'
             ),
                array(
                    'LEFT JOIN'        => 'posts AS p',
                    'ON'            => 'r.post_id=p.id'
                )
         ),
         'WHERE'        => 'r.zapped IS NULL',
         'ORDER BY'    => 'r.created DESC'
     );

And then, modify this variable in the loop:

$post_id = ($cur_report['post_exists'] != '') ? '<a href="'.pun_link($pun_url['post'], $cur_report['post_id']).'">Post #'.$cur_report['post_id'].'</a>' : $lang_admin['Deleted post'];

This way it should work.

FluxBB - v1.4.8

Re: Management > Reports

Fixed.

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