Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Jak naprawić błąd: Warning: Division by zero in /home/..........
rafalsr
post
Post #1





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 6.07.2007

Ostrzeżenie: (0%)
-----


Witam,
mam taki maly problem. Na swojej stronie wgralem cutenews i jest niby wszystko ok, ale jak wchodze w komentrze to wyskakuje mi pod nimi taki blad:

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259

Warning: Division by zero in /home/rclens/domains/rclens.pl/public_html/cutenews/inc/functions.inc.php on line 259


Moja strona to www.rclens.pl, a oto link do tej strony z bledem: www.rclens.pl/index2.php?subaction=showcomments&id=1183842779&archive=&start_from=&ucat=&

Czekam na odp... niby ten blad nie uniemozliwa dodawania koentarzy, ale szpeci strony.

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 11)
domis86
post
Post #2





Grupa: Zarejestrowani
Postów: 255
Pomógł: 5
Dołączył: 20.03.2007
Skąd: Kraków

Ostrzeżenie: (30%)
XX---


oznacza on ze dzielisz przez zero
pokaz tamta linijke tu
Go to the top of the page
+Quote Post
rafalsr
post
Post #3





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 6.07.2007

Ostrzeżenie: (0%)
-----


jaka linijke? to jest system newsow wiec nie mam jak ci pokazac
Go to the top of the page
+Quote Post
domis86
post
Post #4





Grupa: Zarejestrowani
Postów: 255
Pomógł: 5
Dołączył: 20.03.2007
Skąd: Kraków

Ostrzeżenie: (30%)
XX---


masz kod zrodlowy wiec dawaj tu linijke blink.gif
Go to the top of the page
+Quote Post
rafalsr
post
Post #5





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 6.07.2007

Ostrzeżenie: (0%)
-----


to jest kod z pliku index2.php:

<body topmargin="0" bottommargin="0">
<?php include('top.php') ?>
<!--MENU I ZAWARTOSC-->
<tr>

<td width="685" valign="top" bgcolor="#ffffff"><div align="top">
<table width="680">
<tr><td width="330" valign="top"><Img src="gfx/bilbord.png"><BR><BR><Img src="gfx/pasek.png"><BR><?PHP
include("cutenews/show_news.php");
?>
<BR><BR><Img src="gfx/pasek.png"><BR><BR>
<Img src="gfx/archiwum.png"><BR>
<font style="FONT-SIZE: 11px; FONT-FAMILY: verdana"; font color="#000000">
<?php
/**************************************************
* Last news for PSNews *
* -------------------------- *
* author: tiraeth *
* date: 09:10 2005-08-09 *
* version: 0.2-RC *
* email: tiraeth_php [at] o2 [dot] pl *
* *
* ---- *
* PSNews is © by IMPS.pl (Przybek) *
* *
**************************************************/
$PathToNews = "news"; // Nazwa katalogu z PSnews'em
$IndexPath = "index2.php?"; // Nazwa pliku w którym includujemy newsy
$I = 30; // Liczba newsów do wy&para;wietlenia

$file = file($PathToNews."/news.txt");
$file = array_reverse($file);

for($i=12; $i<$I; $i++)
{
$Dane = explode("||", $file[$i]);
$Data = date("d.m.Y H:i", $Dane[3]);
$Tytul = $Dane[1];
$Numer = $Dane[0];
if(file_exists($PathToNews.'/komentarze/'.$Numer))
{
$komfile = file($PathToNews.'/komentarze/'.$Numer);
$ilekomentarzy = count($komfile);
}
else
{
$ilekomentarzy = 0;
}
echo $Data.' <a href="'.$IndexPath.'function=show_all&no='.$Numer.'"><b><font color="#000000">&raquo;</font></b>&nbsp;<font color="#000000"><B>'.$Tytul.'</B></font></a> <font color="#000000">['.$ilekomentarzy.']</font>';
echo '<br />';
}
?></font><BR><BR><Img src="gfx/pasek.png"><BR><BR>
</td>
<td width="20"></td>


<td width="330" valign="top"><Img src="gfx/aktualnosci.png"><BR><Img src="gfx/pasek.png"><BR><?
$newspath = "news";
include("$newspath/show.php");
?>
</td></TR>
</table>


<center><font color="#000000"><small>Redakcja RCLens.pl nie ponosi odpowiedzialności za komentarze użytkowników.<BR>Powered by CuteNews & PS News</small></font></center>


</td>

<td width="184" valign="top" bgcolor="#ffffff"> <?php include('menu2.php') ?></td>
<td width="131" valign="top" bgcolor="#ffffff"> <?php include('menu1.php') ?></td>




</tr>
</td>

<?php include('stopka.php') ?>
Go to the top of the page
+Quote Post
domis86
post
Post #6





Grupa: Zarejestrowani
Postów: 255
Pomógł: 5
Dołączył: 20.03.2007
Skąd: Kraków

Ostrzeżenie: (30%)
XX---


to nie dotyczy tego bledu
pisze ci w komunikacie wyraznie ze to plik:
/cutenews/inc/functions.inc.php
także daj 259-tą linijke z tego pliku snitch.gif
Go to the top of the page
+Quote Post
rafalsr
post
Post #7





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 6.07.2007

Ostrzeżenie: (0%)
-----


to jest kod zrodlowy z index2.php, wiec nie wiem czy o to chodzilo... jezeli chodzi o system newsow to nie wiem skad wziac ten kod
Go to the top of the page
+Quote Post
domis86
post
Post #8





Grupa: Zarejestrowani
Postów: 255
Pomógł: 5
Dołączył: 20.03.2007
Skąd: Kraków

Ostrzeżenie: (30%)
XX---


jak to skad? jest na Twoim serwerze ...............
Go to the top of the page
+Quote Post
rafalsr
post
Post #9





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 6.07.2007

Ostrzeżenie: (0%)
-----


if($i%$break_location == 0 and $break_location)




a dokladnie:


////////////////////////////////////////////////////////
// Function: insertSmilies
// Description: insert smilies for adding into news/comments

function insertSmilies($insert_location, $break_location = FALSE)
{
global $config_http_script_dir, $config_smilies;

$smilies = explode(",", $config_smilies);
foreach($smilies as $smile)
{
$i++; $smile = trim($smile);

$output .= "<a href=\"java script:insertext(':$smile:','$insert_location')\"><img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" /></a>";
if($i%$break_location == 0 and $break_location) {
$output .= "<br />";
}else{ $output .= "&nbsp;"; }
}
return $output;
}
Go to the top of the page
+Quote Post
domis86
post
Post #10





Grupa: Zarejestrowani
Postów: 255
Pomógł: 5
Dołączył: 20.03.2007
Skąd: Kraków

Ostrzeżenie: (30%)
XX---


% - to jest dzielenie modulo
$a % $b <- $b nie moze byc 0

takze przed tą linijką:
if($i%$break_location == 0 and $break_location) {

dodaj taką linijke:
if($break_location != 0 and $break_location!=FALSE)


EDIT: bez klamry smile.gif

Ten post edytował domis86 8.07.2007, 21:10:02
Go to the top of the page
+Quote Post
rafalsr
post
Post #11





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 6.07.2007

Ostrzeżenie: (0%)
-----


dzialaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!

DZIEKI WIELKIE!!
Go to the top of the page
+Quote Post
domis86
post
Post #12





Grupa: Zarejestrowani
Postów: 255
Pomógł: 5
Dołączył: 20.03.2007
Skąd: Kraków

Ostrzeżenie: (30%)
XX---


nastepnym razem czytaj komunikaty o bledach, a nie rzucaj od razu na forum blink.gif
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 07:14