HELP WITH NEWS BLOCK

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   HELP WITH NEWS BLOCK
XtraX
CZ Newbie
Status: Offline
Joined: Oct 23, 2003
0.00 posts per day
Posts: 25
Points: 2,716
   
OK what l am trying to accomplish is a Statistic Center Block displaying the total amount of News Articles in our Data base

for example

Total News

Total Categories

Top 5 Categories Scrolling along the bottom of the block

If anyone could help me out it would be appreciated ...I been banging my head off the wall for days and keep getting nothing but parser errors ..newbie to php does it show icon_redface.gif

XtraX



Back to top Reply with quote
#2   re: HELP WITH NEWS BLOCK
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Post what you got so far I will have a gander.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: HELP WITH NEWS BLOCK
XtraX
CZ Newbie
Status: Offline
Joined: Oct 23, 2003
0.00 posts per day
Posts: 25
Points: 2,716
   
Thank you telli for replying been gone for awhile and just made it back l actually got that one figured out but l am still fighting with this one a need some expert advice on how to achieve this...

This block that l will post the code to is a Least Read News Article block it grabs the least read articles and displays them to the number l have set but it doesnt work yet would you mind taking a look at the code and tell me what it is l am missing or where the error lies...lol



######################
# PHPNUKE.ORG COPYRIGHT 2004 #
# Block- Least_Read.php                 #
# #####################

<?php
if (eregi("block-Least_Read.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
}


$least_read=100;
$list=32;
global $dbi;
$num_now = sql_num_rows(sql_query("select * from ".$prefix."_stories", $dbi), $dbi); 
$now = $num_now-$least_read; 
$result = sql_query("select sid, title, counter, time from ".$prefix."_stories where sid<$now order by counter ASC limit 0,$list", $dbi); 
if (sql_num_rows($result, $dbi)>0) { 
    $lugar=1; 
    while(list($sid, $title, $counter) = sql_fetch_row($result, $dbi)) { 
        if($counter>=0) { 
                  echo "<td><font>$lugar: <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\">$title</a> - ($counter "._READS.")<br></font>"; 

              $lugar++; 
         } 
    } 


?>


PS by the way that mod you have installed on your forums is pretty cool ll tested it out and sent another member a 127 points is this yours and if so where could l find something like this it's pretty nifty


XtraX


Back to top Reply with quote
#4   re: HELP WITH NEWS BLOCK
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
$num_now = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_stories"));


Add $db as a global

That mod is the Cash Mod and I got it from [ Register or login to view links on this board. ] But they have modded version for Nuke at [ Register or login to view links on this board. ]



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: HELP WITH NEWS BLOCK
XtraX
CZ Newbie
Status: Offline
Joined: Oct 23, 2003
0.00 posts per day
Posts: 25
Points: 2,716
   
Thank you for your help and thanks for the link keep up the great work guys



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum