phpBB3 Dynamically Generated Stat Graphs

Generic, discuss anything about or related to phpBB3 (Olympus) here.
-- No support or MOD requests --
Forum rules
READ: StarTrekGuide.com Board Rules

Generic discussion of anything phpBB or phpBB3 "Olympus" related.
Only specific phpBB discussions please.

No Support or MOD Requests

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Krupski » 24 May 2010, 15:54

Highway of Life wrote:Top 10 Posters of Star Trek Guide


Can I have the code for that? Please? Pretty-please?

-- Roger
''Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto.'' -- Mikhail T. Kalashnikov
User avatar
Krupski    
Lieutenant
Lieutenant
 
Posts: 287
Joined: 26 Mar 2010, 20:25
Location: PHPBB 3.0.10 with full WYSIWYG Editor. Try it with UN: "tester" and PW: "tester"
Gender: Male
phpBB Knowledge: 5




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Highway of Life » 24 May 2010, 16:24

Code: Select all
SELECT user_id, username, user_posts
FROM phpbb_users
ORDER BY user_posts
LIMIT 0, 10
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Krupski » 24 May 2010, 17:36

Highway of Life wrote:
Code: Select all
SELECT user_id, username, user_posts
FROM phpbb_users
ORDER BY user_posts
LIMIT 0, 10


Ha ha. I know how to query the DB. I was looking for the graphing code. It it a Flash object?
''Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto.'' -- Mikhail T. Kalashnikov
User avatar
Krupski    
Lieutenant
Lieutenant
 
Posts: 287
Joined: 26 Mar 2010, 20:25
Location: PHPBB 3.0.10 with full WYSIWYG Editor. Try it with UN: "tester" and PW: "tester"
Gender: Male
phpBB Knowledge: 5

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Highway of Life » 24 May 2010, 18:27

Oh! No, it's actually an image generated by PHP. It uses the JPGraph library.
Here is the code for top posters. But you should be able to adapt it to other graphing scripts as well. :)
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Krupski » 24 May 2010, 20:41

Highway of Life wrote:Oh! No, it's actually an image generated by PHP. It uses the JPGraph library.
Here is the code for top posters. But you should be able to adapt it to other graphing scripts as well. :)


Ah! Thank you!

I guess I'm gonna have to change this a bit....

Code: Select all
/***
* get top 10 users
***/
function top_ten()
{
    global $db;
    $sql = 'SELECT username, user_posts FROM phpbb_users ORDER BY ~user_posts LIMIT 0, 10';
    $result = $db->sql_query($sql);
    $top = '';
    while ($row = $db->sql_fetchrow($result))
    {
        $top .= ($row['username'] . ',' . $row['user_posts']);
    }
    return $top;
}


:D


Thanks for the info & links!

-- Roger
Last edited by Krupski on 25 May 2010, 20:17, edited 2 times in total.
''Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto.'' -- Mikhail T. Kalashnikov
User avatar
Krupski    
Lieutenant
Lieutenant
 
Posts: 287
Joined: 26 Mar 2010, 20:25
Location: PHPBB 3.0.10 with full WYSIWYG Editor. Try it with UN: "tester" and PW: "tester"
Gender: Male
phpBB Knowledge: 5

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Obsidian » 25 May 2010, 07:14

Highway of Life wrote:Oh! No, it's actually an image generated by PHP. It uses the JPGraph library.
Here is the code for top posters. But you should be able to adapt it to other graphing scripts as well. :)

Problem is that JPGraph uses a wonky license. Alas, it is sad day for opensource.
うるさいうるさいうるさい!

StopForumSpam Spam Reporting Database
Giving xrumer and friends a great big "screw you" since 2007.
User avatar
Obsidian    
Supporter
Supporter
 
Posts: 2250
Joined: 04 Mar 2008, 23:35
Gender: Male
phpBB Knowledge: 10

Re: phpBB3 Dynamically Generated Stat Graphs

Postby wadie » 04 Aug 2010, 08:26

That's cool . :P
PM me for private support or installing MODs/styles.
User avatar
wadie    
Lieutenant
Lieutenant
 
Posts: 329
Joined: 11 Mar 2010, 10:14
Gender: Male
phpBB Knowledge: 5

Re: phpBB3 Dynamically Generated Stat Graphs

Postby Highway of Life » 09 Jan 2013, 03:30

It's been quite a few years since I first started using some of these graphs. I'm sure they've since improved and there should be a few more options to choose from now... could be interesting. :)
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Previous

Return to Olympus Discussions

Who is online

Users browsing this forum: No registered users and 9 guests