Forum » Server-Side scripting » Doorstuur laatste bericht
http://www.hogwartscastle
Berichten: 217
avatar
Offline Stuur privebericht
Hey,

Ik heb een nieuws reactie script maar ik wil dat als je een nieuwe reactie post dat je wordt doorgestuurd naar die reactie. Maar mijn param 2 wilt het niet doen.

Weet iemand hoe ik dit oplos?

Code | Selecteer Alles
minimaliseren
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
<?php
include 'includes/config.php';

if(isset(
$param[1]))
{
    
    
$nieuwsQuery $core->mysql->query("SELECT
                                         id,
                                         titel,
                                         inhoud,
                                         schrijver_id,
                                         datum
                                        FROM
                                            nieuws_nieuwsberichten
                                        WHERE
                                            id = '"
.$param[1]."'");
                                            

    
$nieuwsFetch $core->mysql->fetch($nieuwsQuery);
    
    
$aantalcommentsQuery $core->mysql->query("SELECT
                                                    1
                                                FROM
                                                    nieuws_reacties
                                                WHERE
                                                    nieuwsbericht_id = '"
.$param[1]."'");
    
$totaal  $core->mysql->num_rows($aantalcommentsQuery); 
    
$huidige = (isset($param[2]) && ctype_digit($param[2]) && $param[2] > 0) ? $param[2] : 1;
    
$per_pagina 10;    
    
$str paging('nieuws/'.$param[1].'/'$totaal$per_pagina$huidige);

    
$reactiesQuery =  $core->mysql->query("SELECT
                                            n.id,
                                            n.lid_id,
                                            n.inhoud,
                                            n.datum,
                                            l.uLeerjaar,
                                            l.uAvatar,
                                            l.uName,
                                            l.uRang,
                                            l.uAfdeling
                                        FROM
                                            nieuws_reacties n,
                                            leden_leden l
                                        WHERE
                                            n.nieuwsbericht_id = '"
.$nieuwsFetch['id']."'
                                        AND
                                            n.lid_id = l.uId
                                        ORDER BY
                                            n.id
                                        LIMIT
                                            "
.(($huidige $per_pagina) - $per_pagina).", ".$per_pagina);

    
define('_TITLE_'$nieuwsFetch['titel']);
       include 
'includes/header.php';
    
   
     if(
$core->mysql->num_rows($nieuwsQuery) == 1)    
     {   
        
            echo 
'<div class="nieuws-titel">&rsaquo;  <strong>'.$nieuwsFetch['titel'].'</strong></div>
                    <div class="nieuws-container">'
.parseUbb($nieuwsFetch['inhoud']).'</div>
                    <div class="nieuws-bottom" style="margin-bottom: 20px;">Gepost op '
.$nieuwsFetch['datum'].' door '.$core->leden->naam($nieuwsFetch['schrijver_id']).'</div>';
        
        if(
$core->mysql->num_rows($reactiesQuery) >= 1)    
        {

            while(
$reactiesFetch $core->mysql->fetch($reactiesQuery))
            {
               
?>
                    <div class="nieuws-titel">&rsaquo;  <strong>Gepost op <?php echo $reactiesFetch['datum']; ?></strong></div>
                        <div class="reactie-container" id="post_<?php echo $reactiesFetch['id']; ?>">
                            <div class="nieuws-inhoud">
                                    <div class="nieuws-ledeninfo">
                                        <a href="<?php echo _ROOT_?>profiel/<?php echo $core->leden->naam($reactiesFetch['lid_id']); ?>" style="text-decoration: none;"><span style="color: #<?php echo $reactiesFetch['uColor']; ?>; font-weight: bold"><?php echo $core->leden->naam($reactiesFetch['lid_id']); ?></span></a>
                                        <small><?php echo $functies[$reactiesFetch['uRang']]; ?></small>
                                        <img src="<?php echo _ROOT_?><?php echo $reactiesFetch['uAvatar']; ?>" alt="Avatar" />
                                        
                                        <?php echo $reactiesFetch['uLeerjaar']; ?><sup>e</sup> <?php echo $afdelingen[$reactiesFetch['uAfdeling']]; ?>
                                    </div>
                                    <div class="nieuws-bericht">
                                        <?php echo parseUbb($reactiesFetch['inhoud']); ?>
                                    </div>
                            <div style="clear: both;"></div>
                            </div>
                    </div>
                <?php                     
            
}
            
echo 
''.$str.'';


        }
        else
        {
            
            echo 
'<strong>Er zijn geen reacties in dit nieuwsbericht.</strong>';
            
        }

    }
    else
    {
        
         
header('Location: '._ROOT_.'');
    }    
    
    if(
$_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['submit'])
    {
        
        if(
trim($_POST['bericht']) == '')
        {
            
$core->fouten->add('Je bent een bericht vergeten in te vullen.');
        
        }
        
        if(
$core->fouten->aantal() == 0)
        {
            
            
$core->mysql->query("INSERT INTO
                                        nieuws_reacties
                                    (
                                        lid_id,
                                        datum,
                                        inhoud,
                                        nieuwsbericht_id
                                    ) VALUES (
                                        '"
.$core->leden->info['mijn']['uId']."',
                                        NOW(),
                                        '"
.$core->mysql->escape($_POST['bericht'])."',
                                        '"
.$core->mysql->escape($param[1])."'
                                    )"
);
                                    
            
$postid $core->mysql->insert_id();
                                    
               
header('Location: '._ROOT_.'nieuws/'.$param[1].'/'.$param[2].'#'.$postid.'');
            
    }
    else
        echo 
''.$core->fouten->weergeef();
      }  
    
        
?>
            <div class="nieuws-titel" style="margin-top: 10px;">&rsaquo;  <strong>Reageer</strong></div>
            <div class="nieuws-inhoud">
                <form action="" method="post">
                    <textarea style="height: 100px; width: 300px;" name="bericht" id="bericht" tabindex="2"></textarea>
                    <input type="submit" name="submit" value="Verzend" />
                </form>
            </div>
       <?php

}

include 
'includes/footer.php';
?>

19-09-2010 10:14
Dit topic is 177 keer bekeken door 40 verschillende leden
Reacties op: "Doorstuur laatste bericht"
1
Webdeveloper & Programmeu
Berichten: 1000
avatar
Offline Stuur privébericht
misschien klein vraagje, waar word param überhaupt vandaan gehaald?
waaarschijnlijk geef je het geen waarde of kan hij geen waarde vinden?
19-09-2010 10:45
Reageer op: "Doorstuur laatste bericht"
1
Je kan niet reageren omdat je niet bent ingelogd. Inloggen of Aanmelden