julienV / Joomla-Tracks

Racing league extension for Joomla
http://tracks.jlv-solutions.com
16 stars 9 forks source link

Is this project still alive/having support? If so please help. Need help with paid module. #102

Closed Uncommonly closed 11 months ago

Uncommonly commented 1 year ago

Hi, @julienV ! I hope this project is still having your support out there.

I'm trying to do some modifications on the paid individuals/teams module, and more specifically:

I have tried to copy/paste some code from the component files into the modules files but without success - my php knowledge is just poor. I'll appreciate if you can help me out here.

Thanks!

julienV commented 1 year ago

Hi, i will come back to you on this

julienV commented 1 year ago

ok, so for the first one, you can modify /modules/mod_tracks_individual/tmpl/default.php (ideally in a template override templates/my_template/html/mod_tracks_individual/default.php) like this:

                <div class="mod_tracks_individual__name">
                    <a href="<?= Route::_(TrackslibHelperRoute::getIndividualRoute($individual->id)) ?>">
                    <?= TrackslibHelperTools::formatIndividualName($individual) ?>
                    </a>

                    <?php if (!empty($individual->country_code)): ?>
                        <?php echo TrackslibHelperCountries::getCountryFlag($individual->country_code); ?>
                    <?php endif; ?>
                </div>
julienV commented 1 year ago

and for the second one, modify /modules/mod_tracks_team/tmpl/default.php (same thing, best with a template override) like this:


            <div class="mod_tracks_team__header__picture" style="width: <?=$params->get('picture_width', '150px') ?>">
                <a href="<?= Route::_(TrackslibHelperRoute::getTeamRoute($team->id)) ?>">
                <?php if (empty($team->picture)): ?>
                    <?= HTMLHelper::image('com_tracks/teams/placeholder_team.png', $team->name, null, true); ?>
                <?php else: ?>
                    <img src="<?= $team->picture ?>" alt="<?php echo $team->name; ?>"/>
                <?php endif; ?>
                <?php if (!empty($team->vehicle_picture)): ?>
                    <img src="<?= $team->vehicle_picture ?>" alt="<?php echo $team->name; ?>"/>
                <?php endif; ?>
                </a>
            </div>
Uncommonly commented 1 year ago

Wicked man! Thank you so much for that @julienV ! :) All worked like a charm and after some modifications, here's the result (ignore the drivers picture, I just took the team's logo - it's not a bug :) )

Would you consider making paid module for achievements/medals that individuals/teams can receive after triggering X wins for example, or manually adjusting custom-added medals, or having both options ideally? Do you think such an idea is achievable with the current state of "Tracks"?

Ideally, them achievements/medals would be nice to be shown in the currently paid modules for individuals and teams, just under all the stats for them.

I would love to help with design ideas if you need them.

Thank you once again, man, you are doing an amazing job! This project is one of a kind and it needs to be kept alive! :)

julienV commented 12 months ago

Your design looks really neat, congrats.

if the medals are 'globals', you might be able to achieve this using the custom fields module without any specific development, with just template override. I am not sure otherwise i have the time to develop such a module at the moment, if i had i should rather focus on porting to joomla 4. The problem is that i built tracks using redcore library, which is now unmaintained and not working on j4, so it's a big effort to either port the library myself, or rewrite tracks (and for how many people... not really sure of the number of users ;))

Uncommonly commented 12 months ago

Is there any demo where I can play with the custom fields module? Not so much screenshots/info there showing how actually works and what it can do. Not so sure what to expect from it and if it's gonna work for such a thing.

I totally agree with you. Supporting such a project for very few people is a waste of time. You should consider creating a Patreon page mate. That's one way to see if this project (or any others of yours) deserves any future development and your attention, I believe. Maybe pulling out an additional update on Tracks at JE, that shows "Patreon support" is now available will trigger your community, and you can see if Tracks is having enough attention/supporters. :)

Uncommonly commented 12 months ago

Sorry for the off-topic @julienV , but decided to ask here, instead of opening new thread.

I've got a problem with one of the menu links. I'm trying to create user menu, which redirerct to user profile EDIT page, but it looks like it fails because a some specific menu item isn't generated.

Link should be like site/user-profile/race-profile Instead, it leads to site/component/tracks/individualform/username.html?layout=edit&Itemid=101 with all the default template block thrown in the middle, which is usually a caused by a not generated menu item. I've checked all and I couldnt find anything in the menu creation form that is or can be related to this. It looks like "individualform" is just missing in there. Any ideas? Thanks!

