In constants.php wijzig je NUM_CORE_BBCODES in 13.
In bbcode.php voeg je in functie bbcode_second_pass op regel 116:
if ($bbcode_id == 13)
{
if (preg_match("/fileId=([a-z]{12,19})/",
$message,
$matches))
{
$track = '</iframe>' . gpsies_properties($matches[1]) . '</div><br style="clear:both;" />';
}else
{
$message .= '</div>';
}
}
Op regel 346 in functie bbcode_cache_init voeg je toe:
case 13:
$this-
>bbcode_cache[$bbcode_id] =
array(
'!\[gpsies=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/gpsies:$uid\]!is' => $this->bbcode_tpl('gpsies', $bbcode_id),
)
);
break;
In functie bbcode_tpl op regel 425 voeg je toe:
'gpsies' => '<div><iframe src="http://www.gpsies.com/mapOnly.do?fileId=$1" style="float:left; width:400px; height:400px; border:none;" scrolling="no" title="$2"></iframe>',
In functions.php voeg je op het einde toe:
function gpsies_properties($gpsies='')
{
$gpsies_api_key = je api
key
$gpsies_url_api = 'http://www.gpsies.com/api.do?key=';
$gpsies_url_api .= $gpsies_api_key;
$gpsies = 'fileId=' . $gpsies . ' show=details';
CURLOPT_URL =
> $gpsies_url_api .
(strpos($gpsies_url_api,
'?') ===
FALSE ?
'?' :
'&') .
$gpsies,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_TIMEOUT => 4
);
$ch = curl_init();
curl_setopt_array($ch, ($defaults));
if (!$result = curl_exec($ch))
{
}
curl_close($ch);
$xmlresp = $result;
$xmlgpsies = new SimpleXMLElement($xmlresp);
$trackinfo = 'Geen data beschikbaar!';
foreach ($tracksrev as $track)
{
$trackinfo ='<div style="float:left; width:250px; font-size:11px; margin-left:10px;">
<strong>Track naam:</strong> ' . $track->title . '
<strong>Track lengte:</strong> ' .
round((real
)$track-
>trackLengthM/1000,
1) .
' km
<strong>Hoogteverschil:</strong> ' . $track->altitudeDifferenceM . ' m
<strong>Minimum hoogte:</strong> ' . $track->altitudeMinHeightM . ' m
<strong>Maximum hoogte:</strong> ' . $track->altitudeMaxHeightM . ' m
<strong>Klimmen:</strong> ' . $track->totalAscentM . ' m | '.
'<strong>Afdalen:</strong> ' . $track->totalDescentM . ' m
<strong>Adres:</strong> ' . $track->startPointAddress . '
<strong>Latitude:</strong> ' . $track->startPointLat . '
<strong>Longitude:</strong> ' . $track->startPointLon . '</div>';
}
return $trackinfo;
}
In message_parser.php rond regel 128 voeg je toe:
'gpsies' =
> array('bbcode_id' =
> 13,
'regexp' =
> array('!\[gpsies=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/gpsies\]!uise' =
> "\$this->bbcode_gpsies('\$1', '\$2')")),
en rond regel 281:
/**
* Parse gpsies tag
*/
function bbcode_gpsies($stx, $in)
{
if (!$this->check_bbcode('gpsies', $in))
{
return $in;
}
return '[gpsies=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/gpsies:' . $this->bbcode_uid . ']';
}