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
2c3bf9be
Commit
2c3bf9be
authored
Mar 07, 2017
by
Scott
Committed by
GitHub
Mar 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #496 from pupi1985/patch-88
Use onchange instead of onclick; add default permit in userfields
parents
2030c41b
cf377db5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
format.php
qa-include/app/format.php
+1
-1
install.php
qa-include/db/install.php
+33
-9
No files found.
qa-include/app/format.php
View file @
2c3bf9be
...
...
@@ -1638,7 +1638,7 @@ function qa_set_display_rules(&$qa_content, $effects)
// set default state of options
$loadscript
=
array
(
"for (var i = 0; i <
{
$optVar
}
.length; i++) {"
,
"
\t
$('#'+
{
$optVar
}
[i]).c
lick
(function() { "
.
$function
.
"(false); });"
,
"
\t
$('#'+
{
$optVar
}
[i]).c
hange
(function() { "
.
$function
.
"(false); });"
,
"}"
,
"
{
$function
}
(true);"
,
);
...
...
qa-include/db/install.php
View file @
2c3bf9be
...
...
@@ -716,18 +716,42 @@ function qa_db_create_table_sql($rawname, $definition)
*/
function
qa_db_default_userfields_sql
()
{
$oldprofileflags
=
array
(
'name'
=>
0
,
'location'
=>
0
,
'website'
=>
QA_FIELD_FLAGS_LINK_URL
,
'about'
=>
QA_FIELD_FLAGS_MULTI_LINE
,
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
$profileFields
=
array
(
array
(
'title'
=>
'name'
,
'position'
=>
0
,
'flags'
=>
0
,
'permit'
=>
QA_PERMIT_ALL
,
),
array
(
'title'
=>
'location'
,
'position'
=>
1
,
'flags'
=>
0
,
'permit'
=>
QA_PERMIT_ALL
,
),
array
(
'title'
=>
'website'
,
'position'
=>
2
,
'flags'
=>
QA_FIELD_FLAGS_LINK_URL
,
'permit'
=>
QA_PERMIT_ALL
,
),
array
(
'title'
=>
'about'
,
'position'
=>
3
,
'flags'
=>
QA_FIELD_FLAGS_MULTI_LINE
,
'permit'
=>
QA_PERMIT_ALL
,
),
);
$sql
=
'INSERT INTO ^userfields (title, position, flags) VALUES '
;
// content column will be NULL, meaning use default from lang files
$sql
=
'INSERT INTO ^userfields (title, position, flags, permit) VALUES'
;
// content column will be NULL, meaning use default from lang files
foreach
(
$profileFields
as
$field
)
{
$sql
.=
sprintf
(
'("%s", %d, %d, %d), '
,
qa_db_escape_string
(
$field
[
'title'
]),
$field
[
'position'
],
$field
[
'flags'
],
$field
[
'permit'
]);
}
$index
=
0
;
foreach
(
$oldprofileflags
as
$title
=>
$flags
)
$sql
.=
(
$index
?
', '
:
''
)
.
"('"
.
qa_db_escape_string
(
$title
)
.
"', "
.
(
++
$index
)
.
", "
.
(
int
)
@
$oldprofileflags
[
$title
]
.
")"
;
$sql
=
substr
(
$sql
,
0
,
-
2
);
return
$sql
;
}
...
...
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