vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Major Additions - vBExperience 4 (https://vborg.vbsupport.ru/showthread.php?t=245023)

NickyNet 07-21-2010 10:47 AM

Quote:

Originally Posted by Phalynx (Post 2072383)

thank you... worked like a charm! :up:

Phalynx 07-21-2010 11:06 AM

Quote:

Originally Posted by KURTZ (Post 2072385)
i need to do it Marius?

No, as you are not using DB Prefix.

Quote:

Originally Posted by NickyNet (Post 2072392)
thank you... worked like a charm! :up:

Nice :)

AA_ 07-21-2010 12:14 PM

@phalynx

the query should you change:

Code:

SELECT userid,
        (_wr * " . (int) $vbulletin->options['vbsoccer_points']['wr'] . ") +
        ((_count - _wr - _rr - _rd) * " . (int) $vbulletin->options['vbsoccer_points']['rw'] . ") +
        (_rd * " . (int) $vbulletin->options['vbsoccer_points']['rd'] . ") +
        (_rr * " . (int) $vbulletin->options['vbsoccer_points']['rr'] . ") AS points
FROM (
        SELECT userid, COUNT(*) AS _count,
                SUM(score_key != bet_score_key) AS _wr,
                SUM(bet_home=points_home AND bet_away=points_away) AS _rr,
                SUM(CAST(bet_home - bet_away AS SIGNED)=(points_home - points_away)
                        AND NOT (bet_home = points_home AND bet_away = points_away)) AS _rd
        FROM " . TABLE_PREFIX . "soccer_user_bet AS b
        INNER JOIN " . TABLE_PREFIX . "soccer_match AS m ON(m.id=b.match_id)
        WHERE userid=" . $user['userid'] . " AND score_key>0 AND match_is_finished=1
        GROUP BY userid) AS userpoints

(der join auf die usertabelle ist nicht notwendig und das sortieren ebensowenig. ausserdem werden nur abgeschlossene spiele ber?cksichtigt. beachte, dass "u.userid" zu "userid" wird. am besten du kopierst das komplette query.)

Phalynx 07-21-2010 12:24 PM

Quote:

Originally Posted by AA_ (Post 2072414)
the query should you change:

Thanks for your optimization hints, I appreciate it.

@KURTZ
Now you should update :)

Download:
https://vborg.vbsupport.ru/showthrea...37#post2071937

NickyNet 07-21-2010 12:35 PM

Quote:

Originally Posted by AA_ (Post 2072414)
@phalynx

the query should you change:

(der join auf die usertabelle ist nicht notwendig und das sortieren ebensowenig. ausserdem werden nur abgeschlossene spiele ber?cksichtigt. beachte, dass "u.userid" zu "userid" wird. am besten du kopierst das komplette query.)

wie ?blich :up:

have 782 points at vbsoccer... got 7820 points into vBExperience
thank you 2 both of you!

AA_ 07-21-2010 12:36 PM

Quote:

Originally Posted by Phalynx (Post 2072417)
Thanks for your optimization hints, I appreciate it.

@KURTZ
Now you should update :)

Download:
https://vborg.vbsupport.ru/showthrea...37#post2071937

noch eine kleine speicheroptimierung (das ganze mit query_first() also limit 1 und automatischem free(). beachte die verwendung der variablen $att statt $attq; userid habe ich gleich mit entfernt, wird nicht ben?tigt):

Code:

if (($att = $vbulletin->db->query_first("
                SELECT (_wr * " . (int) $vbulletin->options['vbsoccer_points']['wr'] . ") +
                ((_count - _wr - _rr - _rd) * " . (int) $vbulletin->options['vbsoccer_points']['rw'] . ") +
                (_rd * " . (int) $vbulletin->options['vbsoccer_points']['rd'] . ") +
                (_rr * " . (int) $vbulletin->options['vbsoccer_points']['rr'] . ") AS points
                FROM (
                        SELECT userid, COUNT(*) AS _count,
                        SUM(score_key != bet_score_key) AS _wr,
                        SUM(bet_home=points_home AND bet_away=points_away) AS _rr,
                        SUM(CAST(bet_home - bet_away AS SIGNED)=(points_home - points_away)
                        AND NOT (bet_home = points_home AND bet_away = points_away)) AS _rd
                FROM " . TABLE_PREFIX . "soccer_user_bet AS b
                INNER JOIN " . TABLE_PREFIX . "soccer_match AS m ON(m.id=b.match_id)
                WHERE userid=" . $user['userid'] . " AND score_key>0 AND match_is_finished=1
                GROUP BY userid) AS userpoints
        ")))
{
        $xperience['count_user_vbs'] = $att['points'] * $vbulletin->options['xperience_points_vbs'];
        $xperience['count_user'] += $xperience['count_user_vbs'];
}


Phalynx 07-21-2010 01:06 PM

@All
The file has been updated!

@AA_
Habs eingebaut, danke.

KURTZ 07-21-2010 06:05 PM

Quote:

Originally Posted by Phalynx (Post 2072417)
Thanks for your optimization hints, I appreciate it.

@KURTZ
Now you should update :)

Download:
https://vborg.vbsupport.ru/showthrea...37#post2071937

done :)

NickyNet 07-21-2010 06:33 PM

just 4 info:

table: xperience_achievements_issues want be emptied if you delete all your stats in admincp after you "played" with the point settings...

Aramist 07-22-2010 03:54 AM

Hi , ty for this great mod.

I have installed this mod today on my board, and all member's activity is 99%+

Is it correct?

Ty in advance


All times are GMT. The time now is 03:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02945 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete