Hi
I'm using the CreateBox extenstion: http://www.mediawiki.org/wiki/Extension:CreateBox
I want the title of each new page created via this extension to consist of 'User/xxxx', where the user substitutes 'User' for their own username, and 'xxxx' is anything unique. I've tried using the following code for the default field text:
User/{{CURRENTTIMESTAMP}}
http://www.chainsofreason.org/wiki/Create_a_new_chain
I used this variable to save the user having to add something unique, given that the timestamp includes seconds and therefore should never be the same on each use. However, the timestamp does not actually change after the user returns to the same page to create another new page - presumably something to do with caching.
Can anyone think of any other way of automatically something after 'Username/' that will always be unique - it doesn't matter what it is.
Thanks in advance for any help.
Derrick
See the Extensions FAQ: http://www.mediawiki.org/wiki/Extensions_FAQ
"How do I disable caching for pages using my extension?"
HTH,
Boris
On 22-May-08, at 8:11 AM, Derrick Farnell wrote:
Hi
I'm using the CreateBox extenstion: http://www.mediawiki.org/wiki/Extension:CreateBox
I want the title of each new page created via this extension to consist of 'User/xxxx', where the user substitutes 'User' for their own username, and 'xxxx' is anything unique. I've tried using the following code for the default field text:
User/{{CURRENTTIMESTAMP}}
http://www.chainsofreason.org/wiki/Create_a_new_chain
I used this variable to save the user having to add something unique, given that the timestamp includes seconds and therefore should never be the same on each use. However, the timestamp does not actually change after the user returns to the same page to create another new page - presumably something to do with caching.
Can anyone think of any other way of automatically something after 'Username/' that will always be unique - it doesn't matter what it is.
Thanks in advance for any help.
Derrick _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks very much - I'll give that a go. However, I'm not very literate with coding: It says to just insert the following code in the extension:
$parser->disableCache();
I assume that I should just add it to the end of the main extension php file? Also, could there be any downsides to disabling caching for an extension?
Also, I tried to use the {{NUMBEROFEDITS}} and {{NUMBEROFPAGES}} variables instead, and neither of them changed even after a new page was created and I returned to create a new page. Shouldn't these values have at least changed after the creation of new page, caching or not?
Derrick
On Thu, May 22, 2008 at 2:41 PM, Boris Steipe boris.steipe@utoronto.ca wrote:
See the Extensions FAQ: http://www.mediawiki.org/wiki/Extensions_FAQ
"How do I disable caching for pages using my extension?"
HTH,
Boris
On 22-May-08, at 8:11 AM, Derrick Farnell wrote:
Hi
I'm using the CreateBox extenstion: http://www.mediawiki.org/wiki/Extension:CreateBox
I want the title of each new page created via this extension to consist of 'User/xxxx', where the user substitutes 'User' for their own username, and 'xxxx' is anything unique. I've tried using the following code for the default field text:
User/{{CURRENTTIMESTAMP}}
http://www.chainsofreason.org/wiki/Create_a_new_chain
I used this variable to save the user having to add something unique, given that the timestamp includes seconds and therefore should never be the same on each use. However, the timestamp does not actually change after the user returns to the same page to create another new page - presumably something to do with caching.
Can anyone think of any other way of automatically something after 'Username/' that will always be unique - it doesn't matter what it is.
Thanks in advance for any help.
Derrick _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Adding the code at the end of the extension code cause the site to crash.
On Thu, May 22, 2008 at 3:20 PM, Derrick Farnell derrick.farnell@gmail.com wrote:
Thanks very much - I'll give that a go. However, I'm not very literate with coding: It says to just insert the following code in the extension:
$parser->disableCache();
I assume that I should just add it to the end of the main extension php file? Also, could there be any downsides to disabling caching for an extension?
Also, I tried to use the {{NUMBEROFEDITS}} and {{NUMBEROFPAGES}} variables instead, and neither of them changed even after a new page was created and I returned to create a new page. Shouldn't these values have at least changed after the creation of new page, caching or not?
Derrick
On Thu, May 22, 2008 at 2:41 PM, Boris Steipe boris.steipe@utoronto.ca wrote:
See the Extensions FAQ: http://www.mediawiki.org/wiki/Extensions_FAQ
"How do I disable caching for pages using my extension?"
HTH,
Boris
On 22-May-08, at 8:11 AM, Derrick Farnell wrote:
Hi
I'm using the CreateBox extenstion: http://www.mediawiki.org/wiki/Extension:CreateBox
I want the title of each new page created via this extension to consist of 'User/xxxx', where the user substitutes 'User' for their own username, and 'xxxx' is anything unique. I've tried using the following code for the default field text:
User/{{CURRENTTIMESTAMP}}
http://www.chainsofreason.org/wiki/Create_a_new_chain
I used this variable to save the user having to add something unique, given that the timestamp includes seconds and therefore should never be the same on each use. However, the timestamp does not actually change after the user returns to the same page to create another new page - presumably something to do with caching.
Can anyone think of any other way of automatically something after 'Username/' that will always be unique - it doesn't matter what it is.
Thanks in advance for any help.
Derrick _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Look in the code for this line: function actionCreate($action, $article) {
Below change this line: global $wgRequest; into this: global $wgRequest, $parser;
Now add just below that global line this here: $parser->disableCache();
I have not tested this but by general programming logic that should do the trick.
On Thu, May 22, 2008 at 10:01 AM, Derrick Farnell derrick.farnell@gmail.com wrote:
Adding the code at the end of the extension code cause the site to crash.
On Thu, May 22, 2008 at 3:20 PM, Derrick Farnell derrick.farnell@gmail.com wrote:
Thanks very much - I'll give that a go. However, I'm not very literate with coding: It says to just insert the following code in the extension:
$parser->disableCache();
I assume that I should just add it to the end of the main extension php file? Also, could there be any downsides to disabling caching for an extension?
Also, I tried to use the {{NUMBEROFEDITS}} and {{NUMBEROFPAGES}} variables instead, and neither of them changed even after a new page was created and I returned to create a new page. Shouldn't these values have at least changed after the creation of new page, caching or not?
Derrick
On Thu, May 22, 2008 at 2:41 PM, Boris Steipe boris.steipe@utoronto.ca wrote:
See the Extensions FAQ: http://www.mediawiki.org/wiki/Extensions_FAQ
"How do I disable caching for pages using my extension?"
HTH,
Boris
On 22-May-08, at 8:11 AM, Derrick Farnell wrote:
Hi
I'm using the CreateBox extenstion: http://www.mediawiki.org/wiki/Extension:CreateBox
I want the title of each new page created via this extension to consist of 'User/xxxx', where the user substitutes 'User' for their own username, and 'xxxx' is anything unique. I've tried using the following code for the default field text:
User/{{CURRENTTIMESTAMP}}
http://www.chainsofreason.org/wiki/Create_a_new_chain
I used this variable to save the user having to add something unique, given that the timestamp includes seconds and therefore should never be the same on each use. However, the timestamp does not actually change after the user returns to the same page to create another new page - presumably something to do with caching.
Can anyone think of any other way of automatically something after 'Username/' that will always be unique - it doesn't matter what it is.
Thanks in advance for any help.
Derrick _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks very much Chris. I tried that, but it didn't work. The value produce by the {{CURRENTTIMESTAMP}} variable didn't change upon returning to the page, or even doing a hard refresh. I've double-checked that I followed your instructions correctly.
On Thu, May 22, 2008 at 5:12 PM, Chris Riesen chris.riesen@gmail.com wrote:
Look in the code for this line: function actionCreate($action, $article) {
Below change this line: global $wgRequest; into this: global $wgRequest, $parser;
Now add just below that global line this here: $parser->disableCache();
I have not tested this but by general programming logic that should do the trick.
On Thu, May 22, 2008 at 10:01 AM, Derrick Farnell derrick.farnell@gmail.com wrote:
Adding the code at the end of the extension code cause the site to crash.
On Thu, May 22, 2008 at 3:20 PM, Derrick Farnell <
derrick.farnell@gmail.com>
wrote:
Thanks very much - I'll give that a go. However, I'm not very literate
with
coding: It says to just insert the following code in the extension:
$parser->disableCache();
I assume that I should just add it to the end of the main extension php file? Also, could there be any downsides to disabling caching for an extension?
Also, I tried to use the {{NUMBEROFEDITS}} and {{NUMBEROFPAGES}}
variables
instead, and neither of them changed even after a new page was created
and I
returned to create a new page. Shouldn't these values have at least
changed
after the creation of new page, caching or not?
Derrick
On Thu, May 22, 2008 at 2:41 PM, Boris Steipe <
boris.steipe@utoronto.ca>
wrote:
See the Extensions FAQ: http://www.mediawiki.org/wiki/Extensions_FAQ
"How do I disable caching for pages using my extension?"
HTH,
Boris
On 22-May-08, at 8:11 AM, Derrick Farnell wrote:
Hi
I'm using the CreateBox extenstion: http://www.mediawiki.org/wiki/Extension:CreateBox
I want the title of each new page created via this extension to consist of 'User/xxxx', where the user substitutes 'User' for their own username, and 'xxxx' is anything unique. I've tried using the following code for
the
default field text:
User/{{CURRENTTIMESTAMP}}
http://www.chainsofreason.org/wiki/Create_a_new_chain
I used this variable to save the user having to add something unique, given that the timestamp includes seconds and therefore should never be the same on each use. However, the timestamp does not actually change after the user returns to the same page to create another new page - presumably something to do with caching.
Can anyone think of any other way of automatically something after 'Username/' that will always be unique - it doesn't matter what it
is.
Thanks in advance for any help.
Derrick _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org