Yes j'ai réussi
la version du haut me plaisait pas car en cas de mise à jour il aurait fallu sans doute remodifier le fichier function.php
Donc j'ai carrément fais un bloc "Web_Links" dont voici le code:
<?php
/**
* pragmaMx Content Management System
* Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
$module_name = "Web_Links";
defined('mxMainFileLoaded') or die('access denied');
$mxblockcache = false;
require_once('modules/Web_Links/l_config.php');
include("modules/Web_Links/includes/functions.php");
include("modules/Web_Links/language/lang-french.php");
global $prefix, $module_name, $perpage;
$cidwhere = ($cid) ? ' cid = ' . intval($cid) . ' ' : ' cid > 0 ';
$viewlimit = (empty($cid)) ? 10 : $perpage;
// New Links
$news = '';
$i = 0;
// einen Datensatz mehr abfragen ;)
$result = sql_query("select lid, title, date as updated from " . $prefix . "_links_links WHERE " . $cidwhere . " ORDER BY date DESC limit 0,11");
$totalrows = sql_num_rows($result);
// nur was anzeigen, wenn mehr als 10 oder {perpage} Datensaetze vorhanden
if ($totalrows <= $viewlimit) {
return;
} while (list($lid, $title, $date) = sql_fetch_row($result)) {
$i++;
if ($i == $viewlimit + 1) {
break;
}
$shortdate = mx_strftime(_SHORTDATESTRING, mxSqlDate2UnixTime($date));
$title2 = str_replace("_", " ", $title);
$news .= "<tr><td align=\"right\" valign=\"top\" nowrap>" . $shortdate . " </td><td><a href=\"modules.php?name=Web_links&op=view&lid=" . $lid . "\">" . $title2 . "</a></td></tr>";
}
// nur was anzeigen, wenn mehr als 10 Datensaetze vorhanden
if ($i <= $viewlimit) {
return;
}
// Top Links
$tops = '';
$result = sql_query("select lid, title, hits from " . $prefix . "_links_links where hits > 1 AND " . $cidwhere . " ORDER BY hits DESC limit 0,10");
while (list($lid, $title, $hits) = sql_fetch_row($result)) {
$title2 = str_replace("_", " ", $title);
$tops .= "<tr><td align=\"right\" valign=\"top\" nowrap>" . $hits . " x </td><td><a href=\"modules.php?name=Web_Links&op=view&lid=" . $lid . "\">" . $title2 . "</a></td></tr>\n";
}
echo '
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<th width="49%" align="left" nowrap class="title">' . _NEWLINKS . '</th>
<th width="2%"> </th>
<th width="49%" align="left" nowrap class="title">' . _MOSTPOPULAR . ' ' . _MODITEMS . '</th>
</tr>
<tr valign="top">
<td><table border="0" cellspacing="0" cellpadding="2">' . $news . '</table></td>
<td> </td>
<td><table border="0" cellspacing="0" cellpadding="2">' . $tops . '</table></td>
</tr></table>
';
echo '<br />';
global $prefix, $module_name;
$cidwhere = ($cid) ? ' cid = ' . intval($cid) . ' ' : ' cid > 0 ';
$result = sql_query("select count(lid) from " . $prefix . "_links_links WHERE " . $cidwhere);
list($numrows) = sql_fetch_row($result);
if ($numrows) {
$result = sql_query("select count(cid) from " . $prefix . "_links_categories WHERE " . $cidwhere);
list($catnum) = sql_fetch_row($result);
echo "<center><span class=\"content\">" . _WLTHEREARE . " <b>" . $numrows . "</b> " . _MODITEMS . " " . _AND . " <b>" . $catnum . "</b> " . _WLCATEGORIES . " " . _WLATTACHEDTOCAT . "</span></center>";
}
?>
On peut le voir
ICI en bas de page!
