Jump to content


Photo

somthens wrong =(


  • Please log in to reply
16 replies to this topic

#1 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 09 September 2006 - 06:23 PM

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.i...wtopic.php?id=1 (second post)

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 09 September 2006 - 06:30 PM

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 [code][/code] tags.

Ken

#3 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts
  • LocationUnited Kingdom

Posted 09 September 2006 - 06:31 PM

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


You can learn alot from reading the manual

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 09 September 2006 - 06:32 PM

if you want to limitto, say, 50 characters max, then

echo wordwrap("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",50, '<br>', true);

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 09 September 2006 - 06:39 PM

Also your table cell tags should be <td> (lower case) not <TD>.
Cold


When did HTML tags become case sensitive? They must have sneaked that in quickly when I wasn't looking.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#6 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 09 September 2006 - 06:51 PM

you mean  you didn't get that memo?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#7 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 09 September 2006 - 06:54 PM

I got the memo!!!!! Haha i think they still work fine upper case they just arent w3c complient when in uppercase...
Why doesn't anyone ever say hi, hey, or whad up world?

#8 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 09 September 2006 - 07:05 PM

well i tried the wordwrap but it seems it doesnt work the script is like 300+ lines long so..

<?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]
<?php
ob_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>
<?php
if($logged[username] ==null){
?>
| <a href="login.php">Login</a> | <a href="register.php">Register</a>
</td>
<? } ?>
<td width="10%">
<?php
if($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 Hyperlinks
echo "<center>Select a Page<br />";

// Build Previous Link
if($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 Link
if($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>&nbsp;</td>
</tr>
</table>


<table valign="bottom">
&copy; Nevux of 2006<br>Version 1.0.2 Lite <a href="nindex.php">Nevux Ability Boards
</table>
</BODY>
<!--BoardCenter EndDIV-->
</div>
<!--Dont Remove-->
</HTML>
<?php
include "javascript/mods.php";
?>


#9 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 09 September 2006 - 07:09 PM

$tdpost = wordwrap($td['post'], 20, "<br>", true);
echo $tdpost;

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#10 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 09 September 2006 - 07:14 PM

so word wrap works like n12br() so i dont need to even use it right?

#11 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 09 September 2006 - 07:17 PM

It does if you tell it to put 'BR' in when it wraps as I did
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#12 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 09 September 2006 - 07:22 PM

yeah :) now i got a new problem -_-

<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>

the smileys wont work because the < br >'s are taking over the text.
anyway how to fix this?

#13 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 09 September 2006 - 07:32 PM

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
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#14 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 09 September 2006 - 07:59 PM

lmao dude i didnt do that the wordwrap() did i cant edit the HTML since its done automatically.

#15 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 09 September 2006 - 10:22 PM

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...
Why doesn't anyone ever say hi, hey, or whad up world?

#16 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 09 September 2006 - 11:43 PM

This function should help. Place it in your script then call
$tdpost = wrapWithTags ($td['post'], 20, "<br>", 1);
echo $tdpost;

The function
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;
}


If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#17 jefkin

jefkin
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 10 September 2006 - 12:52 AM

Try running the wordwrap prior to the smiley replacements.

That might be the trick.

Jeff




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users