Quote:
Originally Posted by TerryMason
Take a look at this image
http://www.pchangout.com/forum/sig5.php
I just used my own background with it:
PHP Code:
// Gather info $total_posts = number_format($total_posts); $total_threads = number_format($total_threads); $total_members = vb_number_format($vbulletin->userstats['numbermembers']);
$my_img = imagecreatefrompng("http://www.pchangout.com/images/sig/5.png"); $background = imagecolorallocate( $my_img, 255, 255, 255 ); $text_colour = imagecolorallocate( $my_img, 000, 000, 0 ); $line_colour = imagecolorallocate( $my_img, 203, 203, 203 );
|
I got the following:
PHP Code:
<?php
//###############################################
////////////////////// Satistics Image Light 1.0.0 Add-On /////////////////
//////----------------------- by Gio~Logist --------------------\\\\\\\\\\
/////------------------------ http://www.giologist.com/vb ---------------------\\\\\\\\\\
///////////////////////////////////////////////////////////////////////
//###############################################
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'stats_image');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);
// get special data templates from the datastore
$specialtemplates = array(
'userstats'
);
// pre-cache templates used by all actions
$globaltemplates = array(
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('global.php');
Header ("Content-type: image/gif");
// Count Threads and Posts
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$count_threads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
// Gather info
$total_posts=number_format($counter['posts']);
$total_threads = number_format($countthreads['threads']);
$total_members = vb_number_format($vbulletin->userstats['numbermembers']);
$my_img = imagecreatefrompng("http://www.evercube.net/images/eclite.png");
$background = imagecolorallocate( $my_img, 255, 255, 255 );
$text_colour = imagecolorallocate( $my_img, 000, 000, 0 );
$line_colour = imagecolorallocate( $my_img, 203, 203, 203 );
imagestring( $my_img, 3, 0, 5, $vbulletin->options[bbtitle], $text_colour );
imagestring( $my_img, 2, 0, 15, $vbulletin->options[bburl], $text_colour );
imagesetthickness ( $my_img, 2 );
imageline( $my_img, 0, 30, 468, 30, $line_colour );
imagestring( $my_img, 2, 0, 40, "Threads: $total_threads Posts: $total_posts Members: $total_members", $text_colour );
header( "Content-type: image/gif" );
imagegif( $my_img );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $my_img );
?>
The image location is right but when I view the php I get no image:
http://evercube.net/forum/stats_image.php
Any thoughts on why this isn't working?
=-=-=-= Edit
Seemed to fix itself. Thanks thou.