You are here

function ad_update_3 in Advertisement 5

Same name and namespace in other branches
  1. 5.2 ad.install \ad_update_3()

Redirect urls need to be absolute to work when hosting ads remotely.

File

./ad.install, line 312

Code

function ad_update_3() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    default:
      $result = db_query('SELECT aid FROM {ads}');
      while ($ad = db_fetch_object($result)) {
        $ret[] = update_sql("UPDATE {ads} SET redirect = '" . url("ad/redirect/{$ad->aid}", NULL, NULL, TRUE) . "' WHERE aid = {$ad->aid}");
      }
  }
  return $ret;
}