-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate2_2_5.php
107 lines (92 loc) · 2.78 KB
/
update2_2_5.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
require_once('includes/upb.initialize.php');
$from_version = UPB_VERSION;
$to_version = "2.2.5";
require_once('includes/class/posts.class.php');
$posts_tdb = new posts(DB_DIR."/", "posts.tdb");
$where = "Updating $from_version to $to_version";
?>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<title>UPB v2.2.5 Updater</title>
<link rel='stylesheet' type='text/css'
href='./skins/default/css/style.css' />
</head>
<body>
<div id='upb_container'>
<div class='main_cat_wrapper2'>
<table class='main_table_2' cellspacing='1'>
<tr>
<td id='logo'><img src='./skins/default/images/logo.png' alt=''
title='' /></td>
</tr>
</table>
</div>
<br />
<br />
<div class='main_cat_wrapper'>
<div class='cat_area_1'>myUPB v2.2.5 Updater</div>
<table class='main_table' cellspacing='1'>
<tr>
<th style='text-align: center;'> </th>
</tr>
<tr>
<td class='area_welcome'>
<div class='welcome_text'>If you had any problems, please seek support
at <a href='http://forum.myupb.com/'>myupb.com's support forums!</a></div>
</td>
</tr>
<tr>
<td class='footer_3'><img src='./skins/default/images/spacer.gif'
alt='' title='' /></td>
</tr>
<tr>
<td class='area_2'
style='text-align: center; font-weight: bold; padding: 12px; line-height: 20px;'>
<p><?php echo $where; ?>
<p>Fixing post counts .... <?php
$userlist = $tdb->query('users',"id>'0'",1,-1,array('user_name','id','posts'));
$forumlist = $tdb->query('forums',"id>'0'",1,-1,array('id','forum','topics','posts'));
$postcount = array();
foreach ($forumlist as $forum)
{
$posts_tdb->setFp("topics", $forum['id']."_topics");
$posts_tdb->setFp("posts", $forum["id"]);
$posts = $posts_tdb->query('posts',"id>'0'",1,-1,array('user_name','user_id','id'));
$topics = $posts_tdb->query('topics',"id>'0'");
$tdb->edit('forums',$forum['id'],array('topics'=>count($topics),'posts'=>count($posts)));
if ($posts !== false)
{
foreach ($posts as $post)
{
$postcount[$post['user_id']] = $postcount[$post['user_id']] + 1;
}
}
}
foreach ($postcount as $key => $value)
{
$uquery = $tdb->basicQuery('users','id',$key);
if ($uquery !== false)
$tdb->edit('users',$key,array('posts'=>$value));
}
echo "done";
?>
<p><input type='button' onclick="location.href='complete_update.php'"
value='Click here to proceed to next step'>
</td>
</tr>
<tr>
<td class='footer_3'><img src='./skins/default/images/spacer.gif'
alt='' title='' /></td>
</tr>
</table>
<div class='footer'><img src='./skins/default/images/spacer.gif' alt=''
title='' /></div>
</div>
<br />
<div class='copy'>Powered by myUPB · <a
href='http://www.myupb.com/'>PHP Outburst</a> ©2002 -
<?php echo date("Y",time()); ?></div>
</div>
</body>
</html>