Commit ee222151 by Gideon Greenspan

1.6.3

parent 3157101b
1.6.3-dev-1203 1.6.3
\ No newline at end of file \ No newline at end of file
...@@ -992,7 +992,7 @@ ...@@ -992,7 +992,7 @@
{ {
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); } if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
return substr(preg_replace('/([^A-Za-z0-9])((http|https|ftp):\/\/([^\s&<>"\'\.])+\.([^\s&<>"\']|&amp;)+)/i', '\1<a href="\2" rel="nofollow"'.($newwindow ? ' target="_blank"' : '').'>\2</a>', ' '.$html.' '), 1, -1); return substr(preg_replace('/([^A-Za-z0-9])((http|https|ftp):\/\/([^\s&<>\(\)\[\]"\'\.])+\.([^\s&<>\(\)\[\]"\']|&amp;)+)/i', '\1<a href="\2" rel="nofollow"'.($newwindow ? ' target="_blank"' : '').'>\2</a>', ' '.$html.' '), 1, -1);
} }
...@@ -1229,7 +1229,7 @@ ...@@ -1229,7 +1229,7 @@
} }
function qa_user_sub_navigation($handle, $selected) function qa_user_sub_navigation($handle, $selected, $ismyuser=false)
/* /*
Return the sub navigation structure for navigating between the different pages relating to a user Return the sub navigation structure for navigating between the different pages relating to a user
*/ */
...@@ -1240,6 +1240,16 @@ ...@@ -1240,6 +1240,16 @@
'url' => qa_path_html('user/'.$handle), 'url' => qa_path_html('user/'.$handle),
), ),
'account' => array(
'label' => qa_lang_html('misc/nav_my_details'),
'url' => qa_path_html('account'),
),
'favorites' => array(
'label' => qa_lang_html('misc/nav_my_favorites'),
'url' => qa_path_html('favorites'),
),
'wall' => array( 'wall' => array(
'label' => qa_lang_html('misc/nav_user_wall'), 'label' => qa_lang_html('misc/nav_user_wall'),
'url' => qa_path_html('user/'.$handle.'/wall'), 'url' => qa_path_html('user/'.$handle.'/wall'),
...@@ -1266,6 +1276,12 @@ ...@@ -1266,6 +1276,12 @@
if (QA_FINAL_EXTERNAL_USERS || !qa_opt('allow_user_walls')) if (QA_FINAL_EXTERNAL_USERS || !qa_opt('allow_user_walls'))
unset($navigation['wall']); unset($navigation['wall']);
if (QA_FINAL_EXTERNAL_USERS || !$ismyuser)
unset($navigation['account']);
if (!$ismyuser)
unset($navigation['favorites']);
return $navigation; return $navigation;
} }
...@@ -1273,7 +1289,8 @@ ...@@ -1273,7 +1289,8 @@
function qa_account_sub_navigation() function qa_account_sub_navigation()
/* /*
Return the sub navigation structure for user account pages Return the sub navigation structure for user account pages.
RETIRED FROM USE IN Q2A 1.6.3 BUT RETAINED FOR BACKWARDS COMPATIBILITY
*/ */
{ {
return array( return array(
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
{ {
$continue=false; $continue=false;
@list($operation, $length, $next, $done)=explode(',', $state); @list($operation, $length, $next, $done)=explode("\t", $state);
switch ($operation) { switch ($operation) {
case 'doreindexcontent': case 'doreindexcontent':
...@@ -234,19 +234,25 @@ ...@@ -234,19 +234,25 @@
break; break;
case 'dorecalcpoints_recalc': case 'dorecalcpoints_recalc':
$userids=qa_db_users_get_for_recalc_points($next, 10); $recalccount=10;
$userids=qa_db_users_get_for_recalc_points($next, $recalccount+1); // get one extra so we know where to start from next
$gotcount=count($userids);
$recalccount=min($recalccount, $gotcount); // can't recalc more than we got
if (count($userids)) { if ($recalccount>0) {
$lastuserid=max($userids); $lastuserid=$userids[$recalccount-1];
qa_db_users_recalc_points($next, $lastuserid);
$done+=$recalccount;
qa_db_users_recalc_points($next, $lastuserid); } else
$lastuserid=$next; // for truncation
$next=1+$lastuserid;
$done+=count($userids); if ($gotcount>$recalccount) { // more left to do
$next=$userids[$recalccount]; // start next round at first one not recalculated
$continue=true; $continue=true;
} else { } else {
qa_db_truncate_userpoints($next); qa_db_truncate_userpoints($lastuserid);
qa_db_userpointscount_update(); // quick so just do it here qa_db_userpointscount_update(); // quick so just do it here
qa_recalc_transition($state, 'dorecalcpoints_complete'); qa_recalc_transition($state, 'dorecalcpoints_complete');
} }
...@@ -523,7 +529,7 @@ ...@@ -523,7 +529,7 @@
} }
if ($continue) if ($continue)
$state=$operation.','.$length.','.$next.','.$done; $state=$operation."\t".$length."\t".$next."\t".$done;
return $continue && ($done<$length); return $continue && ($done<$length);
} }
...@@ -534,7 +540,11 @@ ...@@ -534,7 +540,11 @@
Change the $state to represent the beginning of a new $operation Change the $state to represent the beginning of a new $operation
*/ */
{ {
$state=$operation.','.qa_recalc_stage_length($operation).',0,0'; $length=qa_recalc_stage_length($operation);
$next=(QA_FINAL_EXTERNAL_USERS && ($operation=='dorecalcpoints_recalc')) ? '' : 0;
$done=0;
$state=$operation."\t".$length."\t".$next."\t".$done;
} }
...@@ -609,7 +619,7 @@ ...@@ -609,7 +619,7 @@
Return a string which gives a user-viewable version of $state Return a string which gives a user-viewable version of $state
*/ */
{ {
@list($operation, $length, $next, $done)=explode(',', $state); @list($operation, $length, $next, $done)=explode("\t", $state);
$done=(int)$done; $done=(int)$done;
$length=(int)$length; $length=(int)$length;
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_APPROVE, true); qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_APPROVE, true);
qa_send_notification($userid, $email, $handle, qa_lang('emails/welcome_subject'), qa_lang('emails/welcome_body'), array( qa_send_notification($userid, $email, $handle, qa_lang('emails/welcome_subject'), qa_lang('emails/welcome_body'), array(
'^password' => isset($password) ? $password : qa_lang('users/password_to_set'), '^password' => isset($password) ? qa_lang('main/hidden') : qa_lang('users/password_to_set'), // v 1.6.3: no longer email out passwords
'^url' => qa_opt('site_url'), '^url' => qa_opt('site_url'),
'^custom' => strlen($custom) ? ($custom."\n\n") : '', '^custom' => strlen($custom) ? ($custom."\n\n") : '',
'^confirm' => $confirm, '^confirm' => $confirm,
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
*/ */
define('QA_VERSION', '1.6.3-dev-1203'); // also used as suffix for .js and .css requests define('QA_VERSION', '1.6.3'); // also used as suffix for .js and .css requests
define('QA_BUILD_DATE', '2013-12-03'); define('QA_BUILD_DATE', '2014-01-15');
// Execution section of this file - remainder contains function definitions // Execution section of this file - remainder contains function definitions
...@@ -733,7 +733,7 @@ ...@@ -733,7 +733,7 @@
$safe=htmLawed($html, array( $safe=htmLawed($html, array(
'safe' => 1, 'safe' => 1,
'elements' => '*+embed+object', 'elements' => '*+embed+object-form',
'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; style: !; classid:clsid', 'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; style: !; classid:clsid',
'keep_bad' => 0, 'keep_bad' => 0,
'anti_link_spam' => array('/.*/', ''), 'anti_link_spam' => array('/.*/', ''),
......
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
*/ */
{ {
if (qa_should_update_counts()) if (qa_should_update_counts())
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND acount=0"); qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND acount=0 AND closedbyid IS NULL");
} }
...@@ -341,7 +341,7 @@ ...@@ -341,7 +341,7 @@
*/ */
{ {
if (qa_should_update_counts()) if (qa_should_update_counts())
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unselqcount', COUNT(*) FROM ^posts WHERE type='Q' AND selchildid IS NULL"); qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unselqcount', COUNT(*) FROM ^posts WHERE type='Q' AND selchildid IS NULL AND closedbyid IS NULL");
} }
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
*/ */
{ {
if (qa_should_update_counts()) if (qa_should_update_counts())
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unupaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND amaxvote=0"); qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unupaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND amaxvote=0 AND closedbyid IS NULL");
} }
......
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
{ {
if (QA_FINAL_EXTERNAL_USERS) if (QA_FINAL_EXTERNAL_USERS)
return qa_db_read_all_values(qa_db_query_sub( return qa_db_read_all_values(qa_db_query_sub(
'(SELECT DISTINCT userid FROM ^posts WHERE userid>=# ORDER BY userid LIMIT #) UNION (SELECT DISTINCT userid FROM ^uservotes WHERE userid>=# ORDER BY userid LIMIT #)', 'SELECT userid FROM ((SELECT DISTINCT userid FROM ^posts WHERE userid>=# ORDER BY userid LIMIT #) UNION (SELECT DISTINCT userid FROM ^uservotes WHERE userid>=# ORDER BY userid LIMIT #)) x ORDER BY userid LIMIT #',
$startuserid, $count, $startuserid, $count $startuserid, $count, $startuserid, $count, $count
)); ));
else else
return qa_db_read_all_values(qa_db_query_sub( return qa_db_read_all_values(qa_db_query_sub(
...@@ -298,14 +298,14 @@ ...@@ -298,14 +298,14 @@
} }
function qa_db_truncate_userpoints($firstuserid) function qa_db_truncate_userpoints($lastuserid)
/* /*
Remove any rows in the userpoints table from $firstuserid upwards Remove any rows in the userpoints table where userid is greater than $lastuserid
*/ */
{ {
qa_db_query_sub( qa_db_query_sub(
'DELETE FROM ^userpoints WHERE userid>=#', 'DELETE FROM ^userpoints WHERE userid>#',
$firstuserid $lastuserid
); );
} }
......
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
$selectspec=qa_db_posts_basic_selectspec($voteuserid, $full); $selectspec=qa_db_posts_basic_selectspec($voteuserid, $full);
$selectspec['source'].=" JOIN (SELECT postid FROM ^posts WHERE ".qa_db_categoryslugs_sql_args($categoryslugs, $selectspec['arguments'])."type=$ AND ".$bysql." ORDER BY ^posts.created DESC LIMIT #,#) y ON ^posts.postid=y.postid"; $selectspec['source'].=" JOIN (SELECT postid FROM ^posts WHERE ".qa_db_categoryslugs_sql_args($categoryslugs, $selectspec['arguments'])."type=$ AND ".$bysql." AND closedbyid IS NULL ORDER BY ^posts.created DESC LIMIT #,#) y ON ^posts.postid=y.postid";
array_push($selectspec['arguments'], $type, $start, $count); array_push($selectspec['arguments'], $type, $start, $count);
...@@ -801,7 +801,7 @@ ...@@ -801,7 +801,7 @@
} }
if ($selectparts==0) if ($selectparts==0)
$selectspec['source'].='(SELECT NULL as questionid, 0 AS score, NULL AS matchposttype, NULL AS matchpostid FROM ^posts WHERE postid=NULL)'; $selectspec['source'].='(SELECT NULL as questionid, 0 AS score, NULL AS matchposttype, NULL AS matchpostid FROM ^posts WHERE postid IS NULL)';
$selectspec['source'].=") x LEFT JOIN ^posts ON ^posts.postid=questionid GROUP BY questionid ORDER BY score DESC LIMIT #,#) y ON ^posts.postid=y.questionid"; $selectspec['source'].=") x LEFT JOIN ^posts ON ^posts.postid=questionid GROUP BY questionid ORDER BY score DESC LIMIT #,#) y ON ^posts.postid=y.questionid";
......
...@@ -34,19 +34,28 @@ ...@@ -34,19 +34,28 @@
function process_event($event, $userid, $handle, $cookieid, $params) function process_event($event, $userid, $handle, $cookieid, $params)
{ {
// Don't increment limits or report user actions for events that were delayed. For example, a 'q_post'
// event sent when a post is approved by the admin, for which a 'q_queue' event was already sent.
if (isset($params['delayed']))
return;
require_once QA_INCLUDE_DIR.'qa-app-limits.php'; require_once QA_INCLUDE_DIR.'qa-app-limits.php';
switch ($event) { switch ($event) {
case 'q_queue':
case 'q_post': case 'q_post':
case 'q_claim': case 'q_claim':
qa_limits_increment($userid, QA_LIMIT_QUESTIONS); qa_limits_increment($userid, QA_LIMIT_QUESTIONS);
break; break;
case 'a_queue':
case 'a_post': case 'a_post':
case 'a_claim': case 'a_claim':
qa_limits_increment($userid, QA_LIMIT_ANSWERS); qa_limits_increment($userid, QA_LIMIT_ANSWERS);
break; break;
case 'c_queue':
case 'c_post': case 'c_post':
case 'c_claim': case 'c_claim':
case 'a_to_c': case 'a_to_c':
...@@ -85,10 +94,10 @@ ...@@ -85,10 +94,10 @@
'u_block', 'u_edit', 'u_level', 'u_message', 'u_password', 'u_save', 'u_unblock', 'u_block', 'u_edit', 'u_level', 'u_message', 'u_password', 'u_save', 'u_unblock',
); );
if ((!isset($params['delayed'])) && ( if (
is_numeric(array_search(strstr($event, '_'), $writeactions)) || is_numeric(array_search(strstr($event, '_'), $writeactions)) ||
is_numeric(array_search($event, $writeactions)) is_numeric(array_search($event, $writeactions))
)) { ) {
if (isset($userid)) { if (isset($userid)) {
require_once QA_INCLUDE_DIR.'qa-app-users.php'; require_once QA_INCLUDE_DIR.'qa-app-users.php';
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
array( array(
'^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] : '^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] :
(strlen(@$oldquestion['name']) ? $oldquestion['name'] : qa_lang('main/anonymous'))), (strlen(@$oldquestion['name']) ? $oldquestion['name'] : qa_lang('main/anonymous'))),
'^p_context' => trim(@$params['title']."\n\n".$params['text']), '^p_context' => trim(@$params['title']."\n\n".$params['text']), // don't censor for admin
'^url' => qa_q_path($params['postid'], $params['title'], true), '^url' => qa_q_path($params['postid'], $params['title'], true),
'^a_url' => qa_path_absolute('admin/moderate'), '^a_url' => qa_path_absolute('admin/moderate'),
) )
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
array( array(
'^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] : '^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] :
(strlen(@$oldanswer['name']) ? $oldanswer['name'] : qa_lang('main/anonymous'))), (strlen(@$oldanswer['name']) ? $oldanswer['name'] : qa_lang('main/anonymous'))),
'^p_context' => $params['text'], '^p_context' => $params['text'], // don't censor for admin
'^url' => qa_q_path($params['parentid'], $params['parent']['title'], true, 'A', $params['postid']), '^url' => qa_q_path($params['parentid'], $params['parent']['title'], true, 'A', $params['postid']),
'^a_url' => qa_path_absolute('admin/moderate'), '^a_url' => qa_path_absolute('admin/moderate'),
) )
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
'^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] : '^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] :
(strlen(@$oldcomment['name']) ? $oldcomment['name'] : // could also be after answer converted to comment (strlen(@$oldcomment['name']) ? $oldcomment['name'] : // could also be after answer converted to comment
(strlen(@$oldanswer['name']) ? $oldanswer['name'] : qa_lang('main/anonymous')))), (strlen(@$oldanswer['name']) ? $oldanswer['name'] : qa_lang('main/anonymous')))),
'^p_context' => $params['text'], '^p_context' => $params['text'], // don't censor for admin
'^url' => qa_q_path($params['questionid'], $params['question']['title'], true, 'C', $params['postid']), '^url' => qa_q_path($params['questionid'], $params['question']['title'], true, 'C', $params['postid']),
'^a_url' => qa_path_absolute('admin/moderate'), '^a_url' => qa_path_absolute('admin/moderate'),
) )
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
'^p_handle' => isset($oldpost['handle']) ? $oldpost['handle'] : '^p_handle' => isset($oldpost['handle']) ? $oldpost['handle'] :
(strlen($oldpost['name']) ? $oldpost['name'] : qa_lang('main/anonymous')), (strlen($oldpost['name']) ? $oldpost['name'] : qa_lang('main/anonymous')),
'^flags' => ($flagcount==1) ? qa_lang_html_sub('main/1_flag', '1', '1') : qa_lang_html_sub('main/x_flags', $flagcount), '^flags' => ($flagcount==1) ? qa_lang_html_sub('main/1_flag', '1', '1') : qa_lang_html_sub('main/x_flags', $flagcount),
'^p_context' => trim(@$oldpost['title']."\n\n".qa_viewer_text($oldpost['content'], $oldpost['format'])), '^p_context' => trim(@$oldpost['title']."\n\n".qa_viewer_text($oldpost['content'], $oldpost['format'])), // don't censor for admin
'^url' => qa_q_path($params['questionid'], $params['question']['title'], true, $oldpost['basetype'], $oldpost['postid']), '^url' => qa_q_path($params['questionid'], $params['question']['title'], true, $oldpost['basetype'], $oldpost['postid']),
'^a_url' => qa_path_absolute('admin/flagged'), '^a_url' => qa_path_absolute('admin/flagged'),
)); ));
...@@ -257,12 +257,15 @@ ...@@ -257,12 +257,15 @@
break; break;
case 'u_wall_post': case 'u_wall_post':
if ($userid!=$params['userid']) if ($userid!=$params['userid']) {
$blockwordspreg=qa_get_block_words_preg();
qa_send_notification($params['userid'], null, $params['handle'], qa_lang('emails/wall_post_subject'), qa_lang('emails/wall_post_body'), array( qa_send_notification($params['userid'], null, $params['handle'], qa_lang('emails/wall_post_subject'), qa_lang('emails/wall_post_body'), array(
'^f_handle' => isset($handle) ? $handle : qa_lang('main/anonymous'), '^f_handle' => isset($handle) ? $handle : qa_lang('main/anonymous'),
'^post' => $params['text'], '^post' => qa_block_words_replace($params['text'], $blockwordspreg),
'^url' => qa_path_absolute('user/'.$params['handle'], null, 'wall'), '^url' => qa_path_absolute('user/'.$params['handle'], null, 'wall'),
)); ));
}
break; break;
} }
} }
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
'wall_post_subject' => 'Post on your ^site_title wall', 'wall_post_subject' => 'Post on your ^site_title wall',
'wall_post_body' => "^f_handle has posted on your user wall at ^site_title:\n\n^open^post^close\n\nYou may respond to the post here:\n\n^url\n\nThank you,\n\n^site_title", 'wall_post_body' => "^f_handle has posted on your user wall at ^site_title:\n\n^open^post^close\n\nYou may respond to the post here:\n\n^url\n\nThank you,\n\n^site_title",
'welcome_body' => "Thank you for registering for ^site_title.\n\n^custom^confirmYour login details are as follows:\n\nEmail: ^email\nPassword: ^password\n\nPlease keep this information safe for future reference.\n\nThank you,\n\n^site_title\n^url", 'welcome_body' => "Thank you for registering for ^site_title.\n\n^custom^confirmYour login details are as follows:\n\nUsername: ^handle\nEmail: ^email\n\nPlease keep this information safe for future reference.\n\nThank you,\n\n^site_title\n^url",
'welcome_confirm' => "Please click below to confirm your email address.\n\n^url\n\n", 'welcome_confirm' => "Please click below to confirm your email address.\n\n^url\n\n",
'welcome_subject' => 'Welcome to ^site_title!', 'welcome_subject' => 'Welcome to ^site_title!',
); );
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
'my_favorites_title' => 'My favorites', 'my_favorites_title' => 'My favorites',
'nav_all_my_updates' => 'All my updates', 'nav_all_my_updates' => 'All my updates',
'nav_my_content' => 'My content', 'nav_my_content' => 'My content',
'nav_my_details' => 'My details', 'nav_my_details' => 'My account',
'nav_my_favorites' => 'My favorites', 'nav_my_favorites' => 'My favorites',
'nav_user_activity' => 'Recent activity', 'nav_user_activity' => 'Recent activity',
'nav_user_as' => 'All answers', 'nav_user_as' => 'All answers',
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
'delete_wall_post_popup' => 'Delete this wall post', 'delete_wall_post_popup' => 'Delete this wall post',
'extra_privileges' => 'Extra privileges:', 'extra_privileges' => 'Extra privileges:',
'gave_out' => 'Gave out:', 'gave_out' => 'Gave out:',
'my_account_title' => 'My account details', 'my_account_title' => 'My account',
'no_answers_by_x' => 'No answers by ^', 'no_answers_by_x' => 'No answers by ^',
'no_posts_by_x' => 'No posts by ^', 'no_posts_by_x' => 'No posts by ^',
'no_questions_by_x' => 'No questions by ^', 'no_questions_by_x' => 'No questions by ^',
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
'confirm_wrong_log_in' => 'Code not correct - please ^1log in^2 to send a new link', 'confirm_wrong_log_in' => 'Code not correct - please ^1log in^2 to send a new link',
'confirm_wrong_resend' => 'Code not correct - please click below to send a new link', 'confirm_wrong_resend' => 'Code not correct - please click below to send a new link',
'delete_user_button' => 'Delete User', 'delete_user_button' => 'Delete User',
'edit_profile' => 'Edit my Profile',
'edit_user_button' => 'Edit User', 'edit_user_button' => 'Edit User',
'email_confirmed' => 'Confirmed', 'email_confirmed' => 'Confirmed',
'email_exists' => 'Email already belongs to an account', 'email_exists' => 'Email already belongs to an account',
......
...@@ -431,7 +431,7 @@ ...@@ -431,7 +431,7 @@
$qa_content['form_profile']['ok']=qa_lang_html('users/password_changed'); $qa_content['form_profile']['ok']=qa_lang_html('users/password_changed');
$qa_content['navigation']['sub']=qa_account_sub_navigation(); $qa_content['navigation']['sub']=qa_user_sub_navigation($useraccount['handle'], 'account', true);
return $qa_content; return $qa_content;
......
...@@ -587,7 +587,7 @@ ...@@ -587,7 +587,7 @@
array_push($showoptions, 'max_rate_ip_flags', 'max_rate_user_flags', 'max_rate_ip_uploads', 'max_rate_user_uploads'); array_push($showoptions, 'max_rate_ip_flags', 'max_rate_user_flags', 'max_rate_ip_uploads', 'max_rate_user_uploads');
if (qa_opt('allow_private_messages')) if (qa_opt('allow_private_messages') || qa_opt('allow_user_walls'))
array_push($showoptions, 'max_rate_ip_messages', 'max_rate_user_messages'); array_push($showoptions, 'max_rate_ip_messages', 'max_rate_user_messages');
$formstyle='wide'; $formstyle='wide';
......
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
$in=array(); $in=array();
$followpostid=qa_get('follow'); $followpostid=qa_get('follow');
$in['categoryid']=qa_get_category_field_value('category'); $in['categoryid']=qa_clicked('doask') ? qa_get_category_field_value('category') : qa_get('cat');
if (!isset($in['categoryid']))
$in['categoryid']=qa_get('cat');
$userid=qa_get_logged_in_userid(); $userid=qa_get_logged_in_userid();
list($categories, $followanswer, $completetags)=qa_db_select_with_pending( list($categories, $followanswer, $completetags)=qa_db_select_with_pending(
......
...@@ -150,8 +150,7 @@ ...@@ -150,8 +150,7 @@
$qa_content['suggest_next']=qa_lang_html_sub('misc/suggest_favorites_add', '<span class="qa-favorite-image">&nbsp;</span>'); $qa_content['suggest_next']=qa_lang_html_sub('misc/suggest_favorites_add', '<span class="qa-favorite-image">&nbsp;</span>');
if (!QA_FINAL_EXTERNAL_USERS) $qa_content['navigation']['sub']=qa_user_sub_navigation(qa_get_logged_in_handle(), 'favorites', true);
$qa_content['navigation']['sub']=qa_account_sub_navigation();
return $qa_content; return $qa_content;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
File: qa-include/qa-page-unanswered.php File: qa-include/qa-page-unanswered.php
Version: See define()s at top of qa-include/qa-base.php Version: See define()s at top of qa-include/qa-base.php
Description: Controller for page listing recent questions without answers Description: Controller for page listing recent questions without upvoted/selected/any answers
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
......
...@@ -94,7 +94,8 @@ ...@@ -94,7 +94,8 @@
// Sub menu for navigation in user pages // Sub menu for navigation in user pages
$qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'activity'); $qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'activity',
isset($loginuserid) && ($loginuserid==(QA_FINAL_EXTERNAL_USERS ? $userid : $useraccount['userid'])));
return $qa_content; return $qa_content;
......
...@@ -102,7 +102,8 @@ ...@@ -102,7 +102,8 @@
// Sub menu for navigation in user pages // Sub menu for navigation in user pages
$qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'answers'); $qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'answers',
isset($loginuserid) && ($loginuserid==(QA_FINAL_EXTERNAL_USERS ? $userid : $useraccount['userid'])));
return $qa_content; return $qa_content;
......
...@@ -38,6 +38,12 @@ ...@@ -38,6 +38,12 @@
// $handle, $userhtml are already set by qa-page-user.php - also $userid if using external user integration // $handle, $userhtml are already set by qa-page-user.php - also $userid if using external user integration
// Redirect to 'My Account' page if button clicked
if (qa_clicked('doaccount'))
qa_redirect('account');
// Find the user profile and questions and answers for this handle // Find the user profile and questions and answers for this handle
$loginuserid=qa_get_logged_in_userid(); $loginuserid=qa_get_logged_in_userid();
...@@ -74,8 +80,6 @@ ...@@ -74,8 +80,6 @@
return include QA_INCLUDE_DIR.'qa-page-not-found.php'; return include QA_INCLUDE_DIR.'qa-page-not-found.php';
$userid=$useraccount['userid']; $userid=$useraccount['userid'];
$ismyuserpage=isset($loginuserid) && ($loginuserid==$userid);
$fieldseditable=false; $fieldseditable=false;
$maxlevelassign=null; $maxlevelassign=null;
...@@ -710,7 +714,15 @@ ...@@ -710,7 +714,15 @@
'code' => qa_get_form_security_code('user-'.$handle), 'code' => qa_get_form_security_code('user-'.$handle),
); );
} }
}
} elseif (isset($loginuserid) && ($loginuserid==$userid))
$qa_content['form_profile']['buttons']=array(
'account' => array(
'tags' => 'name="doaccount"',
'label' => qa_lang_html('users/edit_profile'),
),
);
if (!is_array($qa_content['form_profile']['fields']['removeavatar'])) if (!is_array($qa_content['form_profile']['fields']['removeavatar']))
unset($qa_content['form_profile']['fields']['removeavatar']); unset($qa_content['form_profile']['fields']['removeavatar']);
...@@ -934,7 +946,8 @@ ...@@ -934,7 +946,8 @@
// Sub menu for navigation in user pages // Sub menu for navigation in user pages
$qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'profile'); $qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'profile',
isset($loginuserid) && ($loginuserid==(QA_FINAL_EXTERNAL_USERS ? $userid : $useraccount['userid'])));
return $qa_content; return $qa_content;
......
...@@ -96,7 +96,8 @@ ...@@ -96,7 +96,8 @@
// Sub menu for navigation in user pages // Sub menu for navigation in user pages
$qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'questions'); $qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'questions',
isset($loginuserid) && ($loginuserid==(QA_FINAL_EXTERNAL_USERS ? $userid : $useraccount['userid'])));
return $qa_content; return $qa_content;
......
...@@ -155,7 +155,8 @@ ...@@ -155,7 +155,8 @@
// Sub menu for navigation in user pages // Sub menu for navigation in user pages
$qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'wall'); $qa_content['navigation']['sub']=qa_user_sub_navigation($handle, 'wall',
isset($loginuserid) && ($loginuserid==(QA_FINAL_EXTERNAL_USERS ? $userid : $useraccount['userid'])));
return $qa_content; return $qa_content;
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
$user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true) $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true)
).' '.$usershtml[$user['userid']], ).' '.$usershtml[$user['userid']],
'score' => qa_html(number_format($user['points'])), 'score' => qa_html(number_format($user['points'])),
'raw' => $user,
); );
} else } else
......
...@@ -667,12 +667,6 @@ ...@@ -667,12 +667,6 @@
: qa_get_one_user_html(qa_get_logged_in_handle(), false) : qa_get_one_user_html(qa_get_logged_in_handle(), false)
); );
if (!QA_FINAL_EXTERNAL_USERS)
$qa_content['navigation']['user']['account']=array(
'url' => qa_path_html('account'),
'label' => qa_lang_html('main/nav_account'),
);
$qa_content['navigation']['user']['updates']=array( $qa_content['navigation']['user']['updates']=array(
'url' => qa_path_html('updates'), 'url' => qa_path_html('updates'),
'label' => qa_lang_html('main/nav_updates'), 'label' => qa_lang_html('main/nav_updates'),
......
...@@ -140,8 +140,12 @@ ...@@ -140,8 +140,12 @@
$maxsize=qa_opt('tag_cloud_font_size'); $maxsize=qa_opt('tag_cloud_font_size');
$scale=qa_opt('tag_cloud_size_popular'); $scale=qa_opt('tag_cloud_size_popular');
$blockwordspreg=qa_get_block_words_preg();
foreach ($populartags as $tag => $count) { foreach ($populartags as $tag => $count) {
if (count(qa_block_words_match_all($tag, $blockwordspreg)))
continue; // skip censored tags
$size=number_format(($scale ? ($maxsize*$count/$maxcount) : $maxsize), 1); $size=number_format(($scale ? ($maxsize*$count/$maxcount) : $maxsize), 1);
if (($size>=5) || !$scale) if (($size>=5) || !$scale)
......
/* /*
Theme Name: Snow Theme Name: Snow
Theme URI: Theme URI:
Theme Version: 1.2 Theme Version: 1.3
Theme Date: 2013-05-01 Theme Date: 2013-11-13
Theme Author: Q2A Market Theme Author: Q2A Market
Theme Author URI: http://www.q2amarket.com/ Theme Author URI: http://www.q2amarket.com/
Theme License: GPLv2 Theme License: GPLv2
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
.qa-footer-bottom-group:after, .qa-footer-bottom-group:after,
.qa-main-wrapper:after, .qa-main-wrapper:after,
.qa-nav-main-list:after, .qa-nav-main-list:after,
.qa-nav-sub-list:after { .qa-nav-sub-list:after,
.qa-nav-cat-item:after {
visibility: hidden; visibility: hidden;
display: block; display: block;
font-size: 0; font-size: 0;
...@@ -33,7 +34,8 @@ ...@@ -33,7 +34,8 @@
.qa-footer-bottom-group, .qa-footer-bottom-group,
.qa-main-wrapper, .qa-main-wrapper,
.qa-nav-main-list, .qa-nav-main-list,
.qa-nav-sub-list { display: inline-table; } .qa-nav-sub-list,
.qa-nav-cat-item { display: inline-table; }
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html .clearfix { height: 1%; } * html .clearfix { height: 1%; }
.clearfix, .clearfix,
...@@ -44,7 +46,8 @@ ...@@ -44,7 +46,8 @@
.qa-footer-bottom-group, .qa-footer-bottom-group,
.qa-main-wrapper, .qa-main-wrapper,
.qa-nav-main-list, .qa-nav-main-list,
.qa-nav-sub-list { display: block; } .qa-nav-sub-list,
.qa-nav-cat-item { display: block; }
/* End hide from IE-mac */ /* End hide from IE-mac */
:-moz-placeholder{ :-moz-placeholder{
...@@ -64,7 +67,7 @@ body { ...@@ -64,7 +67,7 @@ body {
padding:0; padding:0;
} }
body,td,input,textarea { body,td,input,textarea {
font:14px/1.5 Helvetica, Arial, Sens-serif; font:14px/1.5 Helvetica, Arial, sans-serif;
color:#333; color:#333;
} }
a:link, a:visited { a:link, a:visited {
...@@ -339,6 +342,8 @@ input[type="submit"].qa-search-button:hover{ ...@@ -339,6 +342,8 @@ input[type="submit"].qa-search-button:hover{
.qa-logged-in-avatar .qa-avatar-image{ .qa-logged-in-avatar .qa-avatar-image{
max-width: 100%; max-width: 100%;
height: auto; height: auto;
min-width: 24px; /* pull request */
min-height: 24px; /* pull request */
} }
/* end */ /* end */
.qa-logged-in-points{ .qa-logged-in-points{
...@@ -1049,16 +1054,18 @@ margin-left:1em; ...@@ -1049,16 +1054,18 @@ margin-left:1em;
} }
.qa-nav-cat-item { .qa-nav-cat-item {
margin:2px 0; margin:2px 0;
text-align: right;
} }
.qa-nav-cat-item:nth-child(odd){ .qa-nav-cat-item:nth-child(odd){
} }
.qa-nav-cat-item:nth-child(even){ .qa-nav-cat-item:nth-child(even){
} }
.qa-nav-cat-link { .qa-nav-cat-link {
clear: both;
float: left;
} }
.qa-nav-cat-note{ .qa-nav-cat-note{
color:#000; color:#000;
float:right;
} }
.qa-nav-cat-selected,.qa-nav-cat-selected:hover { .qa-nav-cat-selected,.qa-nav-cat-selected:hover {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment