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
391068b6
Commit
391068b6
authored
Mar 19, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Option to prevent caching new questions
parent
fbb97ca1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
+13
-11
format.php
qa-include/app/format.php
+1
-1
options.php
qa-include/app/options.php
+2
-1
qa-lang-options.php
qa-include/lang/qa-lang-options.php
+1
-0
admin-default.php
qa-include/pages/admin/admin-default.php
+5
-8
question.php
qa-include/pages/question.php
+4
-1
No files found.
qa-include/app/format.php
View file @
391068b6
...
...
@@ -732,7 +732,7 @@
* Generate array of split HTML (prefix, data, suffix) to represent a timestamp, optionally with the full date.
*
* @param int $timestamp Unix timestamp.
* @param
bool
$fulldatedays Number of days after which to show the full date.
* @param
int
$fulldatedays Number of days after which to show the full date.
* @return array The HTML.
*/
function
qa_when_to_html
(
$timestamp
,
$fulldatedays
)
...
...
qa-include/app/options.php
View file @
391068b6
...
...
@@ -215,7 +215,8 @@
'avatar_users_size'
=>
30
,
'caching_catwidget_time'
=>
30
,
'caching_enabled'
=>
0
,
'caching_q_time'
=>
5
,
'caching_q_start'
=>
7
,
'caching_q_time'
=>
30
,
'caching_qlist_time'
=>
5
,
'captcha_on_anon_post'
=>
1
,
'captcha_on_feedback'
=>
1
,
...
...
qa-include/lang/qa-lang-options.php
View file @
391068b6
...
...
@@ -47,6 +47,7 @@
'block_ips_write'
=>
'Blocked IP addresses - separate by spaces or commas:'
,
'caching_catwidget_time'
=>
'Cache category widget for:'
,
'caching_enabled'
=>
'Enable caching:'
,
'caching_q_start'
=>
'Start caching questions after:'
,
'caching_q_time'
=>
'Cache question pages for:'
,
'caching_qlist_time'
=>
'Cache question lists for:'
,
'captcha_module'
=>
'Use captcha module:'
,
...
...
qa-include/pages/admin/admin-default.php
View file @
391068b6
...
...
@@ -74,6 +74,7 @@
'avatar_store_size'
=>
'number'
,
'avatar_users_size'
=>
'number'
,
'caching_catwidget_time'
=>
'number'
,
'caching_q_start'
=>
'number'
,
'caching_q_time'
=>
'number'
,
'caching_qlist_time'
=>
'number'
,
'columns_tags'
=>
'number'
,
...
...
@@ -646,13 +647,7 @@
$subtitle
=
'admin/caching_title'
;
$formstyle
=
'wide'
;
$showoptions
=
array
(
'caching_enabled'
,
'caching_q_time'
,
'caching_qlist_time'
,
'caching_catwidget_time'
);
$checkboxtodisplay
=
array
(
'caching_q_time'
=>
'option_caching_enabled'
,
'caching_qlist_time'
=>
'option_caching_enabled'
,
'caching_catwidget_time'
=>
'option_caching_enabled'
,
);
$showoptions
=
array
(
'caching_enabled'
,
'caching_q_start'
,
'caching_q_time'
,
'caching_qlist_time'
,
'caching_catwidget_time'
);
break
;
...
...
@@ -1556,6 +1551,9 @@
case
'caching_catwidget_time'
:
$optionfield
[
'note'
]
=
qa_lang_html_sub
(
'main/x_minutes'
,
''
);
break
;
case
'caching_q_start'
:
$optionfield
[
'note'
]
=
qa_lang_html_sub
(
'main/x_days'
,
''
);
break
;
}
if
(
isset
(
$feedrequest
)
&&
$value
)
...
...
@@ -1786,7 +1784,6 @@
case
'caching'
:
$cacheManager
=
Q2A_Storage_CacheManager
::
getInstance
();
$qa_content
[
'error'
]
=
$cacheManager
->
getError
();
break
;
}
...
...
qa-include/pages/question.php
View file @
391068b6
...
...
@@ -153,11 +153,14 @@
}
// Save question data to cache
// Save question data to cache
(if older than configured limit)
if
(
$saveCache
)
{
$questionAge
=
qa_opt
(
'db_time'
)
-
$question
[
'created'
];
if
(
$questionAge
>
86400
*
qa_opt
(
'caching_q_start'
))
{
$cacheHandler
->
set
(
$cacheKey
,
$questionData
,
qa_opt
(
'caching_q_time'
));
}
}
// Determine if captchas will be required
...
...
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