Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1775

PostPosted: Tue Sep 07, 2010 5:41 pm Reply with quote

hey guys!

how can i display the last articles from the news catagory in the article.php. i have take lines from the topics module (index.php) and set it under the line of themearticle($aaid, ...);. i can dislay atm the latest articles of the site but not the latest articles of the news category. sorry for the bad code but i'm little bit confused on it Smile

Code:
OpenTable();

$sql01 = 'SELECT sid, catid, title FROM ' . $prefix . '_stories WHERE catid=\'' . $catid . '\' ORDER BY sid DESC LIMIT 1,4';
      $result4 = $db->sql_query($sql01);
      $num = $db->sql_numrows($result4);
      if ($num != 0) {
         while ($row4 = $db->sql_fetchrow($result4)) {
            $sid = intval($row4['sid']);
            $catid = intval($row4['catid']);
            $title = stripslashes(check_html($row4['title'], 'nohtml'));

         echo ''.$topictext.' &raquo; <a href="modules.php?name=News&amp;file=article&amp;sid='. $sid .'">'. $title .'</a><br />';         
         }
         } else {
         echo '<i>no articles found!</i>';         
         }
CloseTable();


Last edited by neralex on Tue Sep 07, 2010 9:06 pm; edited 4 times in total 
View user's profile Send private message
neralex







PostPosted: Tue Sep 07, 2010 6:24 pm Reply with quote

i have found the solution *gg*

i must change the the sql01 call, only. here the changed line:

Code:
$sql01 = 'SELECT sid, catid, title, topic FROM ' . $prefix . '_stories WHERE topic=\'' . $topic . '\' ORDER BY sid DESC LIMIT 1,4';


Last edited by neralex on Tue Sep 07, 2010 8:59 pm; edited 2 times in total 
neralex







PostPosted: Tue Sep 07, 2010 7:50 pm Reply with quote

how can i add this to my story_page? i want put this sql-call between hometext and bodytext. any ideas?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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 ©