Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
82a68650
Commit
82a68650
authored
Apr 10, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Splits PMs into inbox and sent items
parent
d5c5c2a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
25 deletions
+31
-25
qa-lang-misc.php
qa-include/qa-lang-misc.php
+4
-1
qa-page-messages.php
qa-include/qa-page-messages.php
+26
-23
qa-page.php
qa-include/qa-page.php
+1
-1
No files found.
qa-include/qa-lang-misc.php
View file @
82a68650
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
'form_security_reload'
=>
'Please reload the page then try again'
,
'form_security_reload'
=>
'Please reload the page then try again'
,
'hide_all_ip_button'
=>
'Hide all posts from this IP'
,
'hide_all_ip_button'
=>
'Hide all posts from this IP'
,
'host_name'
=>
'Host name:'
,
'host_name'
=>
'Host name:'
,
'inbox'
=>
'Inbox'
,
'matches_blocked_ips'
=>
'Matches blocked IP addresses:'
,
'matches_blocked_ips'
=>
'Matches blocked IP addresses:'
,
'message_empty'
=>
'Please enter your message to send to this user'
,
'message_empty'
=>
'Please enter your message to send to this user'
,
'message_explanation'
=>
'This will be sent as a notification from ^. Your email address will not be revealed unless you include it in the message.'
,
'message_explanation'
=>
'This will be sent as a notification from ^. Your email address will not be revealed unless you include it in the message.'
,
...
@@ -83,8 +84,10 @@
...
@@ -83,8 +84,10 @@
'no_recent_updates'
=>
'No recent updates'
,
'no_recent_updates'
=>
'No recent updates'
,
'no_updates_content'
=>
'No recent updates for my content'
,
'no_updates_content'
=>
'No recent updates for my content'
,
'no_updates_favorites'
=>
'No updates for my favorites'
,
'no_updates_favorites'
=>
'No updates for my favorites'
,
'outbox'
=>
'Sent items'
,
'private_message_title'
=>
'Send a private message'
,
'private_message_title'
=>
'Send a private message'
,
'private_messages_title'
=>
'Private messages'
,
'pm_inbox_title'
=>
'Private messages received'
,
'pm_outbox_title'
=>
'Private messages sent'
,
'recent_activity_from_x'
=>
'Recent activity from ^'
,
'recent_activity_from_x'
=>
'Recent activity from ^'
,
'recent_updates_content'
=>
'Recent updates for my content'
,
'recent_updates_content'
=>
'Recent updates for my content'
,
'recent_updates_favorites'
=>
'Recent updates for my favorites'
,
'recent_updates_favorites'
=>
'Recent updates for my favorites'
,
...
...
qa-include/qa-page-messages.php
View file @
82a68650
...
@@ -34,59 +34,62 @@
...
@@ -34,59 +34,62 @@
require_once
QA_INCLUDE_DIR
.
'qa-app-format.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-app-format.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-app-limits.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-app-limits.php'
;
$login
useri
d
=
qa_get_logged_in_userid
();
$login
UserI
d
=
qa_get_logged_in_userid
();
// Check we have a handle, we're not using Q2A's single-sign on integration and that we're logged in
// Check which box we're showing (inbox/sent), we're not using Q2A's single-sign on integration and that we're logged in
$showInbox
=
qa_request_part
(
1
)
!==
'sent'
;
if
(
QA_FINAL_EXTERNAL_USERS
)
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User accounts are handled by external code'
);
qa_fatal_error
(
'User accounts are handled by external code'
);
if
(
!
isset
(
$login
useri
d
))
{
if
(
!
isset
(
$login
UserI
d
))
{
$qa_content
=
qa_content_prepare
();
$qa_content
=
qa_content_prepare
();
$qa_content
[
'error'
]
=
qa_insert_login_links
(
qa_lang_html
(
'misc/message_must_login'
),
qa_request
());
$qa_content
[
'error'
]
=
qa_insert_login_links
(
qa_lang_html
(
'misc/message_must_login'
),
qa_request
());
return
$qa_content
;
return
$qa_content
;
}
}
// Find the user profile and questions and answers for this handle
list
(
$toaccount
,
$usermessages
)
=
qa_db_select_with_pending
(
qa_db_user_account_selectspec
(
qa_get_logged_in_handle
(),
false
),
// qa_db_recent_messages_selectspec($loginuserid, true, null, null)
qa_db_messages_inbox_selectspec
(
'private'
,
$loginuserid
,
true
)
// qa_db_messages_outbox_selectspec('private', $loginuserid, true)
);
// Check the user exists and work out what can and can't be set (if not using single sign-on)
if
(
!
qa_opt
(
'allow_private_messages'
)
)
if
(
!
qa_opt
(
'allow_private_messages'
)
)
return
include
QA_INCLUDE_DIR
.
'qa-page-not-found.php'
;
return
include
QA_INCLUDE_DIR
.
'qa-page-not-found.php'
;
// Find the user profile and questions and answers for this handle
$pmSpec
=
$showInbox
?
qa_db_messages_inbox_selectspec
(
'private'
,
$loginUserId
,
true
)
:
qa_db_messages_outbox_selectspec
(
'private'
,
$loginUserId
,
true
);
$userMessages
=
qa_db_select_with_pending
(
$pmSpec
);
// Prepare content for theme
// Prepare content for theme
$qa_content
=
qa_content_prepare
();
$qa_content
=
qa_content_prepare
();
$qa_content
[
'title'
]
=
qa_lang_html
(
'misc/private_messages_title'
);
$qa_content
[
'title'
]
=
$showInbox
?
qa_lang_html
(
'misc/pm_inbox_title'
)
:
qa_lang_html
(
'misc/pm_outbox_title'
);
$qa_content
[
'error'
]
=
@
$pageerror
;
$qa_content
[
'raw'
][
'account'
]
=
$toaccount
;
// for plugin layers to access
$qa_content
[
'message_list'
]
=
array
(
$qa_content
[
'message_list'
]
=
array
(
// 'title' => '<a name="pms">'.qa_lang_html('misc/private_messages_title').'</a>',
'tags'
=>
'id="privatemessages"'
,
'tags'
=>
'id="privatemessages"'
,
'messages'
=>
array
(),
'messages'
=>
array
(),
);
);
$options
=
qa_message_html_defaults
();
$options
=
qa_message_html_defaults
();
foreach
(
$user
m
essages
as
$message
)
{
foreach
(
$user
M
essages
as
$message
)
{
$qa_content
[
'message_list'
][
'messages'
][]
=
qa_message_html_fields
(
$message
,
$options
);
$qa_content
[
'message_list'
][
'messages'
][]
=
qa_message_html_fields
(
$message
,
$options
);
}
}
$qa_content
[
'navigation'
][
'sub'
]
=
array
(
'inbox'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/inbox'
),
'url'
=>
qa_path_html
(
'messages'
),
'selected'
=>
$showInbox
,
),
'outbox'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/outbox'
),
'url'
=>
qa_path_html
(
'messages/sent'
),
'selected'
=>
!
$showInbox
,
)
);
return
$qa_content
;
return
$qa_content
;
qa-include/qa-page.php
View file @
82a68650
...
@@ -422,7 +422,7 @@
...
@@ -422,7 +422,7 @@
'ip/'
=>
'qa-page-ip.php'
,
'ip/'
=>
'qa-page-ip.php'
,
'login'
=>
'qa-page-login.php'
,
'login'
=>
'qa-page-login.php'
,
'logout'
=>
'qa-page-logout.php'
,
'logout'
=>
'qa-page-logout.php'
,
'messages'
=>
'qa-page-messages.php'
,
'messages
/
'
=>
'qa-page-messages.php'
,
'message/'
=>
'qa-page-message.php'
,
'message/'
=>
'qa-page-message.php'
,
'questions/'
=>
'qa-page-questions.php'
,
'questions/'
=>
'qa-page-questions.php'
,
'register'
=>
'qa-page-register.php'
,
'register'
=>
'qa-page-register.php'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment