Project:
stupidCMS
Code Location:
https://stupidcms.svn.sourceforge.net/svnroot/stupidcms
index.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
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
<?php /* Copyright (C) 2011 Jacopo Cascioli This file is part of stupidCMS This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ require "layout.php"; require "format.php"; require "settings.php"; $con = mysql_connect($server, $user, $password); mysql_select_db($database, $con); $query = mysql_query("SELECT * FROM general LIMIT 1"); $general = mysql_fetch_array($query); $title = $general[1]; $description = $general[2]; $license = $general[4]; $version = $general[5]; $lastupdate = date("l j F Y", $general[6]); $header = sprintf($header, $title, $description, ''); $footer = sprintf($footer, $lastupdate, $version, $license); $from_last = $_GET["fromlast"]; if (!$from_last) { $query = mysql_query("SELECT * FROM posts ORDER BY id DESC LIMIT 0,10"); $posts = fetch_all($query); $formatted_posts = format_posts($posts, 1); $page_slide = format_page_slide(1, 0, 0); } else { $query = mysql_query("SELECT * FROM posts ORDER BY id DESC"); $posts_array = fetch_all($query); $posts = limit_workaround($posts_array, $from_last, 10); $formatted_posts = format_posts($posts, 1); $page_slide = format_page_slide($from_last, 0, 0); } $main_content = $formatted_posts.$page_slide; printf($html_base, $title, $header, $main_content, $footer); ?>
