-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmobil.copyright.class.php
99 lines (83 loc) · 2.46 KB
/
mobil.copyright.class.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php if( !defined('IN_WISY') ) die('!IN_WISY');
loadWisyClass('WISY_COPYRIGHT_CLASS');
// HINWEIS: Falls Sie in Ihren Klassen einen Konstruktor verwenden, vergessen
// Sie nicht, den Konstruktor der Elternklasse ueber parent::__construct()
// aufzurufen!
class MOBIL_COPYRIGHT_CLASS extends WISY_COPYRIGHT_CLASS
{
var $framework;
function __construct(&$framework)
{
// constructor
$this->framework =& $framework;
parent::__construct($framework);
}
function renderCopyright(&$db, $table, $recordId)
{
// Nicht mobil? Dann Funktion der Elternklasse aufrufen:
global $showMobile;
if(!$showMobile) return parent::renderCopyright($db, $table, $recordId);
$copyright = '';
// search by stichwort
if( $copyright == '' && ($table=='kurse' || $table=='anbieter') )
{
$sql = "SELECT notizen x FROM stichwoerter s, {$table}_stichwort a
WHERE a.attr_id=s.id AND a.primary_id=$recordId AND s.eigenschaften=2048 AND s.notizen LIKE '%copyright.$table%' ORDER BY a.structure_pos;";
$db->query($sql);
while( $db->next_record() )
{
$test = explodeSettings(stripslashes($db->f('x')));
if( $test["mobil.copyright.$table"] != '' )
{
$copyright = $test["mobil.copyright.$table"];
} else if( $test["copyright.$table"] != '' )
{
$copyright = $test["copyright.$table"];
}
}
}
// search by user id
if( $copyright == '' )
{
$sql = "SELECT s.settings x FROM user s, $table a
WHERE a.user_created=s.id AND a.id=$recordId;";
$db->query($sql);
if( $db->next_record() )
{
$test = explodeSettings(stripslashes($db->f('x')));
if( $test["mobil.copyright.$table"] != '' )
{
$copyright = $test["mobil.copyright.$table"];
} else if( $test["copyright.$table"] != '' )
{
$copyright = $test["copyright.$table"];
break;
}
}
}
// search by group id
if( $copyright == '' )
{
$sql = "SELECT s.settings x FROM user_grp s, $table a
WHERE a.user_grp=s.id AND a.id=$recordId;";
$db->query($sql);
if( $db->next_record() )
{
$test = explodeSettings(stripslashes($db->f('x')));
if( $test["mobil.copyright.$table"] != '' )
{
$copyright = $test["mobil.copyright.$table"];
} else if( $test["copyright.$table"] != '' )
{
$copyright = $test["copyright.$table"];
}
}
}
// render
if( $copyright != '' )
{
return '<p id="wisy_copyright_footer">' . $copyright . '</p>';
}
}
}
registerWisyClass('MOBIL_COPYRIGHT_CLASS');