[ dozetfkvsv @ 03.09.2009. 11:37 ] @
pomagajte ljudi, kupio sam neki cms koji solidni radi ali ima problem primetio sam da googleboot kad prodje straicama sajta oceni fotografiju ili tekst sa 0 iako je u ponudi ocenjivanje od 1 do 5 http://fkvsv.org/catalog/house.html ne znam kako to resiti nema smisla da blokiram IP adrese googla, mozda da se samo ubaci neki kod da sistem ne zabelezi ocenu 0 nasa sam jedan fajl ne znam da li je dovoljno samo njega editovati: vote_add.php ima sledeci kod: Code: <?include("../admin/function/db.php");?> <?include("JsHttpRequest.php");?> <? $JsHttpRequest =& new JsHttpRequest($mtg); $sql="select ip,id from voteitems where ip='".result($_SERVER["REMOTE_ADDR"])."' and id=".(int)$_GET["id_parent"]; $ds->open($sql); if($ds->eof) { $sql="insert into voteitems (id,ip,vote) values (".(int)$_GET["id_parent"].",'".result($_SERVER["REMOTE_ADDR"])."',".(int)$_REQUEST["vote"].")"; $ds->open($sql); } $item_rating=0.00; $item_count=0; $sql="select sum(vote) as sum_vote,count(ip) as count_user from voteitems where id=".(int)$_GET["id_parent"]; $dr->open($sql); if(!$dr->eof) { if($dr->row["count_user"]!=0) { $item_rating=$dr->row["sum_vote"]/$dr->row["count_user"]; $item_count=$dr->row["count_user"]; $sql="update photos set rating=".$item_rating." where id_parent=".(int)$_GET["id_parent"]; $db->execute($sql); $sql="update videos set rating=".$item_rating." where id_parent=".(int)$_GET["id_parent"]; $db->execute($sql); $sql="update audio set rating=".$item_rating." where id_parent=".(int)$_GET["id_parent"]; $db->execute($sql); $sql="update vector set rating=".$item_rating." where id_parent=".(int)$_GET["id_parent"]; $db->execute($sql); } } $rating_text="<table border='0' cellpadding='1' cellspacing='0'><tr>"; for($j=1;$j<6;$j++) { $tt="2"; if($j<=$item_rating){$tt="1";} if($j>$item_rating and $j-$item_rating>0.25 and $j-$item_rating<0.75){$tt="3";} $rating_text.="<td><img src='".site_root."/".$site_template_url."images/rating".$tt.".gif' width='11' height='11' border='0'></td>"; } $rating_text.="</tr></table>"; echo($rating_text); ?> izmenio Nemanja: Kôd stavljajte u CODE tagove! [Ovu poruku je menjao Nemanja Avramović dana 03.09.2009. u 14:34 GMT+1] |