Jump to content

pleek

Members
  • Posts

    135
  • Joined

  • Last visited

Posts posted by pleek

  1. HTML

    <SELECT NAME="BG" ID="BGChooser" onchange="changeimg()">
    <OPTION VALUE="0">Choose a Background...
    <OPTION VALUE="0">None
    <OPTION VALUE="1">Little Big Planet
    <OPTION>Other Background
    </SELECT>
    

     

    Javascript

    function changeimg(){
    document.getElementById(\'Card\').src=\'http://craigh.tlcrepair.net/ConsoleCard/ConsoleCardTwo/index.php?UserName=' .$UserName. '&Posts=' .$UserPosts. '&PS=' .$PersonalText. '&Site=' .$Website. '&Av=' .$UserAvatar. '&Group=' .$Group. '&BG=\' + document.getElementById(\'BGChooser\').value;
    }
    

     

    The code above doesn't work but when i replace "document.getElementById(\'BGChooser\').value" with "1" it works fine. How am i supposed to do this so when the user changes the dropdown menu it gets the value and adds it to the url in the function?

     

     

  2. Cut on the question mark and then cut on the last period.

     

    $ext=array_pop(explode('.',array_shift(explode('?',$url))));
    

    Won't that show php as the filetype? The file itself is a png image.

     

    parse_url()

     

    I read the php manual for parse_url and im not seeing how that will get the files extension.

  3. ok, i don't get it. I have scoured the internet for hours on how to fix this but i can't figure out anything. And i can't find anything wrong with my code ether. PLEASE HELP!!!

     

    The image looks perfect. But when you save it and open it in photoshop it has a white background. But its supposed to be transparent. Thats my problem.

     

    See the image here

     

    <?php
    
    header('Content-type: image/png');
    
    $new_image = ImageCreateTruecolor(418, 252);
    imagealphablending($new_image, true);
    $bg = ImageColorAllocateAlpha($new_image, 255, 255, 255, 127);
    ImageFill($new_image, 0, 0 , $bg);
    
    $Background = imagecreatefrompng('BackgroundOne.png');
    $Logo = imagecreatefrompng('CcLogo.png');
    $AvatarBackground = imagecreatefrompng('AvatarBackground.png');
    $Avatar = imagecreatefrompng('Avatar.png');
    $AvatarReflection = imagecreatefrompng('AvatarReflection.png');
    $UserRank = imagecreatefrompng('administrator.png');
    
    imagecopy($new_image, $Background, 3, 42, 0, 0, 412, 167);
    imagecopy($new_image, $Logo, 0, 0, 0, 0, 247, 252);
    imagecopy($new_image, $AvatarBackground, 5, 44, 0, 0, 134, 164);
    imagecopy($new_image, $Avatar, 12, 56, 0, 0, 120, 139);
    imagecopy($new_image, $AvatarReflection, 11, 49, 0, 0, 120, 143);
    imagecopy($new_image, $UserRank, 280, 50, 0, 0, 128, 28);
    
    imagepng($new_image);
    imagedestroy($new_image);
    imagedestroy($Background);
    imagedestroy($Logo);
    imagedestroy($Avatar);
    imagedestroy($AvatarReflection);
    imagedestroy($UserRank);
    
    ?>
    

     

  4. bump* i can put as many pngs as i want using imagecopymerge and imagecopy. But beyond the background gif i can't get any more gifs to work. And now that i got the transparencies working the imagestring won't show up. heres the new code.

     

     

    <?php
    
    header('Content-type: image/png');
    
    // Set a White & Transparent Background Color
    $new_image = ImageCreateTruecolor(345, 130);
    $bg = ImageColorAllocateAlpha($new_image, 255, 255, 255, 127); // (PHP 4 >= 4.3.2, PHP 5)
    ImageFill($new_image, 0, 0 , $bg);
    
    
    $String = $_GET['text'];
    $UserRank = imagecreatefrompng('elitemember.png');
    $UserAvatar = imagecreatefrompng('avatar.png');
    $Background = imagecreatefromgif('Background.gif');
    $TextColor = imagecolorallocate($Background, 225, 225, 225);
    $Font = imageloadfont('Kozuka Gothic Pro B.gdf');
    imagecopymerge($new_image, $Background, 0, 0, 0, 0, 345, 130, 50);
    imagecopymerge($new_image, $UserRank, 110, 55, 0, 0, 128, 28, 100);
    imagecopy($new_image, $UserAvatar, 0, 0, 0, 0, 128, 128);
    imagestring($new_image, $Font, 90, 15, $String, $TextColor);
    imagepng($new_image);
    imagedestroy($new_image);
    imagedestroy($Background);
    imagedestroy($UserAvatar);
    imagedestroy($UserRank);
    ?>
    

     

    view it here

  5. if you clicked the "here is the result" link you can see how big userrank is. It 128 * 28. And im not sure how to set the transparency for $background. How do i do that? And yes i know its GD not GD. But i didn't notice my error till after i posted it and it won't let me edit it.

  6. Ok, so im learning GC and alls going well but im stuck. The second image that is supposed to merge with $background isn't showing up.

     

    <?php
    
    header('Content-type: image/png');
    $String = $_GET['text'];
    $UserRank = imagecreatefrompng('elitemember.png');
    $UserAvatar = imagecreatefromgif('avatar.gif');
    $Background = imagecreatefrompng('Background.png');
    $TextColor = imagecolorallocate($Background, 225, 225, 225);
    $Font = imageloadfont('Kozuka Gothic Pro B.gdf');
    imagestring($Background, $Font, 90, 15, $String, $TextColor);
    imagecopymerge($Background, $UserRank, 110, 55, 0, 0, 128, 28, 100);
    imagecopymerge($Background, $UserAvatar, 20, 20, 0, 0, 160, 160, 100);
    imagepng($Background);
    imagedestroy($Background);
    imagedestroy($UserRank);
    imagedestroy($UserAvatar);
    ?>
    

     

    The image $UserAvatar is not showing up but $UserRank is. Also how can i stop the transparent parts in $background from turning black? Here is the result

  7. ok, wow those tips helped a ton. I made a lot of progress. I also solved my image problem by using "align="absmiddle"". I have everything how i want it except the search box. I tried a few things, but im not sure how to get it aligned to the right without it going to a new line. And using the link posted for the image input button uses tables and that makes it start on a new line.

     

    New code:

    <html>
    <head>
      <title>Pleek</title>
      <style type="text/css">
        #statbar {
          width: 100%;
          background-color: #888888;
          background: url(barbg.jpg);
          font-family: calibri,arial,sans-serif;
          font-size: 1.2em;
          color: #ffffff;
          padding: 4px 0px 4px 6px;
          position: fixed;
      		top: 0px;
      		left: 0px;
      		right: 0px;
        }
        #statbar a {
          color: #ffffff;
        }
        #statbar a:hover {
          color: #1e1e1e;
        }
      </style>
    </head>
    <body>
      <div id="statbar">
        Welcome <a href="#">Pleek</a> <A HREF="#"><IMG SRC="Logout.png" border="0" align="absmiddle"></A> <IMG SRC="Divider.gif" align="absmiddle"> You have 2 <a href="#">new messages</a> <IMG SRC="Divider.gif" align="absmiddle"> <a href="#">Profile</a> 
    <INPUT TYPE="text" NAME="search" VALUE="Search...">
      </div>
    </body>
    </html>
    

     

    go2q2r08lkqrkq1g6883.jpg

  8. ok, i have a concept for a menu bar i want to make. When i put it together looks all jacked up. I really need some help here.

     

    This is what i want it to look like (I have the psd i made, if you need it).

    idbppqke0d3cja22ips.jpg

     

    this is what i've got so far

    f0ba15b9kl28xtemf7s.jpg

     

    Things i really need help with.

     

    1. ALIGNMENT!!! i have tried align, valign, and more and i can't get everything strait.

    • The valign of the images and text
    • Getting the search box to stay all the way to the right

    2. The search box, i want this as the background d754mceq0ge2h6xhylkz.gif but don't have a clue on how to do it.

     

    The code i have

     

    html

    <TABLE class="bar">
    <TR>
    	<TD>
    	Hello <A HREF="#" class="menu">Pleek</A> <A HREF="#"><IMG SRC="Logout.png" border="0"></A>
    	<IMG SRC="Divider.gif"> You have 2 <A HREF="#" class="menu">new messages</A>
    	<IMG SRC="Divider.gif"> <A HREF="#" class="menu">Profile</A>
    	</TD>
    	<TD>
    	<INPUT TYPE="text" NAME="search" VALUE="Search...">
    	</TD>
    </TR>
    </TABLE>
    

     

    css

    a.menu:link {
     color: white;
     text-decoration: underline;
    }
    a.menu:visited {
     color: white;
     text-decoration: underline;
    }
    a.menu:hover {
    color: #1e1e1e;
     text-decoration: none;
    }
    
    .bar {
    background: url(barbg.jpg);
    width: 100%;
    height: 30px;
    position: fixed;
      top: 0px;
      left: 0px;
      right: 0px;
    color: white;
    padding-left: 10px;
    }
    

     

    Any suggestions?

  9. .bar {
    background: url(barbg.jpg);
    width: 100%;
    height: 30px;
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    color: white;
    padding-left: 10px;
    float: left;
    clear:both;
    text-align:left;
    }
    

     

    and this is what it looks like.

    hldav0ryzwcpty7zyffs.jpg

     

    i need the text and the image to be even, each thing i try moves it some but doesn't make them line up.

  10. i have this code table

     

    <TABLE class="bar">
    <TR>
    	<TD>
    	Hello <A HREF="http://craigh.tlcrepair.net/smf2/index.php?action=profile;u=1" class="menu">Pleek</A> <IMG SRC="LogOut2.png">
    	</TD>
    </TR>
    </TABLE>
    

     

    but when i view it in ff the image doesn't line up right. its higher than all the text. If i put it in a new <td> it aligns right but then its way off to the side. How do i fix this?

  11. ok, i have this code

     

    script type="text/javascript">
    function changeText(){
    var donationAmount = document.getElementById('amount').value;
    document.getElementById('boldStuff').innerHTML = donationAmount;
    document.getElementById('donation').value = donationAmount;
    }
    </script>
    
    <input type="text" id="amount">
    <input type='button' onclick='changeText()' value='Change Text'/>
    
    <p>donate <b id='boldStuff'>$0.00</b> </p>      
    
    <input type="hidden" id="donation" name="amount" value="0.00"/>
    

     

    i didn't include the whole form, just the input for the amount. The form works by itself, and the 'boldstuff' amount changes with "changetext()". But it doesn't change the input value, what am i doing wrong?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.