| 1 |
<?php |
<?php |
| 2 |
// $Id: contaxe.module,v 1.7 2008/02/20 21:08:54 salgar Exp $ |
// $Id: contaxe.module,v 1.8 2008/02/26 09:42:00 salgar Exp $ |
| 3 |
|
|
| 4 |
/* |
/* |
| 5 |
http://drupal.org/project/jquery_update |
http://drupal.org/project/jquery_update |
| 40 |
define('CONTAXE_HIGHLIGHTER_ACTIVE_RULES', 'activerules'); |
define('CONTAXE_HIGHLIGHTER_ACTIVE_RULES', 'activerules'); |
| 41 |
define('CONTAXE_HIGHLIGHTER_INACTIVE_RULES', 'inactiverules'); |
define('CONTAXE_HIGHLIGHTER_INACTIVE_RULES', 'inactiverules'); |
| 42 |
|
|
| 43 |
define('CONTAXE_IAS_ENABLE', 'contaxe_ias_enable'); |
define('CONTAXE_ISA_ENABLE', 'contaxe_isa_enable'); |
| 44 |
define('CONTAXE_IAS_CHANNEL_ID', 'contaxe_ias_channel_id'); |
define('CONTAXE_ISA_CHANNEL_ID', 'contaxe_isa_channel_id'); |
| 45 |
define('CONTAXE_IAS_DESIGN_ID', 'contaxe_ias_design_id'); |
define('CONTAXE_ISA_DESIGN_ID', 'contaxe_isa_design_id'); |
| 46 |
define('CONTAXE_IAS_TYPE', 'contaxe_ias_type'); |
define('CONTAXE_ISA_TYPE', 'contaxe_isa_type'); |
| 47 |
define('CONTAXE', 'CONTAXE'); |
define('CONTAXE', 'CONTAXE'); |
| 48 |
|
|
| 49 |
define('CONTAXE_INJECTOR_NODETYPE', 'contaxe_injector_nodetype'); |
define('CONTAXE_INJECTOR_NODETYPE', 'contaxe_injector_nodetype'); |
| 159 |
Regeln kann definiert werden, wann ein Werbemittel sichtbar ist. Ausserdem können die Einnahmen |
Regeln kann definiert werden, wann ein Werbemittel sichtbar ist. Ausserdem können die Einnahmen |
| 160 |
mittels Revenue Sharing unter mehreren Autoren aufgeteilt werden.'; |
mittels Revenue Sharing unter mehreren Autoren aufgeteilt werden.'; |
| 161 |
break; |
break; |
| 162 |
case 'admin/settings/contaxe/ias': |
case 'admin/settings/contaxe/isa': |
| 163 |
$output = 'Das <em>Intelligent Search Ad</em> ist ein Werbemittel welches mit dem Suchfeld |
$output = 'Das <em>Intelligent Search Ad</em> ist ein Werbemittel welches mit dem Suchfeld |
| 164 |
Ihrer Website verbunden ist. Sobald Suchbegriffe eingegeben werden, erscheint dazu passende |
Ihrer Website verbunden ist. Sobald Suchbegriffe eingegeben werden, erscheint dazu passende |
| 165 |
Werbung in einem kleinen Fenster unterhalb des Eingabefelds.'; |
Werbung in einem kleinen Fenster unterhalb des Eingabefelds.'; |
| 347 |
'access' => user_access('administer site configuration'), |
'access' => user_access('administer site configuration'), |
| 348 |
); |
); |
| 349 |
$items[] = array( |
$items[] = array( |
| 350 |
'path' => 'admin/settings/contaxe/ias', |
'path' => 'admin/settings/contaxe/isa', |
| 351 |
'title' => t('Intelligent Search Ad'), |
'title' => t('Intelligent Search Ad'), |
| 352 |
'callback' => 'drupal_get_form', |
'callback' => 'drupal_get_form', |
| 353 |
'callback arguments' => array('contaxe_admin_ias'), |
'callback arguments' => array('contaxe_admin_isa'), |
| 354 |
'type' => MENU_LOCAL_TASK, |
'type' => MENU_LOCAL_TASK, |
| 355 |
'weight' => 2, |
'weight' => 2, |
| 356 |
'access' => user_access('administer site configuration'), |
'access' => user_access('administer site configuration'), |
| 722 |
system_settings_form_submit($form_id, $form_values); |
system_settings_form_submit($form_id, $form_values); |
| 723 |
} |
} |
| 724 |
|
|
| 725 |
function contaxe_admin_ias() { |
function contaxe_admin_isa() { |
| 726 |
$contaxe_css = drupal_get_path('module', 'contaxe') .'/contaxe.css'; |
$contaxe_css = drupal_get_path('module', 'contaxe') .'/contaxe.css'; |
| 727 |
drupal_add_css($contaxe_css, 'module', 'all', FALSE); |
drupal_add_css($contaxe_css, 'module', 'all', FALSE); |
| 728 |
|
|
| 729 |
$form = array(); |
$form = array(); |
| 730 |
|
|
| 731 |
if (module_exists('search')) { |
if (module_exists('search')) { |
| 732 |
$form[CONTAXE_IAS_ENABLE] = array( |
$form[CONTAXE_ISA_ENABLE] = array( |
| 733 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 734 |
'#title' => t('Aktiviere Intelligent Search Ad'), |
'#title' => t('Aktiviere Intelligent Search Ad'), |
| 735 |
'#return_value' => 1, |
'#return_value' => 1, |
| 736 |
'#default_value' => variable_get(CONTAXE_IAS_ENABLE, 0), |
'#default_value' => variable_get(CONTAXE_ISA_ENABLE, 0), |
| 737 |
); |
); |
| 738 |
|
|
| 739 |
$form[CONTAXE_IAS_CHANNEL_ID] = array( |
$form[CONTAXE_ISA_CHANNEL_ID] = array( |
| 740 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 741 |
'#title' => t('Channel-ID'), |
'#title' => t('Channel-ID'), |
| 742 |
'#default_value' => variable_get(CONTAXE_IAS_CHANNEL_ID, ''), |
'#default_value' => variable_get(CONTAXE_ISA_CHANNEL_ID, ''), |
| 743 |
'#size' => 10, |
'#size' => 10, |
| 744 |
'#maxlength' => 10, |
'#maxlength' => 10, |
| 745 |
'#description' => t('Channel-ID die bei der Einblendung des Intelligent Search Ads verwendet wird. Wenn Sie dieses Feld leer lassen wird die ID aus den Allgemeinen Einstellungen verwendet. <strong>Achtung:</strong> Geben Sie hier unbedingt die korrekte Channel-ID an, ansonsten wird evtl. keine Werbung eingeblendet bzw. generierte Einnahmen können Ihnen nicht zugeordnet werden.') |
'#description' => t('Channel-ID die bei der Einblendung des Intelligent Search Ads verwendet wird. Wenn Sie dieses Feld leer lassen wird die ID aus den Allgemeinen Einstellungen verwendet. <strong>Achtung:</strong> Geben Sie hier unbedingt die korrekte Channel-ID an, ansonsten wird evtl. keine Werbung eingeblendet bzw. generierte Einnahmen können Ihnen nicht zugeordnet werden.') |
| 746 |
); |
); |
| 747 |
$form[CONTAXE_IAS_DESIGN_ID] = array( |
$form[CONTAXE_ISA_DESIGN_ID] = array( |
| 748 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 749 |
'#title' => t('Design-ID'), |
'#title' => t('Design-ID'), |
| 750 |
'#default_value' => variable_get(CONTAXE_IAS_DESIGN_ID, ''), |
'#default_value' => variable_get(CONTAXE_ISA_DESIGN_ID, ''), |
| 751 |
'#size' => 10, |
'#size' => 10, |
| 752 |
'#maxlength' => 10, |
'#maxlength' => 10, |
| 753 |
'#description' => t('Falls Sie ein eigenes Design für das Intelligent Search Ad wünschen, erstellen Sie dieses bitte bei Contaxe und tragen Sie die ID hier ein. Leer lassen für Standard-Design.') |
'#description' => t('Falls Sie ein eigenes Design für das Intelligent Search Ad wünschen, erstellen Sie dieses bitte bei Contaxe und tragen Sie die ID hier ein. Leer lassen für Standard-Design.') |
| 758 |
57 => t('5 Titel'), |
57 => t('5 Titel'), |
| 759 |
58 => t('10 Titel') |
58 => t('10 Titel') |
| 760 |
); |
); |
| 761 |
$form[CONTAXE_IAS_TYPE] = array( |
$form[CONTAXE_ISA_TYPE] = array( |
| 762 |
'#type' => 'select', |
'#type' => 'select', |
| 763 |
'#title' => t('Format'), |
'#title' => t('Format'), |
| 764 |
'#default_value' => variable_get(CONTAXE_IAS_TYPE, 57), |
'#default_value' => variable_get(CONTAXE_ISA_TYPE, 57), |
| 765 |
'#options' => $list |
'#options' => $list |
| 766 |
); |
); |
| 767 |
} |
} |
| 776 |
return system_settings_form($form); |
return system_settings_form($form); |
| 777 |
} |
} |
| 778 |
|
|
| 779 |
function contaxe_admin_ias_submit($form_id, $form_values) { |
function contaxe_admin_isa_submit($form_id, $form_values) { |
| 780 |
$active = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_IAS_ACTIVE_RULES ], 'rules')); |
$active = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_ISA_ACTIVE_RULES ], 'rules')); |
| 781 |
$form_values['contaxe_ias_active'] = $active; |
$form_values['contaxe_isa_active'] = $active; |
| 782 |
/* TODO maybe we should save order and values of inactive rules... |
/* TODO maybe we should save order and values of inactive rules... |
| 783 |
$inactive = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_IAS_INACTIVE_RULES], 'rules')); |
$inactive = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_ISA_INACTIVE_RULES], 'rules')); |
| 784 |
$form_values['contaxe_ias_inactive'] = $inactive; |
$form_values['contaxe_isa_inactive'] = $inactive; |
| 785 |
*/ |
*/ |
| 786 |
$form_values = contaxe_clean_form_values($form_values, 'contaxe_ias'); |
$form_values = contaxe_clean_form_values($form_values, 'contaxe_isa'); |
| 787 |
system_settings_form_submit($form_id, $form_values); |
system_settings_form_submit($form_id, $form_values); |
| 788 |
} |
} |
| 789 |
|
|
| 1029 |
); |
); |
| 1030 |
$form['whoseesads']['active'][$activeid] = array( |
$form['whoseesads']['active'][$activeid] = array( |
| 1031 |
'#type' => 'sortable', |
'#type' => 'sortable', |
| 1032 |
'#items' => contaxe_sortable(true, $banner['rules']), |
'#items' => contaxe_sortable(true, $banner['rules'], $id), |
| 1033 |
'#inner_id' => 'rules', |
'#inner_id' => 'rules', |
| 1034 |
'#options' => array( |
'#options' => array( |
| 1035 |
'helperclass' => 'sortable-helper', |
'helperclass' => 'sortable-helper', |
| 1045 |
); |
); |
| 1046 |
$form['whoseesads']['inactive'][$inactiveid] = array( |
$form['whoseesads']['inactive'][$inactiveid] = array( |
| 1047 |
'#type' => 'sortable', |
'#type' => 'sortable', |
| 1048 |
'#items' => contaxe_sortable(false, $banner['rules']), |
'#items' => contaxe_sortable(false, $banner['rules'], $id), |
| 1049 |
'#inner_id' => 'rules', |
'#inner_id' => 'rules', |
| 1050 |
'#options' => array( |
'#options' => array( |
| 1051 |
'helperclass' => 'sortable-helper', |
'helperclass' => 'sortable-helper', |
| 1161 |
'after' => $_POST['rule_date_after'] |
'after' => $_POST['rule_date_after'] |
| 1162 |
); |
); |
| 1163 |
break; |
break; |
| 1164 |
|
case 'fallback': |
| 1165 |
|
$ret['params'] = $_POST['rule_fallback']; |
| 1166 |
|
break; |
| 1167 |
case 'olderthan': |
case 'olderthan': |
| 1168 |
$age = (int) $_POST['rule_olderthan']; |
$age = (int) $_POST['rule_olderthan']; |
| 1169 |
if ($age <= 0) $age = 3; |
if ($age <= 0) $age = 3; |
| 1178 |
$list = array(); |
$list = array(); |
| 1179 |
if ($active) { |
if ($active) { |
| 1180 |
foreach ($activerules as $rule) { |
foreach ($activerules as $rule) { |
| 1181 |
$list[$rule['type']] = contaxe_sortable_item($rule['type'], $rule['display'], $rule['params']); |
$list[$rule['type']] = contaxe_sortable_item($rule['type'], $rule['display'], $rule['params'], $banner); |
| 1182 |
} |
} |
| 1183 |
return $list; |
return $list; |
| 1184 |
} |
} |
| 1186 |
foreach ($activerules as $a_rule) { |
foreach ($activerules as $a_rule) { |
| 1187 |
if ($a_rule['type'] == $rule) continue 2; |
if ($a_rule['type'] == $rule) continue 2; |
| 1188 |
} |
} |
| 1189 |
$list[$rule] = contaxe_sortable_item($rule); |
$list[$rule] = contaxe_sortable_item($rule, TRUE, NULL, $banner); |
| 1190 |
} |
} |
| 1191 |
return $list; |
return $list; |
| 1192 |
} |
} |
| 1196 |
* @param rule ID of rule |
* @param rule ID of rule |
| 1197 |
* @returns string output for given rule |
* @returns string output for given rule |
| 1198 |
*/ |
*/ |
| 1199 |
function contaxe_sortable_item($rule, $display = TRUE, $params = NULL, $banner = NULL) { |
function contaxe_sortable_item($rule, $display = TRUE, $params = NULL, $id = NULL) { |
| 1200 |
$selectname = 'rule_' . $rule . '_display'; |
$selectname = 'rule_' . $rule . '_display'; |
| 1201 |
$select = array( |
$select = array( |
| 1202 |
'#type' => 'select', |
'#type' => 'select', |
| 1253 |
$selectname => $select |
$selectname => $select |
| 1254 |
); |
); |
| 1255 |
case 'fallback': |
case 'fallback': |
| 1256 |
if (empty($id) || count($options['banners']) >= 2) { |
$banners = contaxe_banners(); |
| 1257 |
$list = '<select name="rule_' . $rule . '" class="wpcontaxe_select">'; |
$list = ''; |
| 1258 |
/* |
if (count($banners) > 0) { |
| 1259 |
foreach ($options['banners'] as $banner) { |
foreach ($banners as $banner) { |
| 1260 |
if ($banner['id'] == $id) continue; |
if ($banner['id'] == $id) continue; |
| 1261 |
$list .= '<option value="' . check_plain($banner['id']) . '"' . ($params == $banner['id'] ? ' selected="selected"': '') . '>' . $banner['name'] . '</option>'; |
$list .= '<option value="' . check_plain($banner['id']) . '"' . ($params == $banner['id'] ? ' selected="selected"': '') . '>' . $banner['name'] . '</option>'; |
| 1262 |
} |
} |
| 1263 |
*/ |
} |
| 1264 |
$list .= '</select>'; |
if (!empty($list)) { |
| 1265 |
|
$list = '<select name="rule_' . $rule . '" class="contaxe_select">' . $list . '</select>'; |
| 1266 |
} |
} |
| 1267 |
else { |
else { |
| 1268 |
$list = 'einen anderen Banner (noch keiner vorhanden)'; |
$list = 'einen anderen Banner (noch keiner vorhanden)'; |
| 1318 |
return false; |
return false; |
| 1319 |
} |
} |
| 1320 |
|
|
| 1321 |
|
function contaxe_check_banner_rules($rules) { |
| 1322 |
|
if (empty($rules)) return true; |
| 1323 |
|
foreach ($rules as $rule) { |
| 1324 |
|
if ($rule['type'] == 'fallback') { |
| 1325 |
|
list ($ret, $output) = contaxe_show_banner($rule['params']); |
| 1326 |
|
if ($ret) return $output; |
| 1327 |
|
continue; |
| 1328 |
|
} |
| 1329 |
|
if (contaxe_test_rule($rule['type'], $rule['params'])) { |
| 1330 |
|
return $rule['display']; |
| 1331 |
|
} |
| 1332 |
|
} |
| 1333 |
|
return false; |
| 1334 |
|
} |
| 1335 |
|
|
| 1336 |
|
|
| 1337 |
function contaxe_test_rule($type, $params) { |
function contaxe_test_rule($type, $params) { |
| 1338 |
switch ($type) { |
switch ($type) { |
| 1339 |
case 'any' : return true; // ok |
case 'any' : return true; |
| 1340 |
case 'date' : return contaxe_check_date($params); // ok |
case 'date' : return contaxe_check_date($params); |
| 1341 |
// case 'fallback' : XXX not handled at this point |
// case 'fallback' : XXX not handled at this point |
| 1342 |
case 'fromsearchengine' : return contaxe_check_from_search_engine(); |
case 'fromsearchengine' : return contaxe_check_from_search_engine(); |
| 1343 |
case 'home' : return drupal_is_front_page(); // ok |
case 'home' : return drupal_is_front_page(); |
| 1344 |
case 'loggedin' : return (bool) $GLOBALS['user']->uid; // ok |
case 'loggedin' : return (bool) $GLOBALS['user']->uid; |
| 1345 |
// case 'loggedin' : return user_is_logged_in(); XXX Drupal 6 |
// case 'loggedin' : return user_is_logged_in(); XXX Drupal 6 |
| 1346 |
case 'olderthan' : return contaxe_check_older_than($params); // ok |
case 'olderthan' : return contaxe_check_older_than($params); |
| 1347 |
case 'regularvisitor' : return contaxe_check_regular_visitor(); // ok |
case 'regularvisitor' : return contaxe_check_regular_visitor(); |
| 1348 |
default : break; |
default : break; |
| 1349 |
} |
} |
| 1350 |
return false; |
return false; |
| 1403 |
case 'view': // view the block |
case 'view': // view the block |
| 1404 |
$config = contaxe_get_block_config($delta); |
$config = contaxe_get_block_config($delta); |
| 1405 |
$block['subject'] = t('Anzeige'); |
$block['subject'] = t('Anzeige'); |
| 1406 |
$block['content'] = ($config['banner']) ? contaxe_display($config['banner']) : t('Unkonfigurierter Contaxe-Block. <a href=!url>Konfigurieren.</a>', array('!url' => url('admin/build/block/configure/contaxe/'. $delta))); |
if (!$config['banner']) { |
| 1407 |
|
$block['content'] = t('Unkonfigurierter Contaxe-Block. <a href=!url>Konfigurieren.</a>', array('!url' => url('admin/build/block/configure/contaxe/'. $delta))); |
| 1408 |
|
return $block; |
| 1409 |
|
} |
| 1410 |
|
list ($ret, $content) = contaxe_show_banner($config['banner']); |
| 1411 |
|
if (!$ret) return NULL; |
| 1412 |
|
$block['content'] = $content; |
| 1413 |
return $block; |
return $block; |
| 1414 |
case 'configure': |
case 'configure': |
| 1415 |
$config = contaxe_get_block_config($delta); |
$config = contaxe_get_block_config($delta); |
| 1495 |
} |
} |
| 1496 |
|
|
| 1497 |
function contaxe_display($id) { |
function contaxe_display($id) { |
| 1498 |
|
list ($ret, $output) = contaxe_show_banner($id); |
| 1499 |
|
return $output; |
| 1500 |
|
return $banner['name']; |
| 1501 |
|
} |
| 1502 |
|
|
| 1503 |
|
function contaxe_show_banner($id) { |
| 1504 |
$banner = contaxe_banner($id); |
$banner = contaxe_banner($id); |
| 1505 |
if (!isset($banner)) $banner = contaxe_banner_by_name($id); |
if (!isset($banner)) $banner = contaxe_banner_by_name($id); |
| 1506 |
return $banner['name']; |
if (!isset($banner)) |
| 1507 |
|
return array(FALSE, '<!-- contaxe: banner "' . check_plain($id) . '" not found -->'); |
| 1508 |
|
if (!$banner['enabled']) |
| 1509 |
|
return array(FALSE, '<!-- contaxe: banner "' . check_plain($id) . '" is disabled -->'); |
| 1510 |
|
if (($mode = contaxe_get_mode()) == CONTAXE_MODE_NOTHING) |
| 1511 |
|
return array(FALSE, '<!-- contaxe: mode says we should hide ' . check_plain($id) . '" -->'); |
| 1512 |
|
|
| 1513 |
|
$ret = contaxe_check_banner_rules($banner['rules']); |
| 1514 |
|
if ($ret === FALSE) return array(FALSE, '<!-- contaxe: rules say we should not display "' . check_plain($id) . '" -->'); |
| 1515 |
|
if ($ret !== TRUE) return array(TRUE, $ret); |
| 1516 |
|
|
| 1517 |
|
$url = 'http://www.contaxe.com/go/go.js?t='; |
| 1518 |
|
$url.= $banner['format']; |
| 1519 |
|
$url.= '&c=' . urlencode($channel); |
| 1520 |
|
$url.= '&opt=' . $banner['opt']; |
| 1521 |
|
if (!empty($banner['style'])) $url .= '&s=' . urlencode($banner['style']); |
| 1522 |
|
if ($banner['rnd']) $url .= '&rnd=1'; |
| 1523 |
|
if ($mode == CONTAXE_MODE_DEMO) $url .= '&demo=1'; |
| 1524 |
|
|
| 1525 |
|
$url.= $banner['params']; |
| 1526 |
|
|
| 1527 |
|
|
| 1528 |
|
$output = '<script language="JavaScript1.1" type="text/javascript" src="' . check_plain($url) . '"></script>'; |
| 1529 |
|
return array(TRUE, $output); |
| 1530 |
} |
} |
| 1531 |
|
|
| 1532 |
/* |
/* |
| 1533 |
* Print javascript code for Text Highlighting |
* Print javascript code for Text Highlighting |
| 1534 |
*/ |
*/ |
| 1535 |
function contaxe_highlighter() { |
function contaxe_highlighter() { |
|
switch (contaxe_check_highlighter_rules()) { |
|
|
case true: $output = 'Show Highlighter'; break; |
|
|
case false: $output = 'Hide Highlighter'; break; |
|
|
} |
|
|
/* |
|
| 1536 |
if (!variable_get(CONTAXE_HIGHLIGHTER_ENABLE, 0)) return ''; |
if (!variable_get(CONTAXE_HIGHLIGHTER_ENABLE, 0)) return ''; |
| 1537 |
if (($mode = contaxe_get_mode()) == CONTAXE_MODE_NOTHING) return ''; |
if (($mode = contaxe_get_mode()) == CONTAXE_MODE_NOTHING) return ''; |
| 1538 |
|
|
| 1548 |
if (($style = variable_get(CONTAXE_HIGHLIGHTER_DESIGN_ID, '')) != '') $url .= '&s=' . urlencode($style); |
if (($style = variable_get(CONTAXE_HIGHLIGHTER_DESIGN_ID, '')) != '') $url .= '&s=' . urlencode($style); |
| 1549 |
|
|
| 1550 |
$output = '<script language="JavaScript1.1" type="text/javascript" src="' . check_plain($url) . '"></script>'; |
$output = '<script language="JavaScript1.1" type="text/javascript" src="' . check_plain($url) . '"></script>'; |
|
$output.= <<<EOF |
|
|
<script language="JavaScript1.1" type="text/javascript"> |
|
|
ContaxeSTHandlerInst.AddId('edit-search-block-form-keys'); |
|
|
ContaxeSTHandlerInst.AddId('edit-keys'); |
|
|
</script> |
|
|
EOF; |
|
|
*/ |
|
| 1551 |
return $output; |
return $output; |
| 1552 |
} |
} |
| 1553 |
|
|
| 1554 |
/* |
/* |
| 1555 |
* Print javascript code for Intelligent Search Ad |
* Print javascript code for Intelligent Search Ad |
| 1556 |
*/ |
*/ |
| 1557 |
function contaxe_ias() { |
function contaxe_isa() { |
| 1558 |
if (!module_exists('search')) return; |
if (!module_exists('search')) return; |
| 1559 |
if (!variable_get(CONTAXE_IAS_ENABLE, 0)) return; |
if (!variable_get(CONTAXE_ISA_ENABLE, 0)) return; |
| 1560 |
if (($mode = contaxe_get_mode()) == CONTAXE_MODE_NOTHING) return; |
if (($mode = contaxe_get_mode()) == CONTAXE_MODE_NOTHING) return; |
| 1561 |
|
|
| 1562 |
if (($channel = contaxe_get_channel(variable_get(CONTAXE_IAS_CHANNEL_ID, ''))) == '') return; |
if (($channel = contaxe_get_channel(variable_get(CONTAXE_ISA_CHANNEL_ID, ''))) == '') return; |
| 1563 |
$url = 'http://www.contaxe.com/go/go.js?t=' . variable_get(CONTAXE_IAS_TYPE, 57); |
$url = 'http://www.contaxe.com/go/go.js?t=' . variable_get(CONTAXE_ISA_TYPE, 57); |
| 1564 |
$url.= '&c=' . urlencode($channel); |
$url.= '&c=' . urlencode($channel); |
| 1565 |
if ($mode == CONTAXE_MODE_DEMO) $url .= '&demo=1'; |
if ($mode == CONTAXE_MODE_DEMO) $url .= '&demo=1'; |
| 1566 |
if (($style = variable_get(CONTAXE_IAS_DESIGN_ID, '')) != '') $url .= '&s=' . urlencode($style); |
if (($style = variable_get(CONTAXE_ISA_DESIGN_ID, '')) != '') $url .= '&s=' . urlencode($style); |
| 1567 |
|
|
| 1568 |
$output = '<script language="JavaScript1.1" type="text/javascript" src="' . check_plain($url) . '"></script>'; |
$output = '<script language="JavaScript1.1" type="text/javascript" src="' . check_plain($url) . '"></script>'; |
| 1569 |
$output.= <<<EOF |
$output.= <<<EOF |
| 1699 |
|
|
| 1700 |
/** |
/** |
| 1701 |
* Implementation of hook_footer. |
* Implementation of hook_footer. |
| 1702 |
* Print javascript code for highlighter and or ias |
* Print javascript code for highlighter and or isa |
| 1703 |
*/ |
*/ |
| 1704 |
function contaxe_footer($main = 0) { |
function contaxe_footer($main = 0) { |
| 1705 |
$output = ''; |
$output = ''; |
| 1706 |
$output .= contaxe_highlighter(); |
$output .= contaxe_highlighter(); |
| 1707 |
$output .= contaxe_ias(); |
$output .= contaxe_isa(); |
| 1708 |
return $output; |
return $output; |
| 1709 |
} |
} |