Post count

Messages from the admins

Moderator: Moderators

User avatar
otseng
Savant
Posts: 20566
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 337 times
Contact:

Post count

Post #1

Post by otseng »

Now that we have the token system, I've changed it so that any post (except to the test subforum) will increment your post count.

Here is how the post ranking is set up:
Newbie - 0 posts
Student - 10 posts
Apprentice - 100 posts
Scholar - 250 posts
Sage - 500 posts
Guru - 1000 posts
Prodigy - 2500 posts
Savant - 5000 posts
Last edited by otseng on Wed Apr 04, 2007 12:32 pm, edited 4 times in total.

User avatar
otseng
Savant
Posts: 20566
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 337 times
Contact:

Post #21

Post by otseng »

Here is a screenshot of what I see:
http://debatingchristianity.com/forum/i ... _count.png

User avatar
Vladd44
Sage
Posts: 571
Joined: Mon Jan 03, 2005 10:58 am
Location: Climbing out of your Moms bedroom window.
Contact:

Post #22

Post by Vladd44 »

And this is what I am seeing

Image
When I was a child, I spake as a child, I understood as a child, I thought as a child: but when I became a man, I put away childish things.[GOD] ‑ 1 Cor 13:11
WinMX, BitTorrent and other p2p issues go to http://vladd44.com

User avatar
McCulloch
Site Supporter
Posts: 24063
Joined: Mon May 02, 2005 9:10 pm
Location: Toronto, ON, CA
Been thanked: 3 times

Post #23

Post by McCulloch »

As a developer, I hate it when users complain about a problem that I cannot recreate. I know that they experience the problem (usually) but I cannot go about trying to fix a problem that I cannot get a handle on. Could it have something to do with the international settings in the affected user's profiles?
Examine everything carefully; hold fast to that which is good.
First Epistle to the Church of the Thessalonians
The truth will make you free.
Gospel of John

User avatar
otseng
Savant
Posts: 20566
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 337 times
Contact:

Post #24

Post by otseng »

Well, I found the sql code to generate the data:

Code: Select all

SELECT DISTINCT u.*, &#40;CASE WHEN i.buddy_ignore = 0 THEN 1 ELSE 0 END&#41; AS user_my_friend_virt, i.buddy_visible AS user_my_visible_virt, &#40;CASE WHEN i.buddy_ignore = 1 THEN 1 ELSE 0 END&#41; AS user_my_ignore_virt, &#40;CASE WHEN b.buddy_ignore = 0 THEN 1 ELSE 0 END&#41; AS user_friend_virt, b.buddy_visible AS user_visible_virt, &#40;CASE WHEN b.buddy_ignore = 1 THEN 1 ELSE 0 END&#41; AS user_ignore_virt, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 0 <> 0 OR 0 <> 1 &#41; AND &#40; b.buddy_visible = 1 OR &#40; u.user_allow_viewonline = 1 OR &#40;0 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_allow_viewonline = 2 OR &#40;0 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN &#40;CASE WHEN u.user_session_time >= &#40;1175483462-300&#41; THEN 1 ELSE 0 END&#41; ELSE '' END&#41; AS user_online_virt, u.username AS username_virt, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 0 <> 0 OR 0 <> 1 &#41; AND &#40; b.buddy_visible = 1 OR &#40; u.user_allow_viewonline = 1 OR &#40;0 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_allow_viewonline = 2 OR &#40;0 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN u.user_regdate ELSE '' END&#41; AS user_regdate_virt, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 0 <> 0 OR 0 <> 1 &#41; AND &#40; b.buddy_visible = 1 OR &#40; u.user_allow_viewonline = 1 OR &#40;0 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_allow_viewonline = 2 OR &#40;0 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN u.user_lastvisit ELSE '' END&#41; AS user_lastvisit_virt, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 0 <> 0 OR 0 <> 1 &#41; AND &#40; b.buddy_visible = 1 OR &#40; u.user_allow_viewonline = 1 OR &#40;0 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_allow_viewonline = 2 OR &#40;0 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN u.user_posts ELSE '' END&#41; AS user_posts_virt, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 1 <> 0 OR 0 <> 1 &#41; AND u.user_allow_website = 1 AND &#40; b.buddy_visible = 1 OR &#40; u.user_viewwebsite = 1 OR &#40;1 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_viewwebsite = 2 OR &#40;1 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN r.rank_title ELSE '' END&#41; AS user_rank_title_virt, 1 AS user_generic_display, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 0 <> 0 OR 0 <> 1 &#41; AND &#40; b.buddy_visible = 1 OR &#40; u.user_allow_viewonline = 1 OR &#40;0 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_allow_viewonline = 2 OR &#40;0 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN 1 ELSE '' END&#41; AS user_viewonline_display, &#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 1 <> 0 OR 0 <> 1 &#41; AND u.user_allow_website = 1 AND &#40; b.buddy_visible = 1 OR &#40; u.user_viewwebsite = 1 OR &#40;1 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_viewwebsite = 2 OR &#40;1 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN 1 ELSE '' END&#41; AS user_webdisplay_display FROM &#40;&#40;&#40;&#40; phpbb_users AS u&#41; LEFT JOIN phpbb_buddy AS i ON i.user_id=62 AND i.buddy_id=u.user_id&#41; LEFT JOIN phpbb_buddy AS b ON b.user_id=u.user_id AND b.buddy_id=62&#41; LEFT JOIN phpbb_ranks AS r ON &#40;u.user_rank > 0 AND r.rank_special <> 0 AND r.rank_id = u.user_rank&#41; OR &#40;u.user_rank = 0 AND r.rank_special = 0 AND u.user_posts >= r.rank_min AND u.user_posts < r.rank_max&#41;&#41; WHERE u.user_id <> -1 ORDER BY user_posts_virt DESC
If you really would like for me to try to dive into this, I guess I could try to find out what is wrong with the query. :shock:

