Pc 1203
08-05-2007, 12:13 AM
Hi All,
Here is my current code:
<?php
header("Content-type: image/png");
$username = "Pc1203";
$server = 'Mammoth/Frozen';
$age = '236';
$membership = 'Yes';
$item = 'Party Hat!';
$im = imagecreatefrompng("blue_base.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$pxpk = (imagesx($im) - 4.0 * strlen($string)) / 3.64;
$px = (imagesx($im) - 7.5 * strlen($string)) / 364.4;
$pxage = (imagesx($im) - 7.5 * strlen($string)) / 24.5;
$pxmem = (imagesx($im) - 7.5 * strlen($string)) / 2.0;
$pxitem = (imagesx($im) - 7.5 * strlen($string)) / 2.4;
imagestring($im, 25, $px, 5.4443, $username, $orange);
imagestring($im, 25, $px, 22.475, $server, $orange);
imagestring($im, 25, $pxage, 39757.5, $age, $orange);
imagestring($im, 25, $pxmem, 557.77, $membership, $orange);
imagestring($im, 25, $pxitem, 7757.5, $item, $orange);
imagepng($im);
imagedestroy($im);
?>
(I Changed Some Of The Varibles -- So no one copies my work)
Everything works with that code. Now I want it to get my custom profile fields (hint-hint: thats where most of my support questions) to display in the $username, $server, $membership, $item, and $age. So I have ti include global.php, right? Well, here is the code with the include:
<?php
chdir('/home/penguink/public_html/forums');
require_once('/home/penguink/public_html/forums/global.php');
header("Content-type: image/png");
$username = "Pc1203";
$server = 'Mammoth/Frozen';
$age = '236';
$membership = 'Yes';
$item = 'Party Hat!';
$im = imagecreatefrompng("blue_base.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$pxpk = (imagesx($im) - 4.0 * strlen($string)) / 3.64;
$px = (imagesx($im) - 7.5 * strlen($string)) / 364.4;
$pxage = (imagesx($im) - 7.5 * strlen($string)) / 24.5;
$pxmem = (imagesx($im) - 7.5 * strlen($string)) / 2.0;
$pxitem = (imagesx($im) - 7.5 * strlen($string)) / 2.4;
imagestring($im, 25, $px, 5.4443, $username, $orange);
imagestring($im, 25, $px, 22.475, $server, $orange);
imagestring($im, 25, $pxage, 39757.5, $age, $orange);
imagestring($im, 25, $pxmem, 557.77, $membership, $orange);
imagestring($im, 25, $pxitem, 7757.5, $item, $orange);
imagepng($im);
imagedestroy($im);
?>
And I get this error(s):
<br /><strong>Warning</strong>: imagecreatefrompng(blue_base.png) [<a href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]: failed to open stream: No such file or directory in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>13</strong><br /><br /><strong>Warning</strong>: imagecolorallocate(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>14</strong><br /><br /><strong>Warning</strong>: imagecolorallocate(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>15</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>16</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>17</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>18</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>19</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>20</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>21</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>22</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>23</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>24</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>25</strong><br /><br /><strong>Warning</strong>: imagepng(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>27</strong><br /><br /><strong>Warning</strong>: imagedestroy(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>28</strong><br />
Any help?
- Pc1203
Here is my current code:
<?php
header("Content-type: image/png");
$username = "Pc1203";
$server = 'Mammoth/Frozen';
$age = '236';
$membership = 'Yes';
$item = 'Party Hat!';
$im = imagecreatefrompng("blue_base.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$pxpk = (imagesx($im) - 4.0 * strlen($string)) / 3.64;
$px = (imagesx($im) - 7.5 * strlen($string)) / 364.4;
$pxage = (imagesx($im) - 7.5 * strlen($string)) / 24.5;
$pxmem = (imagesx($im) - 7.5 * strlen($string)) / 2.0;
$pxitem = (imagesx($im) - 7.5 * strlen($string)) / 2.4;
imagestring($im, 25, $px, 5.4443, $username, $orange);
imagestring($im, 25, $px, 22.475, $server, $orange);
imagestring($im, 25, $pxage, 39757.5, $age, $orange);
imagestring($im, 25, $pxmem, 557.77, $membership, $orange);
imagestring($im, 25, $pxitem, 7757.5, $item, $orange);
imagepng($im);
imagedestroy($im);
?>
(I Changed Some Of The Varibles -- So no one copies my work)
Everything works with that code. Now I want it to get my custom profile fields (hint-hint: thats where most of my support questions) to display in the $username, $server, $membership, $item, and $age. So I have ti include global.php, right? Well, here is the code with the include:
<?php
chdir('/home/penguink/public_html/forums');
require_once('/home/penguink/public_html/forums/global.php');
header("Content-type: image/png");
$username = "Pc1203";
$server = 'Mammoth/Frozen';
$age = '236';
$membership = 'Yes';
$item = 'Party Hat!';
$im = imagecreatefrompng("blue_base.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$pxpk = (imagesx($im) - 4.0 * strlen($string)) / 3.64;
$px = (imagesx($im) - 7.5 * strlen($string)) / 364.4;
$pxage = (imagesx($im) - 7.5 * strlen($string)) / 24.5;
$pxmem = (imagesx($im) - 7.5 * strlen($string)) / 2.0;
$pxitem = (imagesx($im) - 7.5 * strlen($string)) / 2.4;
imagestring($im, 25, $px, 5.4443, $username, $orange);
imagestring($im, 25, $px, 22.475, $server, $orange);
imagestring($im, 25, $pxage, 39757.5, $age, $orange);
imagestring($im, 25, $pxmem, 557.77, $membership, $orange);
imagestring($im, 25, $pxitem, 7757.5, $item, $orange);
imagepng($im);
imagedestroy($im);
?>
And I get this error(s):
<br /><strong>Warning</strong>: imagecreatefrompng(blue_base.png) [<a href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]: failed to open stream: No such file or directory in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>13</strong><br /><br /><strong>Warning</strong>: imagecolorallocate(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>14</strong><br /><br /><strong>Warning</strong>: imagecolorallocate(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>15</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>16</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>17</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>18</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>19</strong><br /><br /><strong>Warning</strong>: imagesx(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>20</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>21</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>22</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>23</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>24</strong><br /><br /><strong>Warning</strong>: imagestring(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>25</strong><br /><br /><strong>Warning</strong>: imagepng(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>27</strong><br /><br /><strong>Warning</strong>: imagedestroy(): supplied argument is not a valid Image resource in <strong>/home/penguink/public_html/dev/profilesys/image.php</strong> on line <strong>28</strong><br />
Any help?
- Pc1203