', $content, 1 ); } } // images if ( preg_match_all( $tag_image, $content, $matches, PREG_SET_ORDER ) ) { foreach ($matches AS $images) { if ($img = cms_fnfull( $images[1] )) { $content = preg_replace( $tag_image, '', $content, 1 ); } } } // image (Advanced) format: [IMAGE:#:AlignWidth"Caption"] if ( preg_match_all( $tag_image_adv, $content, $matches ) ) { $align = array( 'L'=>'cms_image_left','R'=>'cms_image_right','C'=>'cms_image_center'); foreach($matches[1] AS $k=>$l) { $img = cms_fnfull( $matches[1][$k] ); $algn = $align[ $matches[2][$k] ]; $caption = (trim($matches[4][$k])) ? trim($matches[4][$k]):''; $scale = ''; if ($matches[3][$k] && $matches[3][$k]!=100 ) { $sc = ($page_image_width/100)*$matches[3][$k]; $scale = 'style="width:'.$sc.'px;"'; } if ( strlen($caption) ) { $content = str_replace($matches[0][$k],'

'.$caption.'

',$content); } else { $content = str_replace($matches[0][$k],'',$content); } } } // files if ( preg_match_all( $tag_file, $content, $matches, PREG_SET_ORDER ) ) { foreach ($matches AS $files) { if ($file = cms_fnfull( $files[1] )) { $link = (trim($files[2])<>'') ? trim($files[2]):$file; // use link text else use filename $fn = cms_fnorginal($files[1]); $content = preg_replace( $tag_file, ''.$fn.'', $content, 1 ); } } } // file advanced format: [FILE:#:"Caption"] if ( preg_match_all( $tag_file_adv, $content, $matches ) ) { foreach($matches[1] AS $k=>$l) { $file = cms_fnfull( $matches[1][$k] ); $linktext = $matches[2][$k]; $content = str_replace($matches[0][$k],''.$linktext.'',$content); } } // we do links LAST so you can have linked images ---------------------------------------------- // internal links - format [LINK:#:"link text"] if ( preg_match_all( $tag_link_int, $content, $matches ) ) { foreach($matches[1] AS $k=>$l) { $link = ''.$matches[2][$k].''; $content = str_replace($matches[0][$k],$link,$content); } } // external links - format [LINK:"url":"link text"] if ( preg_match_all( $tag_link_ext, $content, $matches ) ) { foreach($matches[1] AS $k=>$l) { $content = str_replace($matches[0][$k],''.$matches[2][$k].'',$content); } } // $content = preg_replace('#\[LINK:([^\"]+):\"([^\"]+)\"\]#', 'Link this $2', $content); return( $content ); } function cms_process_content( $content='' ) { // DO NOT CALL DIRECTLY - this returns the content string based on your editor settings in site prefs switch ( cms_getpref( 14 ) ) { default: // textile //$textile = new Textile; //$content = $textile->TextileThis($content); $textile = new \Netcarver\Textile\Parser(); $content = $textile->TextileThis($content); break; case '2': // markdown $content = Markdown($content); break; } return( $content ); } function cms_openmenulist( $count='',$pageflag='',$class='',$pagechar='',$catchar='+ ',$showtop='' ) { // DO NOT CALL DIRECTLY - use openmenu() instead // $count is ARRAY item in $menu to start from // $pageflag toggles display of pages in all cats OR just the final one // $class is the class to pass to the final UL - this is set internally // $showtop always display all TOP LEVEL pages regardless of $pageflag // cms_om_page - page A // cms_om_phere - current selected page A // cms_om_cat - cat A // cms_om_topcat - highest level cat in the path to selected page A // cms_om_path - other cats in the path to the selected page A // cms_om_cathere - current selected cat A // cms_om_cpath - any UL in the path to selected page // cms_om_openul - final level cat UL global $cms_page,$menu; $finalcat = count($menu)-1; if (is_numeric($count)) // cope with $count = '' which is top level { $parent = $menu[$count]; $next = $count+1; // next category to match } else { $parent = '0'; $next = 0; } echo ''; } // !sitemap -------------------------------------------------------- function cms_sitemapchildren($parent,$level=1) { // retrieve all children of $parent // $parent is the parent id of the children we want to see // $level is increased when we go deeper into the tree, // $sp=1/true if you want to show pages as well as cats if ( $res=mysql_query("SELECT id,name,section,sortorder FROM ".PAGE_TABLE." WHERE `parent`='$parent' AND `status`=1 ORDER BY if(sortorder = '' or sortorder is null,1,0),ABS(`sortorder`)")) { while ($row=mysql_fetch_object($res)) { if ($row->id!=$errorid) { // make sure we don't show the error page $nm = (trim($row->name)=='') ? '-unnamed-':$row->name; // take care of unnamed pages $link = ($row->link) ? $row->link:'index.php?page='.$row->id; echo '- '.$nm.'
'; $level++; cms_sitemapchildren( $row->id, $level); } } } } ?> $k) { $line[] = explode('{br}',trim($k)); } // ensure that the page id ($line[2]) takes precedent over the URL ($line[4]) if both are set if ($line[2]) unset($line[4]); if ($line[4]) $line[2]=$line[4]; unset($line[4]); return($line); } return( FALSE ); } ?> $k) { $line[] = explode('{br}',trim($k)); } return($line); } return( FALSE ); } ?> home'; echo cms_showmenu(); $page_menu = ob_get_contents(); ob_clean(); if (!$cms_search && cms_pagedata($cms_page)===FALSE) $cms_page=cms_homepage(); // default to homepage if no page exists if ( !$cms_news && !$cms_search && $cms_page==cms_homepage() ) { include(TEMPLATE_REL_PATH.'homepage.inc.php'); // load the homepage template } else { $page_data = cms_pagedata($cms_page); switch ( true ) { case $cms_search: $page_data = cms_pagedata($cms_page); ob_start(); include(TEMPLATE_REL_PATH.'pagepanel.inc.php'); $page_panel = ob_get_contents(); ob_end_clean(); echo '

