Last change
on this file since 5329 was
3609,
checked in by patdenice, 15 years ago
|
Convert all php and tpl files in Unix format for my plugins.
|
File size:
1.4 KB
|
Rev | Line | |
---|
[3609] | 1 | <?php |
---|
| 2 | |
---|
| 3 | define('PHPWG_ROOT_PATH','../../'); |
---|
| 4 | include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); |
---|
| 5 | include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); |
---|
| 6 | |
---|
| 7 | check_status(ACCESS_GUEST); |
---|
| 8 | |
---|
| 9 | if (!isset($_POST['imgid']) |
---|
| 10 | or !($imgid = explode('img-', $_POST['imgid'])) |
---|
| 11 | or !is_numeric(@$imgid[1])) |
---|
| 12 | { |
---|
| 13 | die; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | $do_log = $conf['log']; |
---|
| 17 | if (is_admin()) |
---|
| 18 | { |
---|
| 19 | $do_log = $conf['history_admin']; |
---|
| 20 | } |
---|
| 21 | if (is_a_guest()) |
---|
| 22 | { |
---|
| 23 | $do_log = $conf['history_guest']; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | if (!$do_log) |
---|
| 27 | { |
---|
| 28 | exit(); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | $image_id = mysql_real_escape_string($imgid[1]); |
---|
| 32 | |
---|
| 33 | if (!empty($_POST['section'])) |
---|
| 34 | { |
---|
| 35 | $page['section'] = mysql_real_escape_string($_POST['section']); |
---|
| 36 | } |
---|
| 37 | if (!empty($_POST['catid'])) |
---|
| 38 | { |
---|
| 39 | $page['category']['id'] = mysql_real_escape_string($_POST['catid']); |
---|
| 40 | } |
---|
| 41 | if ('tags'==@$page['section'] and !empty($_POST['tagids'])) |
---|
| 42 | { |
---|
| 43 | $tags_string = mysql_real_escape_string($_POST['tagids']); |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | $query = ' |
---|
| 47 | INSERT INTO '.HISTORY_TABLE.' |
---|
| 48 | ( |
---|
| 49 | date, |
---|
| 50 | time, |
---|
| 51 | user_id, |
---|
| 52 | IP, |
---|
| 53 | section, |
---|
| 54 | category_id, |
---|
| 55 | image_id, |
---|
| 56 | image_type, |
---|
| 57 | tag_ids, |
---|
| 58 | lightbox |
---|
| 59 | ) |
---|
| 60 | VALUES |
---|
| 61 | ( |
---|
| 62 | CURDATE(), |
---|
| 63 | CURTIME(), |
---|
| 64 | '.$user['id'].', |
---|
| 65 | \''.$_SERVER['REMOTE_ADDR'].'\', |
---|
| 66 | '.(isset($page['section']) ? "'".$page['section']."'" : 'NULL').', |
---|
| 67 | '.(isset($page['category']['id']) ? $page['category']['id'] : 'NULL').', |
---|
| 68 | '.$image_id.', |
---|
| 69 | "picture", |
---|
| 70 | '.(isset($tags_string) ? "'".$tags_string."'" : 'NULL').', |
---|
| 71 | "true" |
---|
| 72 | ) |
---|
| 73 | ;'; |
---|
| 74 | |
---|
| 75 | pwg_query($query); |
---|
| 76 | |
---|
[3298] | 77 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.