Skip to content

Instantly share code, notes, and snippets.

@MaleXachi
Last active July 21, 2019 01:52
Show Gist options
  • Save MaleXachi/660b45e06d685b1e8dc3 to your computer and use it in GitHub Desktop.
Save MaleXachi/660b45e06d685b1e8dc3 to your computer and use it in GitHub Desktop.
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:
// Your default settings
$_Host = "irc.lightirc.com";
$_Channel = '#lightIRC';
$_Language = 'en';
$_ShowNickSelection = 'true';
$_ShowIdentifySelection = 'false';
$_ShowServerWindow = 'true';
$_StyleURL = '';
$_Nick = 'lightIRC_%25';
$_accessKey = '';
$_Webcam = 'false';
$_Rtmp = '';
$_userListWidth = '150';
That's all. Test it out with: http://www.yourdomain.com/start/?host=irc.lightirc.com, etc.
Active Params:
Host
Channel
Language
showNickSelection
showIdentifySelection
showServerWindow
styleURL
Nick
accessKey
Webcam
Rtmp
userListWidth
Feel free to ask for more options to post a comment.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>start.php For lightIRC By MaleXachi</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript" src="config.js"></script>
</head>
<style type="text/css">
html { height: 100%; overflow: hidden; }
body { height:100%; margin:0; padding:0; background-color:#999; }
</style>
<body>
<div id="lightIRC" style="height:100%; text-align:center;">
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<script type="text/javascript">
<?php
foreach($_GET as $key => $value) {
$cValue = strip_tags($value);
// Your default settings
$_Host = "irc.lightirc.com";
$_Channel = '#lightIRC';
$_Language = 'en';
$_ShowNickSelection = 'true';
$_ShowIdentifySelection = 'false';
$_ShowServerWindow = 'true';
$_StyleURL = '';
$_Nick = 'lightIRC_%25';
$_accessKey = '';
$_Webcam = 'false';
$_Rtmp = '';
$_userListWidth = '150';
// Do not change this!!
$langArray = array("en", "nl", "bd", "bg", "br", "cz", "da", "de", "el", "es", "et", "fr", "hu", "it", "ja", "pl", "ro", "ru", "sl", "sq", "sr_cyr", "sr_lat", "sv", "th", "tr", "uk");
$styleArray = array("black.css", "blue.css", "darkorange.css", "green.css", "lightblue.css", "yellow.css");
$checkValue = array('true', 'false');
if($key == 'host') {
if(empty($cValue)) {
$cValue = $_Host;
} elseif(strlen($cValue) < 7 || strlen($cValue) > 20) {
$cValue = $_Host;
} else {
$cValue = strtolower($cValue);
}
}
if($key == 'autojoin') {
if(empty($cValue)) {
$cValue = $_Channel;
} elseif(substr($cValue, 0, 1) != '#') {
$cValue = $_Channel;
} elseif(strlen($cValue) < 3 || strlen($cValue) > 15) {
$cValue = $_Channel;
}
}
if($key == 'language') {
if(empty($cValue)) {
$cValue = $_Language;
} elseif(!in_array($cValue, $langArray)) {
$cValue = $_Language;
}
}
if($key == 'showNickSelection') {
if(!in_array($cValue, $checkValue)) {
$cValue = $_ShowNickSelection;
}
}
if($key == 'showIdentifySelection') {
if(!in_array($cValue, $checkValue)) {
$cValue = $_ShowIdentifySelection;
}
}
if($key == 'showServerWindow') {
if(!in_array($cValue, $checkValue)) {
$cValue = $_ShowServerWindow;
}
}
if($key == 'styleURL') {
if(!in_array($cValue, $styleArray)) {
$cValue = $_StyleURL;
} else {
$cValue = 'css/' . $cValue;
}
}
if($key == 'accessKey') {
if(empty($cValue)) {
$cValue = $_accessKey;
} elseif(preg_match('/[^A-Za-z0-9_-]/', $cValue)) {
$cValue = $_accessKey;
}
}
if($key == 'webcam') {
if(!in_array($cValue, $checkValue)) {
$cValue = $_Webcam;
}
}
if($key == 'rtmp') {
if(empty($cValue)) {
$cValue = $_Rtmp;
} elseif(preg_match('/[^0-9.]/', $cValue)) {
$cValue = $_Rtmp;
}
}
if($key == 'userListWidth') {
if(empty($cValue)) {
$cValue = $_userListWidth;
} elseif(preg_match('/[^0-9.]/', $cValue)) {
$cValue = $_userListWidth;
}
}
if($cValue == 'true' || $cValue == 'false') {
echo "params." . $key . " = " . $cValue . ";\n";
} else {
if($key == 'nick') {
if(empty($cValue)) {
$cValue = $_Nick;
} elseif(substr($cValue, -1) == '%') {
$cValue = $cValue . '25';
} elseif(strlen($cValue) < 1 || strlen($cValue) > 15) {
$cValue = $_Nick;
} elseif(preg_match('/[^A-Za-z0-9_-]/', $cValue)) {
$cValue = $_Nick;
}
}
echo 'params.' . $key . ' = "' . $cValue . '"' . ";\n";
}
}
?>
swfobject.embedSWF("lightIRC.swf", "lightIRC", "100%", "100%", "10.0.0", "expressInstall.swf", params);
</script>
<?php echo "<!-- (c) MaleXachi 27-02-2015 - start.php For lightIRC -->"; ?>
</body>
</html>
@MaleXachi
Copy link
Author

@herman,

Look for this kind of code in the script and change the numbers:

elseif(strlen($cValue) < 3 || strlen($cValue) > 15)

For roomname, look to 'autojoin'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment