Skip to content

Commit 5f38cc2

Browse files
committed
first commit. just starting
starting basic structure. have preliminary db set up. nothing really done yet.
0 parents  commit 5f38cc2

9 files changed

Lines changed: 104 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
.DS_Store

api.php

Whitespace-only changes.

config.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
4+
5+
// SETUP
6+
// Database info
7+
$dbhost = "localhost";
8+
$dbuser = "redditsync";
9+
$dbpass = "GYn5UZGGqGWU9PzA";
10+
$dbname = "redditsync";
11+
12+
13+
$mysql = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
14+
if($mysql->connect_errno) {
15+
echo "database connection failure <!-- ".$mysql->connect_error." -->";
16+
die;
17+
}
18+

create.php

Whitespace-only changes.

functions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
4+
5+
// check if user is logged in.
6+
function checkLoggedIn($authid, $userid, $authhash) {
7+
8+
}

index.php

Whitespace-only changes.

login.php

Whitespace-only changes.

mysql.sql

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
--
2+
-- Database: `redditsync`
3+
--
4+
5+
-- --------------------------------------------------------
6+
7+
--
8+
-- Table structure for table `authcodes`
9+
--
10+
11+
CREATE TABLE IF NOT EXISTS `authcodes` (
12+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
13+
`userid` int(10) unsigned NOT NULL,
14+
`username` varchar(30) NOT NULL,
15+
`authhash` text NOT NULL,
16+
`description` text NOT NULL,
17+
`lastused` int(10) unsigned DEFAULT NULL,
18+
`created` int(10) unsigned DEFAULT NULL,
19+
PRIMARY KEY (`id`),
20+
KEY `userid` (`userid`)
21+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
22+
23+
-- --------------------------------------------------------
24+
25+
--
26+
-- Table structure for table `links`
27+
--
28+
29+
CREATE TABLE IF NOT EXISTS `links` (
30+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
31+
`linkid` varchar(20) NOT NULL,
32+
`userid` int(10) unsigned NOT NULL,
33+
`lastvisit` int(10) unsigned NOT NULL,
34+
`lastcommenttime` int(10) unsigned NOT NULL,
35+
`lastcommentcount` int(6) unsigned NOT NULL,
36+
`firstvisit` int(10) unsigned NOT NULL,
37+
`lastcall` text NOT NULL,
38+
PRIMARY KEY (`id`),
39+
KEY `linkid` (`linkid`,`userid`)
40+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
41+
42+
-- --------------------------------------------------------
43+
44+
--
45+
-- Table structure for table `logincodes`
46+
--
47+
48+
CREATE TABLE IF NOT EXISTS `logincodes` (
49+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
50+
`userid` int(10) unsigned NOT NULL,
51+
`authhash` text NOT NULL,
52+
`lastlogin` int(10) unsigned NOT NULL,
53+
`created` int(10) unsigned NOT NULL,
54+
PRIMARY KEY (`id`)
55+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
56+
57+
-- --------------------------------------------------------
58+
59+
--
60+
-- Table structure for table `user`
61+
--
62+
63+
CREATE TABLE IF NOT EXISTS `user` (
64+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
65+
`username` varchar(30) NOT NULL,
66+
`passhash` text NOT NULL,
67+
`salt` varchar(30) NOT NULL,
68+
`lastlogin` int(10) unsigned DEFAULT NULL,
69+
`lastactivity` int(10) unsigned DEFAULT NULL,
70+
`lastip` varchar(15) DEFAULT NULL,
71+
`numlink` int(8) unsigned DEFAULT NULL,
72+
`numcomments` int(8) unsigned DEFAULT NULL,
73+
`loginattempts` int(2) unsigned DEFAULT NULL,
74+
PRIMARY KEY (`id`),
75+
UNIQUE KEY `username` (`username`)
76+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

register.php

Whitespace-only changes.

0 commit comments

Comments
 (0)