Author |
Topic |
Lon2
Junior Member
USA
151 Posts |
Posted - 05 November 2010 : 15:37:45
|
I searched first but I'm not sure if I'm using the correct terminology. I want to show some counts, like members, topics, etc on a different pages that are not the forum. Do I need to add server includes and what would I use to get totals? Thanks! |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 November 2010 : 03:19:13
|
Yes, you'll need to use includes. Depending on exactly what counts you desire, the SQL string(s) will be different.
I created a page with a variety of counts:
- Members
- Active (or moderated) topics
- Active (or moderated) topics within a specified forum
- Active (or moderated) replies
- Active members signed in
- Guests
- Active auction items
- Polls
- Quizzes
- Recipes
- Shared Photos
In lines 42-43, you will have to change the "(forumpath)" to reflect your actual forum path: using Snitz for example, you only need the forum/ portion following the ".com/" part of the URL.
Other than that mentioned above, you don't have to change any code to use these. All you need is to create the output where you want them displayed. Samples are provided.
|
Edited by - Carefree on 06 November 2010 13:52:29 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 November 2010 : 13:44:54
|
See above. |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 06 November 2010 : 16:32:39
|
Does anyone have a simple script for this? |
Edited by - Lon2 on 06 November 2010 17:03:37 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 November 2010 : 16:33:03
|
|
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 06 November 2010 : 16:44:29
|
I appologize but I'm somewhat of a newbie. I am able to get your suggestion to work on a page all by itself with just one forum ID count but not on an HTML page with head and body tags. I would like to put a forum name with quantities on another page. For example: "Our Animal forum currently has X Topics" I'm not sure how to do this.
Would I create the script above for every Forum ID I want to get counts for or is there a way to call out individual forum counts without reusing the script for every forum ID?
I appreciate your help on this! |
Edited by - Lon2 on 06 November 2010 18:06:19 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 November 2010 : 18:45:21
|
That last script was specifically for the group of forums you had mentioned (1-3). If you want to get a variety, you'd be better off using the method I posted in my first reply. Then it would be as simple as "Call TopicsInForum(Forum_ID)", followed with Response.Write intForumTopics . I'll make you a sample web page with this included so you can see how it's done. |
Edited by - Carefree on 06 November 2010 18:46:24 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 06 November 2010 : 19:09:42
|
For clarification, I would like to show individual counts for each forum. For example:
Animals - 56 Topics Mammals - 37 Topics Reptiles - 9 Topics
Not the 3 combined.
I appreciate your patience with me! |
Edited by - Lon2 on 06 November 2010 19:10:40 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 November 2010 : 19:12:01
|
Here you go: html version. I left the routine to get members because you mentioned that earlier. Notice the lines 20-21
intForumID=1
Call TopicsInForum(intForumID)
That's how you can retrieve information for different forums on demand. Copy those two lines where you want the output, and just change the forum number to the forum you want shown.
For example, to get output for forums 1 & 2, change lines 20-21 to say:
intForumID=1
Call TopicsInForum(intForumID)
intForumID=2
Call TopicsInForum(intForumID)
Example output:quote: Our "Welcome" forum currently has 8 topics. Our "Snitz Modifications" forum currently has 476 topics.
|
Edited by - Carefree on 09 November 2010 21:30:17 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 07 November 2010 : 13:31:26
|
Thanks again Carefree. I get the following error:
Microsoft VBScript compilation error '800a0411'
Name redefined
/topic_totals/test.asp, line 10
dim intMembers, intTopics, intForumID, strForumTitle ---------------------------------------^
Update: I got it to work by removing strForumTitle from the dim statement but I'm not sure if that's the correct thing to do.
This just doesn't seem right. So I have to repeat the entire routine (everything you have in the body, between these <& &> tags), with server includes, every place on the page that I want totals to be? |
Edited by - Lon2 on 07 November 2010 14:50:29 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 09 November 2010 : 16:45:03
|
Does anyone have an easy way to do this? |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 09 November 2010 : 18:29:07
|
quote: Originally posted by Lon2
Thanks again Carefree. I get the following error:
Microsoft VBScript compilation error '800a0411'
Name redefined
/topic_totals/test.asp, line 10
dim intMembers, intTopics, intForumID, strForumTitle ---------------------------------------^
Update: I got it to work by removing strForumTitle from the dim statement but I'm not sure if that's the correct thing to do.
This just doesn't seem right. So I have to repeat the entire routine (everything you have in the body, between these <& &> tags), with server includes, every place on the page that I want totals to be?
No. That is NOT what I said. Go back and read my reply. You only need to copy 3 2 lines of code for each location you want information. I modified it to make it even simpler for you. If that won't do it, I give up. Someone else can try. |
Edited by - Carefree on 09 November 2010 21:32:18 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 10 November 2010 : 05:17:01
|
Try what, Craig, a contest to do what you generously have done in less lines?! You're too generous with your time, if you ask me. This thread also shows how unappreciated that can be. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 10 November 2010 : 07:47:57
|
I'm just waiting to die, Ruirib. I don't have anything better to do with my time, but don't know what more I could try to help this guy. |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 10 November 2010 : 11:16:09
|
quote: Originally posted by ruirib
Is this a hard way? How easier can it get than this?
quote: Originally posted by ruirib
Try what, Craig, a contest to do what you generously have done in less lines?! You're too generous with your time, if you ask me. This thread also shows how unappreciated that can be.
Perfect examples of why Snitz forums has failed to be a leader in forums apps. Amazing comments from a person that we have paid hundreds of dollars to in the past for help with our forums. And you say I am unappreciative!? |
|
|
Topic |
|