Jump to content

gfX

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gfX's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK I am getting close! After reading on Stackoverflow here is what I have now: http://www.autoshopgarage.com/new-era/test2.php?text=testing+%3Cb%3Escript%3C/b%3E%20this%20is%20so%20cool%20i%20love%20it That does what I want, the only problem with this is now I can't get the wordwrap to work! It should wrap to the next line, but I cannot seem to get it. Here is the new PHP code: <?php header('Content-type: image/png'); $im = imagecreatefrompng ( "banner_blank.png" ); $color = imagecolorallocate($image, 0, 0, 0); $tmp = $_GET['text']; $words = explode(" ", $tmp); $x = array(0,0,230); // DUMMY ARRAY WITH X POSITION FOR FIRST WORD $addSpace = 0; foreach($words as $word) { if($addSpace) $word = " ".$word; // IF WORD IS NOT THE FIRST ONE, THEN ADD SPACE if(stristr($word, "<b>")) { $font = 'HelveticaNeueLTStd-BdEx.ttf'; // BOLD FONT $replace = str_replace(array("<b>","</b>"), "", $word); $x = imagettftext($im, 20, 0, $x[2], 20, $color, $font, $replace); } else { $font = 'HelveticaNeueLTStd-LtEx.ttf'; // NORMAL FONT $x = imagettftext($im, 20, 0, $x[2], 20, $color, $font, $word); } $addSpace = 1; } imagepng($im); imagedestroy($im); ?> Anyone have any ideas? Thanks!
  2. Hi guys, Here is what I have so far: http://www.autoshopgarage.com/new-era/generate.php What I am trying to do is instead of having Line 1 and Line 2, I want to just have one big textarea so I don't have to limit the user so much. I did it this way because I want to have two versions of text, the light version and the bold version. Is it possible to have two different fonts with just one textarea of text? Right now I have two functions: So I would limit that to just 1, and it would automatically wordwrap but what would I put for the $font variable? Is this even possible? I was thinking of just using BBCode so they could type in [b*]Bold Text[/b*] and it would use the Bold version of the font if it sees that. Any help is appreciated. Thanks! Here is the full code:
  3. Soooooo.. <table border="0" cellspacing="0" cellpadding="1" align="center"> <tr> <?php $sql = mysql_query("SELECT * FROM `layouts` ORDER BY `id` ASC"); $i = 0; while ($r=mysql_fetch_assoc($sql)) { $i++; $id = $r['id']; $title = $r['title']; $code = $r['code']; $thumbnail = $r['thumbnail']; if ($i > 0 && $i % 5 == 0) { print "</tr><tr>"; } echo "<td width='25%' align='center' valign='top'> <a href='http://www.layoutslife.com/code.php?id=$id'> <img src='http://www.layoutslife.com/thumbnails/$thumbnail' border='0' width='160' height='120' /></a> <br /><b>$title</b><br /></td>"; } ?> </tr> </table> ?? Almost there, Preview at: www.layoutslife.com
  4. Hello. What I am trying to do, is have 12 total layouts showing. 3 rows of 4. I am using tables for this, and it is generated using PHP. <table border="0" cellspacing="0" cellpadding="1" align="center"> <?php $sql = mysql_query("SELECT * FROM `layouts` ORDER BY `id` ASC"); $i = 0; while ($r=mysql_fetch_assoc($sql)) { $i++; $id = $r['id']; $title = $r['title']; $code = $r['code']; $thumbnail = $r['thumbnail']; if (($i == 5)) { echo "<tr>"; } echo "<td width='25%' align='center' valign='top'> <a href='http://www.layoutslife.com/code.php?id=$id'> <img src='http://www.layoutslife.com/thumbnails/$thumbnail' border='0' width='160' height='120' /></a> <br /><b>$title</b><br /></td>"; if (($i == 5)) { echo "</tr>"; } } ?> </table> That's the code I have, which I know is definitely wrong because it isn't working! Does anyone know how I can get this done? Here is a screenshot of how it displays with my current code: Thanks
  5. gfX

    Gallery Help

    Ah Thanks, that worked. Yeah that's from images being deleted from the database :( I wish that could be fixed, but other than that I really appreciate it! Thakns so much
  6. gfX

    Gallery Help

    Great man, fixed that one.  Now the only problem is that there is no next link.  It just shows the text. Any reason for that?
  7. gfX

    Gallery Help

    Hey there, Thakns for taking the time to supply that code! I get: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hsphere/local/home2/andres30/vivagaete.com/viewgallery.php on line 21 Line 21: $total_rows = mysql_num_rows($sql); // find out how many rows are in that table, see what the max number is http://www.vivagaete.com/viewgallery.php?id=5
  8. gfX

    Gallery Help

    Thanks for the replies! That did work, but like KingPhilip said, I need it to check if it is in the database to get the right ID's. How would I make that if statement? Thanks a lot for the help.
  9. Hey guys, I have a gallery for a website: http://www.vivagaete.com/gallery.php If you click on the thumbnail it will bring up viewgallery.php - which has the larger image on it. What I want, is for viewgallery.php to have the options for "PREVIOUS and NEXT" images.  So they don't have to click "Click here to Go Back" every time, they can browse by clicking the NEXT link or PREVIOUS. How would I go about doing this to pull the next image ID from the database? Here is the code for viewgallery.php: [code] <style type="text/css"> .greentext { color: #2a8f3d; margin: 4px; font-family: Tahoma; font-size: 19px; } .blacktext { color: #000000; margin: 4px; font-family: Tahoma; font-size: 11px; } </style> <? include 'db.php'; $getid = $_GET['id']; $sql = "SELECT * FROM gallery WHERE id = $getid"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $picture = $row['picture']; $heading = $row['heading']; $description = $row['description']; } $sql2 = "SELECT id FROM gallery WHERE id > $id LIMIT 1"; $result2 = mysql_query($sql2); while ($row = mysql_fetch_array($result)) { $id = $row['id']; } if ($getid == "$id") { echo "<center> <FORM> $id <INPUT type='button' value='Click here to go back' onClick='history.back()'> </FORM> <div class=\"greentext\"><b>$heading</b></div> <div class=\"blacktext\">$description</div><br /> <img src=\"images/$picture\" style=\"border: 2px solid #d4cccc;\"><br /><br /> <FORM> <INPUT type='button' value='Click here to go back' onClick='history.back()'> </FORM></center>"; } else { echo "No image verfied"; } ?> [/code] Thanks a lot!!
  10. Thank you very much! This is random but how do you remove a file from FTP using PHP?
  11. I don't get what that has to do with it.
  12. Didn't work man, There were a few errors which I fixed up but that code isn't working :(
  13. Okay, So I have a photogallery with pagination.  And I set the limit to 3 photos per page.  And it has pagination for different pages. So, Say I have 7 Images in the database.  I SHOULD have 3 pages, and the third page should only have one image.  Well, My problem is:  If I had 7 images, It would only make 2 pages, and not make that third page, until I reached the limit (3 images). Here is the code: [code] <? include 'header.php';   include 'db.php'; ?> <div class="greentext">Select the photo you would like to view:<br /><br /> <?                  $num = $_GET['num']; if(empty($num)){ $num = 1; }; $limit = 3; $start = ($num-1)*$limit; $start = round($start,0); $sql = "SELECT * FROM `gallery` ORDER by `id` LIMIT $start, $limit"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { echo " <a href='viewgallery.php?id=$row[id]'><img src='galleryimages/$row[picture]' width='222' height='167' style='border: 2px solid #d4cccc;'>&nbsp;&nbsp;&nbsp;&nbsp;</a>"; } ?> <br /><br /> <? $totalpages = mysql_num_rows(mysql_query("SELECT * from `gallery`")); $totalpages = $totalpages / $limit; $totalpages = round($totalpages,0); $c = 0; while($c<$totalpages){ $page = $c + 1; if($_GET['num']==$page){ echo "&nbsp;&nbsp;[$page]"; }else{ echo "&nbsp;&nbsp;<a href=?num=$page>[$page]</a>"; } $c = $c+1; } echo "<br>".$totalpages." Pages in total.";     ?> </div> <? include 'footer.php'; ?> [/code] Thanks!
  14. Alright, I understand. So can you give me the correct code for this script to work? I tryed and it still did the same thing for me. Weird Thankss.
  15. Well if they didn't put a password - it would still be the old one. Because this is for admins, and what if they just want to update the users e-mail address. And even if I edit that stuff, The page still messes up. It says "UPDATED" just when I go to that page and clears that record in the database with blanks.
×
×
  • 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.