girish_327
Posts: 108
|
| Posted: 05/29/2004, 9:20 AM |
|
Please help me out to convert CC code into CCS code. I want create Rating system for my ebook Project and for that I have to create a Rating System for eBooks
My Tabels are as follows
ebook
ebook_id, rating, rating_count etc.
rating
ebook_id, user_id, rate, ip
This is a befoore Update Code from Go2Code Example
'->Before Update Event Start
userID=Session("UserID")
if userID="" then userID=0
set rsTemp=cn.execute("SELECT article_ratings.* FROM article_ratings WHERE article_ratings.art_id="&pPKart_id&" AND ((article_ratings.user_id=" & UserID & " and article_ratings.user_id<>0) or article_ratings.ip='" & Request.ServerVariables("REMOTE_ADDR")&"')")
if rsTemp.eof then
sSQL="insert into article_ratings (art_id,user_id,art_rate,ip) values("&pPKart_id&","&UserID&","&fldart_rating&",'"&Request.ServerVariables("REMOTE_ADDR")&"')"
cn.execute sSQl
sSQL="update articles set art_rating=art_rating+" & fldart_rating & ", art_rating_count=art_rating_count+1 where art_id=" & pPKart_id
else
sRateErr= "Sorry, but you can't rate the same article twice"
end if
'<-Before Update Event End
__________________________________________________
Before Show Update
'->Before Show Event Start
if fldart_ratingview=0 then
fldart_ratingview="Not yet rated"
fldart_rating_count_view=""
else
fldart_ratingview="<img src=images/" & round(fldart_ratingview/fldart_rating_count) & "stars.gif>"
end if
__________________________________________________
Please Help me to covert Code Charge code in 2 Charge code into Code Charge Studio Compatible
'<-Before Show Event End
_________________
Girish Baraskar
Web Designer/Developer
http://www.agnisdesigners.com
http://www.eindianpaintings.com
http://www.realestatekolhapur.com |
 |
 |
|