Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
rafamp
Regular
Regular



Joined: Oct 15, 2005
Posts: 92
Location: Brazil

PostPosted: Sun Nov 06, 2005 6:36 pm Reply with quote

hi

do you guys have a block/module/rss feed to know the last encyclopedia entries?

thanks
 
View user's profile Send private message MSN Messenger
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6433

PostPosted: Sun Nov 06, 2005 7:12 pm Reply with quote

I haven't seen this, but you could probably modify a similar last block to look at the encyclopedia table...

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
rafamp







PostPosted: Tue Nov 08, 2005 2:20 pm Reply with quote

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>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Encyclopedia&amp;rop=content&amp;tid=$id\">$title</a><br>";
}

?>
 
rafamp







PostPosted: Tue Nov 15, 2005 4:04 pm Reply with quote

Come on guys...
 
kguske







PostPosted: Tue Nov 15, 2005 6:02 pm Reply with quote

What happens? Do you get an error message?
 
kguske







PostPosted: Tue Nov 15, 2005 6:13 pm Reply with quote

Did you post the entire code for the block? It's missing a <?PHP to start...
 
rafamp







PostPosted: Tue Nov 15, 2005 6:21 pm Reply with quote

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 Sad
 
kguske







PostPosted: Tue Nov 15, 2005 6:27 pm Reply with quote

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>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Encyclopedia&amp;op=content&amp;tid=$id\">$title</a><br>";
}

?>
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©