mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Minor improvements (#1548)
* Minor improvements * Update register.php * Update register.php * Updated * Update CHANGELOG.md * Update topic_watch.php * Update Ajax.php
This commit is contained in:
parent
a2b15b1ab2
commit
c9d9ebb9c0
5 changed files with 16 additions and 15 deletions
|
@ -376,22 +376,21 @@ foreach ($profile_fields as $field => $can_edit) {
|
|||
case 'avatar_ext_id':
|
||||
if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar')) {
|
||||
// Integration with MonsterID
|
||||
if (!isset($_POST['delete_avatar']) && isset($_POST['use_monster_avatar'])) {
|
||||
if (empty($_FILES['avatar']['name']) && !isset($_POST['delete_avatar']) && isset($_POST['use_monster_avatar'])) {
|
||||
$monsterAvatar = new Arokettu\MonsterID\Monster($pr_data['user_email'], $bb_cfg['avatars']['max_height']);
|
||||
$tempAvatar = tmpfile();
|
||||
$tempAvatarMeta = stream_get_meta_data($tempAvatar);
|
||||
$tempAvatarPath = stream_get_meta_data($tempAvatar)['uri'];
|
||||
$monsterAvatar->writeToStream($tempAvatar);
|
||||
|
||||
// Manual filling $_FILES['avatar']
|
||||
$_FILES['avatar'] = array();
|
||||
if (!empty($tempAvatarMeta['uri']) && is_file($tempAvatarMeta['uri'])) {
|
||||
if (is_file($tempAvatarPath)) {
|
||||
$_FILES['avatar'] = [
|
||||
'name' => 'MonsterID.png',
|
||||
'full_path' => 'MonsterID.png',
|
||||
'type' => 'image/png',
|
||||
'tmp_name' => $tempAvatarMeta['uri'],
|
||||
'error' => 0,
|
||||
'size' => filesize($tempAvatarMeta['uri'])
|
||||
'name' => "MonsterID_{$pr_data['user_id']}.png",
|
||||
'type' => mime_content_type($tempAvatarPath),
|
||||
'tmp_name' => $tempAvatarPath,
|
||||
'error' => UPLOAD_ERR_OK,
|
||||
'size' => filesize($tempAvatarPath)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ if ($watch_count > 0) {
|
|||
AND p.poster_id = u2.user_id
|
||||
AND t.topic_poster = u.user_id
|
||||
AND w.user_id = $user_id
|
||||
GROUP BY t.topic_last_post_time DESC
|
||||
ORDER BY t.topic_last_post_time DESC
|
||||
LIMIT $start, $per_page";
|
||||
if (!($result = DB()->sql_query($sql))) {
|
||||
bb_die('Could not obtain watch topic information #3');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue