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
39b13f70
Commit
39b13f70
authored
Feb 17, 2014
by
Scott Vivian
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch-12' of
https://github.com/pupi1985/question2answer
into pupi1985-patch-12
parents
0fbbd7bd
45a66c64
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
36 deletions
+58
-36
qa-app-options.php
qa-include/qa-app-options.php
+3
-6
qa-base.php
qa-include/qa-base.php
+43
-7
qa-page-question-post.php
qa-include/qa-page-question-post.php
+2
-2
qa-theme-base.php
qa-include/qa-theme-base.php
+9
-9
qa-basic-adsense.php
qa-plugin/basic-adsense/qa-basic-adsense.php
+1
-12
No files found.
qa-include/qa-app-options.php
View file @
39b13f70
...
...
@@ -487,14 +487,11 @@
break
;
default
:
// call option_default method in any registered modules
$moduletypes
=
qa_list_module_types
();
foreach
(
$moduletypes
as
$moduletype
)
{
$modules
=
qa_load_modules_with
(
$moduletype
,
'option_default'
);
$modules
=
qa_load_all_modules_with
(
'option_default'
);
// Loads all modules with the 'option_default' method
foreach
(
$modules
as
$module
)
{
$value
=
$module
->
option_default
(
$name
);
if
(
strlen
(
$value
))
$value
=
$module
->
option_default
(
$name
);
if
(
strlen
(
$value
))
{
return
$value
;
}
}
...
...
qa-include/qa-base.php
View file @
39b13f70
...
...
@@ -612,14 +612,30 @@
// Functions for listing, loading and getting info on modules
function
qa_list_all_registered_modules_info
()
/*
Return an array with all registered modules' information
*/
{
global
$qa_modules
;
return
$qa_modules
;
}
function
qa_list_module_types
()
/*
Return an array of all the module types for which at least one module has been registered
*/
{
global
$qa_modules
;
return
array_keys
(
qa_list_all_registered_modules_info
());
}
return
array_keys
(
$qa_modules
);
function
qa_list_module_types
()
/*
Return an array of all the module types for which at least one module has been registered
*/
{
return
array_keys
(
qa_list_all_registered_modules_info
());
}
...
...
@@ -628,9 +644,8 @@
Return a list of names of registered modules of $type
*/
{
global
$qa_modules
;
return
is_array
(
@
$qa_modules
[
$type
])
?
array_keys
(
$qa_modules
[
$type
])
:
array
();
$modules
=
qa_list_all_registered_modules_info
();
return
is_array
(
@
$modules
[
$type
])
?
array_keys
(
$modules
[
$type
])
:
array
();
}
...
...
@@ -639,8 +654,8 @@
Return an array containing information about the module of $type named $name
*/
{
global
$qa_modules
;
return
@
$
qa_
modules
[
$type
][
$name
];
$modules
=
qa_list_all_registered_modules_info
()
;
return
@
$modules
[
$type
][
$name
];
}
...
...
@@ -674,6 +689,27 @@
return
null
;
}
function
qa_load_all_modules_with
(
$method
)
/*
Return an array of instantiated clases for modules which have defined $method
(all modules are loaded but not included in the returned array)
*/
{
$modules
=
array
();
$registeredmodules
=
qa_list_all_registered_modules_info
();
foreach
(
$registeredmodules
as
$moduletype
=>
$modulesinfo
)
{
foreach
(
$modulesinfo
as
$modulename
=>
$moduleinfo
)
{
$module
=
qa_load_module
(
$moduletype
,
$modulename
);
if
(
method_exists
(
$module
,
$method
))
$modules
[
$moduletype
]
=
$module
;
}
}
return
$modules
;
}
function
qa_load_modules_with
(
$type
,
$method
)
/*
...
...
qa-include/qa-page-question-post.php
View file @
39b13f70
...
...
@@ -852,8 +852,8 @@
// The 'approve', 'login', 'confirm', 'userblock', 'ipblock' permission errors are reported to the user here
// The other option ('level') prevents the comment button being shown, in qa_page_q_post_rules(...)
$
answer
=
(
$question
[
'postid'
]
==
$parent
[
'postid'
])
?
null
:
$parent
;
$
parentid
=
$parent
[
'postid'
]
;
$
parentid
=
$parent
[
'postid'
]
;
$
answer
=
(
$question
[
'postid'
]
==
$parentid
)
?
null
:
$parent
;
switch
(
qa_user_post_permit_error
(
'permit_post_c'
,
$parent
,
QA_LIMIT_COMMENTS
))
{
case
'login'
:
...
...
qa-include/qa-theme-base.php
View file @
39b13f70
...
...
@@ -201,16 +201,17 @@
function
html
()
{
$attribution
=
'<!-- Powered by Question2Answer - http://www.question2answer.org/ -->'
;
$this
->
output
(
'<html>'
,
'<!-- Powered by Question2Answer - http://www.question2answer.org/ -->'
$attribution
);
$this
->
head
();
$this
->
body
();
$this
->
output
(
'<!-- Powered by Question2Answer - http://www.question2answer.org/ -->'
,
$attribution
,
'</html>'
);
}
...
...
@@ -260,10 +261,8 @@
if
(
isset
(
$this
->
content
[
'page_links'
][
'items'
]))
// convert page links to rel=prev and rel=next tags
foreach
(
$this
->
content
[
'page_links'
][
'items'
]
as
$page_link
)
if
(
$page_link
[
'type'
]
==
'prev'
)
$this
->
output
(
'<link rel="prev" href="'
.
$page_link
[
'url'
]
.
'"/>'
);
elseif
(
$page_link
[
'type'
]
==
'next'
)
$this
->
output
(
'<link rel="next" href="'
.
$page_link
[
'url'
]
.
'"/>'
);
if
(
in_array
(
$page_link
[
'type'
],
array
(
'prev'
,
'next'
)))
$this
->
output
(
'<link rel="'
.
$page_link
[
'type'
]
.
'" href="'
.
$page_link
[
'url'
]
.
'" />'
);
}
function
head_script
()
...
...
@@ -312,11 +311,11 @@
$this
->
body_tags
();
$this
->
output
(
'>'
);
$this
->
body_script
();
$this
->
body_header
();
$this
->
body_content
();
$this
->
body_footer
();
$this
->
body_hidden
();
$this
->
body_script
();
$this
->
output
(
'</body>'
);
}
...
...
@@ -934,9 +933,10 @@
$tworows
=
(
$columns
==
1
)
&&
(
!
empty
(
$field
[
'label'
]))
&&
(
!
$skipdata
)
&&
(
(
!
(
$prefixed
||
$suffixed
))
||
(
!
empty
(
$field
[
'error'
]))
||
(
!
empty
(
$field
[
'note'
]))
);
if
((
$columns
==
1
)
&&
isset
(
$field
[
'id'
]))
if
(
isset
(
$field
[
'id'
]))
if
(
$columns
==
1
)
$this
->
output
(
'<tbody id="'
.
$field
[
'id'
]
.
'">'
,
'<tr>'
);
elseif
(
isset
(
$field
[
'id'
]))
else
$this
->
output
(
'<tr id="'
.
$field
[
'id'
]
.
'">'
);
else
$this
->
output
(
'<tr>'
);
...
...
qa-plugin/basic-adsense/qa-basic-adsense.php
View file @
39b13f70
...
...
@@ -34,18 +34,7 @@
function
allow_region
(
$region
)
{
$allow
=
false
;
switch
(
$region
)
{
case
'main'
:
case
'side'
:
case
'full'
:
$allow
=
true
;
break
;
}
return
$allow
;
return
in_array
(
$region
,
array
(
'main'
,
'side'
,
'full'
));
}
...
...
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