vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Signature Stats v3.04 (https://vborg.vbsupport.ru/showthread.php?t=65361)

DWard 05-23-2004 06:50 PM

As I say, any suggestions for other features would be nice :)

bigreefer 05-23-2004 09:05 PM

what is with the <br> version of the Script ? :)
Ready ?

hihi ThX

DWard 05-24-2004 05:10 AM

The next version to be released either today or Wednesday will have:

TrueType font support with font size
Line Break Support

DWard 05-24-2004 07:48 AM

Version 2.01 available with truetype font support and line breaks!

Hopefully, by 24/04/2004, version 2.02 will be released with text alignment support.

Oblivion Knight 05-24-2004 09:49 AM

Thank you kindly, I will have a play with it later.. :D

DWard 05-24-2004 09:52 AM

No worries, I need some feedback if somebody could give me some, of the new version.

bigreefer 05-24-2004 10:03 AM

Hmm the Online User-Counter counts not correct.
It shows 66 User Online but realy there are only 21 online.

Any Idea ?

Ps. the new verion did not run :(

SaN-DeeP 05-24-2004 10:37 AM

i get this
Could not select database

When i run
www.yourdomain.com/forums/signature.php

what am i missing.

thnx for hack ;)

Sandy...

DWard 05-24-2004 12:10 PM

Quote:

Originally Posted by SaN-DeeP
i get this
Could not select database

When i run
www.yourdomain.com/forums/signature.php

what am i missing.

thnx for hack ;)

Sandy...

Yer I think I know why.

DWard 05-24-2004 12:11 PM

I will get on it in a bit.

DWard 05-24-2004 12:11 PM

Quote:

Originally Posted by bigreefer
Hmm the Online User-Counter counts not correct.
It shows 66 User Online but realy there are only 21 online.

Any Idea ?

Ps. the new verion did not run :(

Did not run (need some more info!)

I will look into the user count, I know it's slightly out, will take a look later today and release the fixed version.

DWard 05-24-2004 01:18 PM

Quote:

Originally Posted by SaN-DeeP
i get this
Could not select database

When i run
www.yourdomain.com/forums/signature.php

what am i missing.

thnx for hack ;)

Sandy...

Try the latest version to see if that works. Go pack to the first page, just updated to version 2.02.

Also the online user count is fixed.

DWard 05-24-2004 04:47 PM

Any feedback?

bigreefer 05-24-2004 05:53 PM

Sorry,

if i use the first Verion it runs without problems.
If I use the latest version i saw no Picture.

https://vborg.vbsupport.ru/external/2004/06/1.php

The FilePath and SQL login ist 100% the same as in the first Version.

DWard 05-24-2004 05:54 PM

Are you sure the filepaths are correct and you have CHMOD the files?

DWard 05-24-2004 05:57 PM

Try selecting the default font option in the code. You need to uncomment one line and comment the one below it.

bigreefer 05-24-2004 05:58 PM

Yes 100%

The Path the Pictures are ist alwas the Same.
If i upload the Version SIGNATURE STATS V1.01 the Sig runs without Probs.
If i upload the new Version i saw nothing.

SIGNATURE STATS V1.01
Code:

//full path to empty signature image (input image)
$vorlagedatei = "/var/www/web1/html/vB/signatur/sig2.jpg";

//full path to signare image with forum data (output image)
$ausgabedatei = "/var/www/web1/html/vB/signatur/sig1.jpg";

SIGNATURE STATS V2.01
Code:

//full path to empty signature image (input image)
$vorlagedatei = "/var/www/web1/html/vB/signatur/sig2.jpg";

//full path to signare image with forum data (output image)
$ausgabedatei = "/var/www/web1/html/vB/signatur/sig1.jpg";

Ps. kannst du auch deutsch und hast ICQ ?

DWard 05-24-2004 06:02 PM

Quote:

Cant realy speak German, even though I have german family!
Is the database info correct and have u trued the different font option near the bottom of the script?

bigreefer 05-24-2004 06:04 PM

Quote:

Originally Posted by DWard
Try selecting the default font option in the code. You need to uncomment one line and comment the one below it.


k, but no efect :(

DateBase Info 100% correct. Font near the buttom ist switched.

And now ?

The old Script runs :/

Code:

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'sig_stats');

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

// #################### ENTER DATABASE INFORMATION #######################
//DB-Servername
$host = "localhost";

//DB-Username
$user= "web1";

//DB-Password
$password= "*********";

//vbulletin database name
$database="usr_web1_1";

//E-Mail Address where MySQL Error Messages are sent to
$adminemail = "admin@celebritymarkt.de";

// ###################### ENTER IMAGE INFORMATION #########################

//Width of banner image
$width = 300;

//Height of banner image
$height = 60;

//Left text-margin
$left = 13;

//text-margin from top
$top = 70;

//Font Size
$fontsize = 7;

//Line-spacing of text
$zeilenabstand = 15;

//full path to empty signature image (input image)
$vorlagedatei = "/var/www/web1/html/vB/signatur/sig2.jpg";

//full path to signare image with forum data (output image)
$ausgabedatei = "/var/www/web1/html/vB/signatur/sig1.jpg";

//Compression of output image
$komprimierung = 95;

//debug mode
$debug = 0;

// ######################### DO NOT EDIT BELOW ############################

function mysql_query_eval($query, $database) {
    $mysql_eval_error="";
    $mysql_eval_result = mysql_query($query, $database) or $mysql_eval_error = mysql_error();
    if ($mysql_eval_error) {
        if ( $debug == 1 ) {
            $letter = "An error was encountered during execution of the query:\n\n";
            $letter .= $query."\n\n";
            $letter .="The query returned with an errorcode of: \n\n$mysql_eval_error\n\n";
                        $letter .="To turn this email off set debug=0 in signature.php\n\n";
            $email_from = "From: ".$adminemail;
            $subject="Subject: Signature Error Report";
            $subject=trim($subject);
            mail( $email, $subject, $letter, $email_from );
        } elseif ( $debug == 2 ) {
        dieWell( "MySQL error reported!<p>Query: $query<p>Result: $mysql_eval_error<p>Database handle: $database" );
        exit;
        }
        return FALSE;
    } else {
    return $mysql_eval_result;
  }
}

// CONNECTING TO DATABASE
$link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.');
mysql_select_db ("$database")or die("Could not select database");

// GETTING FORUM MEMBERS
$querya="SELECT COUNT(*) AS users, MAX(userid) AS max FROM " . TABLE_PREFIX . "user WHERE usergroupid!=4";
$numa = mysql_query_eval($querya,$link);
$numb = mysql_fetch_array($numa);
$numbermembers=number_format($numb['users']);
mysql_free_result($numa);