User avatar
Cathar1950
Site Supporter
Posts: 10503
Joined: Sun Feb 13, 2005 12:12 pm
Location: Michigan(616)
Been thanked: 2 times

Post #25

Post by Cathar1950 »

otseng wrote:
McCulloch wrote:Did you know if you use the sort column on the Member List it sorts the number of posts alphabetically?
Seems to work for me.

I see you at top with 4718 posts, Cathar1950 with 3961 posts, and me with 3377 posts.
I think we should start a 4000 + group..lol
Of course as soon as we get 4000 + Otseng, Mack will be at 5000+ and leave us behind. I am now at 3972. I have way to much fun here.
13 Feb 2005 (778 Days)
Has it been that long?

I noticed Rob and sender have me on their ignored llist. Does that mean I can talk about them and they don't know?
It is so hurtfull that I refuse to put anyone on my list.

User avatar
McCulloch
Site Supporter
Posts: 24063
Joined: Mon May 02, 2005 9:10 pm
Location: Toronto, ON, CA
Been thanked: 3 times

Post #26

Post by McCulloch »

The problem is with this bit.

Code: Select all

&#40;CASE WHEN &#40;u.user_id = 62 OR &#40; &#40; i.buddy_ignore <> 1 OR i.buddy_ignore IS NULL &#41; AND &#40; 0 <> 0 OR 0 <> 1 &#41; AND &#40; b.buddy_visible = 1 OR &#40; u.user_allow_viewonline = 1 OR &#40;0 = 1 AND 0 = 1&#41; &#41; OR &#40; b.buddy_ignore = 0 AND &#40; u.user_allow_viewonline = 2 OR &#40;0 = 2 AND 0 = 1&#41; &#41; &#41; &#41; &#41;&#41; THEN u.user_posts ELSE '' END&#41; AS user_posts_virt
Or parsed

Code: Select all

&#40;
	CASE 
	WHEN 
	&#40;
		u.user_id = 62 OR 
		&#40; 
			&#40; 
				i.buddy_ignore <> 1 
				OR 
				i.buddy_ignore IS NULL 
			&#41; 
			AND 
			&#40; 
				0 <> 0 
				OR 
				0 <> 1 
			&#41; 
			AND 
			&#40; 
				b.buddy_visible = 1 
				OR 
				&#40; 
					u.user_allow_viewonline = 1 
					OR 
					&#40;
						0 = 1 
						AND 
						0 = 1
					&#41; 
				&#41; 
				OR 
				&#40; 
					b.buddy_ignore = 0 
					AND 
					&#40; 
						u.user_allow_viewonline = 2 
						OR 
						&#40;
							0 = 2 
							AND 
							0 = 1
						&#41; 
					&#41; 
				&#41; 
			&#41; 
		&#41;
	&#41; 
	THEN 
		u.user_posts 
	ELSE 
		'' 
	END
&#41; 
AS user_posts_virt
The issue is that when the CASE falls through and the ELSE is executed, it may generate an empty string rather than an integer, making the entire virtual column into a string rather than an integer.

This does not happen with Microsoft SQL Server (I tested) but it seems to be happening with your implementation of SQL. Here's something you could do to test to see if this is what is happening. Change

Code: Select all

THEN 
	u.user_posts 
ELSE 
	'' 
END
to

Code: Select all

THEN 
	u.user_posts 
ELSE 
	-99 
END
This would render whatever is being tested for in the CASE as an integer (-99) rather than a string ('').
Examine everything carefully; hold fast to that which is good.
First Epistle to the Church of the Thessalonians
The truth will make you free.
Gospel of John

User avatar
otseng
Savant
Posts: 20566
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 337 times
Contact:

Post #27

Post by otseng »

Nice debugging skills McCulloch!

The code that generates the query is quite complicated. (I guess that's why the author of that piece of code is no longer supporting it? :-k ) I made a change to it though and I think I've fixed it. Though hopefully I didn't break something else in the process.

User avatar
otseng
Savant
Posts: 20566
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 337 times
Contact:

Post #28

Post by otseng »

As for new titles, how about implementing two of the ones McCulloch suggested:
2,500 - prodigy
5,000 - savant

Once we have several over 5000, we can come back and revisit the issue.

User avatar
McCulloch
Site Supporter
Posts: 24063
Joined: Mon May 02, 2005 9:10 pm
Location: Toronto, ON, CA
Been thanked: 3 times

Post #29

Post by McCulloch »

otseng wrote:Nice debugging skills McCulloch!

The code that generates the query is quite complicated. (I guess that's why the author of that piece of code is no longer supporting it? :-k ) I made a change to it though and I think I've fixed it. Though hopefully I didn't break something else in the process.
That seems to have corrected the problem.
Examine everything carefully; hold fast to that which is good.
First Epistle to the Church of the Thessalonians
The truth will make you free.
Gospel of John

User avatar
methylatedghosts
Sage
Posts: 516
Joined: Sun Oct 08, 2006 8:21 pm
Location: Dunedin, New Zealand

Post #30

Post by methylatedghosts »

How about a further title after that:

Master
Legend
Uberposter
Ye are Gods

Post Reply