Seite 26 von 67

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

Verfasst: 11.08.2009 17:37
von LaFeBeSi
Ich hab ein bischen Erfolg, der Button ist nun da *freu*

Jetzt erhalte ich bei einem Klick drauf folgende Fehlermeldung:
SQL ERROR [ mysql4 ]

Field 'topic_id' doesn't have a default value [1364]

SQL

INSERT INTO phpbb_thanks (thanks_from, thanks_to, post_id) VALUES ('3', '5', 7397)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: thanks.php
LINE: 84
CALL: dbal_mysql->sql_query()

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

Verfasst: 11.08.2009 19:36
von Mahony
Hallo
Du hast sicher diesen Bugfix eingebaut --> http://nationsofmetal.na.funpic.de/foru ... p=503#p503
und musst jetzt noch den dazugehörenden SQL-Befehl ausführen

Code: Alles auswählen

ALTER TABLE `phpbb_thanks` ADD `topic_id` mediumint(8) unsigned NOT NULL DEFAULT '0'; 

Grüße: Mahony

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

Verfasst: 12.08.2009 19:58
von LaFeBeSi
Wenn ich den SQL Befehl ausführen will, kommt ne neue Fehlermeldung:

#1060 - Duplicate column name 'topic_id'

Ich hab diese Spalte wohl schon.

Kann ich das denn anders dennoch anwenden?

In dem Bugfix (den ich vorher nicht gesehen habe, Asche über mein Haupt) soll man in viewtopic.php etwas ändern, das, was ich suchen soll, finde ich in meiner Datei jedoch nicht. Ich hab so das leise Gefühl, dass ich da irgendwas an nachträglichen Fixes nicht habe. Die anderen Bugfixes auf der Seite hab ich eingebaut.

Cache geleert und auch alles aktualisiert und momentan hab ich noch keinen Erfolg. Die Fehlermeldung lautet nach wie vor
SQL ERROR [ mysql4 ]

Field 'topic_id' doesn't have a default value [1364]

SQL

INSERT INTO phpbb_thanks (thanks_from, thanks_to, post_id) VALUES ('3', '5', 39994)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: thanks.php
LINE: 93
CALL: dbal_mysql->sql_query()

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

Verfasst: 12.08.2009 20:04
von Mahony
Hallo
Na dann zeig mal deine viewtopic.php und deine thanks.php im Pastebin


Grüße: Mahony

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

Verfasst: 12.08.2009 20:11
von LaFeBeSi
Okay, ich hab hier was probiert, ich hoffe es ist gelungen:

thanks.php: http://www.phpbb.de/support/pastebin.ph ... view&s=156

viewtopic.php: http://www.phpbb.de/support/pastebin.ph ... view&s=155

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

Verfasst: 12.08.2009 20:44
von Mahony
Hallo
In der thanks.php
Suche

Code: Alles auswählen

$post_id        = request_var('p', 0); 
Füge danach ein

Code: Alles auswählen

$topic_id   = request_var('t', 0);
Suche

Code: Alles auswählen

'post_id'      => $post_id,
Füge danach ein

Code: Alles auswählen

'topic_id'      => $topic_id,
In der viewtopic.php
Suche

Code: Alles auswählen

'WARN_IMG'            => $user->img('icon_user_warn', 'WARN_USER'), 
Füge danach ein

Code: Alles auswählen

'THANKS_IMG'        => $user->img('icon_post_thanks', 'THANKS1'), 
Suche

Code: Alles auswählen