// GETTING TOTAL MEMBERS ONLINE

        $datecut = TIMENOW - $vboptions['cookietimeout'];
        $numbervisible = 0;
        $numberregistered = 0;
        $numberguest = 0;

        $forumusers = $DB_site->query("
                SELECT
                        user.username, (user.options & $_USEROPTIONS[invisible]) AS invisible, user.usergroupid,
                        session.userid, session.inforum, session.lastactivity,
                        IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
                FROM " . TABLE_PREFIX . "session AS session
                LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
                WHERE session.lastactivity > $datecut
                ORDER BY " . iif($permissions['genericpermissions'] & CANSEEHIDDEN, 'invisible ASC, ') . "username ASC, lastactivity DESC
        ");

        if ($bbuserinfo['userid'])
        {
                // fakes the user being online for an initial page view of index.php
                $bbuserinfo['joingroupid'] = iif($bbuserinfo['displaygroupid'], $bbuserinfo['displaygroupid'], $bbuserinfo['usergroupid']);
                $userinfos = array
                (
                        $bbuserinfo['userid'] => array
                        (
                                'userid' => $bbuserinfo['userid'],
                                'username' => $bbuserinfo['username'],
                                'invisible' => $bbuserinfo['invisible'],
                                'inforum' => 0,
                                'lastactivity' => TIMENOW,
                                'musername' => fetch_musername($bbuserinfo, 'joingroupid')
                        )
                );
                $numberregistered = 1;
                $numbervisible = 1;
                $loggedin = $userinfos["$bbuserinfo[userid]"];
                eval('$activeusers = ", ' . fetch_template('forumhome_loggedinuser') . '";');
        }
        else
        {
                $userinfos = array();
        }
        $inforum = array();

        while ($loggedin = $DB_site->fetch_array($forumusers))
        {
                $userid = $loggedin['userid'];
                if (!$userid)
                {        // Guest
                        $numberguest++;
                        $inforum["$loggedin[inforum]"]++;
                }
                else if (empty($userinfos["$userid"]['lastactivity']) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
                {
                        $userinfos["$userid"] = $loggedin;
                        $numberregistered++;
                        if ($userid != $bbuserinfo['userid'])
                        {
                                $inforum["$loggedin[inforum]"]++;
                        }
                        $loggedin['musername'] = fetch_musername($loggedin);

                        //if (fetch_online_status($loggedin))
                        //{
                        //        $numbervisible++;
                        //        eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
                        //}
                }
        }

        // memory saving
        unset($userinfos, $loggedin);

        $activeusers = substr($activeusers , 2); // get rid of initial comma

        $DB_site->free_result($loggedins);

        $totalonline = $numberregistered + $numberguest;
        $numberinvisible = $numberregistered - $numbervisible;

        // ### MAX LOGGEDIN USERS ################################
        $maxusers = unserialize($datastore['maxloggedin']);
        if (intval($maxusers['maxonline']) <= $totalonline)
        {
                $maxusers['maxonline'] = $totalonline;
                $maxusers['maxonlinedate'] = TIMENOW;
                build_datastore('maxloggedin', serialize($maxusers));
        }

        $recordusers = $maxusers['maxonline'];
        $recorddate = vbdate($vboptions['dateformat'], $maxusers['maxonlinedate'], true);
        $recordtime = vbdate($vboptions['timeformat'], $maxusers['maxonlinedate']);

//////////////////////////////////////////////////////////////////////////////////////////////////

// GETTING TOTAL POSTS AND THREADS
include_once('./includes/functions_forumlist.php');
cache_ordered_forums(1, 0, 0);
if (is_array($forumcache))
{
        foreach ($forumcache AS $forum)
        {
                $nthreads += $forum['threadcount'];
                $nposts += $forum['replycount'];
                $totalthreads = number_format($nthreads);
                $totalposts = number_format($nposts);
        }
}

// ########################### OUTPUT TEXT ###############################
// Use \n\r to make a line break (only for use with truetype font SO FAR)
// Will be developed to use with default font soon :)

$output = "Members: $numbermembers Threads: $totalthreads Posts: $totalposts Online: $totalonline";

$vorlage = imagecreatefromjpeg("$vorlagedatei");
$img = imagecreate($width,$height);

// ########################## TEXT FORMATTING ############################

// A PNG uses ImageColorAllocate instead of ImageColorClosest like jpeg uses

//background white
$bg_color = imagecolorallocate ($img, 255, 255, 255);

//black text
$text_color = imagecolorallocate ($img, 19, 36, 161);

imagefilledrectangle ($img, 0, 0, $width, $height, $bg_color);

// ######################### DO NOT EDIT BELOW ############################

imagecopy ($img, $vorlage, 0, 0, 0, 0, $width, $height); // copy empty banner

imagecolortransparent($img, $bg_color);  // set dummybg transparent

// the distance is in pixels and the font # is 1 through 5
$i = 0;
while($i < count($output)){

// ######################### CHANGE FONT BELOW ############################
// Uncomment LINE1+LINE12 and comment LINE2+LINE22 to use default font.
// Replace "verdana.ttf" with the URL to your .ttf font
//
imagestring($img, $fontsize, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output, $text_color);  // LINE1
//imagettftext($img, $fontsize, 0, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $text_color, "verdana.ttf", $output); // LINE2
$i++;
}

header("Content-Type: image/png");
imagepng($img);
imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
imagedestroy($img); // get the image out of memory


DWard 05-24-2004 06:27 PM

I really can't tell what's happening, everybody else seems to have no problem. And I cannot tell of any problems with this script, as I personally am not having any problems.

SaN-DeeP 05-24-2004 07:21 PM

Quote:

Originally Posted by DWard
Try the latest version to see if that works. Go pack to the first page, just updated to version 2.02.

Also the online user count is fixed.

alrite i updated info
now i am gettin this error

Fatal error: Call to undefined function: imagettftext() in /home/sandeep/public_html/forums/signature.php on line 247

sorry for bugging you

Sandy...

ranger2kxlt 05-24-2004 07:22 PM

imagettftext() i get this error any help?

DWard 05-24-2004 07:29 PM

Uncomment LINE1 and comment LINE2

DWard 05-24-2004 07:31 PM

I think the reasons for the latest errors seems to be that only the latest versions of PHP will support the imagettftext() function. I have version 4.3.4.

What versions do you have?

ranger2kxlt 05-24-2004 07:33 PM

Code:

// ######################### CHANGE FONT BELOW ############################
// Uncomment LINE1+LINE12 and comment LINE2+LINE22 to use default font.
// Replace "verdana.ttf" with the URL to your .ttf font
//
//imagestring($img, $fontsize, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output, $text_color);  //LINE1
imagettftext($img, $fontsize, 0, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $text_color, "verdana.ttf", $output); //LINE2
$i++;
}

header("Content-Type: image/png");
imagepng($img);
imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
imagedestroy($img); // get the image out of memory
?>

my code looks all messed up is this right? can you give me the last part correctly...

Thanks

DWard 05-24-2004 07:33 PM

BTW:: Have you uploaded a font and specified the location as described in the instructions??

DWard 05-24-2004 07:35 PM

Quote:

Originally Posted by ranger2kxlt
Code:

// ######################### CHANGE FONT BELOW ############################
  // Uncomment LINE1+LINE12 and comment LINE2+LINE22 to use default font.
  // Replace "verdana.ttf" with the URL to your .ttf font
  //
//imagestring($img, $fontsize, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output, $text_color);  //LINE1
 imagettftext($img, $fontsize, 0, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $text_color, "verdana.ttf", $output); //LINE2
  $i++;
  }
 
  header("Content-Type: image/png");
  imagepng($img);
  imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
  imagedestroy($img); // get the image out of memory
  ?>