smileysit commented 12 months ago

Hey I added the user-profile to my menu, and all is functioning ok.

Maybe it is related to your paid extension, [Tracks individual and team modules.

julienV commented 12 months ago

@Uncommonly tell me if @smileysit solution works, otherwise i'll look into it ;) but yeah indeed, it looks like either a menu item is missing, either it's missing from tracks router.

I'll look into creating a patreon, never done it, but sounds like an idea.

Uncommonly commented 12 months ago

@julienV @smileysit user profile itself is working. It's just not possible to use the alias with URL rewriting on. Also, because the menu item is missing, it's been thrown in the middle of the template (you have to scroll a bit to see the actual user profile) and I don't have any control of it, where and how to place it - not sure if that's url rewriting or gantry downside, but please, if you can look into it and patch it, it would be great.

julienV commented 12 months ago

can you give a link of where I can see the problem? I don't understand what you are saying about the template...

Uncommonly commented 12 months ago

Link Use username: testuser pw: asdasdff

julienV commented 12 months ago

ok i see...it's indeed because the profile link redirects to indiviudal form (you can see the original link being redirected). And this one is generic, but hidden, for some reason, so can't really directly link to it in a generic way with a menu item. I'll try to get back to it, and see why i was doing it like this.... and try to fix it, but maybe not super simple :D

Uncommonly commented 12 months ago

I've got the custom fields and you ware right, it will work as a achievements/medals thing I've got as idea. Only thing I can't figure out is how to display them custom fields all in one line (next to each other), instead everyone of them to be on a new line? Surely it will be something easy to remove/add in the php files but I'm dummy there :D

julienV commented 12 months ago

it's just css probably, when you have an example set up, give me the link, i will help you

Uncommonly commented 12 months ago

Example You can see them two images for first place and website logo used for custom fields.

Also, I'm trying to show them custom fields in the individual module using the following code in /modules/mod_tracks_individual/tmpl/default.php

            <?php if (!empty($individual->get->data->jcfields)): ?>
            <?php foreach ($individual->get->data->jcfields as $customField): ?>
                <?php if (!empty($customField->rawvalue)): ?>
                    <div class="tracks-individual__details__list__item">
                        <div class="tracks-individual__details__list__item__value">
                            <?php echo $customField->value; ?>
                        </div>
                    </div>
                <?php endif; ?>
            <?php endforeach; ?>
            <?php endif; ?>

but nothing happens. Any ideas here?

Uncommonly commented 12 months ago

Bump in case you’ve missed my last post 😁

julienV commented 12 months ago

sorry, i have seen it, but really 0 time...

Uncommonly commented 11 months ago

All right. So I managed to put all custom fields in one line with style="float:left" inside the div

<div style="float:left" class="tracks-individual__details__list__item">

The only thing I'm still struggling with is showing them custom fields in the individuals module. :)

Uncommonly commented 11 months ago

I've tried a couple of things but I'm really having no idea how to show them custom fields in the individuals module. Do you think you'll manage to find some free time over the weekend and have a look into this? Thanks!

julienV commented 11 months ago

I updated the module in the shop to add an option for displaying the fields, but basically:

you need to add this line on top of your override

if (!empty($results))
{
    $results = $params->get('results_limit', 5) ? array_slice($results, 0, $params->get('results_limit', 5))
        : $results;
}

// This line
$customFields = $params->get('show_customfields', true) ? $individual->getCustomFields() : false;

then, for example after the name field,


                <?php if (!empty($customFields)): ?>
                    <div class="mod_tracks_individual__fields">
                        <?php foreach ($customFields as $customField): ?>
                        <div class="mod_tracks_individual_field mod_tracks_individual_field--<?= $customField->name ?>">
                            <div class="mod_tracks_individual_field__label">
                                <?= $customField->label ?>
                            </div>
                            <div class="mod_tracks_individual_field__value">
                                <?= $customField->value ?>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                <?php endif ?>
Uncommonly commented 11 months ago

Thanks man! Worked like a charm.

Uncommonly commented 4 months ago

ok i see...it's indeed because the profile link redirects to indiviudal form (you can see the original link being redirected). And this one is generic, but hidden, for some reason, so can't really directly link to it in a generic way with a menu item. I'll try to get back to it, and see why i was doing it like this.... and try to fix it, but maybe not super simple :D

Sorry for bumping such an old issue, but did you manage to fix this? Thanks.

julienV commented 4 months ago

nope, sorry... It was kind if buried in the thread

Uncommonly commented 4 months ago

Any chance if you can look into it please?