Extension talk:Dynamic Article List
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).
- Warning:: These pages can be modified by others. Use with caution!
[edit] Use all namespaces
Is it possible for the extension to use all available namespaces? For instance the namespaces File: and Template: aren't detected. Thanks
[edit] PDF problem
Yes I agree, sharing source code in PDF form is utterly retarded.
I couldn't get the extension to work - I get this message:
Parse error: parse error, unexpected T_CLASS in /home/mart1633/public_html/wiki/includes/CategoryTravelerBase.php on line 9
Steadymarvin 22:19, 11 January 2006 (UTC)
The method of cutting and pasting from pdfs seems unnecessarily complex - why not provide a zip of the files?
[edit] I have the same situation...
Parse error: parse error, unexpected T_CLASS in /home/dental/public_html/wiki/includes/CategoryTravelerBase.php on line 9
[edit] same problem
Parse error: parse error, unexpected T_CLASS in /home/worldnom/public_html/wiki/includes/CategoryTravelerBase.php on line 9
[edit] Ditto
Except my parse error is on line 2. A quick glance around and it looks like this may be a database error. Does this use the database? Do we need SQL code? Or does the PHP need to be configured somehow? --Laveaux 02:55, 5 February 2006 (UTC)
...Actually, something different is happening. I assume this requires Dynamic Page List to work. I get the parse error with that active, but when I "//" the "include("extensions/DynamicPageList.php");" line in LocalSettings, the parse error goes away, however the Dynamic Article List code does not work.
[edit] I have T_CLASS error too. Do you have php5?
This requires php5, i am using php 4.3.10-16.
I'll get php5 and hope it fixes it. Jcobbers
This fixes it: you NEED php5 http://www.debian-administration.org/articles/258 explains how for debian, googling around will explain for others. the basic process (for debian) is update the list of sources to include php5 and other required stuff.
"Found an article saying basically add the repositories to /etc/apt/sources.list and; apt-get update # Of course apt-get install libapache2-mod-php5 php5 php5-mysql" (from the link above).
Your mileage may differ, make sure you get the right php5-mysql version (check what version of mysql you have, <=4.0 or >= 4.1)
[edit] Only a white page
If i install this expension they way told here, then i only get a white Page with only HTML Headers and nothing else. I got PHP5, error_log from Server shows nothing. Im Using Mediawiki 1.5.6
And i don't got any Idea from what this error is coming.
Is there any alternative to Dynamic Article List ? Maybee something using PHP4
I have the same problem with version 1.5.6. Blank white page.
== For PHP Version 4 == (Does this code go in a file named DynamicArticleList.php? -> Yes, it does. And it works fine for me)
Issue is with the Category filter. Removed that from the script and now works in PHP 4.
- Smcnaught (05:24, 1 April 2006 (UTC))
<?php
/*
* Purpose: Dynamic Output of Article List (Main Page always not in list)
* Note: Currently support four types (new, hot, update, discussion).
* new => Newly Posted Articles
* update => Recently Updated Articles
* hot => Most Popular Articles
* discussion => Recently Updated Discussion
* @author: Zeng Ji (zengji@gmail.com)
*
* To install, add following to LocalSettings.php
* require_once ("extensions/DynamicArticleList.php");
*/
$wgExtensionFunctions[] = "wfDynamicArticleList";
function wfDynamicArticleList() {
global $wgParser;
$wgParser->setHook( "DynamicArticleList", "DynamicArticleList" );
}
// The callback function for converting the input text to HTML output
function DynamicArticleList( $input ) {
$dbr =& wfGetDB( DB_SLAVE );
// INVALIDATE CACHE
global $wgTitle;
$wgTitle->invalidateCache();
// Default Values
$listTitle = false;
$listType = 'new';
$listCount = 5;
// ###### PARSE PARAMETERS ######
$aParams = explode("\n", $input);
foreach($aParams as $sParam) {
$aParam = explode("=", $sParam);
if( count( $aParam ) < 2 )
continue;
$sType = trim($aParam[0]);
$sArg = trim($aParam[1]);
switch ($sType) {
case 'title':
$listTitle = $sArg;
break;
case 'type':
if ( in_array($sArg, array('new','hot','update', 'discussion')) )
$listType = $sArg;
break;
case 'count':
$listCount = IntVal( $sArg );
break;
}
}
// ###### CHECKS ON PARAMETERS ######
if ($listTitle!=false && strlen($listTitle)==0)
$listTitle=false;
// ###### BUILD SQL QUERY ######
$sql = genSQL($listType, $listCount);
// ###### PROCESS SQL QUERY ######
global $wgUser;
global $wgLang;
global $wgContLang;
$res = $dbr->query($sql);
$sk =& $wgUser->getSkin();
if ($dbr->numRows( $res ) != 0) {
while( $row = $dbr->fetchObject ( $res ) ) {
$title = Title::makeTitle( $row->namespace, $row->title);
if ($listType == 'discussion')
$sLink = $sk->makeKnownLinkObj($title, $wgContLang->convertHtml($title->getText()), '', '', 'Discussion: ');
else
$sLink = $sk->makeKnownLinkObj($title, $wgContLang->convertHtml($title->getText()));
// Generate 'View Count' String (for 'hot')
if ($listType == 'hot')
$aViews[] = ' - ( ' . $row->count . ' views ) ';
else
$aViews = false;
// Generate 'Time' String (for 'new', 'update', 'discussion')
if ($listType != 'hot') {
$aDates[] = ' - [ ' . $wgLang->timeanddate($row->timestamp, true) . ' ] ';
$editorID = $row->user;
if ($editorID == 0) {
$editor = wfMsg('anonymous');
$aEditors[] = ' (' . $editor . ')';
} else {
$editor = User::whoIs($editorID);
$aEditors[] = ' ( ' . $sk->makeLink($wgContLang->getNsText(NS_USER) . ':' . $editor,
htmlspecialchars($editor)) . ' )';
}
} else {
$aDates = false;
$aEditors = false;
}
$aArticles[] = $sLink;
}
}
$dbr->freeResult( $res );
// ###### GENERATE OUTPUT ######
return OutputList($aArticles, $aEditors, $aDates, $aViews, $listTitle);
}
function genSQL( $type, $count) {
$dbr =& wfGetDB( DB_SLAVE );
$sPageTable = $dbr->tableName( 'page' );
$sRevisionTable = $dbr->tableName( 'revision' );
$sRecentChangesTable = $dbr->tableName( 'recentchanges' );
$sql = '';
if ($type == 'hot') {
$sql = "
SELECT DISTINCT
page_title as title,
page_namespace AS namespace,
page_counter as count
FROM $sPageTable
WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0 AND
page_id!=1
ORDER by count DESC
LIMIT $count
";
} elseif ($type == 'update') {
// Step 1: Get revision list order by rev_id
$sql = "
SELECT
page_id,
MAX(rev_id) AS max_rev_id
FROM $sPageTable
INNER JOIN $sRevisionTable ON page_id=rev_page
WHERE page_is_new!=1 AND page_namespace=0 AND page_is_redirect=0
AND page_id!=1
GROUP BY page_id
ORDER by max_rev_id DESC
LIMIT $count
";
// Step 2: According to revision list, generate SQL to retrieve article page information.
$res = $dbr->query($sql);
$inClause = '';
if ($dbr->numRows( $res ) == 0) {
$inClause = "-1";
} else {
while( $obj = $dbr->fetchObject( $res ) ) {
if( isset( $obj->max_rev_id ) ) {
$inClause .= $obj->max_rev_id . ',';
}
}
$inClause = substr($inClause, 0, -1); //delete tailing ','
}
$dbr->freeResult( $res );
$sql = "
SELECT
page_title AS title,
page_namespace AS namespace,
rev_user AS user,
rev_timestamp AS timestamp
FROM $sRevisionTable, $sPageTable
WHERE rev_page=page_id AND rev_id IN (". $inClause . ")
ORDER BY rev_id DESC";
} elseif ($type == 'discussion') {
// Step 1: Get revision list order by rev_id.
$sql = "
SELECT
p1.page_id,
MAX(rev_id) AS max_rev_id
FROM $sPageTable AS p1
INNER JOIN $sRevisionTable ON p1.page_id=rev_page
WHERE p1.page_is_redirect=0 AND p1.page_namespace=1
GROUP BY rev_page
ORDER by max_rev_id DESC
LIMIT $count
";
// Step 2: According to revision list, generate SQL to retrieve discussion page information.
$res = $dbr->query($sql);
$inClause = '';
if ($dbr->numRows( $res ) == 0) {
$inClause = "-1";
} else {
while( $obj = $dbr->fetchObject( $res ) ) {
if( isset( $obj->max_rev_id ) ) {
$inClause .= $obj->max_rev_id . ',';
}
}
$inClause = substr($inClause, 0, -1); //delete tailing ','
}
$dbr->freeResult( $res );
$sql = "
SELECT
page_title AS title,
page_namespace AS namespace,
rev_user AS user,
rev_timestamp AS timestamp
FROM $sRevisionTable, $sPageTable
WHERE rev_page=page_id AND rev_id IN (". $inClause . ")
ORDER BY rev_id DESC";
} else { // default type is 'new'
$sql = "
SELECT DISTINCT
page_title AS title,
page_namespace AS namespace,
rc_user AS user,
rc_timestamp AS timestamp
FROM $sPageTable
INNER JOIN $sRecentChangesTable ON page_id=rc_cur_id
WHERE rc_new=1 AND rc_namespace=0 AND page_is_redirect=0 AND
page_id!=1
ORDER by rc_id DESC
LIMIT $count
";
}
return $sql;
}
function OutputList ( $aArticles, $aEditors, $aDates, $aViews, $listTitle ) {
if ($listTitle != false) {
$r .= " <h3>" . $listTitle . "</h3>\n";
$r .= " <hr/>\n";
}
$sStartList = '<ul>';
$sEndList = '</ul>';
$sStartItem = '<li>';
$sEndItem = '</li>';
$r .= $sStartList . "\n";
for ($i=0; $i<count($aArticles); $i++) {
$editorString = "";
$dateString = "";
$viewString = "";
if ($aEditors != false)
$editorString = "<font size=-2>" . $aEditors[$i] . "</font>";
if ($aDates != false)
$dateString = "<font size=-2>" . $aDates[$i] . "</font>";
if ($aViews != false)
$viewString = "<font size=-2>" . $aViews[$i] . "</font>";
$r .= $sStartItem . $aArticles[$i] . $editorString . $dateString . $viewString . $sEndItem . "\n";
}
$r .= $sEndList . "\n";
return $r;
}
?>
[edit] Mediawiki 1.6.3
Is there a Chance anyone can make this and DynamicPageList working with mediawiki 1.6.3 ?
[edit] Mediawiki 1.6.5
Would be most grateful if anyone could make DynamicPageList work with mediawiki 1.6.5. Had no luck myself.
[edit] Slow Updating?
On the above note i have this working with mediawiki 1.6.7 fine. However, it seems to take a very long time to refresh the lists. The new articles updates within a few hours, but the recentchanges can sometimes take days to refresh. Does anyone else have the problem or a fix? (I have turned off mediawiki clearing the recent changes aswel)l btw.
--202.72.148.102 02:49, 6 July 2006 (UTC)
[edit] Mediawiki 1.6.7
It works with Mediawiki 1.6.7 but .... I have to use the Dynamic_Article_List_for_PHP4 code to make it works even if I have PHP 5.1.2 installed. I have tried the PDF version of the code and the text file version provided above with no luck. The problem is that I have PHP 5.1.2 (My server is Windows 2003 and IIS is used as web server) and I have the same T_CLASS error if I try to use the extension Dynamic Article List. I am not a PHP programmer but it seems to me a bug related to this extension and not PHP.
Update
Upgraded to PHP 5.1.4 (full stuff) and have this error :
Parse error: parse error, unexpected T_STRING, expecting T_FUNCTION in D:\mediawiki\includes\CategoryTravelerBase.php on line 158
Update 2
Ok, I have donwloaded and install all code from the PDF files to be sure (the error message above indicate maybe that there is a conflict somewhere in the function calls) and receive this error this time :
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "CategoryUtil::buildOneCategory". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's_Group_Policies') ORDER BY page_title' at line 1 (localhost)".
Fix :
This error is because I use the option 'categoryRoot' with the wrong name, I have to use the category name and NOT the Category display name.
--Romainp 17:52, 7 July 2006 (UTC)
[edit] Feture Request
Is there a way to get new and update together with the time order. for ex.
B (new)
A (updated)
C (new)
D (new)
[edit] Mediawiki 1.7.1
Just to let you know that I have upgraded from 1.6.x to 1.7.1 and the extension works, however, I have noticed those bugs :
Bug1 : Can't purge or preview the page
Everytime I try to purge the cache for a page that have the extension, or when I want to preview it, I have got this error :
Notice: Undefined variable:r in D:\mediawiki\extensions\DynamicArticleList.php on line 311
Bug2 : The option 'CategoryRoot' does not seems to work well
I have a general category called 'Knowledge Base' with several subs categories. If I use the extension to see all the latest articles in the 'Knowledge Base' Category, I have got also some articles that are not in this category but contains the words 'Knowledge Base'.
Maybe it is a bug in the query or the extension, maybe the problem is located elsewhere (the caching of the page ??).
Please everybody comment about that if you have the same problem.
Update : Ok, I think that the problem is not related to the name of the category but with the fact that the extension does not seems to work well to retreive all articles in sub categories, starting with a root category. I have an SQL Error each time I try to run it :
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "CategoryUtil::buildOneCategory". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's_Group_Policies') ORDER BY page_title' at line 1 (localhost)".
With the parameters :
<DynamicArticleList> title=Newly Posted Articles type=new count=5 categoryRoot=Knowledge Base </DynamicArticleList>
Is it possible that the code maintainer or the actual coder of this great extension can help us ?
Fix : In fact, my problem was that use the ' caracter in a category name and that bot seem to make mediawiki happy. I have created a new category and remove the problematic category (by remving in it the root category) and now all is working perfectly !
--Romainp 13:52, 10 July 2006 (UTC)
I have the same error:
Database error
From Front Tools wiki
Jump to: navigation, search
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER by rc_id DESC LIMIT 5' at line 9 (localhost)".
But i'm not sure to understand how you have solved yout pb !
Any help is welcome --Ctof 18:13, 24 July 2006 (UTC)
- This error seems to occur any time the category does not exist, which means, in particular, that it doesn't work in templates. (The <DynamicArticleList> tag is executed before the substitution, so unless you have a category called {{{1}}} it fails.) I've been looking through the code to find a better way to handle query failuers, but if anyone knows one, that would be great. --Jimmy 18:42, 24 July 2006 (UTC)
Bug 3 : categoryRoot=MyCat dosn't list the sames numbers of article as when we click on a link like [[Category:MyCat]] ? --Ctof 11:34, 27 July 2006 (UTC)
- after readinf the code,I know what, it's because by default the sql request is limited to the default namespace and i have article ino other namespace. is it possbible to add an attribute to specify the namespace ? --Ctof 13:34, 27 July 2006 (UTC)
[edit] Wikimarkup Feature
Is it possible to allow Wikimarkup, particularly links, in the title field?
[edit] Two New Features
I added two features to Zeng Ji's great extension:
- Options to surpress view count, editor, and timestamp, as pertain to each list type
- Renders wikitext in the title field
I included the code on my user page at User:Socoljam/DynamicArticleList (enhanced). I hope someone finds this useful, besides myself that is! --Socoljam 23:25, 23 July 2006 (UTC)
[edit] Error when used with DPL
When using DynamicArticleList on the same page as DynamicPageList2 I get one of these errors for each use of DynamicArticleList :-
Notice: Undefined variable: r in /my/site/directory/wiki/extensions/DynamicArticleList.php on line 282
My System :-
- MediaWiki: 1.7.1
- PHP: 5.0.5-2ubuntu1.3 (apache2handler)
- MySQL: 4.0.24_Debian-10ubuntu2.3-log
A fix?
I had it happening on line 274/275, so changed them to look like this:
if (isset($r)) { $r .= " <h3>" . $listTitle . "</h3>\n"; }
if (isset($r)) { $r .= " <hr/>\n"; }
Appears to work for me!
[edit] If you are having errors, make sure code copy from pdf was good
I had two spurrious newlines that got inserted into the code in CategoryTravelerBase.php. This caused odd "unexpected T_STRING expected T_FUNCTION ..." type errors, similar to what other people have reported on this page. 71.142.84.12 14:34, 29 September 2006 (UTC)
[edit] The "Undefined variable: r" error
I have Mediawiki 1.8.1 and the extension installed (from the PDF file).
I have also the "Undefined variable: r" in several lines. I have tested the fix describe above :
if (isset($r)) { $r .= " <h3>" . $listTitle . "</h3>\n"; }
if (isset($r)) { $r .= " <hr/>\n"; }
I have apply the if (isset(%r)) {...} on each lines where I have an error AND where the r variable appear. Now there is no errors but ... the extension does not work anymore ...
Any ideas someone ?
--Romain 14:50, 18 October 2006 (UTC)
- I'm just adding in that I'm having the error, with the fix applied, on version 1.8.3, PHP 5.1.2, and MySQL 4.1.14-Debian_5-log. The script still appears to work for me, though, except that I need to go into the page with the dynamic lists, edit, and save the page to update the lists. Refreshing the page clears the errors, but it doesn't update the lists. Er, I'd also like support on getting this so I don't need to edit pages to update lists... It kinda defeats the whole "Dynamic" part of the script. --216.170.23.236 04:20, 30 January 2007 (UTC)
--Special:Contributions 13:59, 14 March 2011 (UTC) Just add $r = ""; after the function OutputList in line 274. It will work!
[edit] Mediawiki 1.8.2
I got the pdf version and that works fine
[edit] Using Namespaces
I add a feature in the file Text version - DynamicArticleList.php with namespace: choice of namespace for the listing.
You can use the name or directly the number of the namespace.
Use like that :
<DynamicArticleList> title=my_listing type=new count=5 namespace=my_namespace categoryRoot=my_category </DynamicArticleList>
Ncante 09:53, 14 February 2007 (UTC)
[edit] Mediawiki 1.9.2 with Namespace version
I have downloaded the Text version - DynamicArticleList.php with namespace Fixed the Undefined variable:r error by adding $r = ""; at the start of the OutputList() function.
As people have said at the end of this discussion it is not updating.
I have added the $wgCacheEpoch = gmdate( 'YmdHis' ); line and when I specify a namespace it seems to work, but on my home page, where I want to check all namespaces it is just not updating even if I edit the page.
--Markw21 20:42, 9 March 2007 (UTC)
[edit] Problem with refresh?
At first i thought, that all works well, but it doesn't. This dynamic List don't refresh. Only if i edit something on the page, where my dynamic list is. I must say, that i have not done what is described in Dynamic_Article_List#Prerequisite. I have version 1.9.2 Can anyone help me? --192.164.38.126 08:45, 22 February 2007 (UTC)
I am reporting the same problem. Just moved from 1.6.7 to 1.9.3 and my dynamic article list doesn't refresh anymore. Only when I am saving the page with the list again. In 1.6.7 it DID refresh very well grz B.Vahrmeijer - LeerWiki.nl
Solved Vahrmeijer 9-3-2007 see http://www.leerwiki.nl use in Localsettings: $wgCacheEpoch = gmdate( 'YmdHis' );
Note that the above conversation may have been edited or added to since the transfer. If in doubt, check the edit history.
[edit] No refresh for me either.
My 1.93 wiki is also having trouble with main page updates.
I have placed $wgCacheEpoch = gmdate( 'YmdHis' ); into the local setting file, but the page still only updates when I edit/save. I really like having the recent changes on the front page and would like to get this feature working. Has anyone else fixed this issue?
Thanks
[edit] Incompatibility with Semantic MediaWiki?
I installed the DynamicAL put three lists on my Main_Page and upon accessing it or refreshing it I get a JavaScript alert-like box saying "Failed to derive URL prefix for Timeline API code files" the worst thing is that that after clicking "OK" or closing the alert box I get a completely correctly rendered page as usual.
So and since WikiMedia is very user friendly software that anyone even users with basic knowledge can use I had to search the entire file system as to what could the cryptic "Timeline API" stand for. The only fiel on my computer having a reference to timeline api is a javascript file for SimileTimeline - a fancy DHTML-based AJAXy widget for visualizing time-based events, that comes with Semantic MediaWiki (I would've never known I have it lol). Any help would be appreciated (although I'll prolly simply have to dump one of the extensions to solve this :D)
for refernce here's the timeline-api.js
/*================================================== * Timeline API * * This file will load all the Javascript files * necessary to make the standard timeline work. * It also detects the default locale. * * Include this file in your HTML file as follows: * * <script src="http://simile.mit.edu/timeline/api/scripts/timeline-api.js" type="text/javascript"></script> * *================================================== */ var Timeline = new Object(); Timeline.Platform = new Object(); /* HACK: We need these 2 things here because we cannot simply append a <script> element containing code that accesses Timeline.Platform to initialize it because IE executes that <script> code first before it loads timeline.js and util/platform.js. */ (function() { var javascriptFiles = [ "timeline.js", "util/platform.js", "util/debug.js", "util/xmlhttp.js", "util/dom.js", "util/graphics.js", "util/date-time.js", "util/data-structure.js", "units.js", "themes.js", "ethers.js", "ether-painters.js", "labellers.js", "sources.js", "layouts.js", "painters.js", "decorators.js" ]; var cssFiles = [ "timeline.css", "ethers.css", "events.css" ]; var localizedJavascriptFiles = [ "timeline.js", "labellers.js" ]; var localizedCssFiles = [ ]; // ISO-639 language codes, ISO-3166 country codes (2 characters) var supportedLocales = [ "en", // English "es", // Spanish "fr", // French "it", // Italian "ru", // Russian "se", // Swedish "vi", // Vietnamese "zh" // Chinese ]; try { var desiredLocales = [ "en" ]; var defaultServerLocale = "en"; var parseURLParameters = function(parameters) { var params = parameters.split("&"); for (var p = 0; p < params.length; p++) { var pair = params[p].split("="); if (pair[0] == "locales") { desiredLocales = desiredLocales.concat(pair[1].split(",")); } else if (pair[0] == "defaultLocale") { defaultServerLocale = pair[1]; } } }; (function() { if (typeof Timeline_urlPrefix == "string") { Timeline.urlPrefix = Timeline_urlPrefix; if (typeof Timeline_parameters == "string") { parseURLParameters(Timeline_parameters); } } else { var heads = document.documentElement.getElementsByTagName("head"); for (var h = 0; h < heads.length; h++) { var scripts = heads[h].getElementsByTagName("script"); for (var s = 0; s < scripts.length; s++) { var url = scripts[s].src; var i = url.indexOf("timeline-api.js"); if (i >= 0) { Timeline.urlPrefix = url.substr(0, i); var q = url.indexOf("?"); if (q > 0) { parseURLParameters(url.substr(q + 1)); } return; } } } throw new Error("Failed to derive URL prefix for Timeline API code files"); } })(); var includeJavascriptFiles; var includeCssFiles; if ("SimileAjax" in window) { includeJavascriptFiles = function(urlPrefix, filenames) { SimileAjax.includeJavascriptFiles(document, urlPrefix, filenames); } includeCssFiles = function(urlPrefix, filenames) { SimileAjax.includeCssFiles(document, urlPrefix, filenames); } } else { var getHead = function() { return document.getElementsByTagName("head")[0]; }; var includeJavascriptFile = function(url) { if (document.body == null) { document.write("<script src='" + url + "' type='text/javascript'></script>"); } else { var script = document.createElement("script"); script.type = "text/javascript"; script.language = "JavaScript"; script.src = url; getHead().appendChild(script); } }; var includeCssFile = function(url) { if (document.body == null) { document.write("<link rel='stylesheet' href='" + url + "' type='text/css'/>"); } else { var link = document.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("type", "text/css"); link.setAttribute("href", url); getHead().appendChild(link); } } includeJavascriptFiles = function(urlPrefix, filenames) { for (var i = 0; i < filenames.length; i++) { includeJavascriptFile(urlPrefix + filenames[i]); } }; includeCssFiles = function(urlPrefix, filenames) { for (var i = 0; i < filenames.length; i++) { includeCssFile(urlPrefix + filenames[i]); } }; } /* * Include non-localized files */ includeJavascriptFiles(Timeline.urlPrefix + "scripts/", javascriptFiles); includeCssFiles(Timeline.urlPrefix + "styles/", cssFiles); /* * Include localized files */ var loadLocale = []; loadLocale[defaultServerLocale] = true; var tryExactLocale = function(locale) { for (var l = 0; l < supportedLocales.length; l++) { if (locale == supportedLocales[l]) { loadLocale[locale] = true; return true; } } return false; } var tryLocale = function(locale) { if (tryExactLocale(locale)) { return locale; } var dash = locale.indexOf("-"); if (dash > 0 && tryExactLocale(locale.substr(0, dash))) { return locale.substr(0, dash); } return null; } for (var l = 0; l < desiredLocales.length; l++) { tryLocale(desiredLocales[l]); } var defaultClientLocale = defaultServerLocale; var defaultClientLocales = ("language" in navigator ? navigator.language : navigator.browserLanguage).split(";"); for (var l = 0; l < defaultClientLocales.length; l++) { var locale = tryLocale(defaultClientLocales[l]); if (locale != null) { defaultClientLocale = locale; break; } } for (var l = 0; l < supportedLocales.length; l++) { var locale = supportedLocales[l]; if (loadLocale[locale]) { includeJavascriptFiles(Timeline.urlPrefix + "scripts/l10n/" + locale + "/", localizedJavascriptFiles); includeCssFiles(Timeline.urlPrefix + "styles/l10n/" + locale + "/", localizedCssFiles); } } Timeline.Platform.serverLocale = defaultServerLocale; Timeline.Platform.clientLocale = defaultClientLocale; } catch (e) { alert(e); } })();
354d 15:58, 28 September 2007 (UTC)
[edit] Warning: Cannot modify header information
I installed the extension in MediaWiki 1.11.0 and got two times the warning:
Warning: Cannot modify header information - headers already sent by (output started at <PATH>/mediawiki-1.11.0/extensions/DynamicArticleList.php:307) in <PATH>/mediawiki-1.11.0/includes/WebResponse.php on line 10
and german umlaute like ä, ö, ü ... will not be displayed.
--AlexSommer 14:22, 5 October 2007 (UTC)
[edit] The same Problem with MediaWiki 1.10.0
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/mediawiki-extensions/DynamicArticleList/DynamicArticleList.php:298) in /usr/share/mediawiki1.10/includes/WebResponse.php on line 10
[edit] not realy a Solution
i' ve put following lines in index.php:
error_reporting( E_ALL ); header( "Content-type: text/html; charset=utf-8" ); @ini_set( "display_errors", false );
[edit] the pdf files are shit
i thought that's my iceweasel, which make this problem. then i download those *.pdf (aka php) files with wget, and with other programs and i allways get strange pdf like file encoded dadaistical texts. i realy don't understand why there is an file.extension upload restructor in mediawiki. i had to install acrobatreader and to copy out these files.
[edit] Blank page with 1.11
I upgraded to 1.11 and now when I enable this extension I just get blank pages. Anyone willing to update this extension ?
[edit] Deleted by poster
[edit] Refresh
mediawiki 1.32. How to make it refresh properly?
[edit] Feature Request: hideminor for update
For the type "update" a feature only to show the majorupdates would be perfect. The "recentchanges" List has the possiblility to hide minorupdates. Maybe it is possible to integrate this. With the mark of minorupdates on updated pages the editor could decide if the change should be diplayed in the Dynamic list.
I would also find this feature quite helpful, were it to be added. --Exor314 13:04, 28 April 2011 (UTC)
[edit] MediaWiki 1.16
Worked for me with MediaWiki 1.16.
I copied all 4 php files into $IP/extensions/DynamicArticleList
I added require_once( "$IP/extensions/DynamicArticleList/DynamicArticleList.php" ); to my LocalSettings.php
All worked as expected.
jcoreil 2010-08-03
[edit] Mediawiki 1.15
It works for me, but if I turn on error display
- adding near top to LocalSettings.php error_reporting( E_ALL ); ini_set( 'display_errors', 1 );
I see the following error repeated 4 times.
Notice: Undefined variable: r in C:\htdocs\wkbv_wiki_copy\extensions\DynamicArticleList\DynamicArticleList.php on line 266
--Mark 10:21, 15 September 2010 (UTC)
[edit] How to change output of type=new
The output shown for the DynamicArticleList when set to type=new includes the title, the author and the date/time it was created.
I would like only the title to be shown. Does anyone have the expertise to share how this might be done? What file do I need to adjust and what lines do I need to edit/delete? Thanks!!
[edit] Problem with output by using type=new
I installed Dynamic Article List a long time ago. I'm running Mediawiki version 1.16. Suddenly, the list output counts only more 8 articles (type=new) despite the fact that count is still set to 10 articles. As compared to the list of the most favourite articles it works correctly. Any idea what could be causing this? --Safetyplan 06:54, 4 October 2011 (UTC)
[edit] MediaWiki 1.18
Does not appear to work. Error: Call to undefined method SkinVector::makeLink --66.227.253.139 20:28, 5 November 2011 (UTC)
TEMP FIX: I managed to remove this error by commenting out the line (100 in my editor): $aEditors[] = ' ( ' . $sk->makeLink($wgContLang->getNsText(NS_USER) . ':' . $editor, htmlspecialchars($editor)) . ' )';
This removes the editor's name link from the table entry, but the article link still works. Not ideal, but a short term fix. I think the makeLink function has been removed in v1.18. I did some digging on this a while back, but can't remember the outcome. I'll update this as/when I find the answer again, but basucally the extension needs updating.
- Thanks for that fix; it is enough to limp along with for now. When you said that the makeLink function was the problem, I tried just putting in the bare $editor (a non-hyperlinked editor name is preferred over nothing at all), but this didn't seem to work. Is the editor name something else in 1.18.x? --NewMexicoKid 23:15, 20 January 2012 (UTC)
- Ok, this works (non-hyperlinked, but the name of the editor is at least there) around line 100 of DynamicArticleList.php. I think that makeLink was replaced by link() in includes/Linker.php but I don't see where this is documented (on the web). --NewMexicoKid 15:52, 21 January 2012 (UTC)
$aEditors[] = ' ( ' . $editor . ' )';
[edit] MediaWiki 1.17
Does not work off the bat. In DynamicArticleList I had to change the following on line 21:
from
require_once ('CategoryUtil.php');
to
require_once ('/path/to/my/wikiinstall/includes/CategoryUtil.php');
--RichyL 20:26, 24 November 2011 (UTC)