= 1) { list($cid) = rss_fetch_row($res); } else { $cid = ""; // is this a folder? $sql = "select c.id, c.parent from ". getTable('channels')." c left join " . getTable('channels2user') . " c2u on (c.id=c2u.fkcid) " ." inner join " . getTable('folders') . " f on f.id = c.parent " ." where f.name like '$sqlid' and f.id > 0"; if (hidePrivate()) { $sql .=" and c2u.flgprivate=0 "; } $sql .= " and c2u.flgdeleted=0 "; $res = rss_query( $sql ); if ( rss_num_rows ( $res ) > 0) { $cids = array(); while (list ($cid__,$fid__) = rss_fetch_row($res)) { $cids[] = $cid__; $fid = $fid__; } } else { // maybe it's a virtual folder? $sql = "select c.id, m.tid from ". getTable('channels')." c " . "inner join " . getTable('metatag') . " m on m.fid = c.id " . "inner join " . getTable('tag') . " t on m.tid = t.id " . "where m.ttype = 'channel' and t.tag like '$sqlid'"; if (hidePrivate()) { $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; } $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; $res = rss_query( $sql ); if ( rss_num_rows ( $res ) > 0) { $cids = array(); while (list ($cid__,$vfid__) = rss_fetch_row($res)) { $cids[] = $cid__; $vfid = $vfid__; } } } } // date ? if ($cid != "" && array_key_exists('y',$_REQUEST) && $_REQUEST['y'] != "" && is_numeric($_REQUEST['y']) && array_key_exists('m',$_REQUEST) && $_REQUEST['m'] != "" && is_numeric($_REQUEST['m'])) { $y = (int) $_REQUEST['y']; if ($y < 1000) $y+=2000; $m = (int)$_REQUEST['m']; if ($m > 12) { $m = date("m"); } $d = (int)$_REQUEST['d']; if ($d > 31) { $d = date("d"); } } // lets see if theres an item id as well $iid = ""; if ($cid != "" && array_key_exists('iid',$_REQUEST) && $_REQUEST['iid'] != "") { $sqlid = preg_replace("/[^A-Za-z0-9\.]/","%",$_REQUEST['iid']); $sql = "select id from " .getTable("item") ." i where i.title like '$sqlid' and i.cid=$cid"; if ($m > 0 && $y > 0) { $sql .= " and month(ifnull(i.pubdate,i.added))= $m " ." and year(ifnull(i.pubdate, i.added))= $y "; if ($d > 0) { $sql .= " and dayofmonth(ifnull(i.pubdate,i.added))= $d "; } } if (hidePrivate()) { $sql .=" and not(i.unread & " . RSS_MODE_PRIVATE_STATE .") "; } $sql .=" and not(i.unread & " . RSS_MODE_DELETED_STATE .") "; $sql .=" order by i.added desc, i.id asc"; $res = rss_query( $sql ); if ( rss_num_rows ( $res ) >0) { list($iid) = rss_fetch_row($res); } } // no mod rewrite: ugly but effective } elseif (array_key_exists('channel',$_REQUEST) || array_key_exists('folder',$_REQUEST) || array_key_exists('vfolder',$_REQUEST)) { $cid= (array_key_exists('channel',$_REQUEST))?sanitize($_REQUEST['channel'],RSS_SANITIZER_NUMERIC):""; $iid= (array_key_exists('iid',$_REQUEST))?sanitize($_REQUEST['iid'],RSS_SANITIZER_NUMERIC):""; $fid= (array_key_exists('folder',$_REQUEST))?sanitize($_REQUEST['folder'],RSS_SANITIZER_NUMERIC):""; $vfid= (array_key_exists('vfolder',$_REQUEST))?sanitize($_REQUEST['vfolder'],RSS_SANITIZER_NUMERIC):""; $y= (array_key_exists('y',$_REQUEST))?sanitize($_REQUEST['y'],RSS_SANITIZER_NUMERIC):"0"; $m= (array_key_exists('m',$_REQUEST))?sanitize($_REQUEST['m'],RSS_SANITIZER_NUMERIC):"0"; $d= (array_key_exists('d',$_REQUEST))?sanitize($_REQUEST['d'],RSS_SANITIZER_NUMERIC):"0"; if ($fid) { $sql = "select c.id from ". getTable('channels')." c " ." where c.parent=$fid and c.parent > 0"; $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; if (hidePrivate()) { $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; } $res = rss_query( $sql ); if ( rss_num_rows ( $res ) > 0) { $cids = array(); while (list ($cid__) = rss_fetch_row($res)) { $cids[] = $cid__; } } } elseif ($vfid) { $sql = "select c.id, m.tid from ". getTable('channels')." c " . "inner join " . getTable('metatag') . " m on c.id = m.fid " . "inner join " . getTable('tag') . " t on m.tid = t.id " . "where m.ttype = 'channel' "; // $vfid can be numeric (t.id) or alphabetic (t.tag) if(is_numeric($vfid)) { $sql .= "and t.id = $vfid"; } else { $sql .= "and t.tag like '$vfid'"; } $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; if (hidePrivate()) { $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; } $res = rss_query( $sql ); if ( rss_num_rows ( $res ) > 0) { $cids = array(); while (list ($cid__,$vfid__) = rss_fetch_row($res)) { $cids[] = $cid__; $vfid = $vfid__; } } } elseif ($cid) { if (hidePrivate()) { $sql = "select id from ". getTable('channels')." where id=$cid "; $sql .=" and not(mode & " . RSS_MODE_PRIVATE_STATE .") "; list ($cid) = rss_fetch_row(rss_query($sql)); } } } elseif ( array_key_exists('y',$_REQUEST) && $_REQUEST['y'] != "" && is_numeric($_REQUEST['y']) && array_key_exists('m',$_REQUEST) && $_REQUEST['m'] != "" && is_numeric($_REQUEST['m']) && array_key_exists('d',$_REQUEST) && $_REQUEST['d'] != "" && is_numeric($_REQUEST['d']) ) { $y = (int) sanitize($_REQUEST['y'],RSS_SANITIZER_NUMERIC); if ($y < 1000) $y+=2000; $m = (int) sanitize($_REQUEST['m'],RSS_SANITIZER_NUMERIC); if ($m > 12) { $m = date("m"); } $d = (int) sanitize($_REQUEST['d'],RSS_SANITIZER_NUMERIC); if ($d > 31) { $d = date("d"); } $iid = $cid = null; } // If we have no channel-id something went terribly wrong. // Send a 404. if ( // channel id: ( // not set !isset($cid) || // ...or empty $cid == "" || // or not numeric while mod_rewrite is off ( !getConfig('rss.output.usemodrewrite') && !is_numeric($cid) ) ) && // folder id ( // not set !isset($cids) || // not an array of ids !is_array($cids) || // zero elements !count($cids) ) && // virtual folder id (!isset($vfid)) && // date? ($d == 0 && $m == 0 && $y == 0) ) { rss_404(); exit; } //echo ("cid=".(isset($cid)?"$cid":"") . " fid=" . (isset($fid)?"$fid":"")); if (!hidePrivate() && array_key_exists ('metaaction', $_REQUEST)) { if (array_key_exists('markreadids',$_POST)) { $IdsToMarkAsRead = explode(",",rss_real_escape_string($_POST['markreadids'])); //var_dump($IdsToMarkAsRead); } else { $IdsToMarkAsRead = array(); } switch ($_REQUEST['metaaction']) { case 'ACT_MARK_CHANNEL_READ': /** mark channel as read **/ $sql = "update " .getTable("i2u") ." set flgunread = 0 where i2u.fkcid=$cid"; if (hidePrivate()) { $sql .= " and i2u.flgprivate =0"; } if (count($IdsToMarkAsRead)) { $sql .= " and id in (" . implode(',',$IdsToMarkAsRead) .")"; } rss_query($sql); rss_invalidate_cache(); /* Redirect! If this feed has more unread items, self-redirect */ $sql = "select count(*) from " .getTable("item2user") . " i2u " ." where i2u.flgunread=1 " ." and i2u.fkcid=$cid" ." and i2u.flgdeleted=0 "; if (hidePrivate()) { $sql .=" and i2u.flgprivate =0"; } list($hasMoreUnreads) = rss_fetch_row(rss_query($sql)); //more unread items in this feed? if ($hasMoreUnreads) { $next_unread_id=$cid; } else { /* Find where we should redirect - The next feed in the list with unread items, or, failing that: - The first feed in the list with unread items, or, faling that: - The main page */ // 1: build a list of all feeds: $feeds = array(); $sql = "select c.id from " . getTable('channels') . " c " . "inner join " . getTable('folders') . " f on c.parent=f.id " ." where not (c.mode & " . RSS_MODE_DELETED_STATE .") " ; if (hidePrivate()) { $sql .= " and not (c.mode & " . RSS_MODE_PRIVATE_STATE . ") "; } if (getConfig('rss.config.absoluteordering')) { $sql .= " order by f.position asc, c.position asc"; } else { $sql .=" order by f.name asc, c.title asc"; } $res = rss_query($sql); while (list($cid__) = rss_fetch_row($res)) { $feeds[$cid__] = 0; } // 2: Get the unread count for each feed: $sql = "select fkcid, count(*) from " .getTable('item2user') ." i2u where i2u.flgunread=1 " ." and i2u.flgdeletd=0"; if (hidePrivate()) { $sql .= " and i2u.flgprivate=0 "; } $sql .= " group by i2u.fkcid"; $res = rss_query($sql); while (list($cid__,$uc__) = rss_fetch_row($res)) { // this makes sure only the feeds that were gathered in the // last query are put into this array.. fixes #305 if(array_key_exists($cid__, $feeds)) { $feeds[$cid__] = $uc__; } } // 3: iterate over the feeds and see where we should redirect. $found = false; $first_unread_id = $next_unread_id = 0; foreach($feeds as $cid__ => $cnt) { // reached the feed we're coming from? if ($cid == $cid__) { $found = true; } // if not yet, get a hold of the first in the list with unread items if ($cnt && !$first_unread_id) { $first_unread_id = $cid__; } // passed the previous feed? We got a winner! if ($cnt && $found) { $next_unread_id = $cid__; break; } } // found none after the previous feed, but there is on on top if (!$next_unread_id && $first_unread_id) { $next_unread_id = $first_unread_id; } } //redirect if (!$next_unread_id) { rss_redirect(); } else { $cid = $next_unread_id; } break; // folder case 'ACT_MARK_FOLDER_READ': $fid = sanitize($_REQUEST['folder'],RSS_SANITIZER_NUMERIC); $rs = rss_query("select id from " .getTable('channels') . " where parent=$fid"); $cids_ = array(); while(list($cid_) = rss_fetch_row($rs)) { $cids_[]=$cid_; } $sql = "update " .getTable('item2user') . " set unread = 0 " . " where fkcid in (" .implode(',', $cids_) . ") "; unset($cids_); if (count($IdsToMarkAsRead)) { $sql .= " and fkiid in (" . implode(',',$IdsToMarkAsRead) .")"; } //die($sql); rss_query($sql); rss_invalidate_cache(); $next_fid = $first_fid = 0; $found = false; $res = rss_query( " select id from " .getTable('folders') ." f order by " .(getConfig('rss.config.absoluteordering')?" f.position asc":"f.name asc") ); while (list($fid__) = rss_fetch_row($res)) { if($fid__ == $fid) { $found = true; } if( $found || !$first_fid ) { $sql = "select count(*) from " . getTable('item2user') . " i2u " . "inner join ". getTable('channels') ." c on i2u.fkcid = c.id" ." where i2u.flgunread=1 and c.parent = $fid__" ." and i2u.fkuid=" . rss_user_id(); if (hidePrivate()) { $sql .= " and i2u.flgprivate=0 "; } list($c) = rss_fetch_row(rss_query($sql)); //echo "$fid__ -> $c\n"; if ($c > 0) { if (!$first_fid) $first_fid = $fid__; if ($found) { $next_fid = $fid__; break; } } } } if( !$next_fid && $first_fid ) $next_fid = $first_fid; if ( $next_fid ) { $fid = $next_fid; $sql = "select id from " . getTable('channels') ." where parent=$fid"; $res = rss_query($sql); $cids = array(); while ( list($cid__) = rss_fetch_row($res)) { $cids[] = $cid__; } } else { rss_redirect(); } break; // virtual folder - code extremely similar to __('Mark These Items as Read') case 'ACT_MARK_VFOLDER_READ': $vfid = sanitize($_REQUEST['vfolder'],RSS_SANITIZER_NUMERIC); $rs = rss_query( "select fid from " .getTable('metatag') . "m " ." where m.ttype = 'channel' and m.tid = $vfid"); $fids_ = array(); while(list($fid_) = rss_fetch_row($rs)) { $fids_[]=$fid_; } $sql = "update " .getTable('item2user') . " set unread = 0 " . " where fkcid in (" .implode(',',$fids_). ")" . " and fkuid=". rss_user_id(); if (count($IdsToMarkAsRead)) { $sql .= " and fkiid in (" . implode(',',$IdsToMarkAsRead) .")"; } rss_query($sql); rss_invalidate_cache(); // find next virtual folder to redirect to $next_vfid = $first_vfid = 0; $found = false; $res = rss_query("select distinct tid from " .getTable('metatag') ." m " . "inner join" . getTable('tag') ."t on m.tid = t.id order by t.tag asc"); while (list($tid__) = rss_fetch_row($res)) { if ($tid__ == $vfid) { $found = true; } if( $found || !$first_vfid ) { // check for unread items in next virtual folder $sql = "select count(distinct(i.fkiid)) as cnt from " .getTable('metatag') ." left join " .getTable('item2user') . "i2u on (i2u.fkcid=fid) " ."where tid = $tid__ and ttype = 'channel' " ." and i2u.flgunread=1 " ." and i2u.fkuid=" .rss_user_id() ." and i2u.flgdeleted=0 "; if (hidePrivate()) { $sql .= " and i2u.flgprivate=0 "; } list($c) = rss_fetch_row(rss_query($sql)); if ($c > 0) { if (!$first_vfid) $first_vfid = $tid__; if ($found) { $next_vfid = $tid__; break; } } } } if( !$next_vfid && $first_vfid ) $next_vfid = $first_vfid; if($next_vfid) { $vfid = $next_vfid; $sql = "select distinct(fid) from " . getTable('metatag') . " where tid = $vfid"; $res = rss_query($sql); $cids = array(); while(list($cid__) = rss_fetch_row($res)) { $cids[] = $cid__; } } else { rss_redirect(); } break; } if( array_key_exists ('redirectto', $_REQUEST)) { header("Location: " . $_REQUEST['redirectto']); exit(); } } //echo ("cid=".(isset($cid)?"$cid":"") . " fid=" . (isset($fid)?"$fid":"")); assert( (isset($cid) && is_numeric($cid)) || (isset($fid) && isset($cids) && is_array($cids) && count($cids)) || (isset($vfid) && isset($cids) && is_array($cids) && count($cids)) || (!isset($cid) && ($y || $m)) ); $itemFound = true; if ($iid != "" && !is_numeric($iid)) { //item was deleted $itemFound = false; $iid = ""; } // make sure the variables passed to makeName are initialized if (!isset($fid)) { $fid=null; } if (!isset($vfid)) { $vfid=null; } if (!isset($cids)) { $cids=null; } //precompute the navigation hints, which will be passed to the header as s $links = NULL; if (($cid || $fid || $vfid || ($y && $m && $d)) && ($nv = makeNav($cid,$iid,$y,$m,$d,$fid,$vfid,$cids)) != null) { list($prev,$succ, $up) = $nv; $links =array(); if ($prev != null) { $links['prev'] = array('title' => $prev['lbl'], 'href' => $prev['url']); } if ($succ != null) { $links['next'] = array( 'title' => $succ['lbl'], 'href' => $succ['url']); } if ($up != null) { $links['up'] = array( 'title' => $up['lbl'], 'href' => $up['url'] ); } } if ($iid == "") { $cidfid = array(); // "channel / folder mode" $prepend = false; if ($cid) { $res = rss_query("select title,icon from " . getTable("channels") ." where id = $cid"); list($title,$icon) = rss_fetch_row($res); if (isset($y) && $y > 0 && $m > 0 && $d == 0) { $dtitle = (" " . TITLE_SEP ." " . rss_locale_date('%B %Y',mktime(0,0,0,$m,1,$y),false)); $prepend=true; } elseif (isset($y) && $y > 0 && $m > 0 && $d > 0) { $prepend=true; $dtitle = (" " . TITLE_SEP ." " . rss_locale_date('%B %e, %Y',mktime(0,0,0,$m,$d,$y),false)); } else { $dtitle =""; } $cidfid ['cid']=$cid; $cidfid ['fid']=null; } elseif($fid) { list($title) = rss_fetch_row( rss_query("select name from " . getTable('folders') . " where id = $fid") ); $dtitle =""; $cidfid ['cid']=null; $cidfid ['fid']=$fid; } elseif($vfid) { list($title) = rss_fetch_row(rss_query("select tag from " . getTable('tag') . " where id = $vfid")); $dtitle = ""; $cidfid ['cid']=null; $cidfid ['fid']=null; } elseif($y && $m && $d) { $dtitle = ( rss_locale_date('%B %e, %Y',mktime(0,0,0,$m,$d,$y),false)); $cidfid ['cid']=null; $cidfid ['fid']=null; $title =""; } else { $dtitle =""; $title = ""; $cidfid ['cid']=null; $cidfid ['fid']=null; } if ($links) { foreach ($links as $rel => $val) { if (($lbl = $links[$rel]['title']) != "" && $prepend) { $links[$rel]['title'] = htmlentities( $title,ENT_COMPAT,"UTF-8" ) . " " . TITLE_SEP ." " . $lbl; } elseif (($lbl = $links[$rel]['title']) != "" && !$prepend) { $links[$rel]['title'] = htmlentities( $lbl, ENT_COMPAT,"UTF-8" ); } elseif ($title) { $links[$rel]['title'] = htmlentities( $title,ENT_COMPAT,"UTF-8" ); } } } //rss_header( rss_htmlspecialchars( $title ) . $dtitle,0,$cidfid,"", HDR_NONE, $links); $GLOBALS['rss'] -> header = new Header( rss_htmlspecialchars( $title ) . $dtitle,0,$cidfid,"", HDR_NONE, $links); } else { // "item mode" $res = rss_query ("select c.title, c.icon, i.title from " . getTable("channels") ." c " . "inner join " . getTable("item") ." i on i.cid=c.id " . "inner join ". getTable('item2user') ." i2u on i2u.fkiid=i.id " ."where c.id = $cid and i.id=$iid" ." and i2u.flgdeleted=0 " ); list($title,$icon,$ititle) = rss_fetch_row($res); $GLOBALS['rss'] -> header = new Header( rss_htmlspecialchars($title) . " " . TITLE_SEP ." " . rss_htmlspecialchars($ititle), 0,null,"", HDR_NONE, $links ); } $GLOBALS['rss'] -> feedList = new FeedList($cid); if (array_key_exists('dbg',$_GET)) { require_once('cls/debugfeed.php'); $dbg = new DebugFeed($cid); $GLOBALS['rss'] -> appendContentObject($dbg); } else { if ($cid && !(isset($cids) && is_array($cids) && count($cids))) { $cids = array($cid); } if(!isset($vfid)) $vfid = null; doItems($cids,$fid,$vfid,$title,$iid,$y,$m,$d,(isset($nv)?$nv:null),$show_what); } $GLOBALS['rss'] -> renderWithTemplate('index.php','items'); function doItems($cids,$fid,$vfid,$title,$iid,$y,$m,$d,$nv,$show_what) { $do_show=$show_what; //should we honour unread-only? if ($show_what == SHOW_UNREAD_ONLY) { // permalink will always be printed if ($iid != "") { $do_show = SHOW_READ_AND_UNREAD; } else { // archives, folders, channels $sql = "select count(*) from " . getTable('item2user') . " i2u left join ".getTable('item')." i on (i2u.fkiid=i.id) where" ." i2u.flgunread=1 and i2u.flgdeleted=0"; //archive? if ($m > 0 && $y > 0) { $sql .= " and month(ifnull(pubdate,added))= $m " ." and year(ifnull(pubdate, added))= $y "; if ($d > 0) { $sql .= " and dayofmonth(ifnull(pubdate,added))= $d "; } } if ($cids && count($cids)) { $sql .= " and i.cid in (".implode(',',$cids).")"; } list($unreadCount) = rss_fetch_row(rss_query($sql)); if ($unreadCount == 0) { $do_show = SHOW_READ_AND_UNREAD; } } } $items = new ItemList(); $severalFeeds = (($fid != null) || ($vfid != null)); if ($severalFeeds && !getConfig('rss.config.feedgrouping')) { $sqlWhere = "("; foreach ($cids as $cid) { $sqlWhere .= " i.cid = $cid or "; } $sqlWhere .= " 1=0) "; $hint = ITEM_SORT_HINT_MIXED; if ($do_show == SHOW_UNREAD_ONLY) { $sqlWhere .= " and i2u.flgunread=1 "; $hint = ITEM_SORT_HINT_UNREAD; } // how many items should we display in a folder view? // default to numitemsonpage. $cnt = getConfig('rss.output.frontpage.numitems'); // if that is set to zero, use itemsinchannelview times the number of feeds in the folder if ($cnt == 0) { $cnt = count($cids) * getConfig('rss.output.itemsinchannelview'); } // should that be zero too, go for a fixed value if ($cnt == 0) { // arbitrary! $cnt = 50; } $items -> populate($sqlWhere, "", 0, $cnt, $hint); } else { if (!isset($cids)) { $cids = array(-1); } foreach ($cids as $cid) { $hint = ITEM_SORT_HINT_MIXED; if ($cid > -1) { $sqlWhere = "i.cid = $cid"; if ($do_show == SHOW_UNREAD_ONLY) { $sqlWhere .= " and i2u.flgunread=1 "; $hint = ITEM_SORT_HINT_UNREAD; } } else { $sqlWhere = " 1 = 1 "; } if ($iid != "") { $sqlWhere .= " and i.id=$iid"; } if ($m > 0 && $y > 0) { $sqlWhere .= " and month(ifnull(i.pubdate,i.added))= $m " ." and year(ifnull(i.pubdate, i.added))= $y "; if ($d > 0) { $sqlWhere .= " and dayofmonth(ifnull(i.pubdate,i.added))= $d "; } } if ( $m==0 && $y==0 ) { $sqlLimit = getConfig('rss.output.itemsinchannelview'); } else { $sqlLimit = RSS_DB_MAX_QUERY_RESULTS; } /* $sqlOrder = " order by i.unread & ".RSS_MODE_UNREAD_STATE." desc"; if(getConfig("rss.config.datedesc")){ $sqlOrder .= ", ts desc, i.id asc"; } else { $sqlOrder .= ", ts asc, i.id asc"; } */ $sqlOrder = ""; $items -> populate($sqlWhere,$sqlOrder,0, $sqlLimit, $hint, true); } } if ($items -> unreadCount && $iid == "") { $items -> preRender[] = array("showViewForm",$show_what); if (!$severalFeeds) { $items -> preRender[] = array("markReadForm",$cid); $title .= " " .sprintf(__('(%d unread)'), "ucnt","",$items -> unreadCount); } else { if(!$vfid) { list($fid) = rss_fetch_row(rss_query('select parent from ' .getTable('channels') . 'where id = ' .$cids[0])); $title .= " " .sprintf(__('(%d unread)'), "ucnt","",$items -> unreadCount); $items -> preRender[] = array("markFolderReadForm",$fid); } else { list($fid) = $vfid; $title .= " " .sprintf(__('(%d unread)'), "ucnt","",$items -> unreadCount); $items -> preRender[] = array("markVirtualFolderReadForm",$vfid); } } } $items -> setTitle($title); if ($severalFeeds) { $items -> setRenderOptions(IL_NO_COLLAPSE | IL_FOLDER_VIEW); } elseif ($cid && $cid > -1) { $items -> setRenderOptions(IL_CHANNEL_VIEW); } else { $items -> setRenderOptions(IL_NO_COLLAPSE | IL_FOLDER_VIEW); } $items -> setRenderOptions(IL_TITLE_NO_ESCAPE); if ($nv != null) { list($prev,$succ,$up) = $nv; $readMoreNav = ""; if($prev != null) { $lbl = $prev['lbl']; if (function_exists('mb_strlen') && function_exists('mb_substr') && mb_strlen($lbl) > 40) { $lbl = mb_substr($lbl,0,37) . "..."; } elseif (strlen($lbl) > 40) { $lbl = substr($lbl,0,37) . "..."; } $readMoreNav .= "".ACT_NAV_PREV_PREFIX ."$lbl\n"; } if($succ != null) { $lbl = $succ['lbl']; if (function_exists('mb_strlen') && function_exists('mb_substr') && mb_strlen($lbl) > 40) { $lbl = mb_substr($lbl,0,37) . "..."; } elseif (strlen($lbl) > 40) { $lbl = substr($lbl,0,37) . "..."; } $readMoreNav .= "$lbl".ACT_NAV_SUCC_POSTFIX."\n"; } if ($readMoreNav != "") { $items->afterList = "