Hallo, Gast! (Registrieren)

Wir wünschen allen Besuchern frohe Ostern!

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


Benutzer, die gerade dieses Thema anschauen: 2 Gast/Gäste
Thankyou MyBB System
#41
Eine neue Version wurde veröffentlicht: Thankyou MyBB System 2.6.3
Zitieren
#42
hi!
also ich möchte gerne dieses Plugin nutzen, allerdings kollidiert es an mancher Stelle wohl mit einem anderen.

Ich nutze dieses RPG-Relations Plugin (Link)
Hier der Plugin-Code:
Code:
<?php

if(!defined("IN_MYBB"))
{
        die("Direct initialization of this file is not allowed.");
}

$plugins->add_hook("member_profile_end", "rprelations_member_profile_end");
$plugins->add_hook("usercp_do_options_end", "rprelations_usercp_options");
$plugins->add_hook("usercp_options_start", "rprelations_usercp");


function rprelations_info()
{
        return array(
                "name"                        => "RPG-Relations",
                "description"        => "Charaktere können in Profilen anderer Charaktere samt Beziehungsangabe & Kategorisierung in Positiv, Negativ & Neutral angegeben werden.",
                "website"                => "http://www.storming-gates.de",
                "author"                => "sparks fly",
                "authorsite"        => "http://www.storming-gates.de",
                "version"                => "1.0",
                "compatibility" => "*"
        );
}