if ($poster_id == ANONYMOUS)
                {
                        $user_cache[$poster_id] = array(
                                'joined'                => '',
                                'posts'                 => '',
                                 //Begin Thank Post MOD
                                  'thanks'        => (isset($row['user_thanks'])) ? $row['user_thanks'] : '',
                                  'thanked'        => (isset($row['user_thanked'])) ? $row['user_thanked'] : '',
                                  'thanks_post'    => (isset($row['user_thanks_post'])) ? $row['user_thanks_post'] : '',
                                  //End Thank Post MOD
                                'from'                  => '',
                                //Begin Thank Post MOD
                                  'thanks'        => (isset($row['user_thanks'])) ? $row['user_thanks'] : '',
                                  'thanked'        => (isset($row['user_thanked'])) ? $row['user_thanked'] : '',
                                  'thanks_post'    => (isset($row['user_thanks_post'])) ? $row['user_thanks_post'] : '',
                                  //End Thank Post MOD
                                'sig'                   => '', 
Ersetze mit

Code: Alles auswählen

if ($poster_id == ANONYMOUS)
        {
            $user_cache[$poster_id] = array(
                'joined'        => '',
                'posts'            => '',
                'from'            => '',
                //Begin Thank Post MOD
                'thanks'        => (isset($row['user_thanks'])) ? $row['user_thanks'] : '',
                'thanked'        => (isset($row['user_thanked'])) ? $row['user_thanked'] : '',
                'thanks_post'    => (isset($row['user_thanks_post'])) ? $row['user_thanks_post'] : '',
                //End Thank Post MOD

                'sig'                    => '', 
Suche

Code: Alles auswählen

$user_cache[$poster_id] = array(
                                'joined'                => $user->format_date($row['user_regdate']),
                                'posts'                        => $row['user_posts'],
                                'warnings'                => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, 
Ersetze mit

Code: Alles auswählen

$user_cache[$poster_id] = array(
                'joined'        => $user->format_date($row['user_regdate']),
                'posts'            => $row['user_posts'],
                //Begin Thank Post MOD
                'thanks'        => (isset($row['user_thanks'])) ? $row['user_thanks'] : '',
                'thanked'        => (isset($row['user_thanked'])) ? $row['user_thanked'] : '',
                'thanks_post'    => (isset($row['user_thanks_post'])) ? $row['user_thanks_post'] : '',
                //End Thank Post MOD
                'warnings'        => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, 
Suche

Code: Alles auswählen

//Begin Thank Post MOD
          $sql = 'SELECT thanks_from
          FROM ' . THANKS_TABLE . '
        WHERE post_id = ' . $row['post_id'] .'
        AND thanks_from = ' . $user->data['user_id'];
         $result = $db->sql_query($sql);
         $give_thanks = $db->sql_fetchfield('thanks_from');
         $db->sql_freeresult($result);

         $sql_array = array(
         'SELECT'        => 'u.username, u.user_colour, t.*',

        'FROM'                => array(
                USERS_TABLE                => 'u',
                THANKS_TABLE        => 't'
        ),

        'WHERE'                => 't.post_id =' . $row['post_id'] . '
                AND u.user_id = t.thanks_from',

        'ORDER_BY'        => 'u.username_clean'
         );

         $sql = $db->sql_build_query('SELECT', $sql_array);
         $result = $db->sql_query($sql);

         $thanks_list = '';
         while ($row2 = $db->sql_fetchrow($result))
         {
        $thanks_user = get_username_string('full', $row2['thanks_from'], $row2['username'], $row2['user_colour'], $row2['username']);
        $thanks_list = $thanks_list . ", " . $thanks_user;
         }

         $thanks_list = ltrim($thanks_list, ", ");
         $postrow = array_merge($postrow, array(
        'THANKS_LIST'                => $thanks_list,
        'U_THANKS'                        => (!$give_thanks) ? append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=thanks') : append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=remove'),
        'S_GIVE_THANKS'                => $give_thanks,
        'S_FIRST_POST'      => true,
        'S_IS_OWN_POST'                => ($poster_id == $user->data['user_id']) ? true : false
        ));
         $db->sql_freeresult($result);

        $template->assign_vars(array(
        'THANKS_ENABLE'      => ($topic_data['enable_thanks']) ? true : false));
        //End Thank Post MOD  
Ersetze mit

Code: Alles auswählen

//Begin Thank Post MOD
$sql = 'SELECT thanks_from
    FROM ' . THANKS_TABLE . '
    WHERE post_id = ' . $row['post_id'] .'
    AND thanks_from = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$give_thanks = $db->sql_fetchfield('thanks_from');
$db->sql_freeresult($result);

$sql_array = array(
    'SELECT'    => 'u.username, u.user_colour, t.*',

    'FROM'        => array(
        USERS_TABLE        => 'u',
        THANKS_TABLE    => 't'
    ),

    'WHERE'        => 't.post_id =' . $row['post_id'] . '
        AND u.user_id = t.thanks_from',

    'ORDER_BY'    => 'u.username_clean'
);

$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);

$thanks_list = '';
while ($row2 = $db->sql_fetchrow($result))
{    
    $thanks_user = get_username_string('full', $row2['thanks_from'], $row2['username'], $row2['user_colour'], $row2['username']);
    $thanks_list = $thanks_list . ", " . $thanks_user;
}

$thanks_list = ltrim($thanks_list, ", ");
$postrow = array_merge($postrow, array(
    'THANKS_LIST'        => $thanks_list,
    'U_THANKS'         => (!$give_thanks) ? append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&t=' . $topic_id .'&mode=thanks') : append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=remove'),
    'S_GIVE_THANKS'        => $give_thanks,
    'S_FIRST_POST'      => true,
    'S_IS_OWN_POST'        => ($poster_id == $user->data['user_id']) ? true : false
    ));
$db->sql_freeresult($result);

    $template->assign_vars(array(
    'THANKS_ENABLE'      => ($topic_data['enable_thanks']) ? true : false));
    //End Thank Post MOD  


Grüße: Mahony

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

Verfasst: 12.08.2009 20:52
von LaFeBeSi
Ich bin sprachlos und sooo froh!! Danke Mahony, es funktioniert dank deiner Hilfe! Vielen lieben Dank!!!!

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

Verfasst: 24.08.2009 21:00
von croxxx69
hallo,

wollte den mod installieren, doch sehe das eine sprachdatei fuer de und eng gibt... kann man den mod fuer andere sprachen installieren? dachte an kroatisch?

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

Verfasst: 24.08.2009 21:39
von Metzle
Hallo,

vom Prinzip her musst du nur die deutsche oder englische Sprachdatei übersetzen und dann entsprechend analog zu der deutschen oder englischen Anweisung in den kroatischen Sprachordner kopieren.

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

Verfasst: 24.08.2009 21:57
von croxxx69
ja, ok... werde es mal versuchen;-)

ach noch etwas was ich jetzt sehe... kann ich diese sachen auch auf einem anderem theme uebernehmen? habe ein theme aus dem netzt gesaugt...