Esempio n. 1
0
File: art.php Progetto: philum/cms
function prepare_tits($id, $r, $rear, $nbtrk, $nl, $prw)
{
    $ib = trim($r['ib']);
    $nl = $nl ? $nl : $_SESSION['nl'];
    $rst = $_SESSION['rstr'];
    $USE = $_SESSION['USE'];
    $read = $_SESSION['read'];
    $page = $_SESSION['page'];
    if ($nl == 'nlpop') {
        $nl = '';
        $nlp = 1;
    }
    $out['jurl'] = 'content_ajxlnk2__2_art_' . $id;
    $out['purl'] = 'popup_popart__3_' . $id . '_3';
    $out['day'] = $r['day'];
    $out['artedit'] = ' ';
    $nlb = substr($nl, 0, 2);
    if ($nlb == "nl") {
        $http = host();
    }
    $out['url'] = $http . good_url($id, $r['suj']);
    //urlread($id);
    if (!$rst[19]) {
        $out['img1'] = first_img($r['img']);
    }
    //img1
    if (!$rst[68] && $r['img'] && strpos($r['img'], '/')) {
        //gallery
        $out['btim'] = lj('', 'popup_callp___spe-ajxf_art*gallery_' . $id . '_gallery', picto('img'));
    }
    if ($_SESSION['prma']['art_mod']) {
        if ($read == $id && $prw > 2 && !$nl && !$nlp && rstr(60)) {
            $out['float'] = build_art_mod(1);
        }
        //	$out['float']=mkbub(popbub('seek','',picto('list'),'c'),'inline','position:relative; display:inline-block;','');//seek
        $out['open'] .= lj('', 'popup_popartmod__3_' . $id, picto('virtual')) . ' ';
    }
    if (!$rst[31]) {
        $out['back'] = art_back($id, $ib, $r['frm']);
    }
    //back
    if (!$rst[6] && $r['name'] != ses('qb')) {
        //author
        $out['author'] = lka(htac('author') . $r['name'], $r['name']);
    }
    if (!$rst[23] && $r['re'] > 1) {
        $out['priority'] = picto('s' . ($r['re'] - 1), 16);
    }
    if (!$rst[24]) {
        $day = mkday($r['day'], 1);
        //date
        if (!$rst[54]) {
            $out['date'] = lka(target_date($r['day']), $day);
        } else {
            $out['date'] = $day;
        }
    }
    if (!$rst[26]) {
        $out['pid'] = $id;
    }
    //id
    if (!$rst[29]) {
        $out['tag'] = tag_maker($id);
    }
    //tags
    if ($nl != 'nl') {
        $out['edit'] = admin_edit($r['name'], $id, $r['re'], $prw);
    }
    //edit
    if (rstr(27) && trim($r['mail'])) {
        $out['source'] = pub_link($r['mail']);
    }
    //source
    if ($_GET['search'] && $nl) {
        $out['search'] = nbof($nl, 19);
    }
    //rech
    if ($rear > 1 && rstr(43)) {
        $out['nbarts'] = lj('', 'popup_getcontent___parent_' . $id, nbof($rear, 1));
    }
    //nb_arts
    if (is_array($nbtrk)) {
        $nbtk = count($nbtrk);
        //tracks
        if ($read) {
            $out['tracks'] = lka(urlread($id) . '#trackback', picto('forum') . $nbtk);
        } else {
            $out['tracks'] = lj('', 'popup_trckpop___' . $id, picto('forum') . $nbtk);
        }
    }
    if ($ib > 0 && $read != $id && $read != $ib) {
        $sujb = suj_of_id($ib);
        //parent
        if ($sujb) {
            $out['parent'] = lka(urlread($ib), pictxt('copy', $sujb));
        }
    }
    if (!$rst[58] && $nlb != "nl") {
        $out['open'] .= lj('', 'popup_editbrut___' . $id, picto('conn')) . ' ';
    }
    if (!$rst[37] && $nlb != "nl") {
        $out['open'] .= popart($id) . ' ';
    }
    //popen
    if (!$rst[28] && $nlb != "nl") {
        //open
        if ($prw <= 2 && $rst[41] != "0") {
            $out['open'] .= opnart($id, $prw, '') . ' ';
        } elseif ($prw == 3 && $rear > 1) {
            $out['open'] .= opnart($id, 2, '1') . ' ';
        }
    }
    if (!$rst[25] && $r['host'] > 1000) {
        //lenght
        $out['lenght'] = picto('time', 16) . ' ' . art_lenght($r['host']);
    }
    if (!$rst[40]) {
        //rss
        $out['rss'] = lkt("", '/plug/rss1.php?read=' . $id . '&preview=full', picto('rss', 16));
    }
    if (!$rst[71] && $nlb != "nl") {
        $out['social'] = lj('', 'popup_artstats___' . $id . '_' . $r['day'], picto('users', 16));
    }
    //if($ath=@$r['opts']['authlevel'])$out['social'].=asciinb($ath);
    if ($nlb != "nl") {
        $root = host() . urlread($id);
        //social//&via=philum_info
        $rsoc = array(44 => 'http://www.facebook.com/sharer.php?u=' . $root, 45 => 'http://twitter.com/intent/tweet?original_referer=' . $root . '&url=' . $root . '&text=' . utf8_encode($r['suj']) . '&title=' . utf8_encode($r['suj']), 46 => 'http://wd.sharethis.com/api/sharer.php?destination=stumbleupon&url=' . $root);
        if (auth(6) && !$rst[45]) {
            $out['social'] .= lj('', 'popup_plup___twit_twit*share_' . $id, callico('tw'));
        }
        if (!$rst[45]) {
            $out['social'] .= lkt('', $rsoc[45], callico('tw'));
        }
        if (!$rst[44]) {
            $out['social'] .= lkt('', $rsoc[44], callico('fb'));
        }
        if (!$rst[46]) {
            $out['social'] .= lkt('', $rsoc[46], icon('stumble'));
        }
        if (!$rst[52]) {
            $out['social'] .= favs_edt($id) . ' ';
        }
        //	if(!$rst[86])$out['social'].=lj($css,'popup_track___'.$id,picto('forum')).' ';
        if (!$rst[47]) {
            $out['social'] .= lj('', 'popup_vmail___' . $id, callico('mail')) . ' ';
        }
        if (!$rst[12]) {
            $out['social'] .= lkt('', '/plug/read/' . $id, picto('print')) . ' ';
        }
        if (!$rst[49]) {
            $out['words'] = lj('', 'popup_words___' . $id, picto('search'));
        }
    }
    if ($_SESSION['plgs'] && $nlb != "nl") {
        $out['social'] = $_SESSION['plgs'];
    }
    $out['artlang'] = lang_art($id, $r['opts']);
    $out['lang'] = lang_rel_arts($id, $r['opts']);
    if (!$rst[50] or $USE) {
        $out['opt'] = btn('txtsmall2', picto('view', 16) . ' ' . $r['lu']) . ' ';
    }
    //nbof
    $out['sty'] = '';
    return $out;
}
Esempio n. 2
0
File: mod.php Progetto: philum/cms
function pub_art($id, $tpl = '')
{
    $rst = $_SESSION['rstr'];
    list($day, $frm, $suj, $amg, $nod, $thm, $lu, $re) = pecho_arts($id);
    $panout['url'] = urlread($id);
    $panout['suj'] = $suj;
    $panout['jurl'] = 'content_ajxlnk2__2_read_' . $id;
    $panout['purl'] = 'popup_popart__3_' . $id . '_3';
    if ($rst[32] != 1 && $amg) {
        $panout['img1'] = first_img($amg);
    }
    if ($rst[36] != 1) {
        $panout['back'] = art_back($id, $ib, $frm);
        $panout['cat'] = $frm;
    }
    if ($rst[7] != 1) {
        $panout['date'] = mkday($day);
    }
    if ($rst[4] != 1) {
        $r = tag_maker($id, 1);
        if ($r) {
            $panout += $r;
        }
    }
    if (!$tpl) {
        if ($rstr[8]) {
            $tpl = 'pubart';
        } else {
            $tpl = 'pubart_j';
        }
    }
    if ($re) {
        return divc('pubart', template($panout, $tpl));
    }
}