MyBB Community Forums

Full Version: MyBB Signature v1.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Why you take an PNG Picture for this? The Sig would be very smaller if you use the jpg type.
You can't modify a JPEG with php.
i cant get it... i try, but nothing

i open the mybbsig.php file

change the URL to

Code:
marioca5198pe.iespana.es/mybbsig.php

then, i upload the mybbsig.php and mybbsig.png files to my forum direcrtory

but when i wanna to see it i get this:

Code:
in ESP: La imagen �http://marioca5198pe.iespana.es/mybbsig.php� no puede mostrarse, porque contiene errores.

in ING: The image �http://marioca5198pe.iespana.es/mybbsig.php� cant be show, cause contain errors
Did you change any of the code, besides the URL's?
nop...

look, this is how the php code looks:

<?php

/**
 * MyBB Signature v1.0
 * Copyright ?2006 CreateMyBB, All Rights Reserved
 *
 * Website: http://www.createmybb.com
 * Created by Adam of CreateMyBB.com
 */

//Start Code by Michael83
define("KILL_GLOBALS", 1);
define("NO_ONLINE", 1);
//End Code by Michael83


require "./global.php";

//Total Members
$total_members_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."users");
$total_members_result = mysql_num_rows($total_members_sql);

//Total Posts
  $total_posts_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."posts");
  $total_posts_result = mysql_num_rows($total_posts_sql);

//Newest Member
  $newest_member_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."users ORDER BY `uid` DESC LIMIT 0 , 1");
  $newest_member_result = mysql_fetch_array($newest_member_sql);


//Total Threads
  $total_threads_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."threads");
  $total_threads_result = mysql_num_rows($total_threads_sql);

Header ("Content-type: image/png");
$img_handle = imageCreateFromPNG("http://marioca5198pe.iespana.es/mybbsig.php");
$color = ImageColorAllocate ($img_handle, 100, 100, 100);
$totalmembers = "$total_members_result";
$newestmember = "$newest_member_result[username]";
$totalposts = "$total_posts_result";
$totalthreads = "$total_threads_result";
ImageString ($img_handle, 3, 10, 10,  "Total Members: $totalmembers", $color);
ImageString ($img_handle, 3, 10, 40,  "Newest Member: $newestmember", $color);
ImageString ($img_handle, 3, 200, 10,  "Total Posts: $totalposts", $color);
ImageString ($img_handle, 3, 200, 40,  "Total Threads: $totalthreads", $color);
ImagePng ($img_handle);
ImageDestroy ($img_handle);
?>

You changed the .png file to the .php file. Toungue

Use this exact code:

<?php

/**
* MyBB Signature v1.0
* Copyright ?2006 CreateMyBB, All Rights Reserved
*
* Website: http://www.createmybb.com
* Created by Adam of CreateMyBB.com
*/

//Start Code by Michael83
define("KILL_GLOBALS", 1);
define("NO_ONLINE", 1);
//End Code by Michael83


require "./global.php";

//Total Members
$total_members_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."users");
$total_members_result = mysql_num_rows($total_members_sql);

//Total Posts
$total_posts_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."posts");
$total_posts_result = mysql_num_rows($total_posts_sql);

//Newest Member
$newest_member_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."users ORDER BY `uid` DESC LIMIT 0 , 1");
$newest_member_result = mysql_fetch_array($newest_member_sql);


//Total Threads
$total_threads_sql = mysql_query("SELECT * FROM ".TABLE_PREFIX."threads");
$total_threads_result = mysql_num_rows($total_threads_sql);

Header ("Content-type: image/png");
$img_handle = imageCreateFromPNG("http://marioca5198pe.iespana.es/mybbsig.png");
$color = ImageColorAllocate ($img_handle, 100, 100, 100);
$totalmembers = "$total_members_result";
$newestmember = "$newest_member_result[username]";
$totalposts = "$total_posts_result";
$totalthreads = "$total_threads_result";
ImageString ($img_handle, 3, 10, 10, "Total Members: $totalmembers", $color);
ImageString ($img_handle, 3, 10, 40, "Newest Member: $newestmember", $color);
ImageString ($img_handle, 3, 200, 10, "Total Posts: $totalposts", $color);
ImageString ($img_handle, 3, 200, 40, "Total Threads: $totalthreads", $color);
ImagePng ($img_handle);
ImageDestroy ($img_handle);
?>
Confused

nop, nothing... still doesnt work
prutsor Wrote:This is mine:
[Image: mybbsig.php]

@muphil:
You can control the position of the text with some numbers.
Open the php file and have a look.
ImageString ($img_handle, 3, 10, [b]10[/b],  "Total Members: $totalmembers", $color);
The bold number controls the vertical position of the text. Try to increase it to 25 or 30
Just play with it and you will find the right position.

What do the other numbers signify?
MaRio Wrote:Confused

nop, nothing... still doesnt work

You had to have changed something else.. did you CHMOD the .png file to 777? You usually don't have to do this, though.

RaptorMoonX Wrote:
prutsor Wrote:This is mine:
[Image: mybbsig.php]

@muphil:
You can control the position of the text with some numbers.
Open the php file and have a look.
ImageString ($img_handle, 3, 10, [b]10[/b],  "Total Members: $totalmembers", $color);
The bold number controls the vertical position of the text. Try to increase it to 25 or 30
Just play with it and you will find the right position.

What do the other numbers signify?

ImageString ($img_handle, int font, int x, int y, "Total Members: $totalmembers", $color)

(int font means the font size as an integer, and you can figure out the rest)
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14