ik heb nu een forum ingebouwd van Rik en Luuk (GLS2) maar ik wil, net zoals bij one2xs, avatar en naam etc. naast de forum post.
Stuk dat je moet hebben voor forum:CSS:Het stukje: .post_avatar moet je aanpassen en het stukje .post
Stuk dat je moet hebben voor forum:
Spoiler tonen
elseif($_GET[act] == showtopic)
{
if((isset($_GET[t])) || (ctype_digit($_GET[t])))
{
$topic_info_query = mysql_query("SELECT * FROM `forum_topics` WHERE `id` = " . mysql_real_escape_string($_GET[t]) . "") or trigger_error(mysql_error());
if(mysql_num_rows($topic_info_query))
{
$topic_info = mysql_fetch_assoc($topic_info_query);
if(($topic_info[hidden] == 0) || ($userinfo[uRang] >= 3))
{
$cat_sql = mysql_query("SELECT * FROM `forum_cata` WHERE `id` = " . mysql_real_escape_string($topic_info[cat_id]) . "") or trigger_error(mysql_error());
if(mysql_num_rows($cat_sql))
{
$cat = mysql_fetch_assoc($cat_sql);
if($cat[min_rang_for_access] <= $userinfo[uRang])
{
echo > <a href=" . DIRECT_URL . ?act=showcat&c= . htmlentities($topic_info[cat_id]) . "> . htmlentities($cat[name]) . </a> > <a href=" . DIRECT_URL . ?act=showtopic&t= . htmlentities($_GET[t]) . "> . htmlentities($topic_info[subject]) . </a></div>;
$per_pagina = $config[per_page];
$start = isset($_GET[start]) && ctype_digit($_GET[start]) ? $_GET[start] : 0;
$pagina = ceil($start / $per_pagina) + 1;
$paginas_mysql = mysql_query("SELECT count(*) AS aantal FROM `forum_posts` WHERE `topic_id` = " . mysql_real_escape_string($topic_info[id]) . "") or trigger_error(mysql_error());
$fetch_mysql = mysql_fetch_assoc($paginas_mysql);
$paginas = ceil($fetch_mysql[aantal] / $per_pagina);
if($paginas > 0)
{
if($userinfo[uRang] >= 3)
{
$query = mysql_query("SELECT * FROM `forum_posts` WHERE `topic_id` = " . mysql_real_escape_string($_GET[t]) . " ORDER BY id ASC LIMIT " . mysql_real_escape_string($start) . "," . mysql_real_escape_string($per_pagina)) or trigger_error(mysql_error());
}
else
{
$query = mysql_query("SELECT * FROM `forum_posts` WHERE `topic_id` = " . mysql_real_escape_string($_GET[t]) . " AND `hidden` = 0 ORDER BY id ASC LIMIT " . $start . "," . $per_pagina) or trigger_error(mysql_error());
}
if(mysql_num_rows($query))
{
echo <div style="float: left; width: 250px; padding: 4px 0 0 5px; margin: 3px 0 0 0;">Pagina: ;
for($j = $pagina-5;$j < $pagina+5;$j++)
{
if($j > 0 && $j <= $paginas)
{
if($j == $pagina)
{
echo $pagina;
}
else
{
echo <a href=" . DIRECT_URL . ?act=showtopic&t= . htmlentities($_GET[t]) . &start= . (($j-1)*$per_pagina) . "> . $j . </a>;
}
echo ;
}
}
echo </div><div style="float: right; width: 300px; text-align: right; margin: 3px 0 0 0; padding: 4px 5px 0 0;"> . (($topic_info[status] != 0) ? Het topic is gesloten, je kunt niet meer reageren : <a href=" . DIRECT_URL . ?act=addpost&t= . htmlentities($_GET[t]) . ">Reageer<img src=" . IMAGE_URL . comment.png" alt="Reageer"></a>) . </div><div style="clear: both;"></div>;
while($post = mysql_fetch_assoc($query))
{
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `leden` WHERE `uId` = " . mysql_real_escape_string($post[userid]) . "")) or trigger_error(mysql_error());
echo <div id="post . htmlentities($post[id]) . "><div class="header_of_post"><center><strong>;
if($post[first_post] != 1)
{
echo RE: ;
}
echo htmlentities($topic_info[subject]) . - Geplaatst op . htmlentities($post[date]) . </strong><br></center></div>
<div class="post_avatar">Test</div>
<div class="post"> . Parseubb(htmlentities($post[message]), 0);
if((!empty($post[last_editted_at])) && (!empty($post[last_editted_by])))
{
$last_editted_user_sql = mysql_query("SELECT `uName` FROM `leden` WHERE `uId` = " . mysql_real_escape_string($post[last_editted_by]) . "");
if (mysql_num_rows($last_editted_user_sql)) {
$last_editted_user = mysql_fetch_assoc($last_editted_user_sql);
echo <br>Als laatste aangepast door <a href="index.php?p=profiel&id= . htmlentities($post[last_editted_by]) . "> . htmlentities($last_editted_user[uName]) . </a> op: . htmlentities($post[last_editted_at]);
}
else
{
echo <br>Als laatste aangepast op: . htmlentities($post[last_editted_at]);
}
}
echo </div>;
if(!empty($user[uSignature]))
{
echo <div class="post_user_signature"> . Parseubb(htmlentities($user[uSignature]), 0) . </div>;
}
echo <div class="post_options" align="right">;
if((($post[first_post] == 1) && ($userinfo[uRang] >= 3)) || (($post[first_post] == 1) && ($userinfo[uRang] >= 2) && ($post[userid] == $_SESSION[uId])))
{
echo <a href=" . DIRECT_URL . ?act= . ($topic_info[status] == 0 ? closetopic : reopentopic) . &t= . htmlentities($_GET[t]) . "> . ($topic_info[status] == 0 ? <img src=" . IMAGE_URL . lock.png" alt="Sluit" title="Sluit"> : <img src=" . IMAGE_URL . lock_open.png" alt="Heropen" title="Heropen">) . </a> ;
if($userinfo[uRang] >= 3)
{
echo <a href=" . DIRECT_URL . ?act= . ($topic_info[hidden] == 0 ? hidetopic : unhidetopic) . &t= . htmlentities($_GET[t]) . "> . ($topic_info[hidden] == 0 ? <img src=" . IMAGE_URL . topic_hide.png" alt="Verberg topic" title="Verberg topic"> : <img src=" . IMAGE_URL . topic_unhide.png" alt="Topic terugplaatsen" title="Topic terugplaatsen">) . </a> <a href=" . DIRECT_URL . ?act=movetopic&t= . htmlentities($_GET[t]) . "><img src=" . IMAGE_URL . move_topic.png" alt="Topic verplaatsen" title="Topic verplaatsen"></a>;
}
}
if(($post[userid] == $_SESSION[uId]) || ($userinfo[uRang] >= 3))
{
if($post[hidden] == 0)
{
echo <a href=" . DIRECT_URL . ?act=deletepost&pid= . htmlentities($post[id]) . "><img src=" . IMAGE_URL . comment_delete.png" alt="Verwijder post" title="Verwijder Post"></a>;
}
elseif($userinfo[uRang] >= 3)
{
echo <a href=" . DIRECT_URL . ?act=undeletepost&pid= . htmlentities($post[id]) . "><img src=" . IMAGE_URL . comment_add.png" alt="Zet post terug" title="Zet post terug"></a>;
}
echo <a href=" . DIRECT_URL . ?act=editpost&pid= . htmlentities($post[id]) . "><img src=" . IMAGE_URL . comment_edit.png" alt="Wijzig post" title="Wijzig post"></a> ;
}
echo <a href=" . DIRECT_URL . ?act=addpost&t= . htmlentities($_GET[t]) . &quote= . htmlentities($post[id]) . "><img src=" . IMAGE_URL . quote.png" alt="Quote bericht" title="Quote bericht"></a>;
echo </div></div>;
if(($post[first_post] == 1) && (!empty($topic_info[poll_id])))
{
$poll_sql = mysql_query("SELECT * FROM `forum_poll` WHERE `id` = " . mysql_real_escape_string($topic_info[poll_id]) . "") or trigger_error(mysql_error());
if(mysql_num_rows($poll_sql))
{
echo <div class="post">;
$poll = mysql_fetch_assoc($poll_sql);
$voted_sql = mysql_query("SELECT `voted_at_answer` FROM `forum_poll_votes` WHERE `poll_id` = " . mysql_real_escape_string($topic_info[poll_id]) . " AND `userid_of_voter` = " . mysql_real_escape_string($_SESSION[uId]) . "") or trigger_error(mysql_error());
if(isset($_POST[submit]))
{
if(isset($_SESSION[uId]))
{
if((isset($_POST[answer])) && (ctype_digit($_POST[answer])))
{
if(!empty($poll[answer . htmlentities($_POST[answer])]))
{
if((!mysql_num_rows($voted_sql)) && ($topic[status] == 0))
{
mysql_query("INSERT INTO `forum_poll_votes` VALUES (" . mysql_real_escape_string($topic_info[poll_id]) . "," . mysql_real_escape_string($_SESSION[uId]) . "," . mysql_real_escape_string($_POST[answer]) . ")") or trigger_error(mysql_error());
$voted_sql = mysql_query("SELECT `voted_at_answer` FROM `forum_poll_votes` WHERE `poll_id` = " . mysql_real_escape_string($topic_info[poll_id]) . " AND `userid_of_voter` = " . mysql_real_escape_string($_SESSION[uId]) . "") or trigger_error(mysql_error());
}
}
}
}
}
echo <strong> . htmlentities($poll[question], ENT_QUOTES) . </strong><br>;
$votes_sql = mysql_query("SELECT COUNT(1) AS `total_votes` FROM `forum_poll_votes` WHERE `poll_id` = " . mysql_real_escape_string($topic_info[poll_id]) . "") or trigger_error(mysql_error());
$votes = mysql_fetch_assoc($votes_sql);
if(mysql_num_rows($voted_sql))
{
$voted = mysql_fetch_assoc($voted_sql);
}
if((!isset($voted)) && (isset($_SESSION[uId])) && ($topic_info[status] == 0))
{
echo <form action="#" method="post">;
}
echo <table>;
for($i = 1; $i <= 10; $i++)
{
if (!empty($poll[answer . $i]))
{
$answer_votes_sql = mysql_query("SELECT COUNT(1) AS `answer_votes` FROM `forum_poll_votes` WHERE `poll_id` = " . mysql_real_escape_string($topic_info[poll_id]) . " AND `voted_at_answer` = " . mysql_real_escape_string($i) . "") or trigger_error(mysql_error());
$answer_votes = mysql_fetch_assoc($answer_votes_sql);
if($votes[total_votes] != 0)
{
$percentage = ((round(($answer_votes[answer_votes] / $votes[total_votes]), 4)) * 100);
}
else
{
$percentage = 0;
}
echo <tr>;
if((!isset($voted)) && (isset($_SESSION[uId])) && ($topic_info[status] == 0))
{
echo <td><input type="radio" name="answer" value=" . htmlentities($i) . "></td>;
}
echo <td>;
if($voted[voted_at_answer] == $i)
{
echo <i> . htmlentities($poll[answer . $i]) . </i>;
}
else
{
echo htmlentities($poll[answer . $i]);
}
echo </td><td><div style="background: url(http://www.one2xs.com/img/warn_bar_bg.gif) no-repeat bottom left; width: 135px; height: 10px; padding: 1px 0 0 1px; font-size: 9px;"><div style="background: url(http://www.one2xs.com/img/warn_bar_orange.gif) no-repeat bottom left; width: . ($percentage * 1.33) . px; height: 8px; float: left; margin: 1px 0 0 0;"></div></div></td><td><i> . $percentage . %</i></td></tr>;
}
}
echo </table>;
if((!isset($voted)) && (isset($_SESSION[uId])) && ($topic_info[status] == 0))
{
echo <input type="submit" value="Stem" name="submit"></form>;
}
echo Totaal aantal stemmen: . htmlentities($votes[total_votes]);
echo </div>;
}
}
}
echo <div style="float: left; width: 250px; padding: 4px 0 0 5px; margin: 3px 0 0 0;">Pagina: ;
for($j = $pagina-5;$j < $pagina+5;$j++)
{
if($j > 0 && $j <= $paginas)
{
if($j == $pagina)
{
echo $pagina;
}
else
{
echo <a href=" . DIRECT_URL . ?act=showtopic&t= . htmlentities($_GET[t]) . &start= . (($j-1)*$per_pagina) . "> . $j . </a>;
}
echo ;
}
}
echo </div><div style="float: right; width: 300px; text-align: right; margin: 3px 0 0 0; padding: 4px 5px 0 0;"> . (($topic_info[status] != 0) ? Het topic is gesloten, je kunt niet meer reageren : <a href=" . DIRECT_URL . ?act=addpost&t= . htmlentities($_GET[t]) . ">Reageer<img src=" . IMAGE_URL . comment.png" alt="Reageer"></a>) . </div><div style="clear: both;"></div>;
}
else
{
echo <meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}
else
{
echo <meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}
else
{
echo </div><meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}
else
{
echo </div><meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}
else
{
echo </div><meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}
else
{
echo </div><meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}
else
{
echo </div><meta http-equiv="refresh" content="0;url= . DIRECT_URL . ">;
}
}Spoiler tonen
table, td, tr {
margin: 0;
padding: 0;
border-spacing: 0;
}
div#forun_head {
float: left;
position: inherit;
border-bottom: 1px solid #484848;
}
div#forum_head_bar {
background-image: url(../img/forum_headbar.png);
background-repeat: repeat-x;
height: 45px;
width: 634px;
float: left;
position: inherit;
}
div#forum_head_title {
background-image: url(../img/forum_head.png);
height: 45px;
width: 164px;
float: left;
position: inherit;
}
div#forum_content {
padding: 10px 10px 10px 10px;
}
div#messagepreview {
width: 95%;
border: 1px solid #000000;
padding: 7px 7px 7px 7px;
}
.post {
border-bottom: 1px solid #000000;
border-top: 1px solid #000000;
padding: 7px 7px 7px 7px;
}
table.bbcode
{
width: 95%;
border: 1px solid #CCC;
background-color: #FFF;
font-size: 12px;
}
TD.bb_num
{
background-color: #CCC;
color: #808080;
font-family: Courier;
font-size: 12px;
text-align: right;
}
TD.bb_quote
{
font: 12px Arial;
color: #333;
}
#uitleg {
margin: 0px auto 10px auto;
width: 420px;
border: 1px dotted #962133;
border-bottom: 2px solid #962133;
background-color: #f75353;
}
.rederror, .greenerror {
width: 250px;
height: 19px;
line-height: 18px;
margin-left: 10px;
}
.rederror {
color: #f75353;
border: 2px solid #f75353;
}
.greenerror {
color: #96FF31;
border: 2px solid #96FF31;
}
#usererror, #emailerror {
float: left;
position: relative;
width: 60%;
text-align: center;
}
.multierror {
color: #F75353;
border: 2px solid #F75353;
width: 95%;
margin-left: 2em;
margin-bottom: 10px;
text-align: center;
}
.registred {
color: #96FF31;
border: 2px solid #96FF31;
width: 100%;
text-align: center;
}
.header_of_post {
background: url(../img/forum_titlebar.png) repeat-x;
height: 20px;
border-top: 1px solid #000000;
}
.post_user_signature {
border-bottom: 1px solid #000000;
padding: 7px 7px 7px 7px;
}
.post_ding1 {
width:100%;
height:fixed;
}
.post_avatar {
width:145px;
padding-left:5px;
border-left: 1px solid #000000;
border-right: 1px solid #000000;
}
.post_options {
background: url(../img/forum_options.png) repeat-x;
height: 18px;
border-bottom: 1px solid #000000;
padding-right: 5px;
}
div#footer {
text-align: center;
border-top: 1px solid #FF0000;
}
.forum_titles {
background: url(../img/forum_titlebar.png) repeat-x;
height: 22px;
color:#fff;
border-bottom: 1px solid #000000;
}

