Hallo, Gast! (Registrieren)

Letzte Ankündigung: MyBB 1.8.37 veröffentlicht (04.11.23)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
Forenupdate -- Probleme mit Statit4
#1
@all

ich habe vor dem Forenupdate auf der Einstiegsseite meiner Homepage die aktuellen Forenthemen anzeigen lassen.

Dazu hatte ich auch den Counter von statit4 eingebaut.

Letztes Wochenende habe ich dann auf die neue Forensoftware MyBB 1.0 umgestellt.

Gestern wollte ich den Counter editieren und seit dem wird mir folgende Fehlermeldung angezeigt:

Zitat:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web466/html/peter38/statit4/visible_count_inc.php on line 21

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web466/html/peter38/statit4/visible_count_inc.php on line 23

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web466/html/peter38/statit4/visible_count_inc.php on line 42

Ich kann den Fehler nur abstellen, wenn ich den Verweis auf die aktuellen Forenthemen entferne. Das finde ich aber nicht so gut. Sad

Peter
Ein Tag ohne Lachen ist ein verlorener Tag Big Grin

http://www.motouren.de
#2
Bitte poste alle beteiligten Skripte (nach Möglichkeit als Attachments), da so niemand weiß, wo der Fehler sein könnte. Wink

Gruß,
Michael
[Bild: banner.png]
Support erfolgt NUR im Forum!
Bitte gelöste Themen als "erledigt" markieren.
Beiträge mit mangelhafter Rechtschreibung/Grammatik werden kommentarlos gelöscht.
#3
@Michael

hier die drei Skripte. Die Skripte 'Forenthemen' und 'Statistik' waren beide auf der Homepage-Einstiegseite eingebunden. Das dritte Skript liegt in einem anderen Verzeichnis.

Forenthemen]<?php
// Daten für Verbindung zur Datenbank
$dbhost = localhost";
$dbuser = "********";
$dbpassword = "******";
$dbdatabase = "********";

// Präfix
$prefix = "mybb_";

// URL zum Forum
$url = "http://www.p-meurer.de/forum/upload";

// Anzahl der Themen
$limit = "5";

// Verbindung zur Datenbank aufnehmen
$db = mysql_connect($dbhost,$dbuser,$dbpassword) or die ("Verbindung fehlgeschlagen");
mysql_select_db($dbdatabase,$db);

// Überschrift
echo "<strong>Neueste Forenthemen</strong><br />";

// Liste starten
echo "<ul>";

// Letzte Themen auslesen
$query = mysql_query ("SELECT subject,tid FROM ".$prefix."threads WHERE visible='1' ORDER BY tid DESC LIMIT 0,".$limit."");

