上次编辑整个 wiki 的日期/时间
如何找到整个 wiki 的最后一次编辑的日期/时间?我想将此日期/时间写入文本文件,然后将其作为信息显示在我的维基页面之一 如此处所述使用ExternalData扩展。
谢谢你, russ
后收到错误消息(使用ExternalData 2.3)
注意 2:我在 升级到ExternalData 3.0
注 3:将 {{#get_external_data: 替换为 {{#get_db_data:)后,我得到以下结果(使用 2.3 或 3.0):
< a href="https://i.sstatic.net/Mu6bK.png" rel="nofollow noreferrer">
注 4:LocalSettings.php 中的相关行
$wgScriptPath = "/mediawiki-1.35.1";
$wgServer = WebRequest::detectServer();
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "mywikidbname";
$wgDBuser = "mywikidbuser";
$wgDBpassword = "*********";
# MySQL specific settings
$wgDBprefix = "";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
$wgShellLocale = "C.UTF-8";
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'TitleBlacklist' );
#wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'MathJax' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'Quiz' );
wfLoadExtension( 'TextScroller' );
wfLoadExtension( 'ExternalData' );
$edgCacheExpireTime=10;
$edgFilePath['inject'] = '/home/rwp/shares/share_wiki/rwp_external_data.txt';
$wgExternalDataSources['MW DB'] = [
'type' => 'mysql',
'server' => $wgDBserver,
'user' => $wgDBuser,
'password' => $wgDBpassword,
'name' => $wgDBname,
'prepared' => [
'last revision' => 'SELECT rev_timestamp AS last FROM revision ORDER BY rev_timestamp DESC LIMIT 1;'
]
];
How can I find the date/time of the last edit to my entire wiki? I would like to write this date/time to a text file and then present it as info on one of my wiki pages as described here using the ExternalData extension.
thank you,
russ
Note 1: Error message I'm getting (using ExternalData 2.3) after editing LocalSettings.php
Note 2: The error message I'm getting after upgrading to ExternalData 3.0
Note 3: After replacing {{#get_external_data: with {{#get_db_data: I get this result (using either 2.3 or 3.0):
Note 4: Relevant lines from LocalSettings.php
$wgScriptPath = "/mediawiki-1.35.1";
$wgServer = WebRequest::detectServer();
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "mywikidbname";
$wgDBuser = "mywikidbuser";
$wgDBpassword = "*********";
# MySQL specific settings
$wgDBprefix = "";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
$wgShellLocale = "C.UTF-8";
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'TitleBlacklist' );
#wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'MathJax' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'Quiz' );
wfLoadExtension( 'TextScroller' );
wfLoadExtension( 'ExternalData' );
$edgCacheExpireTime=10;
$edgFilePath['inject'] = '/home/rwp/shares/share_wiki/rwp_external_data.txt';
$wgExternalDataSources['MW DB'] = [
'type' => 'mysql',
'server' => $wgDBserver,
'user' => $wgDBuser,
'password' => $wgDBpassword,
'name' => $wgDBname,
'prepared' => [
'last revision' => 'SELECT rev_timestamp AS last FROM revision ORDER BY rev_timestamp DESC LIMIT 1;'
]
];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 外部数据,您可以将上次修订的时间插入 wiki,而无需文件。添加到
LocalSettings.php
:然后使用
{{#get_external_data: db = MW DB | 获取所需的时间查询 = 最后修订 |数据 = 最后 = 最后}}{{#时间:r | {{#external_value: 最后}} }}
。如果您想使用文件,请使用以下 bash 脚本创建它:
Using External Data, you can insert the time of the last revision to the wiki without a file. Add to
LocalSettings.php
:Then get the required time with
{{#get_external_data: db = MW DB | query = last revision | data = last = last}}{{#time: r | {{#external_value: last}} }}
.If you want to use a file, create it with the following bash script: