• User Attivo

    Login per accedere help

    allora ragazzi ho un grande problema:
    [php]
    <?php
    require "pmheader.php";
    $answer = (empty($_POST['re'])) ? "" : $_POST['re'];
    $post_id = (!isset($_GET['post'])) ? "0" : $_GET['post'];

    echo $header;
    if($answer == "")
    {
    $query = $db->sql_query("select post_text, bbcode_uid from " . POSTS_TEXT_TABLE . " where post_id = "$post_id"");
    $post_text = $db->sql_fetchrow($query);
    $post = $post_text['post_text'];
    $post = wap_validate($post,0,1,$post_text['bbcode_uid'],1);
    $post_text = "$post";
    ?>
    <?php echo $lang['wap_edit']; ?>Messaggio: <input name="re" emptyok="false" maxlength="999" value="<?php echo $post_text; ?>"/><br/>
    <anchor>
    <?php echo $lang['wap_post']; ?>
    <go href="<?php echo append_sid("wapedit.php?re=$(re)&post=$post_id"); ?>" method="post">
    <postfield name="re" value="$(re)"/>
    </go>Edita
    </anchor>
    <?php
    }
    else
    {
    $time = time();
    $update_posts = $db->sql_query("update " . POSTS_TEXT_TABLE . " set post_text = "$answer" where post_id = $post_id");
    $update_text = $db->sql_query("update " . POSTS_TABLE . " set post_edit_time = "$time", post_edit_count = post_edit_count +1 where post_id = $post_id");
    $last = $db->sql_query("select p.topic_id, t.topic_replies, t.forum_id from " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p where p.post_id = $post_id and t.topic_id = p.topic_id");
    $last = $db->sql_fetchrow($last);
    $start = $last['topic_replies'];
    $topic = $last['topic_id'];
    $forum_id = $last['forum_id'];
    echo sprintf($lang['wap_click_view_post'],"<anchor>","<go href="" . append_sid("waptopic.$phpEx?s=$start&topic=$topic&forum=$forum_id&last=1") . ""/></anchor>");
    echo "Clicca <anchor>Qui!<go href="" . append_sid("waptopic.$phpEx?s=$start&topic=$topic&forum=$forum_id&last=1") . "" /></anchor> per vedere il tuo messaggio.";
    }
    echo $footer;
    ?>
    [/php]
    vorrei che la funzione messaggio comparisse solo secondo questo codice:
    if($userdata['session_logged_in'])
    {
    messaggio e opzione x editare
    }else{
    accesso impedito---

    potete aiutarmi???
    ho fatto prove ma non vanno...grazie a ki mi aiuterà


  • User Attivo

    nessuno??? 😞


  • ModSenior

    Ciao hiwap3, ti ricordo che non sono consentiti UP a così breve distanza di tempo, non essendo la prima volta che lo hai fatto anche in altri thread, ti consiglio di rileggere il regolamento, e di attendere come fanno tutti una risposta.


  • Moderatore

    ti voglio aiutare, ma tu devi aiutare me 🙂

    postami solo il pezzo di codice incriminato 🙂

    perchè non ho il tempo di leggerlo tutto scusami ma è un favore che ti chiedo!


  • User Attivo

    [php]
    if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == 2)
    {
    <?php echo $lang['wap_edit']; ?>Messaggio: <input name="re" emptyok="false" maxlength="999" value="<?php echo $post_text; ?>"/><br/>
    <anchor>
    <?php echo $lang['wap_post']; ?>
    <go href="<?php echo append_sid("wapedit.php?re=$(re)&post=$post_id"); ?>" method="post">
    <postfield name="re" value="$(re)"/>
    </go>Edita
    </anchor>
    }
    else
    {
    echo "non consentito";
    }
    [/php]
    ma non funziona 😞


  • Moderatore

    [php]
    <?php
    if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == 2)
    {
    ?>
    <?php echo $lang['wap_edit']; ?>Messaggio: <input name="re" emptyok="false" maxlength="999" value="<?php echo $post_text; ?>"/><br/>
    <anchor>
    <?php echo $lang['wap_post']; ?>
    <go href="<?php echo append_sid("wapedit.php?re=$(re)&post=$post_id"); ?>" method="post">
    <postfield name="re" value="$(re)"/>
    </go>Edita
    </anchor>
    <?php
    }
    else
    {
    echo "non consentito";
    }
    ?>
    [/php]

    prova in questo modo

    altrimenti dimmi cosa contengono le variabili $userdata['user_level'] e $userdata['user_level'] stampandole a video 🙂 ciao bello 😉

    inoltre dimmi quale errore dà 🙂


  • User Attivo

    mazza sbaglio sempre su cose stupide 😞 comunque grazie anzi ora ti invio un messaggio privato :3: