[ADDON] Donation Mod - Donator list

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

[ADDON] Donation Mod - Donator list

Post by Stoker »

List your Donator group at the donation page like I have done here.
Random generated list with first listed user highlighted.
dl.png
Open donate.php
Find:

Code: Select all

// Lets build a page ...
Before add:

Code: Select all

// Random donator list 
switch ($db->sql_layer)
	{
		case 'postgres':
			$sql = 'SELECT username, user_id, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type <> ' . USER_IGNORE . ' AND user_rank = 10
			AND user_type <> ' . USER_INACTIVE . '
			ORDER BY RANDOM()';
		break;
	
		case 'mssql':
		case 'mssql_odbc':
			$sql = 'SELECT username, user_id, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type <> ' . USER_IGNORE . ' AND user_rank = 10
			AND user_type <> ' . USER_INACTIVE . '
			ORDER BY NEWID()';
		break;
	
		default:
			$sql = 'SELECT username, user_id, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type <> ' . USER_IGNORE . ' AND user_rank = 10
			AND user_type <> ' . USER_INACTIVE . '
			ORDER BY RAND()';
		break;
	}
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{	
	$username = $row['username'];
	$user_id = (int) $row['user_id'];
	$colour = $row['user_colour'];

	$template->assign_block_vars('donate_list', array(
	'USERNAME_FULL'		=> get_username_string('full', $user_id, $username, $colour),
));
}
$db->sql_freeresult($result);
Change the number 10 in "AND user_rank = 10" to the ID of your donator rank.

Open styles/prosilver/template/donate/donate_body.html
Find:

Code: Select all

<!-- INCLUDE overall_footer.html -->
Before add:

Code: Select all

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>
		<h3>Thanks To Our Donators</h3>
		<p><!-- BEGIN donate_list --><!-- IF donate_list.S_ROW_COUNT > 0 -->, <!-- ENDIF --><!-- IF donate_list.S_ROW_COUNT < 1 --><span style="font-size:20px;">{donate_list.USERNAME_FULL}</span><!-- ELSE -->{donate_list.USERNAME_FULL}<!-- ENDIF --><!-- END donate_list --></p>
   <span class="corners-bottom"><span></span></span></div>
</div>
You do not have the required permissions to view the files attached to this post.

[ADDON] Donation Mod - Donator list

Post by Steve »

group_id = 10 is a default phpbb group?

Why the changing of database types ,I thought db_tools.php handled this?

[ADDON] Donation Mod - Donator list

Post by Stoker »

Change group ID to the ID of your donator group ;)

[ADDON] Donation Mod - Donator list

Post by mikef35 »

What if I wanted to add multiple groups to show?

[ADDON] Donation Mod - Donator list

Post by Stoker »

an example: AND group_id = 10 OR group_id = 6

[ADDON] Donation Mod - Donator list

Post by mikef35 »

Thanks Stoker,

I was using || as OR. I thought that is what || meant. I guess not. When I used || it pulled all users from all groups.

[ADDON] Donation Mod - Donator list

Post by RMcGirr83 »

Steve© wrote:Why the changing of database types ,I thought db_tools.php handled this?
It does except for the RAND function for the database.

[ADDON] Donation Mod - Donator list

Post by Solidjeuh »

nice, works great! Thank you!

[ADDON] Donation Mod - Donator list

Post by Rhyno »

Thanks Stoker :)

[ADDON] Donation Mod - Donator list

Post by Rhyno »

Hmmm applied the edits but dont see the list :(