SimplePortal

Support => International Support => Topic started by: Devil jimmy on January 19, 2011, 05:04:09 PM

Title: problem with code/ probleem met code
Post by: Devil jimmy on January 19, 2011, 05:04:09 PM
I have a code for a donation block
The intention is
appear in the middle block the last 10 donors marquee

ik heb een probleem met een code voor een donatie block
de bedoeling is dus een blok in het portaal waar de laatste 10 donateurs in voorkomen bewegend

Example/voorbeeld
:+:+:+ Bedankt aan jimmy - Dirk  - Ronny  - Christine  - Arthon  - Rowina   voor hun donatie:+:+:+

I tried to put on the avatar but this does not work
The block is okay
but I get an error message in the error log

ik probeerde de avatar er bij te plaatsen maar dit lukte niet
het blok zelf ziet er goed uit
maar krijg deze foutmelding in het foutenlog

8: Undefined variable: n
     Line: 17
     Line: 15

This is the code I use
dit is de code die ik gebruik


Code: [Select]
<?php

$limit 
10;   // Amount of donors to retrieve.  (default: last 10)

$sql "
   SELECT *
   FROM `smf_treas_donations`
   ORDER BY `smf_treas_donations`.`id` DESC
   LIMIT 0 , 
$limit";
$result mysql_query($sql);

echo 
"<marquee> :+:+:+: Bedankt aan ";

while (
$row mysql_fetch_assoc($result)) {
   if (
$n $limit 1) {
      echo 
"<font color='#FF0000'>" $row['custom'] . "</font> - ";
      
$n++;
   } else {
      echo 
"<font color='#FF0000'>" $row['custom'] . "</font>";
   }
}

echo 
" voor hun Donatie. :+:+:+:</marquee>";

?>

it is possible that someone could even see what is wrong with the code
and if it is possible to add the avatars but not a requirement
I've been happy if the error is resolved
sorry for bad english

is het mogelijk dat er eens iemand naar de code kijkt wat er mis is
en als het mogelijk is om de avatar erbij te krijgen
is wel geen vereiste
ik ben al blij als ik die foutmelding weg krijg


There is no present Dutch support therefore also in English
but apparently I can not open a new topic in English support?

er is geen nederlandse support aanwezig daarom ook in het engels
maar blijkbaar kan ik daar geen nieuw topic openen ?
Title: Re: problem with code/ probleem met code
Post by: AngelinaBelle on January 20, 2011, 10:16:23 AM
This is not a simpleportal error, or even an SMF error.
It is a simple coding error.  You want to know if $n is less than some number, but you didn't say what $n was.
Code: [Select]
if $n< $limit-1
Perhaps you want
Code: [Select]
$n = 0
while .........
Title: Re: problem with code/ probleem met code
Post by: Devil jimmy on March 13, 2011, 04:35:23 PM
solved
SimplePortal 2.3.8 © 2008-2024, SimplePortal