1 (edited by raindc 2008-04-15 06:09:51)

Topic: punbb + article

Naudoju  punbb skripta kartu su article pluginu viskas paimta is www.punbb.org
Ir yra tokia beda, dedant "straipsnius" galima nurodyti grupes kurios des tai... bet stai redaguot gali tik Administratorius ir tik savo paties postus :( Man labai reikia jog adminas galetu redaguot visus postus be isimties kas juos idejo, o moderatoriai kad galetu redaguoti savo paciu detus postus...
Taigi perziurejau visus failus skripto radau tokia kodo daly....


  // Are we authorized to see the section ?
    $ulchkvis=0;
    if ($pun_config['fp_art_who'] == '0')     //All
        $ulchkvis=1;
    if (($pun_config['fp_art_who'] == '1') && (($pun_user['g_id'] == PUN_MOD) || ($pun_user['g_id'] == PUN_ADMIN))) // Mod & Admin
        $ulchkvis=1;
    if (($pun_config['fp_art_who'] == '2') && ($pun_user['g_id'] == PUN_ADMIN))  // Admin
        $ulchkvis=1;
    if ($pun_config['fp_art_who'] == '3')   // None
        $ulchkvis=0;
    if (($pun_config['fp_art_who'] >= '4') && ($pun_user['g_id'] <> PUN_GUEST))  // Member and up
        $ulchkvis=1;


    if ($ulchkvis == 0)
    {
        message("You are not authorized to write articles.");
    }

// If we are editing the article
if ($artedt_id && $fpaction == 'edit')
{
    //check if we have the right
    $result = $db->query('SELECT id , poster, poster_id, message, hide_smilies, posted, cat_id, vright, subject, artisrtf FROM '.$db->prefix.'article_cont WHERE id='.$artedt_id, true) or error('Unable to fetch article info', __FILE__, __LINE__, $db->error());
    $cur_article = $db->fetch_assoc($result);

    if (($pun_user['g_id'] <> PUN_ADMIN) || ($pun_user['id'] <> $cur_article['poster_id']))
        message('You do not have the right to edit this article.');
        
    $art_id = $cur_article['id'];
    $artcat_id = $cur_article['cat_id'];
    $artsub = $cur_article['subject'];
    $artmes = $cur_article['message'];
    $hide_smilies = $cur_article['hide_smilies'];
    $vright = $cur_article['vright'];
    $artisrtf = $cur_article['artisrtf'];
}