adnann Posted July 9, 2008 Share Posted July 9, 2008 hi I have instaled a latest news panel on my site but I want it to show news from one category and to show the news with picture <?php /*---------------------------------------------------+ | PHP-Fusion 6 Content Management System +----------------------------------------------------+ | Copyright © 2002 - 2007 Nick Jones | http://www.php-fusion.co.uk/ +----------------------------------------------------+ | Released under the terms & conditions of v2 of the | GNU General Public License. For details refer to | the included gpl.txt file or visit http://gnu.org +----------------------------------------------------+ | latest_news_panel by flyingduck | Shows latest newslinks in a panel | http://www.flyingduck.dk +----------------------------------------------------*/ if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; } openside($locale['046']); $result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC LIMIT 0,10"); if (dbrows($result) != 0) { while ($data = dbarray($result)) { $itemsubject = trimlink($data['news_subject'], 23); echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."news.php?readmore=".$data['news_id']."' title='".$data['news_subject']."' class='side'>$itemsubject</a><br>\n"; } } else { echo "<center>".$locale['047']."</center>\n"; } closeside(); ?> Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/ Share on other sites More sharing options...
cooldude832 Posted July 9, 2008 Share Posted July 9, 2008 well since no one knows your database scheme the best we can say is $result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC LIMIT 0,10"); add a where clause to this query that best reflects what you need. Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-585545 Share on other sites More sharing options...
adnann Posted July 9, 2008 Author Share Posted July 9, 2008 sorry I dont really understand can you be more specific thanks Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-585551 Share on other sites More sharing options...
cooldude832 Posted July 9, 2008 Share Posted July 9, 2008 sorry I dont really understand can you be more specific thanks Thats your problem you aren't giving us anything to work with. Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-585592 Share on other sites More sharing options...
craygo Posted July 9, 2008 Share Posted July 9, 2008 if your table has a category field use that in a where clause. Example: in your news table there is a field called "category" you can set a category name or id and look for that $category = '1'; $result = dbquery("SELECT * FROM ".$db_prefix."news WHERE `category` = '$category' ORDER BY news_datestamp DESC LIMIT 0,10"); Ray Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-585598 Share on other sites More sharing options...
adnann Posted July 9, 2008 Author Share Posted July 9, 2008 what do you need to work with?? Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-585603 Share on other sites More sharing options...
revraz Posted July 9, 2008 Share Posted July 9, 2008 This should really be in the 3rd party scripts area since you are not the author of the code. Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-585607 Share on other sites More sharing options...
adnann Posted July 10, 2008 Author Share Posted July 10, 2008 can any one help me plz? Link to comment https://forums.phpfreaks.com/topic/113941-latest-news-panel/#findComment-586629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.