forked from delpino73/Blue-Smiley-Organizer
/
show-blog-print.php
58 lines (35 loc) · 1.22 KB
/
show-blog-print.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
<?php
require 'class.base.php';
$base_instance=new base();
$userid=$base_instance->get_userid();
$where='';
if (isset($_GET['text_search'])) {
$text_search=sql_safe($_GET['text_search']);
$where=" AND (text LIKE '%$text_search%' OR title LIKE '%$text_search%') ";
}
if (isset($_GET['category_id'])) {
$category_id=(int)$_GET['category_id'];
$where.=' AND category='.$category_id;
}
else if (isset($_GET['blog_id'])) {
$blog_id=(int)$_GET['blog_id'];
$where=' AND ID='.$blog_id;
}
$data=$base_instance->get_data("SELECT * FROM {$base_instance->entity['BLOG']['MAIN']} WHERE user='$userid'$where ORDER BY datetime DESC");
echo '<head><meta http-equiv="content-type" content="text/html;charset=utf-8">
<style type="text/css">
td {font-family:Arial; font-size:10pt}
table.pastel,table.pastel td {border:1px solid #c5c5c5; border-collapse:collapse}
</style>
</head>
<table width="100%" border cellspacing=0 cellpadding=5 class="pastel">';
for ($index=1; $index <= sizeof($data); $index++) {
$title=$data[$index]->title;
$text=$data[$index]->text;
$title=convert_square_bracket($title);
$text=convert_square_bracket($text);
$text=nl2br($text);
echo '<tr><td><strong>',$title,'</strong><br>',$text,'</td></tr>';
}
echo '</table>';
?>