Demonic Posted September 9, 2006 Share Posted September 9, 2006 yeah my bulletin boards table is messing up like the <TD> tag is streching is thier a way to limit how long each line has to be before is goes to a new line because i tried maxing the table's width and the length; any suggestions?preview: http://skins.nevux.info/viewtopic.php?id=1 (second post) Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/ Share on other sites More sharing options...
kenrbnsn Posted September 9, 2006 Share Posted September 9, 2006 Please post your code. Without it we can't even begin to guess what you have done wrong.When you post the code, please put it between [color=red][b][nobbc][code][/code][/nobbc][/b][/color] tags.Ken Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89023 Share on other sites More sharing options...
coldkill Posted September 9, 2006 Share Posted September 9, 2006 Try using the CSS width attribute on your tables. Also your table cell tags should be <td> (lower case) not <TD>. Hope that helps,Cold Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89024 Share on other sites More sharing options...
Barand Posted September 9, 2006 Share Posted September 9, 2006 if you want to limitto, say, 50 characters max, then[code]echo wordwrap("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",50, '<br>', true);[/code] Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89026 Share on other sites More sharing options...
Barand Posted September 9, 2006 Share Posted September 9, 2006 [quote author=coldkill link=topic=107480.msg431277#msg431277 date=1157826686]Also your table cell tags should be <td> (lower case) not <TD>. Cold[/quote]When did HTML tags become case sensitive? They must have sneaked that in quickly when I wasn't looking. Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89028 Share on other sites More sharing options...
.josh Posted September 9, 2006 Share Posted September 9, 2006 you mean you didn't get that memo? Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89032 Share on other sites More sharing options...
corbin Posted September 9, 2006 Share Posted September 9, 2006 I got the memo!!!!! Haha i think they still work fine upper case they just arent w3c complient when in uppercase... Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89033 Share on other sites More sharing options...
Demonic Posted September 9, 2006 Author Share Posted September 9, 2006 well i tried the wordwrap but it seems it doesnt work the script is like 300+ lines long so..[code]<?php if(!isset($_GET['page'])){ $page = 1;} else { $page = $_GET['page'];} $max_results =6;$from = (($page * $max_results) - $max_results); /*---------------------------Limit topics script starts here mod rewrite By Demonic----------------------------*/$replies = mysql_query("SELECT * FROM replies WHERE tid='$s' ORDER BY id ASC LIMIT $from, $max_results");/*---------------------------Limit topics script starts here mod rewrite By Demonic----------------------------*/while($td = mysql_fetch_array($replies)){?><table class="ttopics" border="0" style="border:1px solid #000;border-top:0px;"><tr><td width="30%" valign="top" class="topics"><? echo "<a href='profile.php?profile=".$td[username]."'>".$td[username]."</a>"; ?><br><?php if($logged[level] != 5 && $logged[level] != 3 && $logged[level] != 4){ echo ""; } else { echo "<a href='tedit.php?id=$td[id]'>Edit</a>|<a href='tdelete.php?id=$td[id]'>Delete</a>"; } if($logged[level] ==1 && $logged[username] == $td[username]){ echo "<a href='tedit.php?id=$td[id]'>Edit</a>";}$spostusername = $td[username];$signature = mysql_query("SELECT * FROM users WHERE username='$spostusername' ") or die(mysql_error());$usersig = mysql_fetch_array($signature);if($usersig[avatar] ==null){ echo "<br><img src='noavater.gif'><br>";}else{ echo "<br><img src='".$usersig[avatar]."'><br>";}echo "<b>User Id:</b> ".$usersig['id']."<br>";echo "<b>User Level:</b> ".$usersig['level']."<br>";echo "<b>Posts:</b> ".$usersig['post']."<br>"; ?></td><td width="70%" class="topics" valign="top"><? /*-----BBtags extended-------*/ $simple_search3 = array( //added line break '/\[br\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[align\=(left|center|right)\](.*?)\[\/align\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[mail\=(.*?)\](.*?)\[\/mail\]/is', '/\[mail\](.*?)\[\/mail\]/is', '/\[font\=(.*?)\](.*?)\[\/font\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is', '/\[color\=(.*?)\](.*?)\[\/color\]/is', //added textarea for code presentation '/\[codearea\](.*?)\[\/codearea\]/is', //added pre class for code presentation '/\[code\](.*?)\[\/code\]/is', //added paragraph '/\[p\](.*?)\[\/p\]/is', '/\[php\](.*?)\[\/php]/is', ); $simple_replace3 = array( //added line break '<br />', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', // added nofollow to prevent spam '<a href="$1" rel="nofollow" title="$2 - $1">$2</a>', '<a href="$1" rel="nofollow" title="$1">$1</a>', '<div style="text-align: $1;">$2</div>', //added alt attribute for validation '<img src="$1" alt="" />', '<a href="mailto:$1">$2</a>', '<a href="mailto:$1">$1</a>', '<span style="font-family: $1;">$2</span>', '<span style="font-size: $1;">$2</span>', '<span style="color: $1;">$2</span>', //added textarea for code presentation '<textarea class="code_container" rows="30" cols="70">$1</textarea>', //added pre class for code presentation '<font color="black"><b>Code:</b></font><br><pre class="code" style="color:#000;background-color:#FFF;border:1px solid #000;">$1</pre>', //added paragraph '<p>$1</p>', '<?php highlight_string("$1"); ?>', ); $td[post] = preg_replace ($simple_search3, $simple_replace3, $td[post]);/*----------------------BBTags----------------------*//*-------------------Smileys------------------------*/$td[post] = eregi_replace("\:\)","<img src='http://kay.smiley.free.fr/images/190.gif'>",$td[post]);$td[post] = eregi_replace("\;\)","<img src='http://fcorpet.free.fr/Meige/photos-Site/smiley.jpg'>",$td[post]);$td[post] = eregi_replace("\:\(","<img src='http://i.b5z.net/i/u/1530927/i/Smiley_-_Frown.jpg'>",$td[post]);$td[post] = eregi_replace("\:\D","<img src='http://img.bebo.com/img/smiley_big_grin.gif'>",$td[post]);$td[post] = eregi_replace("\X\D","<img src='http://ripcomixsite.free.fr/Wiki/Smileys/dkmsn_XD.png'>",$td[post]);/*-------------------Smileys------------------------*/$tdpost = $td[post];wordwrap($tdpost, 20, "<br>\n");echo nl2br($tdpost); ?> [/code]any ideas check the last bit.[code]<?phpob_start();/*-------------------------------------------------------------*//*---------All copyrighted NevuxBoards-----------------*//*------------------------2006-----------------------------*//*Author Lamonte alias Demonic & scheols Thanks to PHPFreaks for the pagination help!*//*------------------------------------------------------------*/include "config.php";$c = mysql_query("SELECT * FROM stylesheets WHERE id='1'") or die(mysql_error());$css = mysql_fetch_array($c);echo $css[css];$td = mysql_query("SELECT * FROM users");if($logged[username] && $logged[banned] ==1){echo "You do not have access to this page";exit();}?><HTML><!--BoardCenter DIV--><div align="center"><!--Dont Remove--><BODY align="center" width="100%"><head><!-Start.CopyRight DONTREMOVE--><title><? echo $sitename ?> - Powered By Nevux</title><!-EndCopyRight--></head><!--START.BANNER--><div id="head" class="middle"></div><!--END BANNER--><!--Start.Userlinks--><table class="ulink" width="100%" border="0" style="border:1px solid #000;border-top:0px;"><tr><td width="60%"><a href="index.php">Index</a><?phpif($logged[username] ==null){?>| <a href="login.php">Login</a> | <a href="register.php">Register</a></td><? } ?><td width="10%"><?phpif($logged[username]){?><a href="usercp.php?ucp=main">UserCp</a><? } ?></td><td width="10%"><a href="members.php">Members</a></td><td width="10%"><?if($logged[level]==5){?><a href="admincp.php">AdminCP</a>|<a href="modcp.php">ModCP</a><? } ?><?if($logged[level]==3 && $logged[level]==4){?><a href="modcp.php">ModCP</a><? } ?></td></tr></table><!--End.Userlinks--><?php$s = $_GET[id];?><table colspan=4 style="border:0px solid #000" width="90%"><tr><td><?php$rrt = mysql_query("SELECT * FROM replies WHERE tid ='$s' ");$s2 = mysql_fetch_array($rrt);if($logged[level] != 5 && $logged[level] != 3 && $logged[level] != 4){echo "";}else{echo '<a href="ts.php?id=' .$s.'">Sticky Topic</a>';}?><?php$none = mysql_query("SELECT * FROM topics WHERE id='$s'");while($c = mysql_fetch_array($none)){if($c[closed] == 0){echo "<img border='0' src='http://images.myioff.net/buttons_meer/statusicon/forum_old_lock.gif'>";}else {?><a href="addpost.php?id=<? echo $s; ?>"><img border="0" src="http://img246.imageshack.us/img246/9079/replyki8.png"></a></td><?}}?></td></tr></table><?php$topic = mysql_query("SELECT * FROM topics WHERE id='$s' ORDER BY id ASC ");?><?while($f = mysql_fetch_array($topic)){$cforum = mysql_query("SELECT * FROM forums");$current_forum = mysql_fetch_array($cforum);?><table class="category" width="100%" border="0" style="border:1px solid #000;border-top:0px;"><tr><td><? if($f[fid] == $current_forum[id]){ echo "<a href='viewforum.php?fid=".$current_forum[id]."'>".$current_forum[title]."</a> | ";} ?><? echo "<a href='viewtopic.php?id=".$f[id]."'>".$f[title]."</a>"; ?></td></tr></table><? } ?><?php$topic1 = mysql_query("SELECT * FROM topics WHERE id='$s' ORDER BY id ASC ");?><?while($t = mysql_fetch_array($topic1)){$s1 = array("http://invisionfree","invisonfree","invisionfree.com","http://invisionfree.com/","fuck","cunt","shit", "ASS", "WHORE", "pussy", "bitch","FUCKER","fucker","ass","dick","faggot"); // this is where you define all the bad words$t[post] = str_replace($s1, "*BLEEP*", "$t[post]"); // where bleep goes put the word you want it to be censored with ?><table class="ttopics" border="0" style="border:1px solid #000;border-top:0px;"><tr><td width="30%" valign="top" class="firstpost"><? echo "<a href='profile.php?profile=".$t[username]."'>".$t[username]."</a>"; ?><br><?php if($logged[level] != 5 && $logged[level] != 3 && $logged[level] != 4){ echo ""; } else { echo "<a href='fpedit.php?id=$s'>Edit</a>"; } if($logged[level] ==1 && $logged[username] == $t[username]){ echo "<a href='fpedit.php?id=$s'>Edit</a>";}$u_info = mysql_query("SELECT * FROM users WHERE username='$t[username]' ");$user_info = mysql_fetch_array($u_info);if($user_info[avatar] ==null){ echo "<br><img src='noavater.gif'><br>";}else{ echo "<br><img src='".$user_info[avatar]."'><br>";}echo "<b>User Id:</b> ".$user_info['id']."<br>";echo "<b>User Level:</b> ".$user_info['level']."<br>";echo "<b>Posts:</b> ".$user_info['post']."<br>";?></td><td width="70%" class="firstpost" valign="top"><? /*-----BBtags extended-------*/ $simple_search = array( //added line break '/\[br\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[align\=(left|center|right)\](.*?)\[\/align\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[mail\=(.*?)\](.*?)\[\/mail\]/is', '/\[mail\](.*?)\[\/mail\]/is', '/\[font\=(.*?)\](.*?)\[\/font\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is', '/\[color\=(.*?)\](.*?)\[\/color\]/is', //added textarea for code presentation '/\[codearea\](.*?)\[\/codearea\]/is', //added pre class for code presentation '/\[code\](.*?)\[\/code\]/is', //added paragraph '/\[p\](.*?)\[\/p\]/is', '/\[php\](.*?)\[\/php]/is', ); $simple_replace = array( //added line break '<br />', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', // added nofollow to prevent spam '<a href="$1" rel="nofollow" title="$2 - $1">$2</a>', '<a href="$1" rel="nofollow" title="$1">$1</a>', '<div style="text-align: $1;">$2</div>', //added alt attribute for validation '<img src="$1" alt="" />', '<a href="mailto:$1">$2</a>', '<a href="mailto:$1">$1</a>', '<span style="font-family: $1;">$2</span>', '<span style="font-size: $1;">$2</span>', '<span style="color: $1;">$2</span>', //added textarea for code presentation '<textarea class="code_container" rows="30" cols="70">$1</textarea>', //added pre class for code presentation '<font color="black"><b>Code:</b></font><br><pre class="code" style="color:#000;background-color:#FFF;border:1px solid #000;">$1</pre>', //added paragraph '<p>$1</p>', '<?php highlight_string("$1"); ?>', ); $t[post] = preg_replace ($simple_search, $simple_replace, $t[post]);/*----------------------BBTags-^^---------------------*//*-------------------Smileys------------------------*/$t[post] = eregi_replace("\:\)","<img src='http://kay.smiley.free.fr/images/190.gif'>",$t[post]);$t[post] = eregi_replace("\;\)","<img src='http://fcorpet.free.fr/Meige/photos-Site/smiley.jpg'>",$t[post]);$t[post] = eregi_replace("\:\(","<img src='http://i.b5z.net/i/u/1530927/i/Smiley_-_Frown.jpg'>",$t[post]);$t[post] = eregi_replace("\:\D","<img src='http://img.bebo.com/img/smiley_big_grin.gif'>",$t[post]);$t[post] = eregi_replace("\X\D","<img src='http://ripcomixsite.free.fr/Wiki/Smileys/dkmsn_XD.png'>",$t[post]);/*-------------------Smileys------------------------*/$t[post] = wordwrap($t[post], 20, "<br />\n");echo nl2br($t[post]); ?> <?echo "<br>-----------------------------<br>";?><?echo nl2br($user_info['signature']); ?></td></tr></table><? }?><? if(!isset($_GET['page'])){ $page = 1;} else { $page = $_GET['page'];} $max_results =6;$from = (($page * $max_results) - $max_results); /*---------------------------Limit topics script starts here mod rewrite By Demonic----------------------------*/$replies = mysql_query("SELECT * FROM replies WHERE tid='$s' ORDER BY id ASC LIMIT $from, $max_results");/*---------------------------Limit topics script starts here mod rewrite By Demonic----------------------------*/while($td = mysql_fetch_array($replies)){?><table class="ttopics" border="0" style="border:1px solid #000;border-top:0px;"><tr><td width="30%" valign="top" class="topics"><? echo "<a href='profile.php?profile=".$td[username]."'>".$td[username]."</a>"; ?><br><?php if($logged[level] != 5 && $logged[level] != 3 && $logged[level] != 4){ echo ""; } else { echo "<a href='tedit.php?id=$td[id]'>Edit</a>|<a href='tdelete.php?id=$td[id]'>Delete</a>"; } if($logged[level] ==1 && $logged[username] == $td[username]){ echo "<a href='tedit.php?id=$td[id]'>Edit</a>";}$spostusername = $td[username];$signature = mysql_query("SELECT * FROM users WHERE username='$spostusername' ") or die(mysql_error());$usersig = mysql_fetch_array($signature);if($usersig[avatar] ==null){ echo "<br><img src='noavater.gif'><br>";}else{ echo "<br><img src='".$usersig[avatar]."'><br>";}echo "<b>User Id:</b> ".$usersig['id']."<br>";echo "<b>User Level:</b> ".$usersig['level']."<br>";echo "<b>Posts:</b> ".$usersig['post']."<br>"; ?></td><td width="70%" class="topics" valign="top"><? /*-----BBtags extended-------*/ $simple_search3 = array( //added line break '/\[br\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[align\=(left|center|right)\](.*?)\[\/align\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[mail\=(.*?)\](.*?)\[\/mail\]/is', '/\[mail\](.*?)\[\/mail\]/is', '/\[font\=(.*?)\](.*?)\[\/font\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is', '/\[color\=(.*?)\](.*?)\[\/color\]/is', //added textarea for code presentation '/\[codearea\](.*?)\[\/codearea\]/is', //added pre class for code presentation '/\[code\](.*?)\[\/code\]/is', //added paragraph '/\[p\](.*?)\[\/p\]/is', '/\[php\](.*?)\[\/php]/is', ); $simple_replace3 = array( //added line break '<br />', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', // added nofollow to prevent spam '<a href="$1" rel="nofollow" title="$2 - $1">$2</a>', '<a href="$1" rel="nofollow" title="$1">$1</a>', '<div style="text-align: $1;">$2</div>', //added alt attribute for validation '<img src="$1" alt="" />', '<a href="mailto:$1">$2</a>', '<a href="mailto:$1">$1</a>', '<span style="font-family: $1;">$2</span>', '<span style="font-size: $1;">$2</span>', '<span style="color: $1;">$2</span>', //added textarea for code presentation '<textarea class="code_container" rows="30" cols="70">$1</textarea>', //added pre class for code presentation '<font color="black"><b>Code:</b></font><br><pre class="code" style="color:#000;background-color:#FFF;border:1px solid #000;">$1</pre>', //added paragraph '<p>$1</p>', '<?php highlight_string("$1"); ?>', ); $td[post] = preg_replace ($simple_search3, $simple_replace3, $td[post]);/*----------------------BBTags----------------------*//*-------------------Smileys------------------------*/$td[post] = eregi_replace("\:\)","<img src='http://kay.smiley.free.fr/images/190.gif'>",$td[post]);$td[post] = eregi_replace("\;\)","<img src='http://fcorpet.free.fr/Meige/photos-Site/smiley.jpg'>",$td[post]);$td[post] = eregi_replace("\:\(","<img src='http://i.b5z.net/i/u/1530927/i/Smiley_-_Frown.jpg'>",$td[post]);$td[post] = eregi_replace("\:\D","<img src='http://img.bebo.com/img/smiley_big_grin.gif'>",$td[post]);$td[post] = eregi_replace("\X\D","<img src='http://ripcomixsite.free.fr/Wiki/Smileys/dkmsn_XD.png'>",$td[post]);/*-------------------Smileys------------------------*/$tdpost = $td[post];wordwrap($tdpost, 20, "<br>\n");echo nl2br($tdpost); ?> <? echo "<br>-----------------------------<br>"; ?><?echo nl2br($usersig['signature']); ?></td></tr></table><? } ?><table colspan=4 style="border:0px solid #000" width="90%"><tr><td><?php$none2 = mysql_query("SELECT * FROM topics WHERE id='$s'");while($c = mysql_fetch_array($none2)){if($c[closed] == 0){echo "<img border='0' src='http://images.myioff.net/buttons_meer/statusicon/forum_old_lock.gif'>";}else {?><a href="addpost.php?id=<? echo $s; ?>"><img border="0" src="http://img246.imageshack.us/img246/9079/replyki8.png"></a></td><?}}?><?$none1 = mysql_query("SELECT * FROM topics WHERE id='$s'");while($c = mysql_fetch_array($none1)){if($logged[level] != 5 && $logged[level] != 3 && $logged[level] != 4){exit;} if($c[closed] == 0){ echo "<a href='to.php?id=$s'>Open Topic</a>"; }else{ echo "<a href='tc.php?id=$s'>Close Topic</a>"; }}$dsql="SELECT * FROM topics WHERE id='$s' ";$dresult=mysql_query($dsql);$drows=mysql_fetch_array($dresult);$views=$drows['views'];$view=$views+1;$sql_update="UPDATE topics SET views='$view' WHERE id='$s'";$result_update=mysql_query($sql_update);/*---------------------------Limit topics script starts here mod rewrite By Demonic----------------------------*/$total_results = mysql_result(mysql_query("SELECT COUNT(*) as id FROM replies WHERE tid='$s' ORDER BY id ASC"),0);// Figure out the total number of pages. Always round up using ceil()$total_pages = ceil($total_results / $max_results);// Build Page Number Hyperlinksecho "<center>Select a Page<br />";// Build Previous Linkif($page > 1){ $prev = ($page - 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?id=".$s."&page=$prev\"><<Previous</a> ";}for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { echo "<a href=\"".$_SERVER['PHP_SELF']."?id=".$s."&page=$i\">$i</a> "; }}// Build Next Linkif($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?id=".$s."&page=$next\">Next>></a>";}echo "</center>"; /*---------------------------Limit topics script starts here mod rewrite By Demonic----------------------------*/?></td></tr></table><table class="drow3" width="100%" border="0" style="border:1px solid #000;border-top:0px;"><tr><td> </td></tr></table><table valign="bottom">© Nevux of 2006<br>Version 1.0.2 Lite <a href="nindex.php">Nevux Ability Boards</table></BODY><!--BoardCenter EndDIV--></div><!--Dont Remove--></HTML><?phpinclude "javascript/mods.php";?>[/code] Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89035 Share on other sites More sharing options...
Barand Posted September 9, 2006 Share Posted September 9, 2006 [code]$tdpost = wordwrap($td['post'], 20, "<br>", true);echo $tdpost;[/code] Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89037 Share on other sites More sharing options...
Demonic Posted September 9, 2006 Author Share Posted September 9, 2006 so word wrap works like n12br() so i dont need to even use it right? Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89040 Share on other sites More sharing options...
Barand Posted September 9, 2006 Share Posted September 9, 2006 It does if you tell it to put 'BR' in when it wraps as I did Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89044 Share on other sites More sharing options...
Demonic Posted September 9, 2006 Author Share Posted September 9, 2006 yeah :) now i got a new problem -_-[code]<td width="70%" class="firstpost" valign="top">By Demonic <img<br>src='http://kay.smil<br>ey.free.fr/images/19<br>0.gif'><img<br>src='http://fcorpet.<br>free.fr/Meige/photos<br>-Site/smiley.jpg'><br>-----------------------------<br></td>[/code]the smileys wont work because the < br >'s are taking over the text.anyway how to fix this? Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89045 Share on other sites More sharing options...
Barand Posted September 9, 2006 Share Posted September 9, 2006 the problem is indeed those BR tags in the middle of the URL. You cannot place them in the middle of another tag like that. Put them before and after the <img> tag Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89049 Share on other sites More sharing options...
Demonic Posted September 9, 2006 Author Share Posted September 9, 2006 lmao dude i didnt do that the wordwrap() did i cant edit the HTML since its done automatically. Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89067 Share on other sites More sharing options...
corbin Posted September 9, 2006 Share Posted September 9, 2006 You could do some wierd explode functions and what not and it could fix the url errors... But, I'm fairly sure theres a better way to do that... Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89115 Share on other sites More sharing options...
Barand Posted September 9, 2006 Share Posted September 9, 2006 This function should help. Place it in your script then call [code]$tdpost = wrapWithTags ($td['post'], 20, "<br>", 1);echo $tdpost;[/code]The function[code]function wrapWithTags ($text, $numchars, $breakText="\n", $split=0) { $copy = ''; $len = strlen($text); if ($len <= $numchars) return $text; $count = 0; $intag = 0; $lastSpace = 0; for ($i=0; $i<$len; $i++) { $c = $text{$i}; switch ($c) { case '<': $copy .= $c; $intag = 1; break; case '>': $copy .= $c; $intag = 0; break; case ' ': if ($pending) { $copy .= $breakText; $count = 0; } else { $copy .= $c; if (!$intag) ++$count; } $pending = 0; break; default: if ($intag) $copy .= $c; else { if ($count < $numchars-1) { $copy .= $c; ++$count; } else { if ($split) { $copy .= $c.$breakText; $count = 0; } else { $pending = 1; $copy .= $c; ++$count; } } } } #switch } #for return $copy;}[/code] Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89133 Share on other sites More sharing options...
jefkin Posted September 10, 2006 Share Posted September 10, 2006 Try running the wordwrap prior to the smiley replacements.That might be the trick.Jeff Link to comment https://forums.phpfreaks.com/topic/20237-somthens-wrong/#findComment-89142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.