function if_next_section_different($atts, $thing) { global $thisarticle, $pretext; if ($thisarticle['article_num'] == 1) return parse($thing); $posted = safe_field('posted','textpattern','id = '.$thisarticle['thisid']); $thenext = getNeighbour($posted,$pretext['s'],'>'); return ($thisarticle['section'] != $thenext['section']) ? parse($thing) : ''; } function if_prev_section_different($atts, $thing) { global $thisarticle, $pretext, $limit; if ($thisarticle['article_num'] == $limit) return parse($thing); $posted = safe_field('posted','textpattern','id = '.$thisarticle['thisid']); $theprev = getNeighbour($posted,$pretext['s'],'<'); return ($thisarticle['section'] != $theprev['section']) ? parse($thing) : ''; }