Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
koun
New Member
New Member


Joined: Mar 01, 2004
Posts: 8

PostPosted: Mon May 24, 2004 12:28 pm Reply with quote

Hi,
Idea I wanna make a block that will contain the last 10 titles of a specific category. If for example i have in my news module a category named Cinema i wanna make a block that will contain the last 10 post i will make about cinema....
I posted the same idea at Karakas Forum and he gave me that link:
Only registered users can see links on this board! Get registered or login!

with a suggestion to adapt it to my situation. The think is that i tried some thinks but without success...
 
View user's profile Send private message
chatserv
Member Emeritus


Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Mon May 24, 2004 3:13 pm Reply with quote

Here's something similar that might help:
Code:
<?php


if (eregi("block-Select_Stories.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

global $prefix, $db, $user, $cookie;
$mytopic = "1";   
$a = 1;
$row = $db->sql_fetchrow($db->sql_query("SELECT sid, title FROM ".$prefix."_stories WHERE topic='$mytopic' ORDER BY sid DESC LIMIT 0,10"));
while ($row = $db->sql_fetchrow($result)) {
    $r_options = "";
    if (isset($cookie[4])) { $r_options .= "&amp;mode=$cookie[4]"; }
    if (isset($cookie[5])) { $r_options .= "&amp;order=$cookie[5]"; }
    if (isset($cookie[6])) { $r_options .= "&amp;thold=$cookie[6]"; }
    $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"modules.php?name=News&amp;file=article&amp;sid=$row[sid]$r_options\">$row[title]</a><br>";
    $a++;
}
$content .= "<br><center>[ <a href=\"article-topic-.html$mytopic\">"._MORENEWS."</a> ]</center>";

?>


Change the 1 in $mytopic = "1"; to the topic number of your choice.
 
View user's profile Send private message Visit poster's website
koun
PostPosted: Mon May 24, 2004 6:09 pm Reply with quote

Works Fine !
You are simple the BEST!!!
Thanks
 
koun
PostPosted: Tue Aug 03, 2004 1:03 am Reply with quote

I noticed that this script that Chatserv have posted in the past...
dont shows the last article from every categorie...
But i cant figure out what to change so this block will show the last article too...any ideas?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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 ©