Hallo, Gast! (Registrieren)

Letzte Ankündigung: MyBB 1.8.37 veröffentlicht (04.11.23)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
MyReactions
#11
vielleicht hat jemand eine Idee

unter PHP 8.1 bekomme ich beim Themenaufruf zahlreiche identische Warnings

Warning [2] Undefined array key "myreactions" - Line: 36 - File: inc/functions_post.php(946) : eval()'d code PHP 8.1.16 (Linux)

die inc/functions_post.php ist sicherlich nicht das Problem, da wird das postbit bzw. postbit_classic Template aufgerufen aber in dem ist der Eintrag vom Plugin
{$post['myreactions']}

im Plugin finde ich die Variable drei mal:
Zeile 484-487
PHP-Code:
    if($post_reactions)
    {
        eval(
"\$post['myreactions'] = \"".$templates->get('myreactions_container')."\";");
    } 

Zeile 576-579
PHP-Code:
        $db->insert_query('post_reactions', array('post_reaction_pid' => $post['pid'], 'post_reaction_rid' => $mybb->input['rid'], 'post_reaction_uid' => $mybb->user['uid'], 'post_reaction_date' => TIME_NOW));

        
myreactions_postbit($post);
        echo 
$post['myreactions'];
        exit; 

Zeile 587-594
PHP-Code:
if($post_reaction)
        {
            
$db->delete_query('post_reactions''post_reaction_id = \''.$post_reaction['post_reaction_id'].'\'');
            
$post get_post($post_reaction['post_reaction_pid']);
            
myreactions_postbit($post);
            echo 
$post['myreactions'];
            exit;
        } 

wie bekommt man diese Warnings weg?
Zitieren
#12
Ändere bitte in der Plugin Datei:
PHP-Code:
if($post_reactions)
{
     eval(
"\$post['myreactions'] = \"".$templates->get('myreactions_container')."\";");


in:
PHP-Code:
$post['myreactions'] = '';
if (!empty(
$post_reactions))
{
    eval(
"\$post['myreactions'] = \"" $templates->get('myreactions_container') . "\";");

Zitieren
#13
danke Sven, es funktioniert (natürlich!)
Zitieren
#14
Schliesse mich da bitte auch an. Ich würde das Plugin gern behalten, bekomme aber viele Fehlermeldungen:

inc/plugin/myreactions.php Zeile 747 und 748
PHP-Code:
$lang->myreactions_received $lang->sprintf($lang->myreactions_received_profile$memprofile['username'], $memprofile['reactions_received'], $reactions_received_posts_count);
    
$lang->myreactions_given $lang->sprintf($lang->myreactions_given_profile$memprofile['username'], $memprofile['reactions_given'], $reactions_given_posts_count); 

inc/plugin/myreactions.php Zeile 777
PHP-Code:
eval("\$myreactions = \"".$templates->get('myreactions_profile')."\";"); 

inc/plugin/myreactions.php Zeile 723
PHP-Code:
eval("\$reaction_image = \"".$templates->get('myreactions_reaction_image')."\";"); 


inc/plugin/myreactions.php Zeile 725
PHP-Code:
eval("\$reactions_given .= \"".$templates->get('myreactions_reaction')."\";"); 


inc/plugin/myreactions.php Zeile 184
PHP-Code:
if($mybb->input['myreactions_debug']) 


inc/plugin/myreactions.php Zeile 284
PHP-Code:
$post['user_details'] = str_replace('{myreactions}''<br />'.$lang->sprintf($lang->myreactions_received_postbit'<a href="javascript:void(0)" onclick="MyReactions.reactedUser('.$post['uid'].', \'received\');"><strong>'.$post['reactions_received'].'</strong></a>').'<br />'.$lang->sprintf($lang->myreactions_given_postbit'<a href="javascript:void(0)" onclick="MyReactions.reactedUser('.$post['uid'].', \'given\');"><strong>'.$post['reactions_given'].'</strong></a>'), $post['user_details']); 


Dankeschön und lg
Karin
Dogs and Fun

Liebe Grüße
Karin
Zitieren
#15
probier mal meine


Angehängte Dateien
.php   myreactions.php (Größe: 23,1 KB / Downloads: 6)
Zitieren
#16
(26.02.2023, 18:08)bv64 schrieb: probier mal meine

DANKE vielmals *freu* - funktioniert !

Ihr seid alle so super - langsam wird mein Forum wieder!
Dogs and Fun

Liebe Grüße
Karin
Zitieren
#17
noch nicht ganz, da fehlen noch einige, sehe ich gerade beim Profilaufruf

ich setz mich mal ran

edit: ersetz sie noch mal mit dieser


Angehängte Dateien
.php   myreactions.php (Größe: 23,14 KB / Downloads: 14)
Zitieren
#18
Post hat sich überschnitten, editiere meins auch.

Ja genau, im Profil war noch was - aber ein riesiges Dankeschön, jetzt funktionierts perfekt !
Schönen Abend und ... danke!

LG
Karin
Dogs and Fun

Liebe Grüße
Karin
Zitieren
#19
hab gerade noch editiert und neue Version dran gepappt Wink
Zitieren
#20
habs gesehen  Smile - hab meins auch editiert
Dogs and Fun

Liebe Grüße
Karin
Zitieren