Skip to content

Instantly share code, notes, and snippets.

@MaleXachi
MaleXachi / config-generator.php
Last active August 27, 2017 04:21
This is a method to create a config with lightIRC using PHP. You can use this script for your own website to give you users a method to create a config file with Config Generator. If you like this and you have a github account, please click on star. Feel free to post a comment.
<!DOCTYPE html>
<html>
<head>
<title>lightIRC Config Generator - By MaleXachi</title>
<meta charset='utf-8'>
<?php
header("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
@MaleXachi
MaleXachi / lightirc-iframe-generator.php
Created May 23, 2013 21:46
This is a method to generate iframe with lightIRC parameters, which it make easier for other users to add your chat for their website. This script works as well, but i had not to much time, so it's maybe not perfectly, so post a comment, if you want to make somethings better. Please click on star, if you have a github account and if you like thi…
<!DOCTYPE html>
<head>
<title>Simple lightIRC iFrame Generator By MaleXachi</title>
<meta charset="utf-8">
<style>
body{font-family:Verdana;font-size:12px;width:920px;margin:10px auto 0;margin-bottom: 20px;}
h2{font-size: 14px;}
</style>
</head>
<body>
var hWidth, bWidth;
function setBgPos(v) {
var off = v * hWidth;
var pos = -bWidth + (v * bWidth);
$('slider').setStyle({backgroundPosition: Math.round(pos - off) + 'px'});
}
function setSlideOutput(v) {
$('percent').innerHTML = Math.round(v * 100) + '%';
}
Event.observe(window, 'load', function() {
@MaleXachi
MaleXachi / sql.sql
Last active December 21, 2015 21:48
Age Range Using CURDATE() Mysqli and Php
--
-- Tabelstructuur voor tabel `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(15) NOT NULL,
`gender` varchar(10) NOT NULL,
`birthdate` date NOT NULL,
PRIMARY KEY (`id`),
@MaleXachi
MaleXachi / Changelog_php_LightIRC.txt
Last active December 31, 2015 17:33
This is a method to login with lightIRC, when you fill in your username and gender and about colours of genders. If you want to add more options, feel free to post a comment. Please click on star, if you like this!
Changes 2015-02-24:
Better Security for $_POST with Errormessages:
- If username is Empty
- If a username don't have legal characters (You can add more values in preg_match())
- If Length of username is longer/shorter than default values (You can change both length of username)
- If username have bad names (You can add more bad names in array of $badNames)
- If gender is Empty
- If gender value is other than default values
@MaleXachi
MaleXachi / Changelog_start.php.txt
Last active July 21, 2019 01:52
This is Start.php for lightIRC. You can use your own domain instead of lightIRC, if people use iframes to your server for their chats. If you want to add more options, just post a comment! Please, click on star, if you like this!
How To Use:
Create folder: start
Download lightIRC: http://lightirc.com/download.html
Put all files in start folder
Put index.php in start folder
Remove index.html
Do not forgot to set ur own default settings:
@MaleXachi
MaleXachi / Add To Same Html.css
Last active August 29, 2015 14:16
This is Youtube Grabber for lightIRC. All Youtube urls from other users will be added in the list below lightIRC.
li { list-style: none; }
ul#youtube-grabber { background: #ffffff; border: solid 1px #000000; overflow: auto; height: 150px; width: 500px; }
@MaleXachi
MaleXachi / Javascript Snippets lightIRC.js
Last active July 21, 2019 01:47
Use some lightIRC javascript snippets for your own. Don't forgot to set true on loopClientCommands or loopServerCommands, depends what you use.
// #1 - Javascript snippet to let users join allowed channels only - See: http://redmine.lightirc.com/issues/647
function onClientCommand(command) {
var raw = command.split(' ');
var chanArray = ['#test', '#test1', '#test2'];
if (raw[0] == 'JOIN' && raw[1].charAt(0) == '#') {
if (chanArray.indexOf(raw[1]) < 0) {
alert('Sorry, this channel isn\'t allowed');
command = '';
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bedrag in Procent berekenen</title>
<style>
fieldset {
margin-bottom: 1em;
}
input {