Пърово си създаваме един файл на име admin_email_list.php
Ето и съдържанието на файла:
CODE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
define('IN_PHPBB', 1);
if( !empty($setmodules) )
{
$filename = basename(__FILE__);
$module['Users']['Email_List'] = append_sid($filename);
return;
}
//
// Load default header
//
$phpbb_root_path = "../";
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
//
// Generate page
//
$template->set_filenames(array(
'body' => 'admin/admin_users_email_list_body.tpl')
);
$template->assign_vars(array(
'L_ADMIN_USERS_LIST_MAIL_TITLE' => $lang['Admin_Users_List_Mail_Title'],
'L_ADMIN_USERS_LIST_MAIL_EXPLAIN' =>
$lang['Admin_Users_List_Mail_Explain'],
'L_USERNAME' => $lang['Usersname'],
'L_EMAIL' => $lang['Email'])
);
// Count users
$sql = "SELECT user_id FROM ".USERS_TABLE." WHERE user_id > 0";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not count Users", "", __LINE__,
__FILE__, $sql);
}
$total_users = $db->sql_numrows($result);
//
$query_result = mysql_query("SELECT username,user_email FROM phpbb_users
WHERE user_id > 0");
while( $row = $db->sql_fetchrow($query_result) )
{
$userrow[] = $row;
}
for ($i = 0; $i < $total_users; $i++)
{
if (empty($userrow[$i]))
{
break;
}
$row_color = (($i % 2) == 0) ? "row1" : "row2";
$template->assign_block_vars('userrow', array(
'COLOR' => $row_color,
'NUMBER' => ($start + $i + 1),
'USERNAME' => $userrow[$i]['username'],
'U_ADMIN_USER' => append_sid("admin_users.$phpEx?mode=edit&" .
POST_USERS_URL . "=" . $userrow[$i]['user_id']),
'EMAIL' => $userrow[$i]['user_email']
) //end array
);
} // end for
$template->pparse('body');
include('./page_footer_admin.'.$phpEx);
?>
Сега трябва да създаден още един файл на име admin_users_email_list_body.tpl
Ето и съдържанието на файла:
CODE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{L_ADMIN_USERS_LIST_MAIL_TITLE}
{L_ADMIN_USERS_LIST_MAIL_EXPLAIN}
class="forumline">
| nowrap="nowrap">{L_USERNAME}
| nowrap="nowrap">{L_EMAIL}
---|
| height="28" nowrap="nowrap">{userrow.USERNAME
}
| height="28" nowrap="nowrap">{userrow.EMAIL}
| colspan="8">