pierre@0: . pierre@0: */ pierre@0: pierre@0: function ad_weight_percent_select_ad($ads, $quantity, $invalid) { pierre@0: $tid = NULL; pierre@0: if (adserve_variable('tids')) { pierre@0: $id = adserve_variable('tids'); pierre@0: $tids = explode(',', $id); pierre@0: // A group can only be comprised of one tid. If multiple tids are defined, pierre@0: // then we're not working with a group. pierre@0: if (sizeof($tids) == 1) { pierre@0: $tid = $tids[0]; pierre@0: } pierre@0: } pierre@0: else if (!adserve_variable('nids')) { pierre@0: // The default group. pierre@0: $tid = 0; pierre@0: } pierre@0: pierre@0: // Only do something if we're currently processing a specific ad group. pierre@0: if ($tid !== NULL) { pierre@0: // TODO: The percentage information needs to be stored in the file cache, pierre@0: // as obviously we don't want to bootstrap the database layer and perform pierre@0: // a query at this point. pierre@0: } pierre@0: }