Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 variables for posts, topics, users
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

kozmos1
Starting Member

3 Posts

Posted - 07 July 2002 :  06:23:44  Show Profile
I am working on an asp page which should display the following:

There are X posts in X topics. We have X members.

I want the generated html code of this asp page to contain only the above line and nothing else (not <html> etc, just the words above).

Now, the closest I got is the following code:

<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top_short.asp" -->

<%


'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "TOTALS.P_COUNT, " &_
strTablePrefix & "TOTALS.T_COUNT, " &_
strTablePrefix & "TOTALS.U_COUNT " &_
" FROM " & strTablePrefix & "TOTALS"

Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open strSql, my_Conn

Users = rs1("U_COUNT")
Topics = rs1("T_COUNT")
Posts = rs1("P_COUNT")

rs1.Close
set rs1 = nothing

Response.Write(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.) %>

Unfortunately the html code it generates does not include only the statement I want, but also some other tags. Can someone help me to produce the asp code which will do what I want? Please excuse my ignorance.

Thanks!
Simon


DoraMoon
Average Member

Taiwan
661 Posts

Posted - 07 July 2002 :  07:00:01  Show Profile
quote:

Response.Write(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.) %>


i think there are some syntax error .. try this..
(add the two small " quote symbol .... )

Response.Write "(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.)" %>




~~ ¡¹ ¡¸ ¡¸¡¹ ¡¸ ¡¹ ~~
Go to Top of Page

kozmos1
Starting Member

3 Posts

Posted - 07 July 2002 :  07:06:46  Show Profile
quote:

[quote]
Response.Write(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.) %>


i think there are some syntax error .. try this..
(add the two small " quote symbol .... )

Response.Write "(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.)" %>

Thanks, I missed the quotes out, but that's not the problem... Any solutions, anybody?

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 07 July 2002 :  07:30:40  Show Profile  Send ruirib a Yahoo! Message
No need to include inc_top_short.asp and inc_functions.asp there.

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 07 July 2002 :  18:40:43  Show Profile
Kozmos1,

Here is your full code:

<!--#INCLUDE FILE="config.asp" -->

<%

strArchiveTablePrefix = strTablePrefix & "A_"

set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString



'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "TOTALS.P_COUNT, " &_
strTablePrefix & "TOTALS.T_COUNT, " &_
strTablePrefix & "TOTALS.U_COUNT " &_
" FROM " & strTablePrefix & "TOTALS"

Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open strSql, my_Conn

Users = rs1("U_COUNT")
Topics = rs1("T_COUNT")
Posts = rs1("P_COUNT")

rs1.Close
set rs1 = nothing

Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>There are " & Posts & " messages in " & Topics & " topics. We have " & Users & " users.</font>"
%>


I have found that this works with bringing only the things you wanted. The code in red was missing, and the code in green has been altered a little bit. All I know is that it works.

Happy playing..

Regards,

Webmaster @ Classic Motorycling Australia
Classic Motorcycling Australia
Go to Top of Page

kozmos1
Starting Member

3 Posts

Posted - 08 July 2002 :  13:50:07  Show Profile
thanks a lot folks!

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07