| Author |
Message |
rafamp Regular


Joined: Oct 15, 2005 Posts: 92 Location: Brazil
|
Posted:
Sun Nov 06, 2005 6:36 pm |
|
hi
do you guys have a block/module/rss feed to know the last encyclopedia entries?
thanks |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Sun Nov 06, 2005 7:12 pm |
|
I haven't seen this, but you could probably modify a similar last block to look at the encyclopedia table... |
|
|
|
 |
rafamp Regular


Joined: Oct 15, 2005 Posts: 92 Location: Brazil
|
Posted:
Tue Nov 08, 2005 2:20 pm |
|
trying this without success
source: block-Last_5_Articles.php
| Code: | if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $prefix, $db;
$sql = "SELECT tid, title FROM ".$prefix."_encyclopedia ORDER BY id DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while (list($tid, $title) = $db->sql_fetchrow($result)) {
$id = intval($tid);
$title = stripslashes($title);
$content .= "<strong><big>·</big></strong> <a href=\"modules.php?name=Encyclopedia&rop=content&tid=$id\">$title</a><br>";
}
?> |
|
|
|
|
 |
rafamp Regular


Joined: Oct 15, 2005 Posts: 92 Location: Brazil
|
Posted:
Tue Nov 15, 2005 4:04 pm |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Tue Nov 15, 2005 6:02 pm |
|
What happens? Do you get an error message? |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Tue Nov 15, 2005 6:13 pm |
|
Did you post the entire code for the block? It's missing a <?PHP to start... |
|
|
|
 |
rafamp Regular


Joined: Oct 15, 2005 Posts: 92 Location: Brazil
|
Posted:
Tue Nov 15, 2005 6:21 pm |
|
yes there is the <?PHP i just removed it and the comments to get smaller here in the forum,
the problem is when i exchange it, nothing happens  |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Tue Nov 15, 2005 6:27 pm |
|
Try this (notice it's using a different table, the tid field is specified consistently in the SQL and the list result, the op code is correct in the URL):
| Code: | <?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $prefix, $db;
$sql = "SELECT tid, title FROM ".$prefix."_encyclopedia_text ORDER BY tid DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while (list($tid, $title) = $db->sql_fetchrow($result)) {
$id = intval($tid);
$title = stripslashes($title);
$content .= "<strong><big>·</big></strong> <a href=\"modules.php?name=Encyclopedia&op=content&tid=$id\">$title</a><br>";
}
?> |
|
|
|
|
 |
|
|
|
|