',$html); $html = str_replace('[/B]','',$html); $html = str_replace('[br]','
',$html); $html = str_replace('[BR]','
',$html); $html = str_replace('[link','[LINK',$html); $html = str_replace('[/link]','[/LINK]',$html); $html = str_replace('[LINK','',$html); $html = str_replace('[/LINK]','',$html); $html = str_replace('[more]','[MORE]',$html); $html = str_replace('[/more]','[/MORE]',$html); $readMore = explode('[MORE]',$html); if(count($readMore) > 1){ $tmp = explode('[/MORE]',$readMore[1]); $html = $readMore[0].$tmp[1]; } return nl2br(makeClickableLinks($html)); } function makeClickableLinks($str) { $html = $str; $html = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1', $html); $html = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1\\2', $html); $html = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '\\1', $html); return $html; } function loadProjectList($filter){ $URL = $filter == "all" ? "projects/all" : "projects/showcase"; $link = "http://thisisloyal.com/".($filter == "all" ? "projects/all" : "showcase"); $objectXml = simplexml_load_string((string)getXML($URL)); $html = ''; for ($i = 0; $i < count($objectXml->project); $i++) { $html .= ''.$objectXml->project[$i]->name.'. '.$objectXml->project[$i]->type.'
'; for ($j = 0; $j < count($objectXml->project[$i]->file_list->file); $j++) { $tmp = $objectXml->project[$i]->file_list->file[$j]->url.$objectXml->project[$i]->file_list->file[$j]->name; $ext = strtolower(substr($tmp,-3)); $suffix = substr(strtolower($objectXml->project[$i]->file_list->file[$j]->name), -6, 2); if(($ext == "jpg" || $ext == "png" || $ext == "gif") && $suffix == "_s"){ $html .= '
'; break; } } $html .= '

'; } echo $html; } function loadProject(){ global $URL; global $path; $objectXml = simplexml_load_string(getXML(str_replace("showcase","projects/showcase",$URL))); $html = ''; $html .= ''.$objectXml->name.'

'; $html .= parseText($objectXml->info).'

'; for ($j = 0; $j < count($objectXml->file_list->file); $j++) { $tmp = $objectXml->file_list->file[$j]->url.$objectXml->file_list->file[$j]->name; $suffix = substr(strtolower($objectXml->file_list->file[$j]->name), -6, 2); $ext = strtolower(substr($tmp,-3)); if(($ext == "jpg" || $ext == "png" || $ext == "gif") && $suffix != "_s"){ $html .= '
'; } } echo $html; } function loadProfile(){ $objectXml = simplexml_load_string(getXML("profile")); $html = ''; $html .= parseText($objectXml->intro).'

'; $html .= parseText($objectXml->main_text).'

'; if(count($objectXml->file_list->file) > 0){ for ($j = 0; $j < count($objectXml->file_list->file); $j++) { $tmp = $objectXml->file_list->file[$j]->url.$objectXml->file_list->file[$j]->name; $suffix = substr(strtolower($objectXml->file_list->file[$j]->name), -6, 2); $ext = strtolower(substr($tmp,-3)); if(($ext == "jpg" || $ext == "png" || $ext == "gif")){ $html .= '
'; } } } echo $html; } function loadContact(){ $objectXml = simplexml_load_string(getXML("contact")); $html = ''; $html .= parseText($objectXml->text1).'

'; $html .= parseText($objectXml->text2).'

'; $html .= parseText($objectXml->text3); if(count($objectXml->file_list->file) > 0){ for ($j = 0; $j < count($objectXml->file_list->file); $j++) { $tmp = $objectXml->file_list->file[$j]->url.$objectXml->file_list->file[$j]->name; $suffix = substr(strtolower($objectXml->file_list->file[$j]->name), -6, 2); $ext = strtolower(substr($tmp,-3)); if(($ext == "jpg" || $ext == "png" || $ext == "gif")){ $html .= '
'; } } } echo $html; } ?>