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
I get:

The image “http://www.wiiloaded.com/mybbsig.php” cannot be displayed, because it contains errors.

http://www.wiiloaded.com/mybbsig.php

<?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://www.wiiloaded.com/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);
?>
Fatal error:  Call to undefined function:  imagecreatefrompng() in /home/wiiloade/public_html/mybbsig.php on line 37
That's from the source of the file. Seems like you don't have GD installed on the server.
What exactly is GD?
Heres a 1.2 version:

<?php

/**
 * MyBB Signature v1.0
 * Copyright © 2006 CreateMyBB, All Rights Reserved
 *
 * Website: http://www.createmybb.com
 * Created by Adam of CreateMyBB.com
 * Updated to work with MyBB 1.2 by Tikitiki
 */
 
$link = "your-image-link-here";

define("IN_MYBB", 1);
define("NO_ONLINE", 1);

require "./global.php";

//Total Members
$query = $db->simple_select(TABLE_PREFIX."users", "COUNT(*) as rows");
$total_members_result = $db->fetch_field($query, "rows");

//Total Posts
$query = $db->simple_select(TABLE_PREFIX."posts", "COUNT(*) as rows");
$total_posts_result = $db->fetch_field($query, "rows");

//Newest Member
$query = $db->simple_select(TABLE_PREFIX."users", "*", "", array('order_by' => 'uid', 'order_dir' => 'desc', 'limit' => 1));
$newest_member_result = $db->fetch_array($query);

//Total Threads
$query = $db->simple_select(TABLE_PREFIX."threads", "COUNT(*) as rows");
$total_threads_result = $db->fetch_field($query, "rows");

Header("Content-type: image/png");
$img_handle = imageCreateFromPNG($link);
$color = ImageColorAllocate ($img_handle, 100, 100, 100);

ImageString($img_handle, 3, 10, 10,  "Total Members: {$total_members_result}", $color);
ImageString($img_handle, 3, 10, 40,  "Newest Member: {$newest_member_result['username']}", $color);
ImageString($img_handle, 3, 200, 10,  "Total Posts: {$total_posts_result}", $color);
ImageString($img_handle, 3, 200, 40,  "Total Threads: {$total_threads_result}", $color);
ImagePng($img_handle);
ImageDestroy($img_handle);
?>
It is not working for me, it comes up with this error "The image “http://fergofrog.teaspoondiner.net/forum/mybbsig.php” cannot be displayed, because it contains errors."

My code is:
<?php

/**
 * MyBB Signature v1.0
 * Copyright © 2006 CreateMyBB, All Rights Reserved
 *
 * Website: http://www.createmybb.com
 * Created by Adam of CreateMyBB.com
 * Updated to work with MyBB 1.2 by Tikitiki
 */
 
$link = "http://fergofrog.teaspoondiner.net/forum/mybbsig.png";

define("IN_MYBB", 1);
define("NO_ONLINE", 1);

require "./global.php";

//Total Members
$query = $db->simple_select(TABLE_PREFIX."users", "COUNT(*) as rows");
$total_members_result = $db->fetch_field($query, "rows");

//Total Posts
$query = $db->simple_select(TABLE_PREFIX."posts", "COUNT(*) as rows");
$total_posts_result = $db->fetch_field($query, "rows");

//Newest Member
$query = $db->simple_select(TABLE_PREFIX."users", "*", "", array('order_by' => 'uid', 'order_dir' => 'desc', 'limit' => 1));
$newest_member_result = $db->fetch_array($query);

//Total Threads
$query = $db->simple_select(TABLE_PREFIX."threads", "COUNT(*) as rows");
$total_threads_result = $db->fetch_field($query, "rows");

Header("Content-type: image/png");
$img_handle = imageCreateFromPNG($link);
$color = ImageColorAllocate ($img_handle, 100, 100, 100);

ImageString($img_handle, 3, 10, 10,  "Total Members: {$total_members_result}", $color);
ImageString($img_handle, 3, 10, 40,  "Newest Member: {$newest_member_result['username']}", $color);
ImageString($img_handle, 3, 200, 10,  "Total Posts: {$total_posts_result}", $color);
ImageString($img_handle, 3, 200, 40,  "Total Threads: {$total_threads_result}", $color);
ImagePng($img_handle);
ImageDestroy($img_handle);
?>

I am using MyBBoard V1.2. It is located here: http://fergofrog.teaspoondiner.net/forum/mybbsig.php. Please help.
<b>Warning</b>: imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]: URL file-access is disabled in the server configuration in <b>/home/.ernest/fergofrog/fergofrog.teaspoondiner.net/forum/mybbsig.php</b> on line <b>36</b><br />

You server has disabled disabled URL file-access, try changing:
$link = "http://fergofrog.teaspoondiner.net/forum/mybbsig.png";
to:
$link = "mybbsig.png";
Cool mod.
Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.


May I ask what I did wrong?
asiankid Wrote:Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.


May I ask what I did wrong?

Your using old code of the mod not updated to work with MyBB 1.2. Use this: http://community.mybboard.net/showthread...6#pid79836
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14