Jump to content

TheBurtle

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TheBurtle's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Unfortunately, at 38, no longer school worthy. It was a little more of an idle curiosity that I had never been able to figure out. I would start, then over-complicate the code, get frustrated, and walk away from it for a year or so until I remembered it again. It's not even like it's necessarily usable. I guess you could call it a poor man's text compression program. But, hey, thanks again, jonsjava, for the point in the right direction.
  2. On the output line: echo end(array_reverse(explode("\n", wordwrap($str, $chars)))) . ' ...'; ?> Have you tried to capture the actual output to check for odd newlines and exact HTML code? Sorta like: $array = array(); $array[0] = end(array_reverse(explode("\n", wordwrap($str, $chars)))) . ' ...'; echo end(array_reverse(explode("\n", wordwrap($str, $chars)))) . ' ...'; ?> <!-- hidden <? print_r($array); ?> --> If you could, would you post the print_r output?
  3. Absolutely great! Thanks a ton. You're right, isn't what I expected, but is that great big nudge in the right direction.
  4. The only other thing I can see is this: echo end(array_reverse(explode("\n", wordwrap($str, $chars)))) . ' ...'; ?> The wordwrap() function defaults to 75 characters, I think, before adding a \n. Not sure, though. Hard to tell without knowing how $chars is defined.
  5. Let's try one more thing... <table border="0" align="left" cellpadding="0" cellspacing="0" height="122" width="494" background="img/bgbox2_494x1.jpg"> <tr> <td height="11"></td> </tr> <form name="supportform" method="post" action="newsmore.php"> <input type="hidden" name="id" /> <? $counter="0"; while($row = mysql_fetch_array($result)) { $counter=$counter+1; if($counter == "1") {$bg="img/bgbox2_494x1.jpg";} if($counter == "2") {$bg="img/bgbox2_494x1b.jpg";} if($counter == "3") {$bg="img/bgbox2_494x1.jpg";} if($counter == "4") {$bg="img/bgbox2_494x1b.jpg";} if($counter == "5") {$bg="img/bgbox2_494x1.jpg";} ?> <tr> <td background="<? print("$bg"); ?>" height="20"><div style="color:#FFFFFF; margin-left:15px; margin-right:15px; font-family:Arial, Verdana, Helvetica, sans-serif; font-size:9px"> <? $str = $row['entry_date'] . $spacer . $row['maintext']; if(strlen($str) > $chars) { echo end(array_reverse(explode("\n", wordwrap($str, $chars)))) . ' ...'; ?> <div style="color:#FFFFFF; font-size:9px"> <a href="javascript:getsupport('<? echo $row ['id']; ?>')"> more </a> </div> <? } else {echo $str . '... <a href="#">more</a>';} ?> </div> </td> </tr> </form> <? } ?> <tr><td height="11"></td></tr> </table>
  6. 1. Make sure images are fully qualified (http://www.yoursite.com/images/image.png) and not (./images/image.png) 2. I have never bothered trying to get CSS to work remote from email, so the best I could offer there would be to embed the CSS in your normal style tags Not a full fix, but hope this helps.
  7. Try this... <div style="color:#FFFFFF; font-size:9px"><a href="javascript:getsupport('<? echo $row ['id']; ?>')">more</a></div> Edit: Oops. There we go. Fixed.
  8. I think the {} count may be off... Example: That still leaves one { open. Hope this helps.
  9. Here's a riddle for PHP coders out there... I want to take a string, and find patterns. RegExp, you say? Exactly, but it gets a little more complex than that. You see, I don't know what I am looking for. Neither will the code. The only thing we know is that we want to find the largest "patterns" in a file, and replace it with a number. Here's an example of what I am talking about, "pseudocode" style: Text to be scanned: God is great, God is good, Let us thank him for our food. Scan complete. Largest pattern: "God is g" Found twice, replaced with "1", noted and removed. Now we have: 1reat, 1ood, Let us thank him for our food. Second scan complete. Largest pattern: "ood" Found twice, replaced with "2", noted and removed. Now we have: 1reat, 12, Let us thank him for our f2. Third scan complete. Largest pattern: "r_" (Underscore is whitespace) Found twice, noted and removed. Now we have: 1reat, 12, Let us thank him fo3ou3f. No more patterns of two or greater. Therefore, pattern matching is over. Now, imagine this on a work like Hamlet. I think you see what I am saying. Thanks in advance!
×
×
  • 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.