function _classified_token_values in Classified Ads 6.3
Implements hook_token_values().
D6 tokens are not chainable, unlike those in D7.
See also
1 call to _classified_token_values()
- classified_token_values in ./
classified.module - Implements hook_token_values().
File
- ./
classified.tokens.inc, line 52 - Token hooks for Classified Ads module
Code
function _classified_token_values($type, $object = NULL, $options = array()) {
$ret = NULL;
if ($type == 'user') {
$account = $object;
$ret['classified-ads-url'] = url('user/' . $account->uid . '/classified', array(
'absolute' => TRUE,
));
if (!isset($account->ads)) {
$account->ads = array();
$sq = _classified_get_ads_query(0);
$q = db_query($sq, $account->uid);
while ($row = db_fetch_array($q)) {
$account->ads[$row['nid']] = $row['title'];
}
}
$ads = '';
foreach ($account->ads as $nid => $title) {
$ads .= t("(@nid) @title\n", array(
'@nid' => $nid,
'@title' => $title,
));
}
$ret['ads'] = $ads;
unset($account, $ads, $nid, $q, $row, $sq, $title);
}
return $ret;
}