Warning: The author of this contribution does not provide support for it anymore.

Quote Post Back Link (QPBL)

*Topic* title instead of post subject - Quote Post Back Link (QPBL)

*Topic* title instead of post subject

by FoulFoot » Thu Mar 21, 2013 3:25 pm

I noticed that if a poster entered no subject for a post, that QPBL has nothing to link to (and just writes "joebob wrote in: " with no back-link).

This code changes the displayed line to the *topic* title instead of the post subject. The link itself remains exactly as before:

OPEN includes/mods/quote_post_back_link/quote_post_back_link.php

FIND

Code: Select all

            'SELECT'   => 'p.post_id, p.topic_id, p.forum_id, p.post_subject, p.post_time',
            'FROM'      => array(
               POSTS_TABLE => 'p',
            ),
            'WHERE'      => "p.post_id = {$post_id}",

REPLACE WITH

Code: Select all

            'SELECT'   => 'p.post_id, p.topic_id, p.forum_id, p.post_time, x.topic_id, x.topic_title',
            'FROM'      => array(
               POSTS_TABLE => 'p',
               TOPICS_TABLE => 'x'
               ),
            'WHERE'     => 'p.post_id = ' . $post_id . ' AND p.topic_id = x.topic_id',

FIND

Code: Select all

            $replace['$3'] = censor_text($this->qpbl_posts_cache[$post_id]['post_subject']);

REPLACE WITH

Code: Select all

            $replace['$3'] = censor_text($this->qpbl_posts_cache[$post_id]['topic_title']);

Enjoy --

Foul
FoulFoot
Registered User
Posts: 262
Joined: Mon Jun 23, 2003 1:04 am
Location: Honolulu, HI
Contact: