webForumDet fria alternativet

Kolla nya pm och gb-inlägg

ASP

6 svar · 291 visningar · startad av WebbisNet

Medlem sedan feb. 20032 027 inlägg
Frågan#1

Får inte den här funktionen att funka riktigt. Har man fått mail och pm så funkar den, men nya medlemmar som inte fått nåt får istället felmeddelande

<%if not newMail("mAntal") = 0 then
response.write ""
end if%>

<%if not newGB("gbAntal") = 0 then
response.write ""
end if%>

<%If newMail("mAntal") = 1 Then%><img title=" Du har <%=newMail("mAntal")%> oläst pm" src="/images/icons/newMail.gif">
<%Else%><img title=" Du har <%=newMail("mAntal")%> olästa pm" src="/images/icons/newMail.gif">
<%End If%>

<%If newGB("gbAntal") = 1 Then%><img title=" Du har <%=newGB("gbAntal")%> oläst gb-inlägg" src="/images/icons/newGB.gif">
<%Else%><img title=" Du har <%=newGB("gbAntal")%> olästa gb-inlägg" src="/images/icons/newGB.gif">
<%End If%>
Medlem sedan okt. 20005 273 inlägg
#2

Felmedelande??

mv icaaq

Medlem sedan feb. 20032 027 inlägg
#3

icaaq skrev:

Felmedelande??

mv icaaq

error '80020009' 
/mail/newMail.asp, line 17

Rad 17 är <%if not newMail("mAntal") = 0 then

Medlem sedan okt. 20005 273 inlägg
#4
[red]
<%if newMail("mAntal") > 0 then
[/red]

kanske??

mv icaaq

/Red. Men då får du vända på det..... ser jag nu..

/REd 2. Du kan ju ta bort dina 2 första if satser om du kör med min ovanstående kod....

Medlem sedan okt. 20005 273 inlägg
#5

Det blev lite kladdigt det där. Så här menar jag.

[red]
<%If newMail("mAntal") > 0 Then%><img title=" Du har <%=newMail("mAntal")%> oläst pm" src="/images/icons/newMail.gif">

<%If newGB("gbAntal") > 0 Then%><img title=" Du har <%=newGB("gbAntal")%> oläst gb-inlägg" src="/images/icons/newGB.gif">
[/red]

För som du hade nu så om besökaren hade 2 nya medelanden så fick han/hon inget medelande om det.

mv icaaq

/REd. Det är bra om man läst koden...... Nu ska det väl funka :OO

Medlem sedan feb. 20032 027 inlägg
#6

icaaq skrev:

[red]
<%if newMail("mAntal") > 0 then
[/red]

kanske??

mv icaaq

/Red. Men då får du vända på det..... ser jag nu..

/REd 2. Du kan ju ta bort dina 2 första if satser om du kör med min ovanstående kod....

error '80020009' 
/mail/newMail.asp, line 17

med

<%If newMail("mAntal") > 0 Then%><img title=" Du har <%=newMail("mAntal")%> oläst pm" src="/images/icons/newMail.gif">
<%Else%><img title=" Du har <%=newMail("mAntal")%> olästa pm" src="/images/icons/noMail.gif">
<%End If%>

<%If newGB("gbAntal") > 0 Then%><img title=" Du har <%=newMail("gbAntal")%> oläst pm" src="/images/icons/newGB.gif">
<%Else%><img title=" Du har <%=newGB("gbAntal")%> olästa gb-inlägg" src="/images/icons/noGB.gif">
<%End If%>
Medlem sedan feb. 20032 027 inlägg
#7

Löstes med en eof

<%if newMail.eof then
response.write ""
else%>

<%if not newMail("mAntal") = 0 then
response.write ""
end if%>

<%If newMail("mAntal") = 1 Then%><img title=" Du har <%=newMail("mAntal")%> oläst pm" src="/images/icons/newMail.gif">
<%Else%><img title=" Du har <%=newMail("mAntal")%> olästa pm" src="/images/icons/newMail.gif">
<%End If%>

<%if newGB.eof then
response.write ""
else%>
<%if not newGB("gbAntal") = 0 then
response.write ""
end if%>

<%If newGB("gbAntal") = 1 Then%><img title=" Du har <%=newGB("gbAntal")%> oläst gb-inlägg" src="/images/icons/newGB.gif">
<%Else%><img title=" Du har <%=newGB("gbAntal")%> olästa gb-inlägg" src="/images/icons/newGB.gif">
<%End If%>
262 ms totalt · 4 externa anrop · v20260731065814-full.1dc6f849
138 ms — deklarationer (db)
0 ms — hämta statistik (cache)
120 ms — hämta tråd, inlägg och bilagor (db)
138 ms — ändringar (db)