my code looks all messed up is this right? can you give me the last part correctly...

Thanks

That's fine, thats how mine is...

Try changing that part to this:
Code:

// ######################### CHANGE FONT BELOW ############################
  // Uncomment LINE1+LINE12 and comment LINE2+LINE22 to use default font.
  // Replace "verdana.ttf" with the URL to your .ttf font
  //
  imagestring($img, $fontsize, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output, $text_color);  //LINE1
 //imagettftext($img, $fontsize, 0, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $text_color, "verdana.ttf", $output); //LINE2
  $i++;
  }
 
  header("Content-Type: image/png");
  imagepng($img);
  imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
  imagedestroy($img); // get the image out of memory
  ?>


ranger2kxlt 05-24-2004 07:36 PM

PHP Version 4.3.3

No i thought it use a default font...can you upload the vernada.ttf file?

DWard 05-24-2004 07:37 PM

YER OK THE NEW CODE i GAVE YOU WAS FOR DEFAULT FONT OPTION.

Just change it back to what you gave me to start with and upload the font I am about to attach to the same directory as the file.

ranger2kxlt 05-24-2004 07:38 PM

I tried your code, same error message....Can you send me the code without line 1 and 2 commented, want to make sure i'm coding it right

DWard 05-24-2004 07:39 PM

:) OK the verdana.ttf file is in the zip:

DWard 05-24-2004 07:40 PM

This end is fine:

Code:

// ######################### CHANGE FONT BELOW ############################
  // Uncomment LINE1+LINE12 and comment LINE2+LINE22 to use default font.
  // Replace "verdana.ttf" with the URL to your .ttf font
  //
//imagestring($img, $fontsize, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output, $text_color);  //LINE1
 imagettftext($img, $fontsize, 0, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $text_color, "verdana.ttf", $output); //LINE2
  $i++;
  }
 
  header("Content-Type: image/png");
  imagepng($img);
  imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
  imagedestroy($img); // get the image out of memory
  ?>


ranger2kxlt 05-24-2004 07:42 PM

Fatal error: Call to undefined function: imagettftext() line 259 this is after i uploaded the font file

DWard 05-24-2004 07:43 PM

Did you change the code back too?

ranger2kxlt 05-24-2004 07:50 PM

yes used the one in post 72...same error

DWard 05-24-2004 07:57 PM

OK, you need to discuss the problem with your host...

You need to know if the GD version is 2 or higher (recommended)
And you need to know if the imagettftext() function is allowed.

That's all I can suggest. It works absolutely fine for me and I have exactly the same version as you. It appears as though only two people are experiencing this problem, which makes me believe that it is something to do with your host.

ranger2kxlt 05-24-2004 08:00 PM

i have GD2 ill check on the imagettftext right now

ranger2kxlt 05-24-2004 08:02 PM

looks like we dont have imagettftext but i know we have GD2+

DWard 05-24-2004 08:04 PM

ok imagettftext is required for the truetype font printing. Is the imagestring function allowed?

ranger2kxlt 05-24-2004 08:05 PM

let me also tell you this...when i uncomment the line 1 and line 2 i get a prase error on line 260 :-/ would that be something?


All times are GMT. The time now is 06:48 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01622 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete