function output_pages_from_cache($http, $otp) { $npg = $_SESSION['prmb'][6]; $page = $_SESSION['page']; $min = ($page - 1) * $npg; $max = $page * $npg; if (is_array($otp)) { foreach ($otp as $id => $nb) { if (is_numeric($id)) { $i++; if ($i >= $min && $i < $max) { $mg = $http . '/imgc/' . first_img($nb[3]); if (is_link($mg)) { $ret .= btn('imgl', image($mg, '', 50)); } $ret .= bal('h2', lka($http . '/' . $id, $nb[2])); $ret .= btn('txtx', $nb[1]) . ' '; if (rstr(27)) { $ret .= btn('txtsmall', mkday($nb[0], 1)) . ' ' . pub_link($nb[9]) . ' '; } if (rstr(25)) { $ret .= btn('txtsmall', art_length($nb[8])); } $ret .= br() . br(); } } } } $n_pages = nb_page($i, $npg, $page); return $n_pages . $ret . $n_pages; }
function plug_book($iq, $id) { bk_rq(); Head::add('csscode', book_css()); Head::add('jscode', book_js()); $_SESSION['book'] = $iq; if (!is_numeric($iq)) { list($r, $rb) = book_builder($iq); } else { $r = sql('ib', 'qdd', 'k', 'msg="' . $iq . '" and val="fav"'); } if (!$r) { return; } else { $_SESSION['bookr'] = $r; } $d = implode(' ', $r); $here = 'book'; $id = $id ? $id : $_SESSION['read']; $rid = randid(); //if(!$id) $rb['opt'] = lj('', 'popup_plup___book_book*ifr_' . $iq, pictxt('get', 'iframe')); foreach ($r as $k => $v) { $i++; if ($oi) { $io = $i . '. '; } $lk = 'book' . $rid . '_plug__2_book_book*read_' . $k . '_' . $rid; $lgh = art_length(sql('host', 'qda', 'v', 'id="' . $k . '"')); $msg .= lj('', $lk, picto('kright') . ' ' . $io . suj_of_id($k) . btn('small', ' (' . $lgh . ')')) . br(); } $rb['msg'] = scroll_c($msg, $rid); $ret = divd('book' . $rid, template($rb, 'book')); $_SESSION['cur_div'] = 'content'; return $ret; }
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_read_' . $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'] = best_img($r['img']); } //first_img //if(!$rst[93])$out['img1']=best_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']) { //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_api___parent:' . $id, nbof($rear, 1)); } //nb_arts if (!$rst[86] && is_array($nbtrk)) { $nbtk = count($nbtrk); //tracks if ($read) { $out['tracks'] = lka(urlread($id) . '#track', picto('forum', 16) . $nbtk); } else { $out['tracks'] = lj('', 'popup_trckpop___' . $id, picto('forum', 16) . $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) { //length $out['length'] = art_length($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' && $prw > 2) { $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]) { //api twitter $ots .= togbub('plug', 'twit_twit*share_' . $id, callico('tw')); } if (!$rst[45]) { $ots .= lkt('', $rsoc[45], callico('tw')); } if (!$rst[44]) { $ots .= lkt('', $rsoc[44], callico('fb')) . ' '; } if (!$rst[46]) { $ots .= lkt('', $rsoc[46], icon('stumble')) . ' '; } if (!$rst[42]) { $ots .= utag_edt($id) . ' '; } if (!$rst[52] or $r['opts']['fav']) { $ots .= fav_edt($id, 'fav') . ' '; } if (!$rst[90] or $r['opts']['like']) { $ots .= fav_edt($id, 'like') . ' '; } if (!$rst[91] or $r['opts']['poll']) { $ots .= poll_edt($id) . ' '; } if (!$rst[86]) { $ots .= lj($css, 'popup_track___' . $id, picto('forum')) . ' '; } //$ots.=lj($css,'popup_plup___track_trk*read_'.$id,picto('forum')).' '; //if(!$rst[47])$ots.=togbub('vmail',$id,picto('mail')).' '; if (!$rst[47]) { $ots .= lj('', 'popup_vmail___' . $id, picto('mail')) . ' '; } if (!$rst[12]) { $ots .= lkt('', '/plug/read/' . $id, picto('print')) . ' '; } if (!$rst[49]) { $out['words'] = togbub('words', $id, picto('search')); } $out['social'] .= $ots; } 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; }
function admin_articles($r) { $ye = btn('" style="color:green;', picto('true')) . ' '; $no = btn('" style="color:#bd0000;', picto('false')) . ' '; foreach ($_GET as $ka => $va) { $goto .= $ka . '=' . $va . '&'; } $goto .= 'publish='; foreach ($r as $id => $va) { $cid = '&art=' . $id . '#' . $id; foreach ($va as $k => $v) { switch ($k) { case "id": $v = '<a name="' . $v . '"></a>' . lkt('', urlread($id), $v); break; case "day": $v = mkday($v, 1); break; case "suj": $v = lj('', 'popup_editbrut___' . $id, $v); break; case "img": $v = ""; break; case "re": if ($v) { $v = lkc("", '/?' . $goto . 'off' . $cid, $ye); } else { $v = lkc("", '/?' . $goto . 'on' . $cid, $no); } break; case "host": $v = art_length($v); break; } $ret[$id][$k] = $v; } } return $ret; }