Location: PHPKode > projects > WH Community > wh_community/admin/blog_comments_edit.php
<?php include('files/header.php'); ?>
<div id="content-outer">
<div id="content">

	<div id="page-heading">
		<h1><?php echo $lang_admin['blog_comment_edit']; ?></h1>
	</div>
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="files/shared/side_shadowleft.jpg" width="20" height="300" alt="shadow_l"></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="files/shared/side_shadowright.jpg" width="20" height="300" alt="shadow_r"></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td><div id="content-table-inner">
			<div id="table-content">
			<p><?php
		
			if(isset($_GET['id'])) {
			$blog_id = htmlentities($_GET['id']);
			$blog_id = intval($_GET['id']);
			$from = htmlentities($_GET['id']);
			
				}else{
				
				echo '<p>' . $lang_admin['choose_it'] . '</p>';
				exit();
				}
			
			$pfad = "blog_comments_edit.php?id=" . $blog_id;
			$query = mysql_query("SELECT blog_id FROM comments WHERE blog_id2 = '" . $blog_id . "'");
			$datensaetze_pro_seitea = "15";
			$p = "5";
			$total = intval(mysql_num_rows($query));
			$seiten = ceil($total / $datensaetze_pro_seitea);
		
			if(empty($_GET['page'])){
				$page = 1;
			}elseif($_GET['page'] <= 0 || $_GET['page'] > $seiten){
				$page = 1;
			}else{
				$page = mysql_real_escape_string($_GET['page']);
				}
			
			$links = array();
			
			if(($page - $p) < 1){ $davor = $page - 1;  }else { $davor = $p; }            
			if(($page + $p) > $seiten){ $danach = $seiten - $page; }else{ $danach = $p; }    
			$off = ($page - $davor);
			if($page- $davor > 1){
				$first = 1;
				   $links[] = "<a href=\"$pfad&page=$first\">&laquo; " . $lang_admin['first'] . " ...</a>\n";      
					}      
			
			if($page != 1){
				$prev = $page-1;
				$links[] = "<a href=\"$pfad&page=$prev\"> &laquo;</a>\n";     
				}   
			
			for($i = $off; $i <= ($page + $danach); $i++){
			  if($i != $page){
					$links[] = "<a href=\"$pfad&page=$i\">$i</a>\n";
			  }elseif($i == $seiten) {
					$links[] = "<span class=\"current\">[ $i ]</span>\n";  
			  }elseif($i == $page){
					$links[] = "<span class=\"current\">[ $i ]</span>\n";
			  		}
			}                
			if($page != $seiten){
				$next = $page+1;
				$links[] = "<a href=\"$pfad&page=$next\"> &raquo;</a>\n";
				}    
			
			if($seiten - $page - $p > 0 ){
				$last = $seiten; 
				$links[] = "<a href=\"$pfad&page=$last\">... " . $lang_admin['last'] . " &raquo;</a>\n";
				}
			
			$start = ($page-1) * $datensaetze_pro_seitea;
			$link_string = implode(" ", $links);
			
			$query = "SELECT * FROM comments WHERE blog_id2 = '" . $blog_id . "' ORDER BY date DESC LIMIT $start,$datensaetze_pro_seitea";
			$result = mysql_query($query);
			
			echo '<strong>' . $lang_admin['comments'] . '</strong><br><br>';
			
			function parseBBCode2HTML($msg) {
			
				$msg = $msg;
				
				$msg = str_replace("/\[b\](.*?)\[\/b\]/", "<b>$1</b>", $msg);
				$msg = str_replace("/\[i\](.*?)\[\/i\]/", "<i>$1</i>", $msg);
				$msg = str_replace("/\[u\](.*?)\[\/u\]/", "<u>$1</u>", $msg);
				$msg = str_replace("/\[s\](.*?)\[\/s\]/", "<s>$1</s>", $msg);
				$msg = str_replace("/\[left\](.*)\[/left\]/", "<s>$1</s>", $msg);
				$msg = str_replace("/\[center\](.*)\[/center\]/", "<s>$1</s>", $msg);
				$msg = str_replace("/\[right\](.*)\[/right\]/", "<s>$1</s>", $msg);
				$msg = preg_replace('#\[url\](.*)\[/url\]#isU', "<a href=\"$1\">$1</a>", $msg);
				$msg = preg_replace('#\[ url=(.*)\](.*)\[/url\]#isU', "<a href=\"$1\">$2</a>", $msg);
				$msg = str_replace("/\n/", "<br/>\n", $msg);
				$msg = str_replace(":P","<img src=\"../layout/smileys/000.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace(":)","<img src=\"../layout/smileys/001.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace(";)","<img src=\"../layout/smileys/002.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace(":(","<img src=\"../layout/smileys/003.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace("*grr*","<img src=\"../layout/smileys/004.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace("o_o","<img src=\"../layout/smileys/005.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace("*_*","<img src=\"../layout/smileys/006.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace("._.","<img src=\"../layout/smileys/007.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace("-_-","<img src=\"../layout/smileys/008.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
				$msg = str_replace(":D","<img src=\"../layout/smileys/009.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg); 
			
			return $msg;
			}
			
			function linkLenght($treffer) {
	
				$url = trim($treffer[1]);
				
				if(substr($url,0,7)!= 'http://')
				$url = "http://".$url;
				
				if(strlen(trim($treffer[2]))!=0)
				$linkname = $treffer[2];
				
				else
				
				$linkname = $treffer[1];
				
				if(strlen($linkname)>50 AND !substr_count(strtolower($linkname), '[img]') AND !substr_count(strtolower($linkname), '[/img]'))
				$linkname = substr($linkname, 0, 45-3)."...".substr($linkname, -5);
				$ergebnis = '<a href="' . $url . '" target="_blank">' . $linkname . '</a>';
			
			return $ergebnis;
			}
			
			while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
			echo '<table width="100%" class="maintable">
				   <tr>
					<td colspan="2"><h2>' . htmlentities($row['title'], ENT_QUOTES) . '</h2></td>
				   </tr>
				   <tr>
					<td width="10%" valign="top"><strong>' . $lang_admin['author'] . ':</strong></td>
					<td width="90%" valign="top">' . htmlentities($row['author'], ENT_QUOTES) . '</td>
				   </tr>
				   <tr>
					<td width="10%" valign="top"><strong>' . $lang_admin['comments'] . ':</strong></td>
					<td width="90%" valign="top">' . parseBBCode2HTML(nl2br(stripslashes(strip_tags($row['comment'])))) . '</td>
				   </tr>
				   <tr>
					<td colspan="2"><a href="blog_comments_delete.php?id=' . $row['blog_id'] . '&from=' . $from . '"><img src="files/delete.png" border="0" title="' . $lang_admin['delete'] . '"></a></td>
				   </tr>
				  </table>';
				  }
			
			echo '<br><div id="navigation">';
			echo '<span class="pages">' . $lang_admin['page'] . ' ' . $page . ' ' . $lang_admin['of'] . ' ' . $seiten . '</span>';
			echo $link_string;
			echo '</div><br><br><br>';
			
			echo '<p>[ <a href="blog.php">' . $lang_admin['back'] . '</a> ]</p>';
			
			?></p>
			</div>
		</div></td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
			
	<div class="clear"></div>
		 
	</div>

	<div class="clear">&nbsp;</div>

</div>
<div class="clear">&nbsp;</div>
</div>
<?php include('files/footer.php'); ?>
Return current item: WH Community