Search Results

'; $matches = cms_search( '

Your search for "{query}" returned {num_results} result(s).

','','
  • {title}

    {content}

  • ' ); echo '
    '; break; case $cms_news: ob_start(); include(TEMPLATE_REL_PATH.'newspanel.inc.php'); $page_panel = ob_get_contents(); ob_end_clean(); cms_shownews($cms_news,1,1,1); ?>» return to news page'; echo '

    '.$item[cmsnews_title].'

    '; echo '

    '.truncate( strip_tags( $ex ),200).'

    '; echo '

    '.$item[cmsnews_dateadd].'

    '; echo ''; } } else { echo '

    There are no news items.

    '; } } else { $news_data = cms_listnewsdata( 8 ); if (count($news_data)) { foreach($news_data AS $item) { $ex = cms_parsecontent($item[cmsnews_content]); echo '
    '; echo ''; echo '

    '.$item[cmsnews_title].'

    '; echo '

    '.truncate( strip_tags( $ex ),200).'

    '; echo '

    '.$item[cmsnews_dateadd].'

    '; echo '
    '; } echo '

    » view all news items

    '; } else { echo '

    There are no news items.

    '; } } break; case $gal_page: ob_start(); include(TEMPLATE_REL_PATH.'pagepanel.inc.php'); $page_panel = ob_get_contents(); ob_end_clean(); // show some content echo ''; include( TEMPLATE_REL_PATH.'gallery.inc.php'); echo '

    » top of page

    '; break; default: ob_start(); include(TEMPLATE_REL_PATH.'pagepanel.inc.php'); $page_panel = ob_get_contents(); ob_end_clean(); // show some content echo ''; switch(TRUE) { case ($cms_page==$resources_section OR cms_topparentid( $cms_page )==$resources_section): // resources custom section if ($cms_page==$resources_section) { $spl = cms_showmenu($resources_section,'{pageid},'); // get list of sub page ids $subpages = explode(',',$spl); // change to array so we can get the first subpage id echo '

    Resources for '.cms_pagename($subpages[0]).'

    '; cms_displaypage( $subpages[0],'{image}{content}{tags}' ); } else { echo '

    Resources for '.cms_pagename($cms_page).'

    '; cms_displaypage( $cms_page,'{image}{content}{tags}' ); } break; case ($cms_page==$hedgerow_section OR cms_topparentid( $cms_page )==$hedgerow_section): if ($cms_page==$hedgerow_section) { $spl = cms_showmenu($hedgerow_section,'{pageid},'); // get list of sub page ids $subpages = explode(',',$spl); // change to array so we can get the first subpage id echo '

    About Hedgerows | '.cms_pagename($subpages[0]).'

    '; cms_displaypage( $subpages[0],'{image}{content}{tags}' ); } else { echo '

    About Hedgerows | '.cms_pagename($cms_page).'

    '; cms_displaypage( $cms_page,'{image}{content}{tags}' ); } break; default: cms_displaypage($cms_page); break; } if ($cms_page==14) include('contactform.inc.php'); // contact form if ($cms_page==25) cms_listincat(4); // surveys echo '

    » top of page

    '; break; } break; } } $page_contents = ob_get_contents(); ob_end_clean(); ?> News | Hedgelink
    Fatal error: Uncaught Error: Call to undefined function cms_parser() in D:\Websites\hedgelink\cms\common\cms.user.func.php:1454 Stack trace: #0 D:\Websites\hedgelink\cms\common\cms.user.func.php(25): cms_parsecontent('[IMAGE:490] [IM...', false) #1 D:\Websites\hedgelink\cms\cms_content\templates\default\layout.php(264): cms_block(1) #2 D:\Websites\hedgelink\cms\cms.php(140): include('D:\\Websites\\hed...') #3 D:\Websites\hedgelink\index.php(14): include('D:\\Websites\\hed...') #4 {main} thrown in D:\Websites\hedgelink\cms\common\cms.user.func.php on line 1454