[(site_name)]
$sitename = $modx->config['site_name'];
[(site_url)]
$siteurl = $modx->config['site_url'];
[*longtitle*]
$docId = "8";
//or
$docId = $modx->documentIdentifier;
$docFields = "longtitle";
$doc = $modx->getDocument($docId, $docFields);
$longtitle = $doc['longtitle'];
[~8~]
$linkurl = $modx->makeUrl(8);
If coding inside functions use:
Instead of return
echo $myOutput;
//or
print $myOutput;
http://wiki.modxcms.com/index.php/Category:API_Function
http://wiki.modxcms.com/index.php/Creating_Snippets
//edit fixed that typo, thx @hotdiggity

BTW See
http://modxcms.com/forums/index.php/topic,24701.0/topicseen.html
http://modxcms.com/forums/index.php/topic,34880.0.html
Awsm - thanks!
$longtitle = $doc[’longtitle’];
Mostly harmless.