Hallo, ich benutze das Spreadshop Modul was auch bis jetzt einwandfrei funktioniert nur leider funktioniert der dazugehörige Block leider nicht, der die Artikel als teaser z.b. auf der Startseite anzeigen soll.
Wenn ich den Block aktiviere steht da nur:
please import your data
So sieht der Original Block aus:
<?php
if (eregi("block-Spreadshop.php", $GLOBALS['PHP_SELF'])) {
Header("Location: index.php");
die('no direct access to this file.');
}
global $prefix, $dbi;
// get config vars from db
$query = 'SELECT * FROM ' . $prefix . '_spreadshop_conf';
$result = sql_query($query, $dbi);
if ($result) {
while(list($varname,$param) = sql_fetch_row($result,$this->dbi)) {
${$varname} = $param;
}
// get articles from db
$query = 'SELECT * FROM ' . $prefix . '_spreadshop_articles';
$result = sql_query($query, $dbi);
while($row = sql_fetch_array($result, $dbi)) {
$articles[] = $row;
}
}
// enough articles for view type?
if ((count($articles) > 0 && $articleblocktype == 'single') || (count($articles) > 3 && $articleblocktype == 'quartett')) {
// add html table opener if view is quartett
if ($articleblocktype == 'quartett') {
$content.= '<table cellpadding="3" cellspacign="0" border="0" align="center"><tr>';
}
// is random view == false ?
if ($articlerandom == 0) {
$end = $articleblocktype == 'single' ? 0 : 3;
for ($i=0;$i<=$end;$i++) {
if ($articleblocktype == 'quartett') {
$content.= '<td align="center">';
}
// define alt-tag
$alt = $articles[$i]['name'] ? $articles[$i]['name'].' ' : $articles[$i]['producttype_name'].' ';
$alt.= $articles[$i]['description'] != 'leer' && '' ? $articles[$i]['description'].' ' : '';
$alt.= $articles[$i]['price'];
$link = 'http://www.spreadshirt.de/shop.php?sid='. $articles[$i]['shop_id'] . '&article_id='.$articles[$i]['article_id'];
$content.= '<a href="'.$link.'" target="_blank"><img src="http://www.spreadshirt.de/'.$articles[$i]['picurl'].'" alt="'.$alt.'" border="0" />';
if ($articleblocktype == 'quartett') {
$content.= '</td>';
if($i == 1) $content.= '</tr><tr>';
}
}
/// is random view == true ?
} else {
// make random keys
$num_req = $articleblocktype == 'single' ? 1 : 4;
srand ((float) microtime() * 10000000);
$rand_keys = array_rand($articles, $num_req);
// fix var type if num_req = 1
if(!is_array($rand_keys)) $rand_keys = array(0 => $rand_keys);
// print articles
$i = 1;
foreach ($rand_keys as $key => $value) {
if ($articleblocktype == 'quartett') {
$content.= '<td align="center">';
}
// define alt-tag
$alt = $articles[$value]['articlename'] ? $articles[$value]['articlename'].' ' : $articles[$value]['producttype_name'].' ';
$alt.= $articles[$value]['description'] != 'leer' && '' ? $articles[$value]['description'].' ' : '';
$alt.= $articles[$value]['price'];
$link = 'http://www.spreadshirt.de/shop.php?sid='. $articles[$value]['shop_id'] . '&article_id='.$articles[$value]['article_id'];
$content.= '<a href="'.$link.'" target="_blank"><img src="http://www.spreadshirt.de/'.$articles[$value]['picurl'].'" alt="'.$alt.'" border="0" />';
if ($articleblocktype == 'quartett') {
$content.= '</td>';
if($i == 2) $content.= '</tr><tr>';
}
$i++;
}
}
// add html table end if blocktype ist quartett
if ($articleblocktype == 'quartett') {
$content.= '</tr></table>';
}
} else {
$content.= 'Please import Your data.';
}
?>
Habe bei meinem Block die Variable $this durch $spshop_this ersetzt wegen PHP5, das musste ich auch im Modul sebst machen damit der Shop läuft(nur zur Info).
kann mir bitte jemand sagen wie ich den Block zum laufen bekommen?
MfG
Hallo
ZitatExitieren die Datenbanktabellen
_spreadshop_articles
_spreadshop_conf
Ja es sind beide Tabellen Vorhanden.
Leider seh ich nur in PHPmyAdmin, daß die Tabellen angelegt sind, und die jeweiligen Felder.
Der Shop an sich funktioniert ja also glaub ich das die Artikel in der Artikeldatenbank vorhanden sind.
Beim Debug-Mode und SQL-Fehler kommt folgendes im Block:
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: spshop_this in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Trying to get property of non-object in /home/www/web35/html/blocks/block-spreadshop.php on line 21
Notice: Undefined variable: articles in /home/www/web35/html/blocks/block-spreadshop.php on line 34
Notice: Undefined variable: articles in /home/www/web35/html/blocks/block-spreadshop.php on line 34
Please import Your data
MfG
EDIT: Leider funktioniert unter Artikelblock bearbeiten der Button Artikeldaten speichern und Artikeldaten aktualisieren auch nicht, nach betätigen einer der Buttons läd er mir eine php datei herunter die admin.php heisst , und leer ist.
Diese Zeile
Zitatwhile(list($varname,$param) = sql_fetch_row($result,$this->dbi)) {
so ändern
Zitatwhile(list($varname,$param) = sql_fetch_row($result,$dbi)) {
Wenn es dann immer noch nicht geht, musst Du in die Artikeldatenbank schauen, ob dort Artikel enthalten sind. Ich denke die Tabelle ist leer (kann man aber mit phpMyAdmin reinsehen, wenn etwas drinne ist)
MfG