-
Notifications
You must be signed in to change notification settings - Fork 0
/
block_visable.php
83 lines (59 loc) · 1.91 KB
/
block_visable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
$displayTermID =array(1978, 1979, 2002, 2003, 2004);
// This will show on the index page for that term
if ((arg(0) == 'taxonomy') && (arg(1) == $displayTermID)) {
return TRUE;
}
$desired_terms = array(1978, 1979, 2002, 2003, 2004);
if ( arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == FALSE ) {
$node = node_load(arg(1)); // cached
if (is_array($node->taxonomy)) {
foreach ($node->taxonomy as $term) {
if ( in_array($term->tid, $desired_terms) ) {
return TRUE;
} //if
} //foreach term
} //if
} //if node
return FALSE;
?>
<?php
$desired_terms = array(1978, 1979, 2002, 2003, 2004);
if(arg(0) == 'quiz' ){
$term_id = node_load(arg(1));
if ( in_array($term_tid, $desired_terms) ) {
return TRUE;
} //if
}
if ( arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == FALSE ) {
$node = node_load(arg(1)); // cached
if (is_array($node->taxonomy)) {
foreach ($node->taxonomy as $term) {
if ( in_array($term->tid, $desired_terms) ) {
return TRUE;
} //if
} //foreach term
} //if
} //if node
return FALSE;
?>
<?php
$desired_terms = array(1978, 1979, 2002, 2003, 2004);
$term_url = array('quiz/1978', 'quiz/1979', 'quiz/2002', 'quiz/2003', 'quiz/2004');
$node_url=drupal_get_path_alias($_GET['q']);
$pos=strpos($node_url,'quiz/');
if($pos!== false && in_array($node_url, $term_url ) ){
return TRUE;
}
if ( arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == FALSE ) {
$node = node_load(arg(1)); // cached
if (is_array($node->taxonomy)) {
foreach ($node->taxonomy as $term) {
if ( in_array($term->tid, $desired_terms) ) {
return TRUE;
} //if
} //foreach term
} //if
} //if node
return FALSE;
?>