News at Glance - 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   News at Glance - block
Gaurav
CZ Super Newbie
Gaurav has been a member for over 20 year's 20 Year Member
Occupation: Student
Gender: Male
Status: Offline
Joined: Feb 09, 2004
0.01 posts per day
Posts: 55
Points: 2,165
 Yahoo Messenger  
Hi everybody

I downloaded the news at glance block from this site. Liked it very much, but needed to tweak it. Block shows News article from 1 - 100 but I wanted it to show the latest News first rather than the old one. So I changed the marquee direction.... this ensured that I get the 100th article first and the 1st article last. Then I change the query from 0, 100 to 0, 1000 tis made sure that my latest news always show up first.

But I think its not the best way to do it and moreover when the News scroll from left to right its hard to read it. So I was wondering if you guys could change it such that the News scroll from right to left (the way it does in the block released) but it should have latest News followed by the old news may be latest 50 or 100. I think only one more query would do the trick. If we obtain the id of the latest news and the job will be done. I tried it but couldnt get it right.

P.S. I also added an additional 'alt' tag to the link, it helps in googling the site icon_wink.gif




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#2   re: News at Glance - 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,475
   
Put the marquee direction back to normal and do the following

Find
$result = sql_query("select sid, title, comments, counter from ".$prefix."_stories $querylang order by sid ASC limit 0,100", $dbi);
while(list($sid, $title, $comtotal, $counter) = sql_fetch_row($result, $dbi)) {


Replace with
$result = sql_query("select sid, title, time, comments, counter from ".$prefix."_stories $querylang order by time  DESC 0,100", $dbi);
while(list($sid, $title, $time, $comtotal, $counter) = sql_fetch_row($result, $dbi)) {


Let me know how it goes.



_________________
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   
Gaurav
CZ Super Newbie
Gaurav has been a member for over 20 year's 20 Year Member
Occupation: Student
Gender: Male
Status: Offline
Joined: Feb 09, 2004
0.01 posts per day
Posts: 55
Points: 2,165
 Yahoo Messenger  
It gave me an error

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home2/username/public_html/includes/sql_layer.php on line 288




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#4   re: News at Glance - 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,475
   
OK that may require that I add more info. Try just replacing the ASC with DESC with the origianl code and see what happens.




_________________
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: News at Glance - block
Gaurav
CZ Super Newbie
Gaurav has been a member for over 20 year's 20 Year Member
Occupation: Student
Gender: Male
Status: Offline
Joined: Feb 09, 2004
0.01 posts per day
Posts: 55
Points: 2,165
 Yahoo Messenger  
works like a charm

thanx a lot.

Protector is making the site real slow header Gen time: .159s




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#6   
Gaurav
CZ Super Newbie
Gaurav has been a member for over 20 year's 20 Year Member
Occupation: Student
Gender: Male
Status: Offline
Joined: Feb 09, 2004
0.01 posts per day
Posts: 55
Points: 2,165
 Yahoo Messenger  
I made one more change to enhance it. Changed

0,100


to

10,110


Now it doesnt repeat the stories that are already present on the homepage.


Thanx again



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#7   re: News at Glance - 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,475
   
That isnt too bad I have seen worse!

Glad ya got the block working for you!




_________________
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
#8   re: News at Glance - block
Gaurav
CZ Super Newbie
Gaurav has been a member for over 20 year's 20 Year Member
Occupation: Student
Gender: Male
Status: Offline
Joined: Feb 09, 2004
0.01 posts per day
Posts: 55
Points: 2,165
 Yahoo Messenger  
I have added a better title function for the block. You can test it. For demo click [ Register or login to view links on this board.] Just mouse over the News links.


Gaurav



Attached Files
block-CZNewsflash.zip (1.04 KB, Downloaded: 5254 Time(s))



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#9   re: News at Glance - 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,475
   
Thats great would you mind adding it to the downloads? Or I can it doesnt matter to me.
Is it for GT?
Thanks,

Telli




_________________
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
#10   Re: re: News at Glance - block
Gaurav
CZ Super Newbie
Gaurav has been a member for over 20 year's 20 Year Member
Occupation: Student
Gender: Male
Status: Offline
Joined: Feb 09, 2004
0.01 posts per day
Posts: 55
Points: 2,165
 Yahoo Messenger  


Originally posted by Telli:

Thats great would you mind adding it to the downloads? Or I can it doesnt matter to me.
Is it for GT?
Thanks,

Telli


Doesnt matter to me...but its your block with just one change....so its upto u, if u want to add it as another download or just replace the existing Newsflash block.

What it does is...if you mouseover the article link in the block, it shows the first 200 chars of the News item in the tool tip. So now the user can read the intro of the article and if he/she finds it interesting can click it and read the whole article. Also Google crawlers, crawl alt and title tags, thus it will index all the title tags.




_________________
[ Register or login to view links on this board.]
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