while ($newest_threads = mysql_fetch_array($query))
{
echo "<li><a href=\"".$url."/showthread.php?tid=".$newest_threads['tid' schrieb:
."\" target=\"_self\">".$newest_threads['subject']."</a></li>";
}

// Liste schließen
echo "</ul>";
?>

Statistik schrieb:<?php
$statitpath = "../statit4/";
include_once($statitpath."visible_count_inc.php");
statit_show(1);
?>


visible_count_inc.php schrieb:<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<?php
include_once($statitpath."inc/mysql_connect.php");
include_once($statitpath."inc/functions.php");
function statit_show($st_id,$graphics = true,$output = "all",$outputtype = "h",$image_path = "../statit4/images/",$image_ext = ".png",$fontstyle = "font-family: Helvetica,Verdana; font-size: 12px; color: #000000; text-decoration:none",$counterlength = 6,$language = "german",$dateformat = "d.m.Y")
{
/* Parameter:
$st_id ID der Statistik
$graphics true,false (Ausgabe mit Grafiken oder als Text)
$output day -> Besucher Tag, all -> Gesamtbesucherzahl, both -> Besucher Tag und Gesamtbesucherzahl
$outputtype h -> horizontal, v - vertikal
$image_path bei $graphics true -> Pfad zu den Bildern (0-9)
$image_ext bei $graphics true -> Dateiendungen der Bilder
$fontstyle bei $graphics false -> CSS der Textausgabe
$counterlength Auffüllung der Ausgabe mit führenden Nullen bis Stellenlänge
$language Sprache (siehe Sprachdateien in language)
$dateformat Ausgabeformat des Datums (PHP Format)
*/
global $statit_mysql,$statitpath;
@include_once($statitpath."language/".$language.".php");
$RES_GLOBAL = mysql_query("SELECT * FROM statit_global",$statit_mysql);
$GLOBAL = mysql_fetch_array($RES_GLOBAL);
$RES_VISITSLOG = mysql_query("SELECT time FROM statit_logstarts WHERE st_id='$st_id' AND stat='visits'",$statit_mysql);
$VISITSLOG = mysql_fetch_array($RES_VISITSLOG);
if($output=="day" || $output=="both")
{
$time = time();
if($GLOBAL['timediffv']=="+") $time = $time + $GLOBAL['timediff'] * 3600;
elseif($GLOBAL['timediffv']=="-") $time = $time - $GLOBAL['timediff'] * 3600;
$day = date("j",$time);
$month = date("n",$time);
$year = date("Y",$time);
$RES_VISITSDAY = mysql_query("SELECT d$day FROM statit_visits WHERE month='$month' AND year='$year'",$statit_mysql);
$VISITSDAY = mysql_fetch_array($RES_VISITSDAY);
$sumday = $VISITSDAY["d$day"];
if($counterlength>8 && strlen($sumday)<=8) $counterlength = 8;
elseif(strlen($sumday) > $counterlength) $counterlength = strlen($sumday);
}
if($output=="all" || $output=="both")
{
$sum = 0;
$RES_VISITS = mysql_query("SELECT * FROM statit_visits WHERE st_id='$st_id' ORDER BY year,month DESC",$statit_mysql);
while($VISITS = mysql_fetch_array($RES_VISITS))
{
$anztage = date("t",mktime(1,1,1,$VISITS['month'],1,$VISITS['year']));
for ($i = 1; $i <= $anztage; $i++)
{
$akttag = "d".$i;
$sum += $VISITS[$akttag];
}
}
if($counterlength>8 && strlen($sum)<=8) $counterlength = 8;
elseif(strlen($sum) > $counterlength) $counterlength = strlen($sum);
}
if($graphics)
{
if($output=="day" || $output=="both")
{
echo "<a href=\"http://www.otterware.de\" target=\"_blank\" title=\"".$lang_script["heute"]."\">";
for ($st_i=0; $st_i < $counterlength-strlen($sumday); $st_i++) echo "<img src=\"".$image_path."0".$image_ext."\" border=\"0\" />";
for ($st_i=0; $st_i < strlen($sumday); $st_i++)
{
$st_actnum = substr($sumday,$st_i,1);
echo "<img src=\"".$image_path.$st_actnum.$image_ext."\" border=\"0\" />";
}
echo "</a>\n";
}
if($output=="both")
{
if($outputtype=="v") echo "<br />";
elseif($outputtype=="h") echo "&nbsp;&nbsp;";
}
if($output=="all" || $output=="both")
{
echo "<a href=\"http://www.otterware.de\" target=\"_blank\" title=\"".$lang_script["seit"]." ".date($dateformat,$VISITSLOG['time'])."\">";
for ($st_i=0; $st_i < $counterlength-strlen($sum); $st_i++) echo "<img src=\"".$image_path."0".$image_ext."\" border=\"0\" />";
for ($st_i=0; $st_i < strlen($sum); $st_i++)
{
$st_actnum = substr($sum,$st_i,1);
echo "<img src=\"".$image_path.$st_actnum.$image_ext."\" border=\"0\" />";
}
echo "</a>\n";
}
}else
{
echo "<style type=\"text/css\">\n.statit_count {\n".$fontstyle."\n}\n</style>\n";
if($output=="day" || $output=="both")
{
echo "<a href=\"http://www.otterware.de\" target=\"_blank\" class=\"statit_count\" title=\"".$lang_script["heute"]."\">";
for ($st_i=0; $st_i < $counterlength-strlen($sumday); $st_i++) echo 0;
echo $sumday."</a>\n";
}
if($output=="both")
{
if($outputtype=="v") echo "<br />";
elseif($outputtype=="h") echo "&nbsp;&nbsp;";
}
if($output=="all" || $output=="both")
{
echo "<a href=\"http://www.otterware.de\" target=\"_blank\" class=\"statit_count\" title=\"".$lang_script["seit"]." ".date($dateformat,$VISITSLOG['time'])."\">";
for ($st_i=0; $st_i < $counterlength-strlen($sum); $st_i++) echo 0;
echo $sum."</a>\n";
}
}
}
?>
Ein Tag ohne Lachen ist ein verlorener Tag Big Grin

http://www.motouren.de