Voorwoord
Ik was met een forumpje bezig, maar heb geen interesse meer, het is echt bagger gescript dusja. Hij is nog lang niet af!
index.php
Mysql.php
forum.sql
Nawoord
Je mag het overal voor gebruiken, maar laat aub de copyright staan!
Eventuele donaties zijn altijd welkom in de vorm van one2xs-punten.
Ik was met een forumpje bezig, maar heb geen interesse meer, het is echt bagger gescript dusja. Hij is nog lang niet af!
index.php
<title>SaFF - Test forum</title>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/* ======================================================= *
Author: Rik ***
Email: Guild-Power@live.nl
License: GNU-GPL
Information of GNU-GPL license can be found at:
http://nl.wikipedia.org/wiki/GNU_General_Public_Licence
* ======================================================= */
// Include mysql.php for connection to database[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]includes/mysql.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]view[/COLOR][COLOR= #007700]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #FF8000]// If catagory is set[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]c[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]c[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #FF8000]// If topic is set[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]t[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]t[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `forum_posts` WHERE `topic_id` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]t[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" ORDER BY `id` ASC"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href="index.php?c="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]c[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"&t="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"&act=addpost">Plaats bericht</a><br /><br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$post[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<strong>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$post[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" - "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$post[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]starter[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</strong><br />"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$post[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reply[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"<br /><br />"[/COLOR][COLOR= #007700];
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `forum_posts` WHERE `cat_id` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]c[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" AND `first` = 1 ORDER BY id ASC"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href="index.php?c="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]c[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"&act=addtopic">Maak nieuw topic</a><br /><br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<strong><a href="index.php?c="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]c[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"&t="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"">"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</a></strong><br /><i>Started by: "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]starter[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</i><br/>"[/COLOR][COLOR= #007700];
}
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `forum_cata` ORDER BY `id` ASC"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<strong><a href="index.php?c="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$cat[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"">"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$cat[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</a></strong><br /><i>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$cat[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]description[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</i><br/>"[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]addtopic[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #FF8000]// Topic adden[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]addpost[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #FF8000]// Post adden[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Mysql.php
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/* ======================================================= *
Author: Rik ***
Email: Guild-Power@live.nl
License: GNU-GPL
Information of GNU-GPL license can be found at:
http://nl.wikipedia.org/wiki/GNU_General_Public_Licence
* ======================================================= */
// Database details[/COLOR]
[COLOR= #0000BB]$name_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Forum"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Name of database[/COLOR]
[COLOR= #0000BB]$user_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"##"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Username for database[/COLOR]
[COLOR= #0000BB]$pass_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"##"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Password for database[/COLOR]
[COLOR= #0000BB]$host_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host for database[/COLOR]
[COLOR= #0000BB]$connect_db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass_db[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Failed to connect to DB server[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// Making connection to our database [/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$name_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$connect_db[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Failed to select DB[/COLOR][COLOR= #007700]);[/COLOR]
?> forum.sql
-- =======================================================
-- Author: Rik ***
-- Email: Guild-Power@live.nl
-- License: GNU-GPL
--
-- Information of GNU-GPL license can be found at:
-- http://nl.wikipedia.org/wiki/GNU_General_Public_Licence
-- =======================================================
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `forum`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `forum_cata`
--
CREATE TABLE IF NOT EXISTS `forum_cata` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT Unnamed,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Gegevens worden uitgevoerd voor tabel `forum_cata`
--
INSERT INTO `forum_cata` (`id`, `name`, `description`) VALUES
(1, Algemeen, Hier kun je al je algemene topics kwijt. AIGHT!),
(2, Digitale shizzle, 001001001010.. Alles wat met bits en bytes te maken heeft komt hier!);
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `forum_posts`
--
CREATE TABLE IF NOT EXISTS `forum_posts` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`starter` varchar(20) NOT NULL,
`topic_id` int(4) NOT NULL,
`cat_id` int(4) NOT NULL,
`reply` text NOT NULL,
`first` tinyint(1) NOT NULL default 0,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Gegevens worden uitgevoerd voor tabel `forum_posts`
--
INSERT INTO `forum_posts` (`id`, `name`, `starter`, `topic_id`, `cat_id`, `reply`, `first`) VALUES
(1, Help, hoe werkt dit?, Admin, 1, 1, Niet xD, 1),
(2, Spam topic, Admin, 2, 1, Door jou deed ik een poepie!, 1),
(3, HTML, HTML-goeroe, 3, 2, HTML IS THE BEST, PHP SUX, 1),
(4, Regels, Admin, 4, 1, Die zijn er niet =], 1),
(5, PHP, PHP-goeroe, 5, 2, PHP RULES, THE REST SUX!, 1),
(6, Help, hoe werkt dit?, 1, 1, Rik, Nou, dat is ook niet leuk.. =[, 0);
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `forum_system`
--
CREATE TABLE IF NOT EXISTS `forum_system` (
`name` varchar(255) NOT NULL DEFAULT GP-Forum test,
`subname` varchar(255) NOT NULL DEFAULT Simple as it can be,
`open_reg` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=MyISAM DEFAULT CHARSET=latin1; Nawoord
Je mag het overal voor gebruiken, maar laat aub de copyright staan!
Eventuele donaties zijn altijd welkom in de vorm van one2xs-punten.