it looks simple ...but many php godfathers could not solve it,can you solve this?

Discussion in 'PHP' started by sriducati, Jan 2, 2010.

  1. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #21
    danx10, Jan 6, 2010 IP
  2. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #22
    I'm in tunisia, I will open it in anyway.
    danx10, the link you give is blocked too :)
     
    Izonedig, Jan 7, 2010 IP
  3. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #23
    I now can see it.
    You should edit pictext.php, not the index page that you posted in this forum :)
     
    Izonedig, Jan 7, 2010 IP
  4. sriducati

    sriducati Peon

    Messages:
    287
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #24
    hello Izonedig
    i have pm'd you the pictext.php and index.php source code...expecting your good response ..thank you...
     
    sriducati, Jan 7, 2010 IP
  5. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #25
    In pictext.php,
    change this:
    $pictext = $_POST['pictext'].''.$_POST['pictext2'];
    to this:
    $pictext = $_POST['pictext'];
    $pictext2 = $_POST['pictext2'];



    then find this line:
    $im = imagecreate($sizeX, $sizeY);
    replace it by:
    $im = imagecreate($sizeX, $sizeY*2);
    This will let you have an image higher.


    Then find:
    imagettftext($im, $fontsize, 0, 15, $sizeYT, $font_color, $fontpath, $pictext);
    Add just after it:
    imagettftext($im, $fontsize, 0, 15, $sizeYT+$fontsize+0, $font_color, $fontpath, $pictext2);

    So that it becomes:
    imagettftext($im, $fontsize, 0, 15, $sizeYT, $font_color, $fontpath, $pictext);
    imagettftext($im, $fontsize, 0, 15, $sizeYT+$fontsize+0, $font_color, $fontpath, $pictext2);

    This will create the two lines, you see the +0 ? change it to anything you want so that image and lines will be cool; ie: +5, +10 ... (this is the y position of the second text)


    This all will make you able to see two lines.
     
    Izonedig, Jan 8, 2010 IP
    ShadyStudent likes this.
  6. ShadyStudent

    ShadyStudent Peon

    Messages:
    341
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #26
    Izonedig you have been repped. Just for helping out so far. :)

    Justads - I hope you are grateful!
     
    ShadyStudent, Jan 8, 2010 IP
  7. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #27
    Thank you :)
     
    Izonedig, Jan 8, 2010 IP
  8. sriducati

    sriducati Peon

    Messages:
    287
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #28
    ya am greatfull to Izonedig if am the owner of this forum ...i would have made Izonedig the super moderator...:) by giving him the maximum rep i can....you simply rock Izonedig..........god bless you.....:)
     
    sriducati, Jan 8, 2010 IP
  9. sriducati

    sriducati Peon

    Messages:
    287
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #29
    hello Izonedig your code works fine by displaying second line below the first line entered....but if a user enters only in the first text box and does not enters anything in the second text box then it displays the output with the first line entered and blank space in place of second text...is it possible to remove that blank space so that image should have only the first line entered and viceversa ...plzz check out the demo once.. thank you....
     
    sriducati, Jan 8, 2010 IP
  10. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #30
    Thank you, and you are welcome :)
     
    Izonedig, Jan 8, 2010 IP
  11. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #31
    Ah, ok ! The image width is not fixed, it depends on the text lenght, that's why you can't see the complete text in the second line.

    So the solution is to choose the width not according to the first line, bu the maximum of the two lines. I sent you the modifications in PM.

    About how to remove the second line if it is empty, it should be simple, just an if condition: if (@$_POST["pictext2"] <> 0 )

    you should add this to each new script that manage the new line.

    for every new script/code in your pictext.php do this:
    
    if (@$_POST["pictext2"] <> 0 ){
    the new code here
    } else {
    the old code here
    }
    
    Code (markup):
    that's it :D
     
    Last edited: Jan 8, 2010
    Izonedig, Jan 8, 2010 IP
  12. sriducati

    sriducati Peon

    Messages:
    287
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #32
    hello everyone...am back with one more doubt... is it possible to provide a color option for text shadow...i mean text shadow color...!!!!!just like font color??
     
    Last edited by a moderator: Jan 12, 2010
    sriducati, Jan 12, 2010 IP
  13. sriducati

    sriducati Peon

    Messages:
    287
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #33
    hello every one am still looking to change shadow properties of an image without using anyother scripts than php...expecting your response guyz ...
     
    sriducati, Jan 15, 2010 IP
  14. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #34
    CodedCaffeine, Jan 15, 2010 IP