A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Custom Forum Achievement Code
Feb 11, 2010
9:29 pm
Member
Forum Posts: 19
Member Since:
Nov 28, 2009
Offline

I was working on making custom forum achievements past special forums ranks. Examples could be "Post in 100 topics" or "Start 100 Topics". I was wondering, is there any way of sensing the post countr or topic count for one specific user from the database. I went through the file that displays user details next to posts, and noticed a lot of variables. Does one exist for topic count? Is there any way I could add one with a MySQL request?

 

Just wondering, I wouldn't expect for you guys to put in something as redundant and odd as topic count or specific post count in different topics. But if you did, or you could tell me how to go about doing that it would be awesome. I have a pretty sharp coding knowledge in areas excluding MySQL requests, but I can learn quick, so there is no need to dumb down your answer so any person can read it, technical terms are understandable.

 

Thanks so much for all your help over the past few months, as this isnt my first topic I have started. My site will be placing ads in pretty soon, and I will make sure a little bit of fiscal appreciation slips your way for all the trouble you have been going through to help people like me.

Feb 11, 2010
11:31 pm

SP Master
Forum Posts: 23587
Member Since:
Dec 10, 2006
Offline

all depends where you are trying to do this…  but for simplistic sake, you can do this

$posts = sf_get_member_item($userid, 'posts');

where $userid is the id of the current user…  and you will have the number of posts by the user…  we dont explicityly track topics started, but you could do

global $wpdb;
$topics = $wpdb->get_resulst("SELECT FROM ".SFTOPICS." WHERE user_id=".$userid);

where $userid is again the id of the current user…  and you will have the topics started by that user…

Feb 13, 2010
12:17 pm
Member
Forum Posts: 19
Member Since:
Nov 28, 2009
Offline

Thanks for the help, I'll add in that bit and elaborate from there.

Feb 13, 2010
12:23 pm

SP Master
Forum Posts: 23587
Member Since:
Dec 10, 2006
Offline

np. glad to help. have to say, I didnt test that for typos, but concept is right…

Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: SPQC
52 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 485

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2616

Members: 7328

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10839

Posts: 79118

Moderators: Brandon C (158)

Administrators: Yellow Swordfish (22131), Mr Papa (23580)