Extensions, styles and support for everything else about phpBB
wads24
Distinguished Donor
Posts: 29 Joined: 26 Aug 2018, 02:16
Location: Idaho
Post
by wads24 » 17 Mar 2021, 17:52
You do not have the required permissions to view the files attached to this post.
Blasto
Donor
Posts: 2 Joined: 30 Jan 2021, 22:17
Post
by Blasto » 22 Mar 2021, 09:22
You could make a sql select from the group and order by join time i guess.
wads24
Distinguished Donor
Posts: 29 Joined: 26 Aug 2018, 02:16
Location: Idaho
Post
by wads24 » 23 Mar 2021, 18:40
Blasto wrote: ↑ 22 Mar 2021, 09:22
You could make a sql select from the group and order by join time i guess.
Thanks.
I don't know how to do that... I'll try researching
Blasto
Donor
Posts: 2 Joined: 30 Jan 2021, 22:17
Post
by Blasto » 24 Mar 2021, 13:35
I’ll give it a try tonight for you.
wads24
Distinguished Donor
Posts: 29 Joined: 26 Aug 2018, 02:16
Location: Idaho
Post
by wads24 » 13 Apr 2021, 17:14
Blasto wrote: ↑ 24 Mar 2021, 13:35
I’ll give it a try tonight for you.
Sorry to bother you... Did you give it a try?
kasimi
mChat developer
Posts: 1173 Joined: 06 Oct 2016, 09:56
Location: Germany
Post
by kasimi » 23 May 2021, 19:33
Latest donor
In the event skouat.ppde.donors_group_user_add_before
, store the latest donor in the config table:
Code: Select all
$this->config->set('latest_donor_id', $event['payer_id'] ?: ANONYMOUS);
Alternatively, you can fetch it from the database on ever page load but remember to cache the query result.
In the event core.index_modify_page_title
, fetch user info for the latest donor and send the data to the template:
Code: Select all
$row = $this->user_loader->get_user($this->config['latest_donor_id'], true);
$this->template->assign_vars([
'LATEST_DONOR' => get_username_string('full', $this->config['latest_donor_id'], $row['username'], $row['user_colour']),
'LATEST_DONOR_COLOR' => $row['user_id'] == ANONYMOUS ? 'inherit' : ('#' . $row['user_colour']),
]);
With this entry in a language file:
Code: Select all
'LATEST_DONOR' => 'Thanks to the latest donor <strong>%1$s</strong>',
you can then render it in your template file, for example:
Code: Select all
{{ lang('LATEST_DONOR', LATEST_DONOR, LATEST_DONOR_COLOR) }}
Donation amount over the last 30 days
Code: Select all
$days = 30;
$sql_queries = '
SELECT SUM(CASE WHEN t.settle_amount = 0 THEN t.mc_gross ELSE t.settle_amount END) AS donations_sum
FROM ' . $this->table_transactions . ' t
WHERE t.test_ipn = 0
AND t.confirmed = 1
AND t.payment_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL ' . $days . ' DAY))';
$result = $this->db->sql_query($sql, 3600);
$donations_sum = $this->db->sql_fetchfield('donations_sum', 0, $result);
$this->db->sql_freeresult($result);
$this->template->assign_vars([
'DONATE_DAYS' => $days,
'DONATE_AMOUNT' => (int) round($donations_sum),
]);
With this entry in a language file:
Code: Select all
'DONATE_RECEIVED' => 'Donations over the last %1$d days <strong>%2$s</strong>',
you can then render it in your template file, for example:
Code: Select all
{{ lang('DONATE_RECEIVED', DONATE_DAYS, DONATE_AMOUNT) }}
wads24
Distinguished Donor
Posts: 29 Joined: 26 Aug 2018, 02:16
Location: Idaho
Post
by wads24 » 23 Jun 2021, 15:15
Thanks I'll give it a try...
I donated to your site a while ago and I didn't see the username change at the bottom of your website. Do these modifications work with the new version of scout PayPal?
kasimi
mChat developer
Posts: 1173 Joined: 06 Oct 2016, 09:56
Location: Germany
Post
by kasimi » 11 Sep 2021, 14:19
Good question. I'm not running the latest version. Time for an update I guess.
wads24
Distinguished Donor
Posts: 29 Joined: 26 Aug 2018, 02:16
Location: Idaho
Post
by wads24 » 08 Nov 2021, 16:09
kasimi wrote: ↑ 11 Sep 2021, 14:19
Good question. I'm not running the latest version. Time for an update I guess.
Long time no see. I hope things are going well with you.
Donation sent
toska
Posts: 19 Joined: 06 Jun 2021, 07:52
Post
by toska » 02 Jan 2022, 08:13
long ago Kasimir have seen
Users browsing this forum: CCBot [Bot] and 0 guests