Dynamic Sigs for Dummies

Discussion in 'Graphics Resources and Discussion' started by tazrockon, Oct 8, 2007.

Dynamic Sigs for Dummies
  1. Unread #1 - Oct 8, 2007 at 2:02 AM
  2. tazrockon
    Joined:
    Apr 23, 2005
    Posts:
    56
    Referrals:
    0
    Sythe Gold:
    0

    tazrockon Member
    Banned

    Dynamic Sigs for Dummies

    Here's an example of how to use php to write text on an image. When combined with PHP query strings, this can be used to create truly dynamic sigs that user's could change simply by changing the URL of the image.

    Here's a code example I'll reference in this article. Note that ALL # SIGNS NEED TO BE CHANGED TO $ SIGNS TO MAKE THE SCRIPT WORK. The forum was messing up the code displayed when I used $ signs in the example.

    Code:
    <?php
    
    //Part 1:
    header ("Content-type: image/jpg");
    
    //Part 2:
    #handle = ImageCreateFromJpeg("background.jpg");
    
    //Part 3:
    #txt_color = ImageColorAllocate (#handle, 0, 0, 0);
    
    //Part 4:
    ImageTTFText (#handle, 16, 0, 85, 154, #txt_color, "arialbd.ttf", "Mary-Jane Juana");
    
    //Part 5:
    ImageJpeg (#handle);
    
    ?>
    
    Part 1:
    The header is used to define the image type. In this case it's .jpg.

    Part 2:
    The ImageCreateFromJpeg function loads an image file from your server, in this case background.jpg. This is the image you want to write on.

    Part 3:
    The ImageColorAllocate function is setting the color of the text you want to write. It's in RGB color format, which in this example is 0, 0, 0 which is black.

    Part 4:
    The ImageTTFText function physically writes the text on the image. Here's what all the attributes are for this function:

    imagettftext(resource image, font size, font angle, x-pos, y-pos, color, fontfile, text)

    It's important to note that for this function to work properly you need to upload the fontfile you want to use to your server. You can just grab a font like Arial off your computer or find one you like more on the internet. It needs to be uploaded to the same directory as this script. In this example I used arialbd.ttf (arial bold). In the example the font size is 16, then angle is 0 (font's in a straight line), the (x, y) coordinates of where the first letter of the text is being written on the background image is (85, 154). You can get these by loading the background image you want to use in Microsoft Paint, putting your mouse over the spot where you want the text to begin, and looking at the coordinates Paint gives you in the bottom right corner of the program. In the color section of the function we used $txt_color to reference the color we set in Part 3. The final part of the function is the text you want to write. In the example we are writing Mary-Jane Juana. This all may seem a bit complicated but it's really not.

    Part 5:
    ImageJpeg displays the new image you just created.


    If you have any questions, ask Google. These sites go in depth into how to use a lot more features of the PHP GD Library (what we used to write the textP:

    http://www.phpit.net/article/image-manipulation-php-gd-part1/
    http://www.phpit.net/article/image-manipulation-php-gd-part2/
    http://www.codewalkers.com/c/a/Miscellaneous/Overlapping-Images-with-GD/
     
  3. Unread #2 - Nov 3, 2007 at 12:11 AM
  4. Dalpra
    Joined:
    Jul 20, 2007
    Posts:
    2,443
    Referrals:
    9
    Sythe Gold:
    35

    Dalpra Grand Master

    Dynamic Sigs for Dummies

    nice tutorial =)
     
  5. Unread #3 - Nov 7, 2007 at 4:11 PM
  6. Praktikal
    Joined:
    Nov 4, 2007
    Posts:
    77
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    239696267129651200
    Discord Username:
    PracTIKaL

    Praktikal Member

    Dynamic Sigs for Dummies

    Nice tut Helped me
     
  7. Unread #4 - Nov 24, 2007 at 5:39 PM
  8. Gamerware
    Joined:
    Nov 14, 2007
    Posts:
    166
    Referrals:
    0
    Sythe Gold:
    0

    Gamerware Active Member
    Banned

    Dynamic Sigs for Dummies

    verify and explain cause ur banned......... im not risking it lol
     
  9. Unread #5 - Nov 25, 2007 at 11:43 AM
  10. Cheeter
    Joined:
    Jun 5, 2005
    Posts:
    3,851
    Referrals:
    1
    Sythe Gold:
    31
    Discord Unique ID:
    236215891849641985
    Discord Username:
    Charkel#8050
    Extreme Homosex Homosex

    Cheeter Grand Master
    Cheetah Retired Global Moderator

    Dynamic Sigs for Dummies

    He's banned due to infractions, not for making this guide. And as you can see in the code there's nothing malicious... Jeez
     
  11. Unread #6 - Nov 25, 2007 at 1:44 PM
  12. adam000
    Referrals:
    0

    adam000 Guest

    Dynamic Sigs for Dummies

    nice tut man thnkas
     
  13. Unread #7 - Dec 1, 2007 at 2:32 PM
  14. LJ.
    Joined:
    Dec 1, 2007
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0

    LJ. Newcomer

    Dynamic Sigs for Dummies

    Nice guide, helped me and my friend a lot :D
     
  15. Unread #8 - Dec 2, 2007 at 2:07 AM
  16. MohtasaUnique
    Joined:
    Sep 1, 2007
    Posts:
    6,681
    Referrals:
    2
    Sythe Gold:
    690
    Discord Unique ID:
    158831078964985856
    Discord Username:
    Tony#2235

    MohtasaUnique Grand Master
    Retired Global Moderator

    Dynamic Sigs for Dummies

    very basic yet very helpful, thank you.
     
  17. Unread #9 - Dec 4, 2007 at 9:32 PM
  18. Hobo
    Joined:
    Aug 23, 2007
    Posts:
    332
    Referrals:
    0
    Sythe Gold:
    0

    Hobo Forum Addict

    Dynamic Sigs for Dummies

    Nice tut <3
     
  19. Unread #10 - Dec 19, 2007 at 4:53 PM
  20. zaks
    Joined:
    May 5, 2007
    Posts:
    55
    Referrals:
    1
    Sythe Gold:
    0

    zaks Member

    Dynamic Sigs for Dummies

    lol made simple hell its copy and past
     
  21. Unread #11 - Dec 19, 2007 at 7:14 PM
  22. fishy guru
    Joined:
    Dec 16, 2007
    Posts:
    121
    Referrals:
    1
    Sythe Gold:
    0

    fishy guru Active Member

    Dynamic Sigs for Dummies

    im confused lol, if this is "simple" i think im gonna go jump off some apartments downtown...

    I guess you helped other people though :D
     
  23. Unread #12 - Dec 19, 2007 at 11:07 PM
  24. the_wippit
    Joined:
    Jan 21, 2007
    Posts:
    1,507
    Referrals:
    0
    Sythe Gold:
    0

    the_wippit Guru
    Banned

    Dynamic Sigs for Dummies

    this is a great user friendly guide i think it should be sickied
     
  25. Unread #13 - Dec 20, 2007 at 7:54 PM
  26. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    Dynamic Sigs for Dummies

    .

    All you're doing is adding text o_O
     
  27. Unread #14 - Dec 21, 2007 at 5:26 AM
  28. Suby
    Joined:
    Aug 17, 2007
    Posts:
    142
    Referrals:
    0
    Sythe Gold:
    0

    Suby Active Member
    Banned

    Dynamic Sigs for Dummies

    Nice tut, thanks
     
  29. Unread #15 - Dec 27, 2007 at 6:51 PM
  30. qball
    Joined:
    Dec 5, 2007
    Posts:
    135
    Referrals:
    0
    Sythe Gold:
    0

    qball Active Member

    Dynamic Sigs for Dummies

    I know that youre banned but i just hope you might one day read this. Lol you idiot how would he be able verify this if hes banned.
     
  31. Unread #16 - Dec 30, 2007 at 10:41 AM
  32. cheeseman86
    Referrals:
    0

    cheeseman86 Guest

    Dynamic Sigs for Dummies

    even thogh im a freaking geainus about computers,i dont get this
     
  33. Unread #17 - Dec 31, 2007 at 3:28 AM
  34. Cruel__Machine
    Referrals:
    100

    Cruel__Machine Guest

    Dynamic Sigs for Dummies

    Too basic, not a very good tut.
    Because it doesn't explain how you can't use php scripts within image tags of most forum. You'll have to rename the script to .jpg (or w/e) and set the server to run it as a php script... or there are a couple other methods, but this one is the easiest imo.

    Then you could still have the filetype in the base name to adhere to the forum sig restrictions. Like this:

    http://cruels.net/sigs/progress/Some stupid title.../Some stupid label.../74.png

    [​IMG]

    EDIT: Oh... source and crap here: http://cruels.net/index.php?showtopic=4096
     
  35. Unread #18 - Jan 1, 2008 at 5:38 AM
  36. Lulz
    Joined:
    Nov 29, 2007
    Posts:
    90
    Referrals:
    0
    Sythe Gold:
    0

    Lulz Member
    Banned

    Dynamic Sigs for Dummies

    So like this :D
    [​IMG]

    Anyone got an actual tut for dynamic sigs that explains more in-depth?
     
  37. Unread #19 - Jan 1, 2008 at 5:40 PM
  38. Toxic Frenzy
    Referrals:
    0

    Toxic Frenzy Guest

    Dynamic Sigs for Dummies

    Confused.com :]
     
  39. Unread #20 - Jan 1, 2008 at 6:27 PM
  40. Cruel__Machine
    Referrals:
    100

    Cruel__Machine Guest

    Dynamic Sigs for Dummies

    [​IMG]
    :D
     
< how do i make my sig bigger? | Need sig help. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site