Tarih: 2007-06-25, 12:58:32 Mesaj konusu: Haberler modulunde hata var
slm arkadaşlar bir problemim var
anasayfamda alttaki hata görüntüleniyor..
Warning: Division by zero in /home/camsihn/public_html/modules/haberler/index.php on line 224
indexdeki kodlarım yardımcı olur belki
Kod:
<?php
/************************************************************************/
/* POWERNUKE CMS DIAMOND: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2005 - 2006 by ibrahim Halil */
/* http://www.phpturk.de */
/* webmaster@phpturk.de */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if ( !defined('MODULE_FILE') )
{
die("You can't access this file directly...");
}
function theindex($new_topic="0") {
global $db, $storyhome, $topicname, $topicimage, $topictext, $datetime, $user, $c o o k i e, $nukeurl, $prefix, $multilingual, $currentlang, $articlecomm, $sitename, $user_news, $userinfo, $activate_ads, $first_ad, $next_ads, $max_ads, $random_ads, $hide_ads, $pagenum;
if (is_user($user)) { getusrinfo($user); }
if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
include("header.php");
automated_news();
if (isset($new_topic)) {
$new_topic = intval($new_topic);
} else {
$new_topic == 0;
}
if (isset($userinfo['setstorynum']) AND $user_news == 1) {
$storynum = $userinfo['setstorynum'];
} else {
$storynum = $storyhome;
}
if ($new_topic == 0) {
$qdb = "WHERE (ihome='0' OR catid='0')";
$home_msg = "";
} else {
$qdb = "WHERE topic='$new_topic'";
$result_a = $db->sql_query("SELECT topictext FROM ".$prefix."_topics WHERE topicid='$new_topic'");
$row_a = $db->sql_fetchrow($result_a);
$numrows_a = $db->sql_numrows($result_a);
$topic_title = stripslashes(check_html($row_a['topictext'], "nohtml"));
OpenTable();
if ($numrows_a == 0) {
echo "<center><font class=\"title\">$sitename</font><br><br>"._NOINFO4TOPIC."<br><br>[ <a href=\"modules.php?name=News\">"._GOTONEWSINDEX."</a> | <a href=\"modules.php?name=Topics\">"._SELECTNEWTOPIC."</a> ]</center>";
} else {
echo "<center><font class=\"title\">$sitename: $topic_title</font><br><br>"
."<form action=\"modules.php?name=Search\" method=\"post\">"
."<input type=\"hidden\" name=\"topic\" value=\"$new_topic\">"
.""._SEARCHONTOPIC.": <input type=\"name\" name=\"query\" size=\"30\"> "
."<input type=\"submit\" value=\""._SEARCH."\">"
."</form>"
."[ <a href=\"index.php\">"._GOTOHOME."</a> | <a href=\"modules.php?name=Topics\">"._SELECTNEWTOPIC."</a> ]</center>";
}
CloseTable();
echo "<br>";
}
######################################################
# PAGENUMMBERS By PowerTurk.De
######################################################
if ($pagenum == "") { $pagenum = 1 ; }
$offset = ($pagenum-1) * $storynum ;
######################################################
# PAGENUMMBERS By PowerTurk.De
######################################################
$result = $db->sql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories $qdb $querylang ORDER BY sid DESC limit $offset, $storynum");
######################################################
# HABER ARASI REKLAM By PowerTurk.De
######################################################
if ($random_ads == 1) {
# v1.5
$result2 = sql_query("select * from ".$prefix."_ads where (ad_expire > now() or ad_expire is null or ad_expire='0000-00-00') ", $dbi);
$numrows = sql_num_rows($result2, $dbi);
if ($numrows>1) {
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$startrow = mt_rand(0, $numrows);
if ($startrow > ($numrows - $max_ads + 1) and $max_ads > 1){
# if startrow is greater than number of rows minus number of ads being displayed plus 1,
# then we wouldn't end up displaying all the requested ads,
# so then make startrow=1.
#
# this will fix ads not being displayed if we started with too high a row number to fetch enough ads.
# the only problem is you'll never have the last records displayed first if there aren't enough subsequent ads
# in the sql_query,
# also the first record will have a higher weight than the rest.
# this wouldn't be a problem if 'order by rand()' actually worked in the select statement.
# this is an improvement over 'order by rand()' but is still not truely random.
# so look for a future release to make this truely random.
$startrow=1;
}
} else {
$startrow = 0;
}
# v1.4
#$result2 = sql_query("select ad_name, ad_order, ad_text, ad_image, ad_link, ad_border, ad_hover, ad_statusbar, ad_width, ad_height from ".$prefix."_ads order by rand()", $dbi);
# v1.5
#$result2 = sql_query("select ad_name, ad_order, ad_text, ad_image, ad_link, ad_border, ad_hover, ad_statusbar, ad_width, ad_height, ad_expire from ".$prefix."_ads where (ad_expire > now() or ad_expire is null or ad_expire='0000-00-00') order by rand()", $dbi);
$result2 = sql_query("select ad_name, ad_order, ad_text, ad_image, ad_link, ad_border, ad_hover, ad_statusbar, ad_width, ad_height, ad_expire from ".$prefix."_ads where (ad_expire > now() or ad_expire is null or ad_expire='0000-00-00') limit $startrow,-1", $dbi);
} else {
# v1.4
#$result2 = sql_query("select ad_name, ad_order, ad_text, ad_image, ad_link, ad_border, ad_hover, ad_statusbar, ad_width, ad_height from ".$prefix."_ads order by ad_order", $dbi);
$result2 = sql_query("select ad_name, ad_order, ad_text, ad_image, ad_link, ad_border, ad_hover, ad_statusbar, ad_width, ad_height, ad_expire from ".$prefix."_ads where (ad_expire > now() or ad_expire is null or ad_expire='0000-00-00') order by ad_order", $dbi);
}
$num_ads = 0 ;
$storycount = 0 ;
###########################################################
# HABER ARASI REKLAM BITIMI By PowerTurk.De
###########################################################
function rate_article($sid, $score) {
global $prefix, $db, $ratec o o k i e, $sitename, $r_options;
$score = intval($score);
$sid = intval($sid);
if ($score) {
if ($score > 5) { $score = 5; }
if ($score < 1) { $score = 1; }
if ($score != 1 AND $score != 2 AND $score != 3 AND $score != 4 AND $score != 5) {
Header("Location: index.php");
die();
}
if (isset($ratec o o k i e)) {
$rc o o k i e = base64_decode($ratec o o k i e);
$rc o o k i e = addslashes($rc o o k i e);
$r_c o o k i e = explode(":", $rc o o k i e);
}
for ($i=0; $i < sizeof($r_c o o k i e); $i++) {
if ($r_c o o k i e[$i] == $sid) {
$a = 1;
}
}
if ($a == 1) {
Header("Location: modules.php?name=News&op=rate_complete&sid=$sid&rated=1");
} else {
$result = $db->sql_query("update ".$prefix."_stories set score=score+$score, ratings=ratings+1 where sid='$sid'");
$info = base64_encode("$rc o o k i e$sid:");
setc o o k i e("ratec o o k i e","$info",time()+3600);
update_points(7);
Header("Location: modules.php?name=News&op=rate_complete&sid=$sid$r_options");
}
} else {
include("header.php");
title("$sitename: "._ARTICLERATING."");
OpenTable();
echo "<center>"._DIDNTRATE."<br><br>"
.""._GOBACK."</center>";
CloseTable();
include("footer.php");
}
}
function rate_complete($sid, $rated=0) {
global $sitename, $user, $c o o k i e, $userinfo;
$r_options = "";
if (is_user($user)) {
getusrinfo($user);
if (isset($userinfo['umode'])) { $r_options .= "&mode=".$userinfo['umode']; }
if (isset($userinfo['uorder'])) { $r_options .= "&order=".$userinfo['uorder']; }
if (isset($userinfo['thold'])) { $r_options .= "&thold=".$userinfo['thold']; }
}
include("header.php");
title("$sitename: "._ARTICLERATING."");
OpenTable();
if ($rated == 0) {
echo "<center>"._THANKSVOTEARTICLE."<br><br>"
."[ <a href=\"modules.php?name=News&file=article&sid=$sid$r_options\">"._BACKTOARTICLEPAGE."</a> ]</center>";
} elseif ($rated == 1) {
echo "<center>"._ALREADYVOTEDARTICLE."<br><br>"
."[ <a href=\"modules.php?name=News&file=article&sid=$sid$r_options\">"._BACKTOARTICLEPAGE."</a> ]</center>";
}
CloseTable();
include("footer.php");
}
if (!(isset($new_topic))) { $new_topic = 0; }
switch ($op) {
default:
theindex($new_topic);
break;
case "rate_article":
rate_article($sid, $score);
break;
case "rate_complete":
rate_complete($sid, $rated);
break;
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız