Advertisement
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 01/22/2008 at 07:17AM PST, ID: 23101341 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: |
<?php
include "../library/dbconnect.php";
include "../library/sessionhandler.php";
$userid = $_SESSION["userid"];
$topic_id = $_GET["id"];
if (!isset($topic_id))
{
mysql_close();
header ("Location:index.php");
exit();
}
$sql = "SELECT COUNT(*) ";
$sql .= "FROM forums_posts ";
$sql .= "WHERE topic_id = " . $topic_id;
$safesql = & new SafeSQL_MySQL;
$sql = $safesql->query($sql);
$recordset = mysql_query($sql);
if (mysql_num_rows($recordset) == 0)
{
mysql_close();
header ("Location:index.php");
exit();
}
$sql = "SELECT f.forum_name, ";
$sql .= "t.* ";
$sql .= "FROM forums_forums f, ";
$sql .= "forums_topics t ";
$sql .= "WHERE t.forum_id = f.forum_id AND ";
$sql .= "t.topic_id = " . $topic_id;
$safesql = & new SafeSQL_MySQL;
$sql = $safesql->query($sql);
$recordset = mysql_query($sql);
if (mysql_num_rows($recordset) == 0)
{
mysql_close();
header ("Location:index.php");
exit();
}
$forum_name = mysql_result($recordset, 0, "forum_name");
$forum_id = mysql_result($recordset, 0, "forum_id");
$topic_title = mysql_result($recordset, 0, "topic_title");
$sql = "UPDATE forums_topics ";
$sql .= "SET topic_views = topic_views + 1 ";
$sql .= "WHERE topic_id = " . $topic_id;
mysql_select_db($mysql);
mysql_query($sql);
$isadministrator = false;
if (isset($_SESSION["userid"]))
{
$sql = "SELECT administrator ";
$sql .= "FROM users ";
$sql .= "WHERE userid = " . $_SESSION["userid"] . " AND ";
$sql .= "administrator = -1";
$safesql = & new SafeSQL_MySQL;
$sql = $safesql->query($sql);
$recordset = mysql_query($sql);
if (mysql_num_rows($recordset) > 0)
{ $isadministrator = true; }
}
?>
<html lang="en">
<head>
<title>Find Your Geek | Forums | <?php echo $topic_title; ?></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="../library/style.css" rel="stylesheet" type="text/css" media="screen, projection" />
<link href="library/forum.css" rel="stylesheet" type="text/css" media="screen, projection" />
<script type="text/javascript" src="../library/imagerollover.js"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<div align="center">
<?php include "../library/header.php" ?>
<?php include "../library/menu.php" ?>
<table width="760px" cellpadding="0px" cellspacing="0px">
<?php
if (isset($_SESSION["errormessage"]))
{
$paddingtop = "";
?>
<tr>
<td style="padding-left:11px;padding-top:5px;" colspan="2">
<font color="red">
<b>
<?php echo $_SESSION["errormessage"]; ?>
</b>
</font>
</td>
</tr>
<tr><td style="padding-left:11px;padding-right:11px;" colspan="2"><hr size="1px" color="#ffc600"></td></tr>
<?php
}
else
{ $paddingtop = "padding-top:5px;"; }
?>
<tr>
<td style="width:380px;padding-left:11px;<?php echo $paddingtop; ?>">
<a href="index.php"><img src="images/up_arrow.gif" border="0px"></a> <a href="index.php">Index</a>
<b> « </b>
<a href="viewforum.php?id=<?php echo $forum_id; ?>"><?php echo $forum_name; ?></a>
</td>
<td style="width:380px;padding-right:11px;padding-top:5px;" align="right"></td>
</tr>
<tr><td height="10px" colspan="2"></td></tr>
<tr>
<td style="padding-left:11px;" colspan="2">
<font style="font-size:20px;font-weight:bold;">
<?php echo $topic_title; ?>
</font>
</td>
</tr>
<tr><td height="10px" colspan="2"></td></tr>
<tr>
<td style="padding-left:11px;">
<a href="posting.php?mode=reply&tid=<?php echo $topic_id; ?>"><img src="images/postreply_off.gif" srcover="images/postreply_on.gif" border="0px"></a>
</td>
<td style="padding-right:11px;" align="right">
<?php
//Pagination
$page = $_GET["page"];
$limit = 25;
$select = "SELECT s.sessionid, ";
$select .= "u.displayname, ";
$select .= "u.avatar, ";
$select .= "u.title, ";
$select .= "u.signature, ";
$select .= "u.posts, ";
$select .= "u.hideonlinestatus, ";
$select .= "u.lastlogindatetime, ";
$select .= "u.administrator, ";
$select .= "p.* ";
$from = "FROM users u, ";
$from .= "forums_posts p ";
$from .= "LEFT JOIN sessions s ";
$from .= "ON p.poster_id = s.sessionuserid ";
$where = "WHERE p.poster_id = u.userid AND ";
$where .= "p.topic_id = " . $topic_id . " ";
$orderby = "ORDER BY post_time ";
$resultcount = mysql_query("SELECT COUNT(*) " . $from . $where);
if (mysql_num_rows($resultcount) > 0)
{
$totalrows = mysql_result($resultcount, 0);
$numofpages = ceil($totalrows / $limit);
if(empty($page))
{
$page = 1;
$limitvalue = 0;
}
else
{ $limitvalue = $page * $limit - ($limit); }
if ($page != 1)
{
$pageprev = $page - 1;
$previous = "<a href=\"viewtopic.php?id=" . $topic_id . "&page=" . $pageprev . "\">« Prev</a>";
}
if ($numofpages > 1)
{
for ($count = 1; $count <= $numofpages; $count++)
{
if ($count == $page)
{ $pages .= $count . " "; }
else
{ $pages .= "<a href=\"viewtopic.php?id=" . $topic_id . "&page=" . $count . "\">" . $count . "</a> "; }
}
}
if ($totalrows - ($limit * $page) > 0)
{
$pagenext = $page + 1;
$next = "<a href=\"viewtopic.php?id=" . $topic_id . "&page=" . $pagenext . "\">Next »</a>";
}
}
$safesql = & new SafeSQL_MySQL;
$sql = $safesql->query($select . $from . $where . $orderby . "LIMIT " . $limitvalue . ", " . $limit);
$postsrecordset = mysql_query($sql);
if ($numofpages == 0) { $numofpages = 1; }
echo mysql_num_rows($postsrecordset);
echo " ";
if (mysql_num_rows($postsrecordset) == 1)
{ echo "post"; }
else
{ echo "posts"; }
?>
•
Page <?php echo $page . " of " . $numofpages; ?>
<?php if ($pages) { echo " • " . $pages; } ?>
</td>
</tr>
</table>
<div style="height:5px;"></div>
<table width="760px" cellpadding="0px" cellspacing="0px">
<?php
$count = 0;
while ($count < mysql_num_rows($postsrecordset))
{
if ($count % 2 == 1)
{ $trid = "topic_rowA"; }
else
{ $trid = "topic_rowB"; }
if ($count + 1 == mysql_num_rows($postsrecordset))
{ $borderbottom = "border-bottom:#ffc600 1px solid;"; }
else
{ $borderbottom = ""; }
?>
<tr id="<? echo $trid; ?>">
<td style="width:200px;border-top: #ffc600 1px solid;<?php echo $borderbottom; ?>padding: 11px 11px 11px 11px;" valign="top">
<?php
if (mysql_result($postsrecordset, $count, "avatar") != null)
{
echo "<a href=\"../profile.php?id=" . mysql_result($postsrecordset, $count, "poster_id") . "\">";
echo "<img src=\"" . mysql_result($postsrecordset, $count, "avatar") . "\" border=\"0px\">";
echo "</a><br />";
}
if (mysql_result($postsrecordset, $count, "administrator"))
{ echo "<a href=\"../administrators.php\"><img src=\"../images/administrator_esm.gif\" border=\"0px\"></a> "; }
echo "<a href=\"../profile.php?id=" . mysql_result($postsrecordset, $count, "poster_id") . "\">";
echo "<b>" . mysql_result($postsrecordset, $count, "displayname") . "</b>";
echo "</a><br />";
if (mysql_result($postsrecordset, $count, "title") != null)
{ echo mysql_result($postsrecordset, $count, "title"); }
//online / offline
echo "<table style=\"padding-top:15px;padding-bottom:15px;\" width=\"100%\" cellpadding=\"0px\" cellspacing=\"0px\">";
echo "<tr>";
if (mysql_result($postsrecordset, $count, "sessionid") == null)
{
echo "<td width=\"20px\">";
echo "<img src=\"../images/offline.gif\"> ";
echo "</td>";
echo "<td>";
echo "<font style=\"font-size:9px;color:#ff2f15\"><b>Offline</b></font>";
echo "</td>";
}
else
{
//add hidden code here
echo "<td width=\"20px\">";
echo "<img src=\"../images/online.gif\"> ";
echo "</td>";
echo "<td>";
echo "<font style=\"font-size:9px;color:#84ff15\"><b>Online</b></font>";
echo "</td>";
}
echo "</tr>";
echo "</table>";
echo "Posts: " . mysql_result($postsrecordset, $count, "posts");
?>
</td>
<td style="width:560px;border-top: #ffc600 1px solid;<?php echo $borderbottom; ?>border-left: #ffc600 1px solid;" valign="top">
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td style="padding-left:11px;padding-top:11px;">
<a name="p<?php echo mysql_result($postsrecordset, $count, "post_id"); ?>"></a>
<font style="font-size:12px;">
<b>
<a href="#p<?php echo mysql_result($postsrecordset, $count, "post_id"); ?>"><?php echo mysql_result($postsrecordset, $count, "post_subject"); ?></a>
</b>
</font>
</td>
<td style="padding-right:11px;padding-top:5px;" align="right">
<a href="posting.php?mode=quote&pid=<?php echo mysql_result($postsrecordset, $count, "post_id"); ?>"><img src="images/quote_button_off.gif" srcover="images/quote_button_on.gif" border="0px"></a>
<?php
if (isset($_SESSION["userid"]))
{
if ($isadministrator || $_SESSION["userid"] == mysql_result($postsrecordset, $count, "poster_id"))
{
?>
<a href="posting.php?mode=edit&pid=<?php echo mysql_result($postsrecordset, $count, "post_id"); ?>"><img src="images/edit_off.gif" srcover="images/edit_on.gif" border="0px"></a>
<?php
}
if ($isadministrator)
{
?>
<a href="posting.php?mode=delete&pid=<?php echo mysql_result($postsrecordset, $count, "post_id"); ?>"><img src="images/delete_off.gif" srcover="images/delete_on.gif" border="0px"></a>
<?php
}
}
?>
</td>
</tr>
<tr><td colspan="2" style="height:5px;"></td></tr>
<tr>
<td colspan="2" style="padding-left:11px;">
<a href="#p<?php echo mysql_result($postsrecordset, $count, "post_id"); ?>"><img src="images/post.gif" border="0px"></a> by
<a href="../profile.php?id=<?php echo mysql_result($postsrecordset, $count, "poster_id"); ?>"><b><?php echo mysql_result($postsrecordset, $count, "displayname") ?></b></a> on
<?php echo date("M d, Y g:i a", mysql_result($postsrecordset, $count, "post_time")) . " EST"; ?>
</td>
</tr>
<tr><td colspan="2" style="height:10px;"></td></tr>
<tr>
<td colspan="2" style="padding-left:11px;padding-right:11px;">
<!-- post text -->
<font style="font-size:1.2em;">
<?php
echo FormatBBCode(mysql_result($postsrecordset, $count, "post_text"), $count);
?>
</font>
<?php
if (mysql_result($postsrecordset, $count, "signature") != null)
{
?>
<br /><br />
<table style="width:100%;border-top:#ffc600 1px solid;" cellpadding="0px" cellspacing="0px">
<tr>
<td style="padding-top:10px;padding-bottom:10px;">
<?php echo FormatBBCode(mysql_result($postsrecordset, $count, "signature")); ?>
</td>
</tr>
</table>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
<?php
$count++;
}
if ($previous || $pages || $next) {
?>
<tr id="header">
<td colspan="3" style="padding-left:11px;"><?php echo $previous; ?></td>
<td colspan="2" style="padding-right:11px;" align="right"><?php echo $next; ?></td>
</tr>
<?php } ?>
</table>
<table width="760px" cellpadding="0px" cellspacing="0px">
<tr><td height="10px" colspan="2"></td></tr>
<tr>
<td style="padding-left:11px;">
<a href="posting.php?mode=reply&tid=<?php echo $topic_id; ?>"><img src="images/postreply_off.gif" srcover="images/postreply_on.gif" border="0px"></a>
</td>
<td style="padding-right:11px;" align="right">
<?php
echo mysql_num_rows($postsrecordset);
echo " ";
if (mysql_num_rows($postsrecordset) == 1)
{ echo "post"; }
else
{ echo "posts"; }
?>
•
Page <?php echo $page . " of " . $numofpages; ?>
<?php if ($pages) { echo " • " . $pages; } ?>
</td>
</tr>
<tr><td height="5px" colspan="2"></td></tr>
<tr>
<td style="padding-left:11px;">
<a href="index.php"><img src="images/up_arrow.gif" border="0px"></a> <a href="index.php">Index</a>
<b> « </b>
<a href="viewforum.php?id=<?php echo $forum_id; ?>"><?php echo $forum_name; ?></a>
</td>
<td></td>
</tr>
<tr><td height="5px" colspan="2"></td></tr>
</table>
<div style="height:5px;"></div>
<img src="../images/line.gif">
<p><?php include "../library/footer.php" ?></p>
</div>
</body>
</html>
<?php
unset($_SESSION["errormessage"]);
mysql_close();
function FormatBBCode($message)
{
$simple_search = array(
'/\:\)/is',
'/\;\)/is',
'/\:\(/is',
'/\:cool:/is',
'/\:mad:/is',
'/\:confused:/is',
'/\:shock:/is',
'/\:bigsmile:/is',
'/\:oops:/is',
'/\:roll:/is',
'/\:twisted:/is',
'/\:lol:/is',
'/\:neutral:/is',
'/\:drool:/is',
'/\:ninja:/is',
'/\[b\](.*?)\[\/b\]/is',
'/\[i\](.*?)\[\/i\]/is',
'/\[u\](.*?)\[\/u\]/is',
'/\[url\](.*?)\[\/url\]/is',
'/\[url\=(.*?)\](.*?)\[\/url\]/is',
'/\[img\](.*?)\[\/img\]/is',
'/\[quote\](.*?)\[\/quote\]/is',
'/\[quote\=(.*?)\](.*?)\[\/quote\]/is',
'/\[youtube\](.*?)\[\/youtube\]/is',
'/\[spoiler\](.*?)\[\/spoiler\]/is',
'/\[nsfw\](.*?)\[\/nsfw\]/is'
);
$simple_replace = array(
'<img src="../images/smileys/smile.gif">',
'<img src="../images/smileys/wink.gif">',
'<img src="../images/smileys/sad.gif">',
'<img src="../images/smileys/cool.gif">',
'<img src="../images/smileys/mad.gif">',
'<img src="../images/smileys/confused.gif">',
'<img src="../images/smileys/shock.gif">',
'<img src="../images/smileys/bigsmile.gif">',
'<img src="../images/smileys/oops.gif">',
'<img src="../images/smileys/eyeroll.gif">',
'<img src="../images/smileys/twisted.gif">',
'<img src="../images/smileys/laugh.gif">',
'<img src="../images/smileys/neutral.gif">',
'<img src="../images/smileys/drool.gif">',
'<img src="../images/smileys/ninja.gif">',
'<b>$1</b>',
'<i>$1</i>',
'<u>$1</u>',
'<a href="$1" target="_new">$1</a>',
'<a href="$1" target="_new">$2</a>',
'<img src="$1">',
'<table width="90%" style="background:#2a2a2a;border:1px solid #555555;padding-bottom:5px;" cellspacing="1px" cellpadding="3px" align="center"><tr><td style="font-size:11px;"><img src="images/quote.gif"></td></tr><tr><td style="font-size:12px;">$1</tr></table>',
'<table width="90%" style="background:#2a2a2a;border:1px solid #555555;padding-bottom:5px;" cellspacing="1px" cellpadding="3px" align="center"><tr><td style="font-size:11px;"><img src="images/quote.gif"> <b>$1 wrote:</b></td></tr><tr><td style="font-size:12px;">$2</tr></table>',
'<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/trim($1)"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>',
"<div style=\"margin-top:5px\"><div><font style=\"font-size:12px;\"><b>Spoiler:</b></font> <input type=\"button\" value=\"Show\" style=\"width:45px;font-size:10px;margin:0px;padding:0px;\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = '';this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none';this.innerText = '';this.value = 'Show'; }\" /></div><div class=\"quotecontent\"><div style=\"display: none;\"><br />$1</div></div></div>",
"<div style=\"margin-top:5px\"><div><font style=\"font-size:12px;\"><b>NSFW:</b></font> <input type=\"button\" value=\"Show\" style=\"width:45px;font-size:10px;margin:0px;padding:0px;\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = '';this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none';this.innerText = '';this.value = 'Show'; }\" /></div><div class=\"quotecontent\"><div style=\"display: none;\"><br />$1</div></div></div>"
);
$message = preg_replace ($simple_search, $simple_replace, $message);
return nl2br($message);
}
?>
|