Skip to content

Commit 2eb2be1

Browse files
cdevroegdtool
andauthored
Merge 2025.2
* Add language Simplified Chinese 简体中文 Thanks @gdtool * Fixed an issue where the list of marks could sometimes get cut off. Addresses #235 * Users can now delete their account. Addresses #264 * Fixed an issue where deleted marks appear in exports. Fixes #277 * Adjusted the per page limit to 50. Addresses #278 * Searching archive now shows archived results. If no results found, option to continue search outside of archive. Addresses #272 Co-authored-by: gdtool <67850057+gdtool@users.noreply.github.com>
1 parent 35ca722 commit 2eb2be1

15 files changed

Lines changed: 266 additions & 7 deletions

File tree

application/config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| version.point.release
1212
|
1313
*/
14-
$config['unmark_version'] = '2025.1';
14+
$config['unmark_version'] = '2025.2';
1515

1616
/*
1717
|--------------------------------------------------------------------------

application/config/routes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
// User methods
9090
$route['user/update/email'] = 'user/updateEmail';
9191
$route['user/update/password'] = 'user/updatePassword';
92+
$route['user/delete'] = 'user/delete';
9293
$route['user(.*?)'] = 'user/index';
9394

9495
// help

application/controllers/Export.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function index()
4343
$this->jsonexport->addMeta('export_date', date('Y-m-d H:i:s'));
4444
// Retrieve user marks
4545
$this->load->model('users_to_marks_model', 'user_marks');
46-
$where = 'users_to_marks.user_id='. $this->user_id;
46+
$where = 'users_to_marks.user_id='. $this->user_id.' AND users_to_marks.active=1';
4747
$marksCount = $this->user_marks->count($where);
4848
// Number of marks
4949
$this->jsonexport->addMeta('marks_count', $marksCount);
@@ -89,7 +89,7 @@ public function html()
8989

9090
// Retrieve user marks
9191
$this->load->model('users_to_marks_model', 'user_marks');
92-
$where = 'users_to_marks.user_id='. $this->user_id;
92+
$where = 'users_to_marks.user_id='.$this->user_id.' AND users_to_marks.active=1';
9393
$marksCount = $this->user_marks->count($where);
9494
// Number of marks
9595
//$this->jsonexport->addMeta('marks_count', $marksCount);

application/controllers/User.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,42 @@ public function index()
3030
$this->renderJSON();
3131
}
3232

33+
// Delete a user
34+
public function delete()
35+
{
36+
if (! isset($this->clean->password) || ! isValid($this->clean->password, 'password')) {
37+
$this->data['message'] = reset(array_values(formatErrors(602)));
38+
} else {
39+
40+
$current_password = (isset($this->clean->password)) ? $this->clean->password : null;
41+
$res = $this->user->read($this->user_id, 1, 1, 'email,password');
42+
43+
if (! isset($res->password)) {
44+
$this->data['message'] = 'We could not verify your current password.';
45+
}
46+
elseif (verifyHash($current_password, $res->password) != $res->password) {
47+
$this->data['message'] = 'Your current password does not match what we have on record.';
48+
}
49+
else {
50+
$this->data['success'] = false;
51+
if (! empty($this->user_id) && is_numeric($this->user_id)) {
52+
53+
// Get the user information
54+
// If user has a customer id, remove them from stripe
55+
$this->load->model('users_model', 'users');
56+
$user = $this->users->read($this->user_id);
57+
58+
if (isset($user->user_id) && ! empty($user->user_id)) {
59+
$this->data['success'] = $this->db->query("DELETE FROM `users` WHERE users.user_id = '" . $this->user_id . "'");
60+
$this->sessionClear();
61+
}
62+
}
63+
}
64+
}
65+
66+
$this->renderJSON();
67+
}
68+
3369
// Update a user's email address
3470
public function updateEmail()
3571
{

application/core/Plain_Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Plain_Controller extends CI_Controller
1212
public $header = 'layouts/header';
1313
public $html_clean = null;
1414
public $is_api = false;
15-
public $limit = 30;
15+
public $limit = 50;
1616
public $logged_in = false;
1717
public $original = null;
1818
public $user_admin = false;

application/language/english.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'register' => array( 'Register' ),
2929
'change password' => array( 'Change password' ),
3030
'change email address' => array( 'Change email address' ),
31+
'delete_account' => array( 'Delete Account' ),
3132
'import or export marks' => array( 'Import or export marks' ),
3233
'invite others' => array( 'Invite others' ),
3334
'unmark help' => array( 'Unmark help' ),

application/language/zh-CN.php

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<?php
2+
3+
$unmark_language = array(
4+
5+
'unmark - the to do app for bookmarks.' => array( '各种书签 - 一个自动化功能的书签'),
6+
'timeline' => array( '时间线', '时间线' ),
7+
'mark' => array( '书签', '书签' ),
8+
'second' => array( '', '' ),
9+
'minute' => array( '', '' ),
10+
'hour' => array( '小时', '小时' ),
11+
'day' => array( '', '' ),
12+
'month' => array( '', '' ),
13+
'week' => array( '', '' ),
14+
'year' => array( '', '' ),
15+
'today' => array( '今天' ),
16+
'yesterday' => array( '昨天' ),
17+
'last week' => array( '上周' ),
18+
'last month' => array( '上月h' ),
19+
'last year' => array( '去年' ),
20+
'last 3 months' => array( '过去3个月' ),
21+
'last 6 months' => array( '过去6个月' ),
22+
'all marks' => array( '所有书签' ),
23+
'most-used tags' => array( '常用标签' ),
24+
'recently-used tags' => array( '近期标签' ),
25+
'search' => array( '搜索', '搜索' ),
26+
'no tags found' => array( '没发现标签' ),
27+
'ago' => array( '' ), // example "1 month ago" or "2 weeks ago"
28+
'sorry, no marks found' => array( '没有书签' ),
29+
'sign out' => array( '退出' ),
30+
'unmark' => array( '各种书签' ),
31+
'register' => array( '注册' ),
32+
'change password' => array( '密码/密钥' ),
33+
'change email address' => array( '更改邮箱' ),
34+
'import or export marks' => array( '导入/导出' ),
35+
'invite others' => array( '邀请朋友' ),
36+
'unmark help' => array( '本书签帮助' ),
37+
'bookmarklet help' => array( '书签工具帮助' ),
38+
'contact support' => array( '联系我们' ),
39+
'save to unmark' => array( '保存到书签' ),
40+
'follow us on twitter' => array( '我的twitter' ),
41+
'chrome extension' => array( '浏览器插件' ),
42+
'account' => array( '账号' ),
43+
'local account' => array( '本地账号'),
44+
'help' => array( '帮助' ),
45+
'tools' => array( '工具' ),
46+
'label' => array( '分类', '分类' ),
47+
'old password' => array( '旧密码' ),
48+
'new password' => array( '新密码' ),
49+
'new email address' => array( '新邮箱' ),
50+
'view/hide details' => array( '展开/隐藏 详情' ),
51+
'view/hide menu' => array( '展开/隐藏 菜单' ),
52+
'view all marks' => array( '查看所有书签' ),
53+
'view labels' => array( '查看分类' ),
54+
'view timeline' => array( '查看时间线' ),
55+
'search &amp; tags' => array( '搜索 &amp; 标签' ),
56+
'view archive' => array( '查看归档' ),
57+
'settings' => array( '设置' ),
58+
'read' => array( '阅读' ),
59+
'watch' => array( '视频' ),
60+
'listen' => array( '音频' ),
61+
'buy' => array( '购物' ),
62+
'eat & drink' => array( '饮食' ),
63+
'do' => array( '运动' ),
64+
'unlabeled' => array( '其他' ),
65+
'account %s' => array( '账户 %s' ),
66+
'do nothing' => array( '无操作' ),
67+
'old password...' => array( '旧密码...' ),
68+
'new password...' => array( '新密码...' ),
69+
'once more...' => array( '再来一次...' ),
70+
'new email address...' => array( '新邮箱...' ),
71+
'export all marks' => array( '导出所有书签' ),
72+
'export file' => array( '导出为文件' ),
73+
'import marks' => array( '导入书签' ),
74+
'import unmark file' => array( '导入本站格式' ),
75+
'import readability file' => array( '导入标准格式' ),
76+
'import html file' => array( '导入html格式' ),
77+
'note: html import supports pocket, delicious, pinboard, and others.' => array( '提示: HTML导入支持pocket, Delicious,Pinboard等等.' ),
78+
'labels' => array( '分类' ),
79+
'archives' => array( '归档' ),
80+
'archive' => array( '归档' ),
81+
'no marks' => array( '没有书签' ),
82+
'search...' => array( '搜索...' ),
83+
'you saved %s mark today' => array( '你保存了 %s 个书签' ),
84+
'and archived %s' => array( '归档 %s 个' ),
85+
'view marks' => array( '浏览书签' ),
86+
'archive all' => array( '所有归档' ),
87+
'for usage tips <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/unmarkit">follow us on twitter</a>!' => array( 'For usage tips <a target="_blank" href="https://twitter.com/unmarkit">我的 Twitter</a>!'),
88+
'%s mark' => array( '%s 个书签', '%s 个书签' ),
89+
'version' => array( '版本' ),
90+
'you have %s mark that are over 1 year old. want to tidy up a bit?' => array( '你有 %s 个1年以上的旧书签,需要整理不?' ),
91+
'mark found containing "%s"' => array( '搜索关键字 "%s"' ),
92+
'mark labeled %s' => array( '分类 %s', '分类 %s' ),
93+
'mark created in the %s' => array( '书签创建在: %s', '书签创建在: %s' ),
94+
'mark archived' => array( '归档的书签', '归档的书签' ),
95+
'mark tagged %s' => array( '标签 %s', '标签 %s' ),
96+
'go' => array( 'ok' ),
97+
'enter url...' => array( '输入网址' ),
98+
'add<span> mark</span>' => array( '添加' ),
99+
'would you like to <a href="/marks/archive/search?q=%s">try searching your archive</a>?'
100+
=>array( '<a href="/marks/archive/search?q=%s">搜一下归档?</a>' ),
101+
'tip: you can restore a mark from your archive. additionally, when searching you can search just your archive.'
102+
=>array( '归档书签还可以恢复,而且可以搜索' ),
103+
'view tags' => array( '查看标签' ),
104+
'unarchive mark' => array( '取消归档' ),
105+
'archive mark' => array( '归档' ),
106+
'view mark info' => array( '编辑' ),
107+
'archived mark found containing "%s"' => array( '在归档中找到: "%s"' ),
108+
'archived marks found containing "%s"' => array( '在归档中找到: "%s"' ),
109+
'please supply an url.' => array( '请输入网址' ),
110+
'back' => array( '返回' ),
111+
'update' => array( '更新' ),
112+
'new password again...' => array( '新密码' ),
113+
'this mark has been added to your stream.' => array( '书签添加成功,可继续完善' ),
114+
'most-used' => array( '常用' ),
115+
'recently-used' => array( '最近' ),
116+
'tags' => array( '标签' ),
117+
'notes' => array( '备注' ),
118+
'type note text here...' => array( '备注...' ),
119+
'delete link' => array( '删??' ),
120+
'add a note or edit Title' => array( '添加备注或者编辑标题' ),
121+
'update &amp; close' => array( '更新' ),
122+
'update &amp; return' => array( '更新' ),
123+
'api key' => array( '查看密钥' ),
124+
'your secret key' => array( '你的密钥' ),
125+
'sign into your account' => array( '登录' ),
126+
'reset password' => array( '重置密码' ),
127+
'need to sign in?' => array( '登录' ),
128+
'forgot password?' => array( '忘记密码?' ),
129+
'sign in' => array( '登录' ),
130+
'have an account? sign in here' => array( '有账号?登录' ),
131+
'error' => array( '发生错误' ),
132+
'install app' => array( '安装APP' ),
133+
'en' => array( 'zh-CN' ),
134+
'unmark : mark added' => array( '已添加' ),
135+
'unmark : user registration' => array( '用户注册' ),
136+
'unmark : reset password' => array( '重置密码' ),
137+
'save to unmark' => array( '收藏到各种标签' ),
138+
'drag me to favorites' => array( '把我拖到收藏夹' ),
139+
'edit labels name' => array( '修改分类' ),
140+
'label name can not empty' => array( '分类不能为空' ),
141+
'wrong api format' => array( 'API网址格式错误' ),
142+
'success' => array( '成功' ),
143+
'trigger api url..' => array( '触发API,最长200' ),
144+
'' => array( '' ),
145+
'' => array( '' ),
146+
'' => array( '' ),
147+
'' => array( '' ),
148+
'' => array( '' ),
149+
'' => array( '' ),
150+
'' => array( '' ),
151+
152+
153+
154+
155+
156+
157+
);
158+
159+
160+
?>

application/views/layouts/accountlinks.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XSYNN4MGM826N"><?php echo unmark_phrase('Support Unmark')?></a></li>
77
<li><a href="#" class="action" data-action="change_password"><?php echo unmark_phrase('Change Password'); ?></a></li>
88
<li><a href="#" class="action" data-action="change_email"><?php echo unmark_phrase('Change Email Address'); ?></a></li>
9+
<li><a href="#" class="action" data-action="delete_user"><?php echo unmark_phrase('Delete Account'); ?></a></li>
910
<li><a href="#" class="action" data-action="import_export"><?php echo unmark_phrase('Import or Export Marks'); ?></a></li>
1011
<li><a href="mailto:?subject=Checkout Unmark&amp;body=You should really check out Unmark. http://unmark.it"><?php echo unmark_phrase('Invite Others'); ?></a></li>
1112
</ul>

application/views/layouts/userforms.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414
</div>
1515
<a href="#" id="unmarkModalClose"><i class="icon-big_close"></i></a>
1616
</figure>
17+
<figure id="deleteUserForm" class="resetWrapper hiddenform">
18+
<div class="loginInner">
19+
<header>
20+
<h1><?php echo unmark_phrase('Delete Account') ?></h1>
21+
<p><strong>Warning:</strong> This cannot be undone.</p>
22+
</header>
23+
<form id="send_delete_user_request" method="post" action="#" class="ajaxsbmt">
24+
<input type="password" class="field-input" name="pass" id="pass" placeholder="<?php echo unmark_phrase('Password...') ?>" autocomplete="off" />
25+
<button class="login-submit" type="submit">Delete Account</button>
26+
</form>
27+
<div class="response-message"></div>
28+
</div>
29+
<a href="#" id="unmarkModalClose"><i class="icon-big_close"></i></a>
30+
</figure>
1731
<figure id="changePasswordForm" class="resetWrapper hiddenform">
1832
<div class="loginInner">
1933
<header>

application/views/marks/index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
</div>
1919
</header>
2020
<div class="marks continue-search no-results"><?php echo sprintf( unmark_phrase('Would you like to <a href="/marks/archive/search?q=%s">try searching your archive</a>?'), (isset($_GET['q'])) ? $_GET['q'] : ''); ?></div>
21+
<?php elseif (isset($_GET['q']) & $lookup_type == 'archive') : ?>
22+
<header class="marks-heading">
23+
<div class="marks-heading-wrapper">
24+
<div class="marks-heading-bar">
25+
<?php $this->load->view('layouts/topbar/searchform.php'); ?>
26+
</div>
27+
</div>
28+
</header>
29+
<div class="marks continue-search no-results"><?php echo sprintf( unmark_phrase('Would you like to <a href="/marks/search?q=%s">try searching outside of your archived marks</a>?'), (isset($_GET['q'])) ? $_GET['q'] : ''); ?></div>
2130
<?php elseif ($lookup_type == 'tag') : ?>
2231
<header class="marks-heading">
2332
<div class="marks-heading-wrapper">

0 commit comments

Comments
 (0)