-
Notifications
You must be signed in to change notification settings - Fork 3
/
adr_research_learned.php
75 lines (64 loc) · 2.47 KB
/
adr_research_learned.php
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
75
<?php
/***************************************************************************
* adr_research_learned.php
* ------------------------
* Date : 07/05/07
* Original Author : Maiken
* Version : 0.0.1
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
define('IN_ADR_CAULDRON', true);
define('IN_ADR_SHOPS', true);
define('IN_ADR_CHARACTER', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'adr/includes/adr_global.'.$phpEx);
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
// Sorry , only logged users ...
if ( !$userdata['session_logged_in'] )
{
$redirect = "adr_research_learned.$phpEx";
$redirect .= ( isset($user_id) ) ? '&user_id=' . $user_id : '';
header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
}
// Includes the tpl and the header
adr_template_file('adr_research_learned_body.tpl');
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// Get the general config
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
$sql = "SELECT * FROM " . ADR_LIBRARY_LEARN_TABLE . "
WHERE user_id = '$user_id'
ORDER BY book_id DESC";
if( !($result = $db->sql_query($sql)) ){
message_die(GENERAL_ERROR, 'Could not obtain required learned information', "", __LINE__, __FILE__, $sql);}
$research_log = $db->sql_fetchrowset($result);
for ( $i = 0 ; $i < count( $research_log ) ; $i++ )
{
$template->assign_block_vars('learned', array(
"BOOK_NAME" => $research_log[$i]['book_name'],
"BOOK_INFO" => $research_log[$i]['book_details'],
));
}
include($phpbb_root_path . 'adr/includes/adr_header.'.$phpEx);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>