diff options
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -43,7 +43,7 @@ require_once('include/taxonomy.php'); define ( 'RED_PLATFORM', 'Red Matrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1065 ); +define ( 'DB_UPDATE_VERSION', 1067 ); define ( 'EOL', '<br />' . "\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -1343,7 +1343,7 @@ function fix_system_urls($oldurl,$newurl) { // paths aren't going to work. You have to be at the (sub)domain root // . (($parsed['path']) ? $parsed['path'] : ''); - $x = q("update xchan set xchan_addr = '%s', xchan_url = '%s', xchan_connurl = '%s', xchan_follow = '%s', xchan_connpage = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s' where xchan_hash = '%s' limit 1", + $x = q("update xchan set xchan_addr = '%s', xchan_url = '%s', xchan_connurl = '%s', xchan_follow = '%s', xchan_connpage = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_date = '%s' where xchan_hash = '%s' limit 1", dbesc($channel . '@' . $rhs), dbesc(str_replace($oldurl,$newurl,$rr['xchan_url'])), dbesc(str_replace($oldurl,$newurl,$rr['xchan_connurl'])), @@ -1352,6 +1352,7 @@ function fix_system_urls($oldurl,$newurl) { dbesc(str_replace($oldurl,$newurl,$rr['xchan_photo_l'])), dbesc(str_replace($oldurl,$newurl,$rr['xchan_photo_m'])), dbesc(str_replace($oldurl,$newurl,$rr['xchan_photo_s'])), + dbesc(datetime_convert()), dbesc($rr['xchan_hash']) ); @@ -2439,9 +2440,9 @@ function construct_page(&$a) { } } - // Let's say we have a comanche declaration '[region_nav][/region_nav][region_content]$region_nav $region_section[/region_content]'. - // The text 'region_' identifies a section of the layout by that name (without the 'region_' text). - // So what we want to do here is leave $a->page['nav'] empty and put the default content from $a->page['nav'] and $a->page['section'] + // Let's say we have a comanche declaration '[region=nav][/region][region=content]$nav $content[/region]'. + // The text 'region=' identifies a section of the layout by that name. So what we want to do here is leave + // $a->page['nav'] empty and put the default content from $a->page['nav'] and $a->page['section'] // into a new region called $a->data['content']. It is presumed that the chosen layout file for this comanche page // has a '<content>' element instead of a '<section>'. @@ -2452,10 +2453,19 @@ function construct_page(&$a) { foreach($a->layout as $k => $v) { if((strpos($k,'region_') === 0) && strlen($v)) { if(strpos($v,'$region_') !== false) { - $v = preg_replace_callback('/\$region_([a-zA-Z0-9]*?)/ism','comanche_replace_region',$v); + $v = preg_replace_callback('/\$region_([a-zA-Z0-9]+)/ism','comanche_replace_region',$v); + } + + // And a couple of convenience macros + if(strpos($v,'$nav') !== false) { + $v = str_replace('$nav',$a->page['nav'],$v); } - $a->data[substr($k,0,7)] = $v; + if(strpos($v,'$content') !== false) { + $v = str_replace('$content',$a->page['section'],$v); + } + + $a->page[substr($k,7)] = $v; } } } |