This repository was archived by the owner on Feb 28, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoweme_shortcodes.php
More file actions
71 lines (59 loc) · 1.8 KB
/
oweme_shortcodes.php
File metadata and controls
71 lines (59 loc) · 1.8 KB
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
<?php
/*
* Owe Me! - an e107 plugin by Tijn Kuyper
*
* Copyright (C) 2015-2016 Tijn Kuyper (http://www.tijnkuyper.nl)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
if (!defined('e107_INIT')) { exit; }
/*
OweMe Shortcodes
*/
class oweme_shortcodes extends e_shortcode
{
function sc_oweme_id($parm='')
{
return $this->var['e_id'];
}
function sc_oweme_date($parm='')
{
$date_format = e107::getPlugPref('oweme', 'date_format', '%d %B, %Y');
return e107::getDate()->convert_date($this->var["e_datestamp"], $date_format);
}
function sc_oweme_category($parm='')
{
return e107::getDb()->retrieve('oweme_categories', 'c_name', 'c_id = '.$this->var["e_category"]);
}
function sc_oweme_amount($parm='')
{
$cur_pos = e107::getDb()->retrieve('oweme_currencies', 'cur_location', 'cur_id = '.$this->var['e_currency']);
$cur_symbol = e107::getDb()->retrieve('oweme_currencies', 'cur_symbol', 'cur_id = '.$this->var['e_currency']);
if($cur_pos == 'front')
{
return $cur_symbol." ".$this->var["e_amount"];
}
else
{
return $this->var["e_amount"]." ".$cur_symbol;
}
}
function sc_oweme_description($parm='')
{
return $this->var["e_description"];
}
function sc_oweme_debtor($parm='')
{
return e107::getDb()->retrieve('oweme_debtors', 'd_name', 'd_id = '.$this->var["e_debtor"]);
}
function sc_oweme_status_label($parm='')
{
return e107::getDb()->retrieve('oweme_statuses', 's_label', 's_id = '.$this->var["e_status"]);
}
function sc_oweme_status_name($parm='')
{
return e107::getDb()->retrieve('oweme_statuses', 's_name', 's_id = '.$this->var["e_status"]);
}
}
?>