Commit 82197ec2 by Scott Committed by GitHub

Merge pull request #462 from pupi1985/patch-74

Some minor changes
parents bdc4f205 668e834f
......@@ -136,7 +136,7 @@
'userlevels' => array(
'userid' => $useridcoltype.' NOT NULL', // the user who has this level
'entitytype' => "CHAR(1) CHARACTER SET ascii NOT NULL", // see qa-app-updates.php
'entitytype' => 'CHAR(1) CHARACTER SET ascii NOT NULL', // see qa-app-updates.php
'entityid' => 'INT UNSIGNED NOT NULL', // relevant postid / userid / tag wordid / categoryid
'level' => 'TINYINT UNSIGNED', // if not NULL, special permission level for that user and that entity
'UNIQUE userid (userid, entitytype, entityid)',
......@@ -179,7 +179,7 @@
'userfavorites' => array(
'userid' => $useridcoltype.' NOT NULL', // the user who favorited the entity
'entitytype' => "CHAR(1) CHARACTER SET ascii NOT NULL", // see qa-app-updates.php
'entitytype' => 'CHAR(1) CHARACTER SET ascii NOT NULL', // see qa-app-updates.php
'entityid' => 'INT UNSIGNED NOT NULL', // favorited postid / userid / tag wordid / categoryid
'nouserevents' => 'TINYINT UNSIGNED NOT NULL', // do we skip writing events to the user stream?
'PRIMARY KEY (userid, entitytype, entityid)',
......@@ -200,7 +200,7 @@
'userevents' => array(
'userid' => $useridcoltype.' NOT NULL', // the user to be informed about this event in their updates
'entitytype' => "CHAR(1) CHARACTER SET ascii NOT NULL", // see qa-app-updates.php
'entitytype' => 'CHAR(1) CHARACTER SET ascii NOT NULL', // see qa-app-updates.php
'entityid' => 'INT UNSIGNED NOT NULL', // favorited source of event - see userfavorites table - 0 means not from a favorite
'questionid' => 'INT UNSIGNED NOT NULL', // the affected question
'lastpostid' => 'INT UNSIGNED NOT NULL', // what part of question was affected
......@@ -212,7 +212,7 @@
),
'sharedevents' => array(
'entitytype' => "CHAR(1) CHARACTER SET ascii NOT NULL", // see qa-app-updates.php
'entitytype' => 'CHAR(1) CHARACTER SET ascii NOT NULL', // see qa-app-updates.php
'entityid' => 'INT UNSIGNED NOT NULL', // see userfavorites table
'questionid' => 'INT UNSIGNED NOT NULL', // see userevents table
'lastpostid' => 'INT UNSIGNED NOT NULL', // see userevents table
......
......@@ -93,7 +93,8 @@
function qa_db_post_set_parent($postid, $parentid, $lastuserid=null, $lastip=null)
/*
Set the parent in the database of $postid to $parentid, and optionally record that $lastuserid did it from $lastip (if at least one is specified)
Set the parent in the database of $postid to $parentid, and optionally record that $lastuserid did it from $lastip
(if at least one is specified)
*/
{
if (isset($lastuserid) || isset($lastip))
......@@ -143,7 +144,8 @@
function qa_db_post_set_category($postid, $categoryid, $lastuserid=null, $lastip=null)
/*
Set the (exact) category in the database of $postid to $categoryid, and optionally record that $lastuserid did it from $lastip (if at least one is specified)
Set the (exact) category in the database of $postid to $categoryid, and optionally record that $lastuserid did it from
$lastip (if at least one is specified)
*/
{
if (isset($lastuserid) || isset($lastip))
......@@ -192,7 +194,7 @@
function qa_db_post_set_updated($postid, $updated)
/*
Set the last updated date of $postid to $updated, which is a unix timestamp. If updated is nul, set to now.
Set the last updated date of $postid to $updated, which is a unix timestamp. If updated is null, set to now.
*/
{
if (isset($updated))
......@@ -318,7 +320,7 @@
function qa_db_posts_filter_q_postids($postids)
/*
Return the array $postids containing only those elements which are the postid of a qustion in the database
Return the array $postids containing only those elements which are the postid of a question in the database
*/
{
if (count($postids))
......
......@@ -105,7 +105,7 @@
function qa_db_user_get_userid_handles($userids)
/*
Return an array mapping mapping each userid in $userids that can be found to that user's handle
Return an array mapping each userid in $userids that can be found to that user's handle
*/
{
if (count($userids))
......
......@@ -886,7 +886,7 @@
}
else { // rudimentary non-Javascript version of mass mailing loop
echo '<tt>';
echo '<code>';
while (true) {
qa_mailing_perform_step();
......@@ -902,7 +902,7 @@
sleep(1);
}
echo qa_lang_html('admin/mailing_complete').'</tt><p><a href="'.qa_path_html('admin/mailing').'">'.qa_lang_html('admin/admin_title').' - '.qa_lang_html('admin/mailing_title').'</a>';
echo qa_lang_html('admin/mailing_complete').'</code><p><a href="'.qa_path_html('admin/mailing').'">'.qa_lang_html('admin/admin_title').' - '.qa_lang_html('admin/mailing_title').'</a>';
qa_exit();
}
......
......@@ -176,11 +176,11 @@
'<small style="color:#666">'.qa_html($plugindirectory).'/</small>';
if (qa_qa_version_below(@$metadata['min_q2a']))
$pluginhtml = '<strike style="color:#999">'.$pluginhtml.'</strike><br><span style="color:#f00">'.
$pluginhtml = '<s style="color:#999">'.$pluginhtml.'</s><br><span style="color:#f00">'.
qa_lang_html_sub('admin/requires_q2a_version', qa_html($metadata['min_q2a'])).'</span>';
elseif (qa_php_version_below(@$metadata['min_php']))
$pluginhtml = '<strike style="color:#999">'.$pluginhtml.'</strike><br><span style="color:#f00">'.
$pluginhtml = '<s style="color:#999">'.$pluginhtml.'</s><br><span style="color:#f00">'.
qa_lang_html_sub('admin/requires_php_version', qa_html($metadata['min_php'])).'</span>';
$qa_content['form_plugin_'.$pluginIndex] = array(
......
......@@ -67,7 +67,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<tt>
<code>
<?php
......@@ -86,7 +86,7 @@
}
?>
</tt>
</code>
<a href="<?php echo qa_path_html('admin/stats')?>"><?php echo qa_lang_html('admin/admin_title').' - '.qa_lang_html('admin/stats_title')?></a>
</body>
......
......@@ -64,9 +64,7 @@
if (@$favoritemap[$navlink['categoryid']])
$navigation[$key]['favorited']=true;
$navigation[$key]['note']='';
$navigation[$key]['note'].=
$navigation[$key]['note'] =
' - <a href="'.qa_path_html('questions/'.implode('/', array_reverse(explode('/', $category['backpath'])))).'">'.( ($category['qcount']==1)
? qa_lang_html_sub('main/1_question', '1', '1')
: qa_lang_html_sub('main/x_questions', number_format($category['qcount']))
......
......@@ -91,7 +91,7 @@
'fields' => array(
'email_handle' => array(
'label' => qa_lang_html('users/email_handle_label'),
'label' => qa_opt('allow_login_email_only') ? qa_lang_html('users/email_label') : qa_lang_html('users/email_handle_label'),
'tags' => 'name="emailhandle" id="emailhandle"',
'value' => qa_html(@$inemailhandle),
'error' => qa_html(@$errors['emailhandle']),
......
......@@ -689,14 +689,18 @@
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
echo 'Question2Answer fatal error:<p><font color="red">'.qa_html($message, true).'</font></p>';
@error_log('PHP Question2Answer fatal error: '.$message);
echo 'Question2Answer fatal error:<p style="color: red">' . qa_html($message, true) . '</p>';
@error_log('PHP Question2Answer fatal error: ' . $message);
echo '<p>Stack trace:<p>';
$backtrace=array_reverse(array_slice(debug_backtrace(), 1));
foreach ($backtrace as $trace)
echo '<font color="#'.((strpos(@$trace['file'], '/qa-plugin/')!==false) ? 'f00' : '999').'">'.
qa_html(@$trace['function'].'() in '.basename(@$trace['file']).':'.@$trace['line']).'</font><br>';
$backtrace = array_reverse(array_slice(debug_backtrace(), 1));
foreach ($backtrace as $trace) {
$color = strpos(@$trace['file'], '/qa-plugin/') !== false ? 'red' : '#999';
echo sprintf(
'<code style="color: %s">%s() in %s:%s</code><br>',
$color, qa_html(@$trace['function']), basename(@$trace['file']), @$trace['line']
);
}
qa_exit('error');
}
......
......@@ -35,10 +35,17 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Question2Answer Language Check</title>
<style>
code {font-size:125%;}
body {
font-family: arial;
font-size: 12px;
}
code {font-size: 125%;}
.severe {color: #b83939;}
.warning {color: #d2930d;}
.includes {color: #999;}
</style>
</head>
<body style="font-family:arial; font-size:12px;">
<body>
<?php
function get_phrase_substitutions($phrase)
......@@ -52,8 +59,8 @@
return $substitutions;
}
echo '<font color="#cc0000"><code>Dark red = important to review.</code></font><br>';
echo '<font color="#cc9999"><code>Light red = probably safe to ignore.</code></font>';
echo '<code class="severe">Red = important to review.</code><br>';
echo '<code class="warning">Orange = probably safe to ignore.</code>';
echo '<h1>Checking US English files in <code>qa-include</code>...</h1>';
......@@ -207,14 +214,14 @@
function output_lang_issue($prefix, $key, $issue, $error=true)
{
echo '<font color="'.($error ? '#cc0000' : '#cc9999').'"><code>';
echo 'qa-lang-<b>'.qa_html($prefix).'</b>.php:';
$colorClass = $error ? 'severe' : 'warning';
if (strlen($key))
echo "'<b>".qa_html($key)."</b>'";
$htmlKey = strlen($key) > 0 ? "'<strong>" . qa_html($key) . "</strong>'" : '';
echo '</code></font> &nbsp; '.qa_html($issue).'<br>';
echo sprintf(
'<code class="%s">qa-lang-<strong>%s</strong>.php:%s</code> &nbsp; %s<br>',
$colorClass, qa_html($prefix), $htmlKey, qa_html($issue)
);
}
......@@ -224,7 +231,7 @@
$oneread=false;
echo '<p style="font-size:80%; color:#999;">Reading: ';
echo '<p class="includes">Reading: ';
}
......
......@@ -108,13 +108,15 @@
global $qa_db_fail_handler;
@error_log('PHP Question2Answer MySQL '.$type.' error '.$errno.': '.$error.(isset($query) ? (' - Query: '.$query) : ''));
@error_log('PHP Question2Answer MySQL ' . $type . ' error ' . $errno . ': ' . $error . (isset($query) ? (' - Query: ' . $query) : ''));
if (function_exists($qa_db_fail_handler))
$qa_db_fail_handler($type, $errno, $error, $query);
else {
echo '<hr><font color="red">Database '.htmlspecialchars($type.' error '.$errno).'<p>'.nl2br(htmlspecialchars($error."\n\n".$query));
echo sprintf(
'<hr><div style="color: red">Database %s<p>%s</p><code>%s</code></div>',
htmlspecialchars($type . ' error ' . $errno), nl2br(htmlspecialchars($error)), nl2br(htmlspecialchars($query))
);
qa_exit('error');
}
}
......
......@@ -46,6 +46,8 @@ class qa_event_logger
') ENGINE=MyISAM DEFAULT CHARSET=utf8';
}
}
return array();
}
......
......@@ -234,7 +234,7 @@ class qa_wysiwyg_editor
}
else {
// convert to text
$viewer = qa_load_module('viewer', '');
qa_load_module('viewer', '');
return array(
'format' => '',
......
......@@ -31,7 +31,6 @@ class qa_xml_sitemap
case 'xml_sitemap_show_category_qs':
case 'xml_sitemap_show_categories':
return true;
break;
}
}
......
......@@ -25,7 +25,7 @@ p {margin-top:0;}
/* Ajax loading spinner */
.qa-waiting {background:url(spinner-icon-14x14.gif) no-repeat center; width:14px; height:14px; display:inline-block; font-size:0; margin:0px 8px 0px 4px; vertical-align:middle;}
.qa-waiting {background:url(spinner-icon-14x14.gif) no-repeat center; width:14px; height:14px; display:inline-block; font-size:0; margin:0 8px 0 4px; vertical-align:middle;}
.qa-favoriting .qa-waiting {position:absolute; padding:18px 0;}
.qa-a-selection .qa-waiting {position:absolute; padding:18px 0; margin-left:-32px;}
......@@ -49,9 +49,9 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
.qa-favorite-button,.qa-unfavorite-button {background:url(favorite-heart.png) no-repeat; border:0; height:49px; width:50px;}
.qa-favorite-button {background-position: 0 -49px;}
.qa-favorite-button:hover {background-position: 0 0px;}
.qa-favorite-button:hover {background-position: 0 0;}
.qa-unfavorite-button {background-position: 0 -98px;}
.qa-unfavorite-button:hover {background-position: 0 0px;}
.qa-unfavorite-button:hover {background-position: 0 0;}
.qa-error {background:#fed8d8 url(error-bg.png) repeat-x left top; border:2px solid #c00; color:#c00; font-size:18px; padding:.5em; margin:1em 0; }
.qa-error a {color:#900; text-decoration:underline;}
......@@ -79,7 +79,7 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
.qa-widget-full-high {margin-bottom:0;}
.qa-widgets-main-high {margin-bottom:24px;}
.qa-widget-main {margin:16px 0; width:748px;}
.qa-widget-main-bottom {margin-bottom:0px;}
.qa-widget-main-bottom {margin-bottom:0;}
.qa-widget-side {margin:24px 0; width:160px;}
/* Header sections */
......@@ -256,9 +256,9 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
.qa-voted-down-button {background-position:-27px -87px; color:#f1c96b;}
.qa-voted-down-button:hover {background-position:-27px -29px; color:#f1c96b;}
.qa-vote-one-button {position:absolute; left:32px; top:0px;}
.qa-vote-first-button {position:absolute; left:10px; top:0px;}
.qa-vote-second-button {position:absolute; left:53px; top:0px;}
.qa-vote-one-button {position:absolute; left:32px; top:0;}
.qa-vote-first-button {position:absolute; left:10px; top:0;}
.qa-vote-second-button {position:absolute; left:53px; top:0;}
.qa-netvote-count {text-align:center; display:block;}
.qa-netvote-count-data {font-size:28px; font-weight:bold;}
......@@ -396,7 +396,7 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
.qa-c-item-who-title {font-size:80%; font-weight:bold; color:#6b0000;}
.qa-c-item-who-points {display:none;}
.qa-c-item-flags {color:#f00; font-weight:bold; padding-left:3px;}
.qa-c-item-buttons {display:block; position:absolute; bottom:0px; right:0px;}
.qa-c-item-buttons {display:block; position:absolute; bottom:0; right:0;}
.qa-c-item-buttons .qa-form-light-button {background:none; height:auto; font-size:10px; padding:0;}
......@@ -438,7 +438,7 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
.qa-tag-link:hover {text-decoration:underline !important;}
.qa-avatar-image {border:0; vertical-align:middle;}
.qa-avatar-link,.qa-avatar-link:hover {text-decoration:none;}
.qa-favorite-image {background:url(favorite-heart.png) no-repeat; background-position: 0 0px; border:0; height:49px; width:50px; vertical-align:middle; display:inline-block;}
.qa-favorite-image {background:url(favorite-heart.png) no-repeat; background-position: 0 0; border:0; height:49px; width:50px; vertical-align:middle; display:inline-block;}
.qa-q-favorited .qa-q-item-title a, .qa-tag-favorited, .qa-cat-favorited, .qa-user-favorited, .qa-nav-cat-favorited, .qa-browse-cat-favorited {background-image:url(favorite-icon-16x16.png); background-repeat: no-repeat;}
.qa-cat-parent-favorited {background-image:url(favorite-light-icon-16x16.png); background-repeat: no-repeat;}
......@@ -478,4 +478,4 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
* html .qa-voted-down-button {background:url(vote-buttons-ie6.png) no-repeat -27px -87px;}
* html .qa-tag-link {background:url(tag-icon-ie6.png) no-repeat left center;}
* html .qa-a-count {background:url(a-count-icon-ie6.png) no-repeat 32px 13px;}
* html .qa-favorite-image {background:url(favorite-heart-ie6.png) no-repeat 0 0px;}
* html .qa-favorite-image {background:url(favorite-heart-ie6.png) no-repeat 0 0;}
......@@ -24,7 +24,7 @@ p {margin-top:0;}
/* Ajax loading spinner */
.qa-waiting {background:url(spinner-icon-14x14.gif) no-repeat center; width:14px; height:14px; display:inline-block; font-size:0; margin:0px 8px 0px 4px; vertical-align:middle;}
.qa-waiting {background:url(spinner-icon-14x14.gif) no-repeat center; width:14px; height:14px; display:inline-block; font-size:0; margin:0 8px 0 4px; vertical-align:middle;}
.qa-favoriting .qa-waiting {position:absolute; padding:6px 4px;}
.qa-a-selection .qa-waiting {position:absolute; padding:7px 0;}
......@@ -49,9 +49,9 @@ h2 {font-size:16px; padding-top:12px; clear:both;}
.qa-favorite-button,.qa-unfavorite-button {background:url(favorite-plus.gif) no-repeat; border:0; height:26px; width:26px;}
.qa-favorite-button {background-position: 0 -26px;}
.qa-favorite-button:hover {background-position: 0 0px;}
.qa-favorite-button:hover {background-position: 0 0;}
.qa-unfavorite-button {background-position: 0 -52px;}
.qa-unfavorite-button:hover {background-position: 0 0px;}
.qa-unfavorite-button:hover {background-position: 0 0;}
.qa-error {background:#fee; border:1px solid #c00; color:#c00; font-size:16px; padding:.5em; margin-bottom:1em; font-weight:bold;}
.qa-error a {color:#900; text-decoration:underline;}
......@@ -148,7 +148,7 @@ h2 {font-size:16px; padding-top:12px; clear:both;}
.qa-form-tall-spacer {background:#E3F4FF; line-height:1px; padding:0; font-size:1px;}
.qa-form-tall-ok {background:#efe; border:1px solid #090; color:#090; font-size:18px; padding:6px; text-align:center;}
.qa-form-tall-label {color:#253845; padding:12px 8px 2px 8px; font-size:13px; font-weight:bold;}
.qa-form-tall-data {padding:0px 8px 6px 8px; width:480px;}
.qa-form-tall-data {padding:0 8px 6px 8px; width:480px;}
.qa-form-tall-text,.qa-form-tall-number {padding:3px;}
.qa-form-tall-text {width:480px; border:1px solid #658296;}
.qa-form-tall-number {width:48px; border:1px solid #658296;}
......@@ -374,7 +374,7 @@ h2 {font-size:16px; padding-top:12px; clear:both;}
.qa-c-item-who-title {font-size:80%; font-weight:bold; color:#900707;}
.qa-c-item-who-points {display:none;}
.qa-c-item-flags {background:#f00; color:#fff; font-weight:bold; padding:2px 5px; display:inline-block;}
.qa-c-item-buttons {display:block; position:absolute; bottom:0px; right:0px;}
.qa-c-item-buttons {display:block; position:absolute; bottom:0; right:0;}
/* Message list */
......
......@@ -2375,7 +2375,7 @@ a.qa-browse-cat-link:visited {
height: 14px;
display: inline-block;
font-size: 0;
margin: 0px 8px 0px 4px;
margin: 0 8px 0 4px;
vertical-align: middle;
}
......
......@@ -2448,7 +2448,7 @@ input[type="submit"], button {
background: #fff;
margin-bottom: 5px;
}
.qa-part-a-form:empty
.qa-part-a-form:empty,
.qa-part-a-form h2 {
margin-top: 0;
}
......@@ -2762,7 +2762,7 @@ input[type="submit"], button {
@media (min-width: 980px) {
.qa-sidepanel {
width: 25%;
padding: 0px;
padding: 0;
float: right;
*zoom: 1;
}
......@@ -2826,7 +2826,7 @@ input[type="submit"], button {
word-wrap: break-word;
}
.qa-sidepanel h1, .qa-sidepanel h2, .qa-sidepanel h3, .qa-sidepanel h4, .qa-sidepanel h5, .qa-sidepanel h6 {
margin-top: 0px;
margin-top: 0;
}
.qa-sidepanel .qa-widget-side {
padding: 20px;
......
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