Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello,
    There is a plugin called “Detailed Player Stats for SportsPress” created by @savvas.

    The detailed player stats for Sportspress created by @savvas works out of the box with themes by Themeboy and default themes as well (I’m guessing) but it does not work when using the theme that marocco is using (Alchemist). You would need to modify the template file to incorporate the detailed player stats into the Alchemist theme. – This is something I want to dive into but just don’t have the time – because I’d love to be able to use this plugin with this theme.

    Side Note: If you’re also looking at using the “advanced h2h” to enhance sportspress sorting capabilities (also created by @savvas), this is an easy fix to get it to work with the alchemist theme. You just need to modify a small piece of code in alchemist’s sportspress’ “league_table” template file to make that little helpful plugin work.

    Now back to the detailed player stats – There is a little widget/element available with the Alchemist theme though that does allow you to list the specific game by game stats for your players. The issue is you have to manually add this widget to the player pages. The widget is called “ALC: Player Game-by-Game stats” Important to note that this will only pick-up the player’s CURRENT team. If the player has both current and past teams under his profile, it won’t show the game-by-game stats of the past teams.

    I did create a work-around for this by copy pasting the element and changing the code so that it pulls the past_team info (instead of the current_team). But there are about 10-12 files that need to be copied/pasted + modified to create a secondary element for the past teams. The end-result is what you see in the picture.

    https://ibb.co/fx5VJJ7

    • This reply was modified 4 months, 3 weeks ago by RobJr.
    • This reply was modified 4 months, 3 weeks ago by RobJr.
    Plugin Contributor Savvas

    (@savvasha)

    Hi there,

    The reason Detailed Player Stats for SportsPress is not compatible with Alchemist, is because that theme does major overrides of SportsPress template files. During those overrides, any changes made by the plugin are gone… I am working on a way to make it compatible with Alchemist but with an open timeframe.

    Thanks,
    Savvas

    ozgurgedikli

    (@ozgurgedikli)

    Hi there,

    I just saw the Detailed Player Stats for SportsPress plugin, it’s very nice.
    It seems to be working perfectly now with the Alchemist theme.
    @savvasha Thank you for this beautiful plugin, congratulations

    https://ibb.co/nL45Yx9

    Plugin Contributor Savvas

    (@savvasha)

    Thank you @ozgurgedikli for your kind words ??

    @robjr14 can you try the latest update and see if it is working also at your Alchemist site?

    The developer of Alchemist, Dan Fisher, was kind enough to provide me with a developer license! It is a great theme and I am really happy I managed to make my plugin compatible with it!

    Thanks, Savvas

    RobJr

    (@robjr14)

    thats amazing! I will be testing it out after work this evening. Will let you know how it goes!

    Thank you!!!

    RobJr

    (@robjr14)

    @savvasha I can confirm that both options (popup or inline) function with the Alchemist theme. I’ve played around with it a little bit and tried it on 2 separate installations – running different versions of both sportspress and Alchemist theme and everything seems good!

    Amazing work!

    ozgurgedikli

    (@ozgurgedikli)

    @robjr14 Is there an example of a view as inline? There may be an option to enhance the popup and inline plugin by adding it as an option to the sportspress player settings menu. What is the coding change you made?

    RobJr

    (@robjr14)

    @ozgurgedikli – If you’re referring to the changes I made to create a 2nd “widget” for a players past teams in Alchemist – it involved about 12-14 files. Now, mind you – I’m not a programmer. I actually don’t know how to code but I am sometimes able to modify certain things and I was able to re-create the gbg stats widget and make that one use a players “past_team”. I know that there is a much much simpler way to make that main widget include both a players current and past teams, but since I am not a programmer – this was the only way I knew how to do it. I did reach out to Dan earlier today to ask about them potentially updating the widget so that it actually includes both current & past teams but I’m not sure if or when that would be done.

    But I did not make any modifications to savvas’ detailed player stats plugin. With his latest update, the detailed player stats works out of the box with Alchemist.

    Main changes were done to alc_player_stats.php on line 157. I copied Get Current Team and then re-pasted below but changed current_team to past_team

    // Get current team
    $sp_current_teams = get_post_meta( $id, 'sp_current_team' );
    $sp_current_team = '';
    if ( ! empty( $sp_current_teams[0] ) ) {
    $sp_current_team = $sp_current_teams[0];
    }


    // Get Past team
    $sp_past_teams = get_post_meta( $id, 'sp_past_team' );
    $sp_past_team = '';
    if ( ! empty( $sp_past_teams[0] ) ) {
    $sp_past_team = $sp_past_teams[0];
    }

    I also copied the alc_player_gbg_stats.php in “/vc_template/ and named the copy “alc_player_gbg_stats_past.php” and in this file, I edited line 50 from…

    // Get player's current team(s)
    $team = get_post_meta( $player_id, 'sp_current_team' );

    Changed to:
    // Get player's past team(s)
    $team = get_post_meta( $player_id, 'sp_past_team' );

    Also had to make a copy of Alchemist’s sportspress template file “player-event-game-by-game.php” and rename it “player-event-game-by-game-past.php” and change every line that had “current_team” to “past_team” – this file has I think 20 or 21 “current_team” occurrences that had to be changed to “past_team”

    A variety of other files had to be edited so that this Past Team widget would be visible and functional in wpBakery. Those files are:

    alchemist\languages\alchemists.pot
    alchemist\inc\vc-functions.php
    alchemist\admin\images\js_composer\alc_player_gbg_stats.png
    alchemist\assets\css\sportspress-soccer.css.map
    alchemist\assets\css\sportspress-soccer-rtl.css.map
    alchemist\sass\sportspress\player_player-game-by-game-stats.scss
    alchemist\sass\sportspress\player_player-game-by-game-stats–skin.scss
    alchemist\sass\sportspress.scss
    alchemist\sass\sportspress-skin.scss
    alchemist\sportspress\single-player.php
    alchemist\config.codekit3
    alchemist\wpml-config.xml

    Some of the above files were simply copied and renamed by adding “-past” to them, while others had to have lines added. All I’d do is copy the main code for the game-by-game stats and add it again and re-name it with “-past” or “_past” – so it would point to the new files for “past_team”.

    Hopefully what you were questioning is somewhere in what I wrote above.

    • This reply was modified 4 months ago by RobJr.
    ozgurgedikli

    (@ozgurgedikli)

    @robjr14 Thanks for the details.
    Alchemist theme Detailed Player Stats for SportsPress plugin works perfectly.
    These details give very good results in creating your own design theme.

    @savvasha with quick action With the 1.7.1 update of the Detailed Player Statistics plugin for SportsPress, two different uses can now be set, pop-up and in-line, with the Detailed Season Statistics option in the Sporspress > Settings > Players tab. Thanks @savvasha for this nice detailing

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.