MyBB.de Forum
NewPoints - Druckversion

+- MyBB.de Forum (https://www.mybb.de/forum)
+-- Forum: Anpassungen (https://www.mybb.de/forum/forum-47.html)
+--- Forum: Plugin-Veröffentlichungen und -Support (https://www.mybb.de/forum/forum-82.html)
+--- Thema: NewPoints (/thread-21721.html)

Seiten: Seiten: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21


RE: NewPoints - Jockl - 24.05.2014

Hier scheint es den Shop aber noch zu geben.


[geteilt] Newpoints Problem - Idefix19 - 03.06.2014

Servus,

habe auch ein kleines unbedeutendes Problem:

Bei den Mitgliedern wird mir folgendes doppelt angezeigt:

Points: 946.56€ [Donate]
Points: 946.56€ [Donate]

Wo bitte muss ich was ändern, das die Points nur einmal angezeigt werden?

Bitte entschuldigt meine Frage, bin noch nicht so fit in allem... Wink

Danke


RE: NewPoints - TelCont@r - 14.06.2014

Hallo MyBBoard,

wiedermal sitze ich vor meine Kiste und hab Bug entdeckt. Im Forum bei mir haben sich zwei User über ein Thema diskutiert, sie meinten folgendes:

User A hat 10 Beiträge und 607Pkt.
User B hat über 150 Beiträge und genausoviel, also 607 Pkt, wie er.

Als ich dann nach meinen Pkt. geschaut habe, stand auch 607 Pkt..

Es scheint so, dass an der Anzeige ein Bug zu sein.

Kann mir dabei jemand helfen?

Screenshot siehe Anhang, Danke.


RE: NewPoints - Jockl - 14.06.2014

Ich kenne das Plugin zwar nicht, aber hast Du mal "Recount Points" durchgeführt?


RE: NewPoints - TelCont@r - 14.06.2014

Nein. Meinst Du die Option im ACP -> Newspoint -> Maintenance ->

Reconstruct TemplatesReconstruct templates
The templates: postbit, postbit_classic and member_profile will be edited in order to fix variable duplicates.

Submit

Auf den Button Submit anklicken?


RE: NewPoints - Jockl - 14.06.2014

Eigentlich ist in der Beschreibung des Plugins doch alles erklärt!?

Schau Dir mal dieses Bild an....


RE: NewPoints - TelCont@r - 14.06.2014

Ich hab die Funktion gerade durchgeführt. Ein User, der sich neu angemeldet hat sollte normalerweiße 0 Okt. haben.

Jedoch hat dieser User 607 Pkt.. Ich bin der Meinung, dass ich irgendwo im Quellcode ein Fehler eingebaut habe, nur ist die Frage wo?


RE: NewPoints - Jockl - 14.06.2014

(14.06.2014, 12:15)TelCont@r schrieb: Ich bin der Meinung, dass ich irgendwo im Quellcode ein Fehler eingebaut habe, nur ist die Frage wo?
Tja, das Problem wird hier keiner lösen können.... Wink


RE: NewPoints - TelCont@r - 14.06.2014

(14.06.2014, 12:20)Jockl schrieb:
(14.06.2014, 12:15)TelCont@r schrieb: Ich bin der Meinung, dass ich irgendwo im Quellcode ein Fehler eingebaut habe, nur ist die Frage wo?
Tja, das Problem wird hier keiner lösen können.... Wink

Ich weiß leider nicht so. Ich hab da ein paar manuelle Änderungen durchgeführt, hab das befürchten, dass ich hier meinen Bug habe.

newpoints_home
Code:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->newpoints}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
<table width="100%" border="0" align="center">
<tr>
<td valign="top" width="180">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>{$lang->newpoints_menu} </strong></td>

</tr>
{$options}
</table>
</td>
<td valign="top">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>{$lang->newpoints}</strong></td>

<td align="right"   class="thead"><strong>Guthaben-Aktuell:</strong> {$user['newpoints']}</td>

{$newpoints_profile}
</tr>
<tr>
<td class="trow1">{$lang->newpoints_home_desc}</td><td class="trow1"></td>
</tr>


</table>
</td>
</tr>
</table>
{$footer}
</body>
</html>

newpoints.php
Code:
<?php

/*************************************************************/***************************************************************************
*
*   NewPoints plugin (/newpoints.php)
*     Author: Pirata Nervo
*   Copyright: © 2009-2011 Pirata Nervo
*  
*   Website: http://www.mybb-plugins.com
*
*   NewPoints plugin for MyBB - A complex but efficient points system for MyBB.
*
***************************************************************************/

/*************************************************************/****************************************************************************
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newpoints.php');
define("NP_DISABLE_GUESTS", 0);

// Templates used by NewPoints
$templatelist  = "newpoints_home,newpoints_donate,newpoints_statistics,newpoints_statistics_richest_user,newpoints_statistics_donation,newpoints_no_results,newpoints_option";

require_once "./global.php";

$plugins->run_hooks("newpoints_begin");

add_breadcrumb(Konto);

// Allow guests here? Some plugins may allow guest access and they may hook to newpoints_start
if (!$mybb->user['uid'] && NP_DISABLE_GUESTS == 1)
    error_no_permission();

// load language
$lang->load("newpoints");

// build the menu

$menu = array();
// default menu options
$menu[0] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php">'.$lang->newpoints_home.'</a>';
if ($mybb->settings['newpoints_main_statsvisible'] == 1)
    $menu[1] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=stats">'.$lang->newpoints_statistics.'</a>';
if ($mybb->settings['newpoints_main_donationsenabled'] == 1)
    $menu[2] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=donate">'.$lang->newpoints_donate.'</a>';
    
if ($mybb->input['action'] == '')
{
    $menu[0] = "&raquo; ".$menu[0];
}
elseif ($mybb->input['action'] == 'stats')
{
    $menu[1] = "&raquo; ".$menu[1];
}
elseif ($mybb->input['action'] == 'donate')
{
    $menu[2] = "&raquo; ".$menu[2];
}

$menu = $plugins->run_hooks("newpoints_default_menu", $menu);

$bgcolor = alt_trow();
$options = '';

foreach($menu as $option)
{
    $bgcolor = alt_trow();
    
    $plugins->run_hooks("newpoints_menu_build_option");
    eval("\$options .= \"".$templates->get('newpoints_option')."\";");
}

$plugins->run_hooks("newpoints_start");

// Block guests here
if (!$mybb->user['uid'])
    error_no_permission();

// no action = home
if (!$mybb->input['action'])
{
    $plugins->run_hooks("newpoints_home_start");
    
    $income_settings = '';
    
    // get income settings' titles, descriptions and its value
    $query = $db->simple_select('newpoints_settings', '*', 'plugin=\'income\'');
    while ($setting = $db->fetch_array($query))
    {
        if ($setting['name'] == 'newpoints_income_minchar')
            $value = $setting['value']." ".$lang->newpoints_chars;
        else
            $value = newpoints_format_points($setting['value']);

        $income_settings .= '<tr><td valign="middle" align="left"><span style="border-bottom: 1px dashed; cursor: help;" title="'.$setting['description'].'">'.$setting['title'].'</span></td><td valign="middle" align="right">'.$value.'</td></tr>';
    }
    
    $lang->newpoints_home_desc = $lang->sprintf($lang->newpoints_home_desc, $income_settings);
    
    $query = $db->simple_select('users', 'newpoints');
$user = $db->fetch_array($query);
$user['newpoints'] = newpoints_format_points($user['newpoints']);
$currency = $mybb->settings['newpoints_main_curname'];
    
    eval("\$page = \"".$templates->get('newpoints_home')."\";");
    
    $plugins->run_hooks("newpoints_home_end");
    
    output_page($page);
}

if ($mybb->input['action'] == 'stats')
{
    if ($mybb->settings['newpoints_main_statsvisible'] != 1)
        error($lang->newpoints_stats_disabled);
        
    $richest_users = '';
    $bgcolor = alt_trow();
    
    $fields = array('uid', 'username', 'newpoints');
    
    $plugins->run_hooks("newpoints_stats_start");

    // get richest users
    $query = $db->simple_select('users', implode(',', $fields), '', array('order_by' => 'newpoints', 'order_dir' => 'DESC', 'limit' => intval($mybb->settings['newpoints_main_stats_richestusers'])));
    while($user = $db->fetch_array($query)) {
        $bgcolor = alt_trow();
        
        $user['username'] = build_profile_link(htmlspecialchars_uni($user['username']), intval($user['uid']));
        $user['newpoints'] = newpoints_format_points($user['newpoints']);
        
        $plugins->run_hooks("newpoints_stats_richest_users");
        
        eval("\$richest_users .= \"".$templates->get('newpoints_statistics_richest_user')."\";");
    }
    
    if($richest_users == '')
    {
        $colspan = 2;
        $no_results = $lang->newpoints_noresults;
        eval("\$richest_users = \"".$templates->get('newpoints_no_results')."\";");
    }
    
    $plugins->run_hooks("newpoints_stats_middle");
    
    $last_donations = '';
    $bgcolor = alt_trow();
    
    // get latest donations

    $query = $db->simple_select('newpoints_log', '*', 'action=\'donation\'', array('order_by' => 'date', 'order_dir' => 'DESC', 'limit' => intval($mybb->settings['newpoints_main_stats_lastdonations'])));
    while($donation = $db->fetch_array($query)) {
        $bgcolor = alt_trow();
        
        $data = explode('-', $donation['data']);
        
        $donation['to'] = build_profile_link(htmlspecialchars_uni($data[0]), intval($data[1]));
        $donation['from'] = build_profile_link(htmlspecialchars_uni($donation['username']), intval($donation['uid']));
        
        $donation['amount'] = newpoints_format_points($data[2]);
        $donation['date'] = my_date($mybb->settings['dateformat'], intval($donation['date']), '', false).", ".my_date($mybb->settings['timeformat'], intval($donation['date']));
        
        $plugins->run_hooks("newpoints_stats_last_donations");
        
        eval("\$last_donations .= \"".$templates->get('newpoints_statistics_donation')."\";");
    }
    
    if($last_donations == '')
    {
        $colspan = 4;
        $no_results = $lang->newpoints_noresults;
        eval("\$last_donations = \"".$templates->get('newpoints_no_results')."\";");
    }
    
    eval("\$page = \"".$templates->get('newpoints_statistics')."\";");
    
    $plugins->run_hooks("newpoints_stats_end");
    
    output_page($page);
}
elseif ($mybb->input['action'] == 'donate')
{
    if ($mybb->settings['newpoints_main_donationsenabled'] != 1)
        error($lang->newpoints_donations_disabled);
    
    $plugins->run_hooks("newpoints_donate_start");
    
    // make sure wen're trying to send a donation to ourselves
    $uid = intval($mybb->input['uid']);
    $user = get_user($uid);
    if ($user['username'] != "")
        $user['username'] = htmlspecialchars_uni($user['username']);
    else
        $user['username'] = '';
        
    if ($uid == $mybb->user['uid'] || $user['username'] == $mybb->user['username'])
        error($lang->newpoints_cant_donate_self);
    
    eval("\$page = \"".$templates->get('newpoints_donate')."\";");
    
    $plugins->run_hooks("newpoints_donate_end");
    
    output_page($page);
}
elseif ($mybb->input['action'] == 'do_donate')
{
    verify_post_check($mybb->input['postcode']);

    if ($mybb->settings['newpoints_main_donationsenabled'] != 1)
        error($lang->newpoints_donations_disabled);
    
    $plugins->run_hooks("newpoints_do_donate_start");
    
    // make sure we're not trying to send a donation to ourselves
    $username = trim($mybb->input['username']);
    if ($username == $mybb->user['username'])
        error($lang->newpoints_cant_donate_self);
    
    $amount = round(floatval($mybb->input['amount']), $mybb->settings['newpoints_main_decimal']);
    
    // do we have enough points?
    if ($amount <= 0 || $amount > $mybb->user['newpoints'])
        error($lang->newpoints_invalid_amount);
        
    // make sure we're sending points to a valid user
    $touser = newpoints_getuser_byname($username, 'uid,username');
    if (!$touser)
    {
        error($lang->newpoints_invalid_user);
    }
    
    // remove points from us
    newpoints_addpoints($mybb->user['uid'], -($amount));

    // give points to user
    newpoints_addpoints($username, $amount, 1, 1, true);
    
    // send pm to the user if the "Send PM on donate" setting is set to Yes
    if ($mybb->settings['newpoints_main_donationspm'] != 0)
    {
        if ($mybb->input['reason'] != '')
            newpoints_send_pm(array('subject' => $lang->newpoints_donate_subject, 'message' => $lang->sprintf($lang->newpoints_donate_message_reason, newpoints_format_points($amount), htmlspecialchars_uni($mybb->input['reason'])), 'receivepms' => 1, 'touid' => $touser['uid']));
        else
            newpoints_send_pm(array('subject' => $lang->newpoints_donate_subject, 'message' => $lang->sprintf($lang->newpoints_donate_message, newpoints_format_points($amount)), 'receivepms' => 1, 'touid' => $touser['uid']));
    }
    
    // log donation
    newpoints_log('donation', $lang->sprintf($lang->newpoints_donate_log, $touser['username'], $touser['uid'], $amount));
    
    $plugins->run_hooks("newpoints_do_donate_end");
    
    redirect($mybb->settings['bburl']."/newpoints.php", $lang->sprintf($lang->newpoints_donated, newpoints_format_points($amount)));
}

$plugins->run_hooks("newpoints_terminate");

exit;

?>

Würd mich freuen, wenn Du mal drüber schauen könntest, Danke.


RE: NewPoints - Jockl - 14.06.2014

Sorry, ich habe das Plugin nicht im Einsatz und kann mich da auch nicht mal "einfach so" in den Code rein denken. Noch dazu, dass man erst einmal großartig suchen müsste, was Du wo alles geändert hast.

Evtl. machst Du Deine Änderungen einfach mal rückgängig. Ich frage mich eh, warum immer so viele Plugins geändert werden "müssen", wenn man u.U. nicht wirklich weiß, was man da macht. Wink