Advertisement:

Author Topic: Forum info image scripts  (Read 19792 times)

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Forum info image scripts
« on: June 05, 2008, 02:50:38 AM »
I know some other are also available, but I created this just for the heck of it. I wanted to give a shot on the PHP image(GD) functions.

Currently there are : forum-stats and user-stats.
To implement you need to upload stats-bg.png and one of the files or all depending on what you need on your forum's root directory otherwise they will not work.

You MUST upload stats-bg.png otherwise it will not work. If you want to replace the background, replace the stats-bg.png file. No modifications to forum's files are required

userstats.php
This is called by http://yoursite.tld/userstats.php?u=x(Where x is the ID of the user), and if you want you can add ;show_avatar to show the avatar(Won't show if no avatar is there)
This is for showing a user's stats

forumstats.php
Simple link to the image and it will show the stats of the forum.

These can be used with img BBC tags or img HTML Tag.

Initially I made them in SMF 2 but they should also work with SMF 1.1 although I have not tested it with SMF 1.1

The background was obtained from DynamicDrive - Gradient Image Maker

I am planning on making more of these image scripts for different utilities
« Last Edit: June 05, 2008, 04:27:58 AM by Dragooon »

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,660
  • Gender: Male
Re: Forum info image scripts
« Reply #1 on: June 05, 2008, 12:20:27 PM »
Moved to Tips and Tricks :D
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Offline TigerTails

  • Newbie
  • *
  • Posts: 6
    • Unseen Britain - Urban Exploration Community
Re: Forum info image scripts
« Reply #2 on: June 06, 2008, 05:37:30 PM »
This potentially looks like it would be a great mod. But when using it, I encounter errors. Userstats gives an SQL error, while Forumstats simply doesn't show an image at all..

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}topics
WHERE ID_MEMBER_STARTED = 2' at line 2
File: /*****************/userstats.php
Line: 65"

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: Forum info image scripts
« Reply #3 on: June 07, 2008, 01:43:10 AM »
Hm I found the problem
Find
Code: [Select]
FROM {db_prefix}topics

WHERE ID_MEMBER_STARTED
And replace the {db_prefix} with {$db_prefix}

Offline Dzonny

  • Lead Localizer
  • SMF Super Hero
  • *
  • Posts: 11,616
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Forum info image scripts
« Reply #4 on: June 01, 2009, 12:42:46 PM »
http://www.samo-opusteno.info/forum/userstats.php?u=1

It says "Imagge can not be displayed because it contains errors."
What is problem?

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,660
  • Gender: Male
Re: Forum info image scripts
« Reply #5 on: June 01, 2009, 12:59:18 PM »
Dzonny, there are errors so it is giving an html page instead of an image, which is why it gives that message. The actual error is:

Code: [Select]
Warning: imagecreatefrompng(/home/samoo/public_html/forum/stats-bg.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/samoo/public_html/forum/userstats.php on line 27

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/samoo/public_html/forum/userstats.php on line 31

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/samoo/public_html/forum/userstats.php on line 33

Warning: imagefill(): supplied argument is not a valid Image resource in /home/samoo/public_html/forum/userstats.php on line 37

Notice: SSI.php was unable to load a session! This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! in /home/samoo/public_html/forum/SSI.php on line 172

Warning: Cannot modify header information - headers already sent by (output started at /home/samoo/public_html/forum/userstats.php:27) in /home/samoo/public_html/forum/Sources/Subs.php on line 3454

Warning: Cannot modify header information - headers already sent by (output started at /home/samoo/public_html/forum/userstats.php:27) in /home/samoo/public_html/forum/Sources/Subs.php on line 3455

Warning: Cannot modify header information - headers already sent by (output started at /home/samoo/public_html/forum/userstats.php:27) in /home/samoo/public_html/forum/Sources/Subs.php on line 3461

Warning: Cannot modify header information - headers already sent by (output started at /home/samoo/public_html/forum/userstats.php:27) in /home/samoo/public_html/forum/Sources/Subs.php on line 3464
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Offline Dzonny

  • Lead Localizer
  • SMF Super Hero
  • *
  • Posts: 11,616
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Forum info image scripts
« Reply #6 on: June 01, 2009, 01:13:08 PM »
Hm, ok but i cant see it as image as well ?
What's problem?

Offline _Anthony_

  • Full Member
  • ***
  • Posts: 547
Re: Forum info image scripts
« Reply #7 on: June 01, 2009, 08:31:28 PM »
It looks like you're missing stats-bg
http://www.samo-opusteno.info/forum/stats-bg.png

Offline Dzonny

  • Lead Localizer
  • SMF Super Hero
  • *
  • Posts: 11,616
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Forum info image scripts
« Reply #8 on: June 02, 2009, 03:31:38 AM »
oh, i found the problem PNG was upcase so i just rename it...
And one other thing
Line 126 and 127:
Code: [Select]
FROM {db_prefix}topics

WHERE ID_MEMBER_STARTED = $user[id] ".(!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ?
There shoud also be  FROM {$db_prefix}topics

Now it's working, but i have "Total time loged in: 0 minutes." :/

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,101
    • @studyforceps on Twitter
    • Study Force
Re: Forum info image scripts
« Reply #9 on: June 04, 2014, 11:23:18 PM »
I can see this being very useful, though it never picked up. I tried it on my SMF 2.x forum - the forumstats.php worked but the userstats.php did not.

What could be the problem apart from those mentioned above?

Offline habibkhan01

  • Newbie
  • *
  • Posts: 1
Re: Forum info image scripts
« Reply #10 on: August 24, 2014, 09:51:48 PM »
Many thanks TigerTails for your informative opinion that is very effective.