function rprelations_install()
{
  global $db, $mybb;

        // Tabelle erstellen
        $db->query("CREATE TABLE `".TABLE_PREFIX."rprelations` ( `rid` INT NOT NULL AUTO_INCREMENT , `suid` INT(11) NOT NULL , `ruid` INT(11) NOT NULL , `type` VARCHAR(155) NOT NULL , `relation` VARCHAR(155) NOT NULL , PRIMARY KEY (`rid`)) ENGINE = MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;");

        $db->query("ALTER TABLE `".TABLE_PREFIX."users` ADD `rprelationspm` int(11) NOT NULL;");

        // Templates erstellen
        $insert_array = array(
                'title'                => 'member_profile_rprelations',
                'template'        => $db->escape_string('<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder tfixed">
<tr>
<td class="thead"><strong>Beziehungen</strong></td>
</tr>
<tr>
<td class="trow1" align="center">
        {$relation_type_bit}
</td>
</tr>
</table>
<br />'),
                'sid'                => '-1',
                'version'        => '',
                'dateline'        => TIME_NOW
        );
        $db->insert_query("templates", $insert_array);

        $insert_array = array(
                'title'                => 'member_profile_rprelations_add',
                'template'        => $db->escape_string('<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder tfixed">
<tr>
<td class="thead"><strong>Zur Beziehungskiste hinzufügen</strong></td>
</tr>
<tr>
<td class="trow1" align="center">
        <form method="post" action="member.php?action=profile&addrel={$memprofile[uid]}" id="addrel">

                <input type="text" class="textbox" name="relation" id="relation" value="{$relvalue}" />
                <select name="type" id="type">
                        <option>Kategorie wählen</option>
                        <option value="positiv">Positiv</option>
                        <option value="neutral">Neutral</option>
                        <option value="negativ">Negativ</option>
                </select>
                <input type="submit" name="submit" id="submit" class="button" />

        </form>
</td>
</tr>
</table>
<br />'),
                'sid'                => '-1',
                'version'        => '',
                'dateline'        => TIME_NOW
        );
        $db->insert_query("templates", $insert_array);

        $insert_array = array(
                'title'                => 'member_profile_rprelations_bit',
                'template'        => $db->escape_string('<div class="trow2" style="text-align: center;">
        <table border="0" cellpadding="5" cellspacing="5" class="smalltext" style="width: 100%;">
                <tr>
                        <td width="10%">{$useravatar}
                        </td>
                        <td>{$relation[\'profilelink\']} &raquo; {$relation[\'relation\']}
                        </td>
                        <td>
                                {$delete_rel}
                        </td>
                </tr>
        </table>
</div>'),
                'sid'                => '-1',
                'version'        => '',
                'dateline'        => TIME_NOW
        );
        $db->insert_query("templates", $insert_array);

$insert_array = array(
        'title'                => 'member_profile_rprelations_none',
        'template'        => $db->escape_string('<div class="trow2" style="text-align: left;">
        <table border="0" cellpadding="5" cellspacing="5" class="smalltext">
                <tr>
                        <td>Keine Einträge vorhanden!
                        </td>
                </tr>
        </table>
</div>'),
        'sid'                => '-1',
        'version'        => '',
        'dateline'        => TIME_NOW
);
$db->insert_query("templates", $insert_array);

$insert_array = array(
        'title'                => 'member_profile_rprelations_types',
        'template'        => $db->escape_string('<div style="width: 32.3%; float: left; margin: 5px;">
        <div class="tcat">{$type}</div>
        <div style="height: 150px; overflow: auto;">
                {$relation_none}
                {$relation_bit}
        </div>
</div>'),
        'sid'                => '-1',
        'version'        => '',
        'dateline'        => TIME_NOW
);

$db->insert_query("templates", $insert_array);

$insert_array = array(
        'title'                => 'usercp_options_rprelationspm',
        'template'        => $db->escape_string('<tr>
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="rprelationspm" id="rprelationspm" value="1" {$rprelationspmcheck} /></td>
<td><span class="smalltext"><label for="rprelationspm">PN-Benachrichtigung bei Beziehungskisten-Veränderungen?</label></span></td>
</tr>'),
        'sid'                => '-1',
        'version'        => '',
        'dateline'        => TIME_NOW
);

$db->insert_query("templates", $insert_array);

}

function rprelations_is_installed()
{
  global $db, $mybb;

        if($db->table_exists("rprelations"))  {
          return true;
        }
          return false;
}

function rprelations_uninstall()
{
  global $db, $mybb;

        // Tabelle löschen
        $db->query("DROP TABLE `".TABLE_PREFIX."rprelations`");
        if($db->field_exists("rprelationspm", "users"))
        {
                $db->drop_column("users", "rprelationspm");
        }

        // Templates entfernen
  $db->delete_query("templates", "title IN('member_profile_rprelations', 'member_profile_rprelations_add', 'member_profile_rprelations_bit', 'member_profile_rprelations_none', 'member_profile_rprelations_types', 'usercp_options_rprelationspm')");
}

function rprelations_activate()
{
        global $db, $mybb;

        // PM-Feld einfügen
        if(!$db->field_exists("rprelationspm", "users"))
  {
    $db->query("ALTER TABLE `".TABLE_PREFIX."users` ADD `rprelationspm` int(11) NOT NULL;");
  }

        // Variablen einfügen
  include MYBB_ROOT."/inc/adminfunctions_templates.php";
        find_replace_templatesets("member_profile", "#".preg_quote('{$awaybit}')."#i", '{$awaybit} {$add_relation}{$show_relation}');
        find_replace_templatesets("usercp_options", "#".preg_quote('{$board_style}')."#i", '{$rprelationspm}{$board_style}');
}

function rprelations_deactivate()
{
        global $db, $mybb;

  // Variablen entfernen
  include MYBB_ROOT."/inc/adminfunctions_templates.php";
  find_replace_templatesets("member_profile", "#".preg_quote('{$add_relation}{$show_relation}')."#i", '', 0);
  find_replace_templatesets("usercp_options", "#".preg_quote('{$rprelationspm}')."#i", '', 0);
}

function rprelations_member_profile_end()
{
        global $db, $mybb, $templates, $add_relation, $memprofile, $show_relation;
        $uid = $mybb->user['uid'];

        // Man kann sich nicht selbst hinzufügen! - Und Gäste haben ebenfalls keine Berechtigung.
        if($uid != $memprofile['uid'] && !empty($uid)) {
                $relvalue = $db->fetch_field($db->query("SELECT relation FROM ".TABLE_PREFIX."rprelations WHERE ruid = '$memprofile[uid]' AND suid = '$uid'"), "relation");
                eval("\$add_relation = \"".$templates->get("member_profile_rprelations_add")."\";");
        }

        // Relation in die Datenbank eintragen
        $addrel = $mybb->input['addrel'];
        if($addrel && $mybb->request_method == "post") {
                $relation = $mybb->get_input('relation');
                $new_record = array(
                        "suid" => $uid,
                        "ruid" => $addrel,
                        "type" => $db->escape_string($mybb->get_input('type')),
                        "relation" => $db->escape_string($mybb->get_input('relation'))
                );

                $check = $db->fetch_field($db->query("SELECT relation FROM ".TABLE_PREFIX."rprelations WHERE ruid = '$addrel' AND suid = '$uid'"), "relation");

                if($check) {
                        $db->update_query("rprelations", $new_record, "ruid = '$addrel' AND suid = '$uid'");
                        $subject = "Ich habe meine Beziehung zu dir verändert!";
                        $message = "Hi! Ich habe soeben die Beziehung zu deinem Charakter in <i>{$relation}</i> verändert. Du kannst diese Angabe jederzeit in meinem Profil löschen, sollte sie dir nicht (mehr) gefallen. Bitte denk daran, auch die Ansicht deines Charakters über meinen zu überarbeiten, sollte sich etwas daran verändert haben.";
                }
                else {
                        $db->insert_query("rprelations", $new_record);
                        $subject = "Ich habe dich meiner Beziehungskiste hinzugefügt!";
                        $message = "Hi! Ich habe deinen Charakter gerade als <i>{$relation}</i> zu meiner Beziehungskiste hinzugefügt. Du kannst diese Angabe jederzeit in meinem Profil löschen, sollte sie dir nicht (mehr) gefallen. Bitte denk daran, meinen Charakter ebenfalls zu deinem Profil hinzuzufügen! :)";
                }

        $relationspmcheck = $db->fetch_field($db->query("SELECT rprelationspm FROM ".TABLE_PREFIX."users where uid = '$addrel'"), "rprelationspm");

                if($relationspmcheck == "1") {

                // PN bei neuer/veränderter Relation
                require_once MYBB_ROOT . "inc/datahandlers/pm.php";
                $pmhandler = new PMDataHandler();

                $pm = array(
                                "subject" => $subject,
                                "message" => $message,
                                "fromid" => $uid,
                                "toid" => $addrel
                );

                $pmhandler->set_data($pm);

                // PM versenden
                if (!$pmhandler->validate_pm()) {
                                $pm_errors = $pmhandler->get_friendly_errors();
                }
                else {
                                $pminfo = $pmhandler->insert_pm();
                }

        }

                redirect("member.php?action=profile&uid={$uid}");
        }

        // Relations im Profil ausgeben
        $types = array("positiv", "neutral", "negativ");
        $uid = $mybb->user['uid'];
        foreach($types as $type) {
                $relation_bit = "";
                eval("\$relation_none = \"".$templates->get("member_profile_rprelations_none")."\";");
                $query = $db->query("SELECT * FROM ".TABLE_PREFIX."rprelations LEFT JOIN ".TABLE_PREFIX."users ON ".TABLE_PREFIX."users.uid = ".TABLE_PREFIX."rprelations.ruid WHERE suid = '$memprofile[uid]' AND type = '$type' AND ruid IN(SELECT uid FROM ".TABLE_PREFIX."users) ORDER by relation DESC");
                while($relation = $db->fetch_array($query)) {
                                $delete_rel = "";
                                $relation_none = "";
                                $useravatar = "<img src=\"{$relation[avatar]}\" style=\"width: 30px;\" / >";
                                $relation['profilelink'] = build_profile_link($relation['username'], $relation['ruid']);
                                if($uid == $relation['suid'] OR $uid == $relation['ruid']) {
                                        $delete_rel = "<a href=\"member.php?action=profile&delrel={$relation[rid]}\">[Löschen]</a>";
                                }
                                eval("\$relation_bit .= \"".$templates->get("member_profile_rprelations_bit")."\";");
                }
                eval("\$relation_type_bit .= \"".$templates->get("member_profile_rprelations_types")."\";");
        }
        eval("\$show_relation = \"".$templates->get("member_profile_rprelations")."\";");

        // Relations löschen
        $delete = $mybb->input['delrel'];
        if($delete) {
                $db->delete_query("rprelations", "rid = '$delete'");
                redirect("member.php?action=profile&id={$uid}");
        }

}

function rprelations_usercp() {

        global $mybb, $user, $templates, $rprelationspmcheck, $rprelationspm;

        if(isset($mybb->user['rprelationspm']) && $mybb->user['rprelationspm'] == 1)
        {
                $rprelationspmcheck = "checked=\"checked\"";
        }
        else
        {
                $rprelationspmcheck = "";
        }

        eval("\$rprelationspm = \"".$templates->get("usercp_options_rprelationspm")."\";");

}

function rprelations_usercp_options()
{
        global $mybb, $db;

        $uid = $mybb->user['uid'];

        $new_record = array(
                "rprelationspm" => $mybb->get_input('rprelationspm', MyBB::INPUT_INT)
        );
                $db->update_query("users", $new_record, "uid = '$uid'");

}

?>

dabei kommt es mit dem Thankyoulike-System-Plugin zu folgendem Fehler, sobald ich eine Beziehung aus dem Relationplugin im Forum lösche:

Code:
Warning [2] Illegal string offset 'location' - Line: 2481 - File: inc/plugins/thankyoulike.php PHP 7.1.30-nmm1 (Linux)
File     Line     Function
/inc/plugins/thankyoulike.php     2481     errorHandler->error
/inc/class_plugins.php     142     thankyoulike_wol_activity
/inc/functions_online.php     573     pluginSystem->run_hooks
/member.php     2581     fetch_wol_activity

Das RPG-Relationsplugin tut trotzdem was es soll, die Beziehung wird gelöscht.
Es steht eigentlich auch in keinerlei Verbindung mit dem Thankyoulike-System-Plugin, allerdings trat dieser Fehler auch bei anderen Plugins auf, wo ein Update das ganze behoben hat. Zb wurde in einem anderen Plugin folgende Stelle:

Code:
function weristwer_online_activity($user_activity) {
global $user;
   
    if(my_strpos($user['location'], "misc.php?action=weristwer") !== false) {
        $user_activity['activity'] = "weristwer";
    }
   
return $user_activity;
}

zu dieser Funktion umgebaut

Code:
function weristwer_online_activity($user_activity) {
global $parameters;

    $split_loc = explode(".php", $user_activity['location']);
    if($split_loc[0] == $user['location']) {
        $filename = '';
    } else {
        $filename = my_substr($split_loc[0], -my_strpos(strrev($split_loc[0]), "/"));
    }
   
    switch ($filename) {
        case 'misc':
        if($parameters['action'] == "weristwer" && empty($parameters['site'])) {
            $user_activity['activity'] = "weristwer";
        }
        break;
    }
     
return $user_activity;
}

Diese Stelle ist ähnlich der Zeile, die die Fehlermeldung mit line 2481 in der /inc/plugins/thankyoulike.php anspricht.
Code:
function thankyoulike_wol_activity($user_activity)
{
        global $user;

        $split_loc = explode(".php", $user_activity['location']);
        if($split_loc[0] == $user['location'])
        {
                $filename = '';
        }
        else
        {
                $filename = my_substr($split_loc[0], -my_strpos(strrev($split_loc[0]), "/"));
        }

        if ($filename == "tylsearch")
        {
                $user_activity['activity'] = "tyl_searching";
        }

        return $user_activity;
}

Kann man das dafür auch umschreiben? Big Grin [wenn die Antwort ist: ja, kann man; dann wäre ich wirklich froh, wenn sich jemand dazu bereit erklärt.]
Zitieren
#43
Kann jemand Seiten, die dieses Plugin einsetzen? Würde ich mir gerne einmal ansehen...
Zitieren
#44
Probiere lieber das hier => https://community.mybb.com/mods.php?action=view&pid=360 Wink
Zitieren
#45
Ah okay. Gibt es dazu vielleicht einen Link zu einem aktiven Forum?
Zitieren
#46
(08.11.2019, 21:52)falcao1010 schrieb: Ah okay. Gibt es dazu vielleicht einen Link zu einem aktiven Forum?
Nutze das von Svepu genannte plugin in meinem Forum. 

Sehen kannst du es z. B. in dem Thread hier.
Zitieren
#47
Eine neue Version wurde veröffentlicht: Thankyou MyBB System 2.6.4
Zitieren
#48
Hallo zusammen

ich würde gerne wissen , ob und wie es möglich ist , den Thx Button mit in das Portal einzubinden , sprich , das man quasi direkt von dort sich bedanken kann

installiert ist bei mir das Plugin

Thanks System Free (2.6.4)

leider sehe ich nur folgende 2 Button bei mir ...

wäre wirklich super wenn mir da einer einen Anstoss geben würde , ich hatte schon im Admin Panel unter

Templates/Portal geschaut , aber komme da ehrlich gesagt keinen Schritt weiter


vielen Dank


Angehängte Dateien Thumbnail(s)
   
Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  ThankYou MyBB.de Bot 72 27.711 17.10.2010, 06:58
Letzter Beitrag: ElkeK.
  Thankyou/Thanks button MyBB.de Bot 0 1.421 10.10.2010, 17:01
Letzter Beitrag: MyBB.de Bot