[DEV] Thank Post Mod (hide MOD compatible )

Hier gibt es phpBB3.0.x MODs zum Downloaden.
Benutzeravatar
Mahony
Site Admin
Site Admin
Beiträge: 792
Registriert: 3. Dez 2006 22:09
Hat sich bedankt: 22 Mal
Danksagung erhalten: 6 Mal

[DEV] Re: Thank Post Mod (hide MOD compatible )

Beitrag von Mahony »

Hallo
Hier noch ein Bugfix, damit sich ein User nicht in einem gesperrten Thema bedanken kann.

Bugfix - Block the thanks button when a topic is locked.

Open thanks.php

Find

Code: Alles auswählen

//redirect guest to login box
if (!$user->data['is_registered'])
{
    login_box();
} 
Add after

Code: Alles auswählen

//Begin NEW Query If the topic is locked, thanks is not allowed
$sql = 'SELECT topic_status
    FROM ' . TOPICS_TABLE . '
    WHERE topic_id = ' . $topic_id;
$result = $db->sql_query($sql);
$topic_locked = $db->sql_fetchfield('topic_status');
$db->sql_freeresult($result);
//END NEW Query If the topic is locked, thanks is not allowed
 
Find

Code: Alles auswählen

if($thanked_post)
        {
            trigger_error('THANKS_CANT_ADD');
        } 
Add after

Code: Alles auswählen

//Begin NEW If the topic is locked, thanks is not allowed
        if($topic_locked)
        {
            trigger_error('THANKS_DISALLOW');
        }
        //End NEW If the topic is locked, thanks is not allowed   
Open viewtopic_body.html

Find

Code: Alles auswählen

<!-- IF THANKS_ENABLE -->
Replace with

Code: Alles auswählen

<!-- IF THANKS_ENABLE and not S_IS_LOCKED -->
clear the cache - leere den cache

Grüße: Mahony
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.
Klug ist, wer nur die Hälfte von dem glaubt, was er hört. Weise ist, wer erkennt, welche Hälfte richtig ist.

Bild
Gesperrt