Adding files - Rebirth from a dead project to finish his life in hell
This commit is contained in:
commit
5be06c4e08
144
bbcode.php
Normal file
144
bbcode.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/*
|
||||
* Class for parsing BBCode
|
||||
* @author - Paul Carter, http://cartpauj.com
|
||||
*Ui = 1 line
|
||||
*Uis = Multiple Lines
|
||||
*/
|
||||
if (!class_exists('cartpaujBBCodeParser'))
|
||||
{
|
||||
class cartpaujBBCodeParser {
|
||||
|
||||
var $patterns = array
|
||||
(
|
||||
'/\[list\](.+)\[\/list\]/Uis',
|
||||
'/\[\*\](.+)\\n/Ui',
|
||||
'/\[spoil\](.+)\[\/spoil\]/Uis',
|
||||
'/\[b\](.+)\[\/b\]/Uis',
|
||||
'/\[i\](.+)\[\/i\]/Uis',
|
||||
'/\[u\](.+)\[\/u\]/Uis',
|
||||
'/\[s\](.+)\[\/s\]/Uis',
|
||||
'/\[url=(.+)\](.+)\[\/url\]/Ui',
|
||||
'/\[url](.+)\[\/url\]/Ui',
|
||||
'/\[map](.+)\[\/map\]/Ui',
|
||||
'/\[yt](.+)\[\/yt\]/Ui',
|
||||
'/\[embed](.+)\[\/embed\]/Ui',
|
||||
'/\[email](.+)\[\/email\]/Ui',
|
||||
'/\[email=(.+)\](.+)\[\/email\]/Ui',
|
||||
'/\[img\](.+)\[\/img\]/Ui',
|
||||
'/\[img=(.+)\](.+)\[\/img\]/Ui',
|
||||
'/\[color=(\#[0-9a-f]{6}|[a-z]+)\](.+)\[\/color\]/Ui',
|
||||
'/\[color=(\#[0-9a-f]{6}|[a-z]+)\](.+)\[\/color\]/Uis',
|
||||
'/\[left\](.+)\[\/left\]/Ui',
|
||||
'/\[left\](.+)\[\/left\]/Uis',
|
||||
'/\[center\](.+)\[\/center\]/Ui',
|
||||
'/\[center\](.+)\[\/center\]/Uis',
|
||||
'/\[right\](.+)\[\/right\]/Ui',
|
||||
'/\[right\](.+)\[\/right\]/Uis',
|
||||
'/\[justify\](.+)\[\/justify\]/Ui',
|
||||
'/\[justify\](.+)\[\/justify\]/Uis',
|
||||
'/\[spoiler\](.+)\[\/spoiler\]/Ui',
|
||||
'/\[spoiler\](.+)\[\/spoiler\]/Uis',
|
||||
'/\[spoiler=(.+)\](.+)\[\/spoiler\]/Ui',
|
||||
'/\[spoiler=(.+)\](.+)\[\/spoiler\]/Uis',
|
||||
'/\[quote](.+)\[\/quote]/Ui',
|
||||
'/\[quote](.+)\[\/quote]/Uis'
|
||||
);
|
||||
|
||||
var $replacements = array
|
||||
(
|
||||
'<ul>\1</ul>',
|
||||
'<li>\1</li>',
|
||||
'<span style = "color:transparent">\1</span>',
|
||||
'<b>\1</b>',
|
||||
'<i>\1</i>',
|
||||
'<u>\1</u>',
|
||||
'<s>\1</s>',
|
||||
'<a href = "\1" target = "_blank">\2</a>',
|
||||
'<a href = "\1" target = "_blank">\1</a>',
|
||||
'<iframe width = "400" height = "325" frameborder = "0" scrolling = "no" marginheight = "0" marginwidth = "0" src = "\1&output=embed">Your browser does not support iFrames</iframe>',
|
||||
'\1',
|
||||
'\1',
|
||||
'<a href = "mailto:\1">\1</a>',
|
||||
'<a href = "mailto:\1">\2</a>',
|
||||
'<a href = "\1"><img src = "\1" alt = "Image" /></a>',
|
||||
'<a href = "\1"><img src = "\1" alt = "\2" /></a>',
|
||||
'<span style = "color: \1;">\2</span>',
|
||||
'<div style = "color: \1;">\2</div>',
|
||||
'<p style = "text-align:left">\1</p>',
|
||||
'<p style = "text-align:left">\1</p>',
|
||||
'<p style = "text-align:center">\1</p>',
|
||||
'<p style = "text-align:center">\1</p>',
|
||||
'<p style = "text-align:right">\1</p>',
|
||||
'<p style = "text-align:right">\1</p>',
|
||||
'<p style = "text-align:justify">\1</p>',
|
||||
'<p style = "text-align:justify">\1</p>',
|
||||
'<ul class="mingle-spoiler-view" style = "list-style-type:none"><li style = "cursor:pointer"><h3><span>+</span>Spoiler</h3></li><li class = "mingle-spoiler-view-hide" style = "display:none">\1</li></ul>',
|
||||
'<ul class="mingle-spoiler-view" style = "list-style-type:none"><li style = "cursor:pointer"><h3><span>+</span>Spoiler</h3></li><li class = "mingle-spoiler-view-hide" style = "display:none">\1</li></ul>',
|
||||
'<ul class="mingle-spoiler-view" style = "list-style-type:none"><li style = "cursor:pointer"><h3><span>+</span>\1</h3></li><li style = "display:none">\2</li></ul>',
|
||||
'<ul class="mingle-spoiler-view" style = "list-style-type:none"><li style = "cursor:pointer"><h3><span>+</span>\1</h3></li><li style = "display:none">\2</li></ul>',
|
||||
'<blockquote>\1</blockquote>',
|
||||
'<blockquote>\1</blockquote>'
|
||||
);
|
||||
|
||||
function bbc2html($subject)
|
||||
{
|
||||
$codes = array(array(), array());
|
||||
preg_match_all('/\[code\](.+)\[\/code\]/Uis', $subject, $codes);
|
||||
|
||||
foreach ($codes[0] as $num => $code) {
|
||||
$subject = str_replace($code, "[code$num]", $subject);
|
||||
}
|
||||
|
||||
$subject = preg_replace($this->patterns, $this->replacements, $subject);
|
||||
|
||||
foreach ($codes[1] as $num => $code) {
|
||||
$subject = str_replace("[code$num]", '<pre class="code">'.$code.'</pre>', $subject);
|
||||
}
|
||||
|
||||
return $subject;
|
||||
}
|
||||
|
||||
function get_editor($text='') {
|
||||
global $mingleforum;
|
||||
|
||||
function mingle_get_editor_mce_external_plugins($plugins) {
|
||||
$plugins['bbcodev2'] = plugins_url('/js/plugins/bbcodev2/editor_plugin_src.js', __FILE__);
|
||||
$plugins['emotions'] = plugins_url('/js/plugins/emotions/editor_plugin_src.js', __FILE__);
|
||||
return $plugins;
|
||||
}
|
||||
add_filter('mce_external_plugins', 'mingle_get_editor_mce_external_plugins');
|
||||
|
||||
ob_start();
|
||||
wp_editor($text, 'message', array(
|
||||
'wpautop' => false,
|
||||
'tinymce' => array(
|
||||
'plugins' => 'bbcodev2,emotions',
|
||||
'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,pre,blockquote,spoil,justifyleft,justifycenter,justifyright,justifyfull,bullist,link,unlink,image,forecolor,yt,map,emotions',
|
||||
'theme_advanced_buttons2' => '',
|
||||
'apply_source_formatting' => false,
|
||||
'setup' => 'function (ed) {
|
||||
ed.addButton("pre", {
|
||||
title: "'.__("Code").'",
|
||||
image: "'.$mingleforum->skin_url.'/images/bbc/code.png"
|
||||
})
|
||||
ed.addButton("yt", {
|
||||
title: "'.__("Embed YouTube Video").'",
|
||||
image: "'.$mingleforum->skin_url.'/images/bbc/yt.png"
|
||||
})
|
||||
ed.addButton("map", {
|
||||
title: "'.__("Embed Google Map").'",
|
||||
image: "'.$mingleforum->skin_url.'/images/bbc/gm.png"
|
||||
})
|
||||
ed.addButton("spoil", {
|
||||
title: "'.__("Spoiler").'",
|
||||
image: "'.$mingleforum->skin_url.'/images/bbc/spoil.png"
|
||||
})
|
||||
}'
|
||||
)
|
||||
));
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
49
captcha/captcha_code.php
Normal file
49
captcha/captcha_code.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Original Author: Simon Jarvis
|
||||
* Copyright: 2006 Simon Jarvis
|
||||
* Date: 03/08/06
|
||||
* Updated: 07/02/07
|
||||
* Requirements: PHP 4/5 with GD and FreeType libraries
|
||||
* Link: http://www.white-hat-web-design.co.uk/articles/php-captcha.php
|
||||
*
|
||||
*
|
||||
* Modified by: Mythos and Rini
|
||||
* Date: 2007-09-10
|
||||
* Description: Modified the code and remove use of Session
|
||||
*
|
||||
*
|
||||
* 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 2
|
||||
* 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:
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class CaptchaCode
|
||||
{
|
||||
|
||||
|
||||
function generateCode($characters)
|
||||
{
|
||||
/* list all possible characters, similar looking characters and vowels have been removed */
|
||||
$possible = '23456789bcdfghjkmnpqrstvwxyz';
|
||||
$code = '';
|
||||
$i = 0;
|
||||
while ($i < $characters)
|
||||
{
|
||||
$code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
|
||||
$i++;
|
||||
}
|
||||
return $code;
|
||||
}
|
||||
|
||||
}
|
76
captcha/captcha_images.php
Normal file
76
captcha/captcha_images.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Original Author: Simon Jarvis
|
||||
* Copyright: 2006 Simon Jarvis
|
||||
* Date: 03/08/06
|
||||
* Updated: 07/02/07
|
||||
* Requirements: PHP 4/5 with GD and FreeType libraries
|
||||
* Link: http://www.white-hat-web-design.co.uk/articles/php-captcha.php
|
||||
*
|
||||
*
|
||||
* Modified by: Mythos and Rini
|
||||
* Date: 2007-09-10
|
||||
* Description: Modified the code and remove use of Session
|
||||
*
|
||||
*
|
||||
* 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 2
|
||||
* 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:
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
include("shared.php");
|
||||
|
||||
class CaptchaSecurityImages {
|
||||
|
||||
var $font = 'monofont.ttf';
|
||||
|
||||
function GenerateImage($width='120',$height='40', $code='') {
|
||||
|
||||
/* font size will be 75% of the image height */
|
||||
$font_size = $height * 0.75;
|
||||
$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
|
||||
/* set the colours */
|
||||
imagecolorallocate($image, 255, 255, 255);
|
||||
$text_color = imagecolorallocate($image, 20, 40, 100);
|
||||
$noise_color = imagecolorallocate($image, 100, 120, 180);
|
||||
/* generate random dots in background */
|
||||
for( $i=0; $i<($width*$height)/3; $i++ ) {
|
||||
imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);
|
||||
}
|
||||
/* generate random lines in background */
|
||||
for( $i=0; $i<($width*$height)/150; $i++ ) {
|
||||
imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color);
|
||||
}
|
||||
/* create textbox and add text */
|
||||
$textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function');
|
||||
$x = ($width - $textbox[4])/2;
|
||||
$y = ($height - $textbox[5])/2;
|
||||
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function');
|
||||
/* output captcha image to browser */
|
||||
header('Content-Type: image/jpeg');
|
||||
imagejpeg($image);
|
||||
imagedestroy($image);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$width = isset($_GET['width']) ? $_GET['width'] : '120';
|
||||
$height = isset($_GET['height']) ? $_GET['height'] : '40';
|
||||
$code = isset($_GET['code']) ? $_GET['code'] : '';
|
||||
|
||||
if (isset($_GET['code']))
|
||||
{
|
||||
$captcha = new CaptchaSecurityImages();
|
||||
$captcha-> GenerateImage($width,$height,wpf_str_decrypt($code));
|
||||
}
|
BIN
captcha/monofont.ttf
Normal file
BIN
captcha/monofont.ttf
Normal file
Binary file not shown.
95
captcha/shared.php
Normal file
95
captcha/shared.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Function : str_encrypt($string) / str_decrypt($string)
|
||||
// Description : en/decrypt $data with the key in $keyfile with an rc4 algorithm
|
||||
// Return : en/decrypted string which is URL safe
|
||||
//
|
||||
// NOTE: Dec 12, 2005 (Mythos and Rini)
|
||||
// - Serious problem after upgraded from 5.0.5 to 5.1.1
|
||||
// Because of the base64_decode function, if there is space in the string
|
||||
// it ignores it. For example: base64_decode(string);
|
||||
//
|
||||
// In 5.0.5, it treats "abc" and "a bc" differently
|
||||
// In 5.1.1, it treats "abc" and "a bc" the same when decode
|
||||
// http://bugs.php.net/bug.php?id=35649
|
||||
// The original code was:
|
||||
// urlencode(base64_encode($mystr); // PROBLEM: if there is space in mystr
|
||||
// To code should have been like this:
|
||||
// base64_encode(urlencode($mystr)); // Encode any space become '+' first
|
||||
// But this won't work because there are existing encrypted data in database already
|
||||
//
|
||||
// Cause: $_GET automatically converts '%2B' into '+' automatically, when we
|
||||
// do the urldecode, it generates the space! Now when it comes to the difference
|
||||
// between 5.0.5 vs 5.1.1 base64_decode, the result is different.
|
||||
//
|
||||
// urldecode("a+bc") // a bc <-- PROBLEM, base64_decode ignores the space
|
||||
/**/define("WPF_KEY_FOR_RC4", wpf_get_cartpauj_url());
|
||||
// urldecode("a%2Bbc"); // a+bc
|
||||
//
|
||||
// Both '+' and '%2B' got the same result
|
||||
// rawurldecode("a+bc") // a+bc <-- SOLVED
|
||||
// rawurldecode("a%2Bbc"); // a+bc
|
||||
//
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
function wpf_get_cartpauj_url() {
|
||||
return (string)$_SERVER["DOCUMENT_ROOT"].substr(uniqid(''), 0, 3);
|
||||
}
|
||||
|
||||
function wpf_str_encrypt($str) {
|
||||
|
||||
$mystr = WPFRC4($str, WPF_KEY_FOR_RC4);
|
||||
$mystr = rawurlencode(base64_encode($mystr));
|
||||
return $mystr;
|
||||
}
|
||||
|
||||
function wpf_str_decrypt($str) {
|
||||
|
||||
$mystr = base64_decode(rawurldecode($str));
|
||||
$mystr = WPFRC4($mystr, WPF_KEY_FOR_RC4);
|
||||
return $mystr;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Function : WPFRC4($data, $key)
|
||||
// Description : ecncrypt/decrypt $data with the key in $keyfile with an rc4 algorithm
|
||||
// This was written by danzarrella in 2002 can be found on Zend.com
|
||||
// Return : string (encrypted/decrypted)
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
function WPFRC4($data, $key) {
|
||||
|
||||
// initialize (modified by Simon Lee)
|
||||
$x=0; $j=0; $a=0; $temp=""; $Zcrypt="";
|
||||
for ($i=0; $i<=255; $i++) {
|
||||
$counter[$i] = "";
|
||||
}
|
||||
|
||||
// $pwd = implode('', file($keyfile));
|
||||
$pwd = $key;
|
||||
$pwd_length = strlen($pwd);
|
||||
for ($i = 0; $i < 255; $i++) {
|
||||
$key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1));
|
||||
$counter[$i] = $i;
|
||||
}
|
||||
for ($i = 0; $i < 255; $i++) {
|
||||
$x = ($x + $counter[$i] + $key[$i]) % 256;
|
||||
$temp_swap = $counter[$i];
|
||||
$counter[$i] = $counter[$x];
|
||||
$counter[$x] = $temp_swap;
|
||||
|
||||
}
|
||||
for ($i = 0; $i < strlen($data); $i++) {
|
||||
$a = ($a + 1) % 256;
|
||||
$j = ($j + $counter[$a]) % 256;
|
||||
$temp = $counter[$a];
|
||||
$counter[$a] = $counter[$j];
|
||||
$counter[$j] = $temp;
|
||||
$k = $counter[(($counter[$a] + $counter[$j]) % 256)];
|
||||
$Zcipher = ord(substr($data, $i, 1)) ^ $k;
|
||||
$Zcrypt .= chr($Zcipher);
|
||||
}
|
||||
return $Zcrypt;
|
||||
}
|
70
feed.php
Normal file
70
feed.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
global $wpdb, $mingleforum;
|
||||
|
||||
$root = dirname(dirname(dirname(dirname(__FILE__))));
|
||||
if (file_exists($root.'/wp-load.php')) {
|
||||
// WP 2.6
|
||||
require_once($root.'/wp-load.php');
|
||||
} else {
|
||||
// before WP 2.6
|
||||
require_once($root.'/wp-config.php');
|
||||
}
|
||||
|
||||
if($mingleforum->options['forum_use_rss'])
|
||||
{
|
||||
$mingleforum->setup_links();
|
||||
|
||||
if(is_numeric($_GET['topic'])) //is_numeric will prevent SQL injections
|
||||
$topic = $_GET['topic'];
|
||||
else
|
||||
$topic = 'all';
|
||||
|
||||
if($topic == "all"){
|
||||
$posts = $wpdb->get_results("SELECT * FROM {$mingleforum->t_posts} ORDER BY `date` DESC LIMIT 20");
|
||||
$title = get_bloginfo('name')." ".__("Forum Feed", "mingleforum")."";
|
||||
$description = __("Forum Feed", "mingleforum");
|
||||
}
|
||||
else{
|
||||
$posts = $wpdb->get_results("SELECT * FROM $mingleforum->t_posts WHERE parent_id = $topic ORDER BY `date` DESC LIMIT 20");
|
||||
$description = __("Forum Topic:", "mingleforum")." - ".$mingleforum->get_subject($topic);
|
||||
$title = get_bloginfo('name')." ".__("Forum", "mingleforum")." - ".__("Topic: ", "mingleforum")." ".$mingleforum->get_subject($topic);
|
||||
}
|
||||
$link = $mingleforum->home_url;
|
||||
|
||||
header ("Content-type: application/rss+xml");
|
||||
|
||||
echo ("<?xml version=\"1.0\" encoding=\"".get_bloginfo('charset')."\"?>\n");
|
||||
?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title><?php echo $title; ?></title>
|
||||
<description><?php bloginfo('name'); echo " $description";?></description>
|
||||
<link><?php echo $link;?></link>
|
||||
<language><?php bloginfo('language');?></language>
|
||||
<?php
|
||||
|
||||
|
||||
foreach($posts as $post){
|
||||
$catid = $mingleforum->forum_get_group_from_post($post->parent_id);
|
||||
$groups = $wpdb->get_var("select usergroups from {$mingleforum->t_forums} where id = {$catid}");
|
||||
$groups = maybe_unserialize($groups);
|
||||
if(empty($groups)) //don't show protected group posts in the feed
|
||||
{
|
||||
$link = $mingleforum->get_paged_threadlink($post->parent_id);
|
||||
$title = $post->subject;
|
||||
|
||||
echo "<item>\n
|
||||
<title>".htmlspecialchars($title)."</title>\n
|
||||
<description>".htmlspecialchars($mingleforum->output_filter($post->text, ENT_NOQUOTES))."</description>\n
|
||||
<link>".htmlspecialchars($link)."</link>\n
|
||||
<author>feeds@r.us</author>\n
|
||||
<pubDate>".date("r", strtotime($post->date))."</pubDate>\n
|
||||
<guid>".htmlspecialchars($link."&guid=$post->id")."</guid>
|
||||
</item>\n\n";
|
||||
}
|
||||
}
|
||||
echo "</channel>
|
||||
</rss>";
|
||||
}
|
||||
else
|
||||
echo "<html><body>".__("Feeds are disabled", "mingleforum")."</body></html>";
|
1145
fs-admin/fs-admin.php
Normal file
1145
fs-admin/fs-admin.php
Normal file
File diff suppressed because it is too large
Load Diff
35
fs-admin/wpf-add-forum.php
Normal file
35
fs-admin/wpf-add-forum.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
if(function_exists('home_url'))
|
||||
{
|
||||
/*************** wpf-add-forum.php *********************/
|
||||
global $mingleforum;
|
||||
$groupmane = isset($_GET['groupid']) ? $_GET['groupid'] : 0;
|
||||
$groupname = stripslashes($mingleforum->get_groupname($groupmane));
|
||||
$groupname = empty($groupname) ? __("Add category", "mingleforum") : __("Add forum to", "mingleforum").' "'.$groupname.'"';
|
||||
echo "<h2><img src='".WPFURL."images/table.png' />$groupname</h2>";
|
||||
|
||||
echo "<form name='add_forum_form' id='add_forum_form' method='post' action='admin.php?page=mfstructure&mingleforum_action=structure'>";
|
||||
echo "<table class='form-table'>
|
||||
<tr>
|
||||
<th>".__("Name:", "mingleforum")."</th>
|
||||
<td><input type='text' value='' name='add_forum_name' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>".__("Description:", "mingleforum")."</th>
|
||||
<td><textarea name='add_forum_description' ".ADMIN_ROW_COL."></textarea></td>
|
||||
</tr>
|
||||
<tr>";
|
||||
|
||||
$gr_id = (isset($_GET['groupid']) && is_numeric($_GET['groupid']))?$_GET['groupid']:0;
|
||||
echo "<tr>
|
||||
<th></th>
|
||||
<td><input type='submit' value='".__("Save forum", "mingleforum")."' name='add_forum_submit' /></td>
|
||||
</tr>
|
||||
<input type='hidden' name='add_forum_group_id' value='{$gr_id}' />";
|
||||
echo "</form></table>";
|
||||
/**********************************************************/
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>Nice TRY!</p>';
|
||||
}
|
32
fs-admin/wpf-add-usergroup.php
Normal file
32
fs-admin/wpf-add-usergroup.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
if(function_exists('home_url'))
|
||||
{
|
||||
/************************ wpf-add-usergroup.php ************************************/
|
||||
$image = WPFURL."images/user.png";
|
||||
echo "<div class='wrap'> <h2>";
|
||||
echo "<h2><img src='$image'>".__("Add User Group", "mingleforum")."</h2>";
|
||||
echo '<form id="usergroupadd" name="usergroupadd" method="post" action="">';
|
||||
if (function_exists('wp_nonce_field'))
|
||||
wp_nonce_field('mingleforum-add_usergroup');
|
||||
echo "<table class='widefat'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr class='alternate'>
|
||||
<td><input type='text' value='' name='group_name' /></td>
|
||||
<td><input type='text' value='' name='group_description' /></td>
|
||||
</tr>
|
||||
<tr class='alternate'>
|
||||
<td colspan='2'><input class='button' type='submit' name='add_usergroup' value='".__("Save user group", "mingleforum")."'/></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
</div>";
|
||||
/*********************************************************************/
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>Nice TRY!</p>';
|
||||
}
|
41
fs-admin/wpf-addusers.php
Normal file
41
fs-admin/wpf-addusers.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
if(function_exists('home_url'))
|
||||
{
|
||||
global $mingleforum;
|
||||
$usergroups = $mingleforum->get_usergroups();
|
||||
$image = WPFURL."images/user.png";
|
||||
|
||||
echo "<div class='wrap'>
|
||||
<h2><img src='$image'>".__("Add users", "mingleforum")."</h2>";
|
||||
echo "<form name='add_usertogroup_form' action='admin.php?page=mfgroups&mingleforum_action=usergroups' method='post'>
|
||||
<table class='widefat'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User names </th>
|
||||
<th>User group</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr class='alternate'>
|
||||
<td><textarea name='togroupusers' ".ADMIN_ROW_COL."></textarea><br/>
|
||||
<i>separate user names by comma sign</i></td>
|
||||
<td>"; echo "<select name='usergroup'>
|
||||
<option selected='selected' value='add_user_null'>".__("Select User group", "mingleforum")."
|
||||
</option>";
|
||||
|
||||
foreach($usergroups as $usergroup){
|
||||
echo "<option value='$usergroup->id'>
|
||||
$usergroup->name</option>";
|
||||
}
|
||||
echo "</select></td>
|
||||
</tr>
|
||||
<tr class='alternate'>
|
||||
<td colspan='2'><input class='button' name='add_user_togroup' type='submit' value='".__("Add users", "mingleforum")."' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>Nice TRY!</p>';
|
||||
}
|
143
fs-admin/wpf-edit-forum-group.php
Normal file
143
fs-admin/wpf-edit-forum-group.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
if(function_exists('home_url'))
|
||||
{
|
||||
if(isset($_POST['edit_save_group'])){
|
||||
global $wpdb, $table_prefix;
|
||||
$usergroups = isset($_POST['usergroups'])?$_POST['usergroups']:"";
|
||||
$usercanpost = isset($_POST['usercanpost'])?$_POST['usercanpost']:"";
|
||||
$edit_group_name = isset($_POST['edit_group_name'])?$wpdb->escape($_POST['edit_group_name']):"";
|
||||
$edit_group_description = isset($_POST['edit_group_description'])?$wpdb->escape($_POST['edit_group_description']):"";
|
||||
$edit_group_id = isset($_POST['edit_group_id'])?$_POST['edit_group_id']:"";
|
||||
|
||||
if($_POST['edit_group_name'] == "")
|
||||
echo "<div id='message' class='updated fade'><p>".__("You must specify a forum name", "mingleforum")."</p></div>";
|
||||
|
||||
global $wpdb, $table_prefix;
|
||||
$wpdb->query("UPDATE ".$table_prefix."forum_forums SET name = '$edit_group_name', description = '$edit_group_description' WHERE id = $edit_group_id" );
|
||||
|
||||
$this->update_usergroups($usergroups, $edit_group_id);
|
||||
$this->update_usercanpost($usercanpost, $edit_group_id);
|
||||
echo "<div id='message' class='updated fade'><p>".__("Forum updated successfully", "mingleforum")."</p></div>";
|
||||
}
|
||||
|
||||
if(($_GET['do'] == "editgroup") && (!isset($_POST['edit_save_group']))){
|
||||
$gr_id = (is_numeric($_GET['groupid']))?$_GET['groupid']:0;
|
||||
global $mingleforum;
|
||||
$usergroups = $mingleforum->get_usergroups();
|
||||
$usergroups_with_access = $this->get_usersgroups_with_access_to_group($gr_id);
|
||||
$usergroups_can_post = $this->get_usersgroups_with_access_to_post($gr_id);
|
||||
$group_name = stripslashes($mingleforum->get_groupname($gr_id));
|
||||
global $wpdb, $table_prefix;
|
||||
|
||||
echo "<h2>".__("Edit forum", "mingleforum")." \"$group_name\"</h2>";
|
||||
|
||||
echo "<form name='edit_group_form' method='post' action=''>";
|
||||
|
||||
echo "<table class='form-table'>
|
||||
<tr>
|
||||
<th>".__("Name:", "mingleforum")."</th>
|
||||
<td><input type='text' value='$group_name' name='edit_group_name' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>".__("Description", "mingleforum")."</th>
|
||||
<td><textarea name='edit_group_description' ".ADMIN_ROW_COL.">".stripslashes($mingleforum->get_group_description($gr_id))."</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>".__("User Groups:", "mingleforum")."</th>
|
||||
<td>";
|
||||
|
||||
echo "<strong>".__("Members of the checked User Groups have access to the forums in this category:", "mingleforum")."</strong> ";
|
||||
if($usergroups){
|
||||
$i = 0;
|
||||
echo "<table class='wpf-wide'>";
|
||||
echo "<tr>";
|
||||
|
||||
foreach($usergroups as $usergroup){
|
||||
$col = 4;
|
||||
if($mingleforum->array_search($usergroup->id, $usergroups_with_access))
|
||||
$checked = "checked='checked'";
|
||||
else
|
||||
$checked = "";
|
||||
$e = "<p><input type='checkbox' $checked name='usergroups[]' value='$usergroup->id'/> ".stripslashes($usergroup->name)."</p>\n\r";
|
||||
|
||||
if($i == 0){
|
||||
echo "<td>$e";
|
||||
++$i;
|
||||
}
|
||||
elseif($i < $col){
|
||||
echo "$e";
|
||||
++$i;
|
||||
}
|
||||
else{
|
||||
echo "$e</td>";
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
}
|
||||
echo "</tr></table>";
|
||||
}
|
||||
|
||||
else
|
||||
echo __("There are no User Groups", "mingleforum");
|
||||
|
||||
|
||||
echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>".__("User Groups:", "mingleforum")."</th>
|
||||
<td>";
|
||||
|
||||
echo "<strong>".__("Members of the checked User Groups can post to the forums in this category:", "mingleforum")."</strong> ";
|
||||
if($usergroups){
|
||||
$i = 0;
|
||||
echo "<table class='wpf-wide'>";
|
||||
echo "<tr>";
|
||||
|
||||
foreach($usergroups as $usergroup){
|
||||
$col = 4;
|
||||
$checked = "";
|
||||
if($mingleforum->array_search($usergroup->id, $usergroups_can_post))
|
||||
$checked = "checked='checked'";
|
||||
$e = "<p><input type='checkbox' $checked name='usercanpost[]' value='$usergroup->id'/> ".stripslashes($usergroup->name)."</p>\n\r";
|
||||
|
||||
if($i == 0){
|
||||
echo "<td>$e";
|
||||
++$i;
|
||||
}
|
||||
elseif($i < $col){
|
||||
echo "$e";
|
||||
++$i;
|
||||
}
|
||||
else{
|
||||
echo "$e</td>";
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
}
|
||||
echo "</tr></table>";
|
||||
}
|
||||
|
||||
else
|
||||
echo __("There are no User Groups", "mingleforum");
|
||||
|
||||
|
||||
echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><input type='submit' name='edit_save_group' value='".__("Save forum", "mingleforum")."' /></td>
|
||||
</tr>
|
||||
|
||||
<input type='hidden' name='edit_group_id' value='".$gr_id."' />";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>Nice TRY!</p>';
|
||||
}
|
43
fs-admin/wpf-moderator.php
Normal file
43
fs-admin/wpf-moderator.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
if(function_exists('home_url'))
|
||||
{
|
||||
global $mingleforum;
|
||||
$users = $mingleforum->get_users();
|
||||
$groups = $mingleforum->get_forums();
|
||||
$image = WPFURL."images/user.png";
|
||||
echo "<h2><img src='$image'>".__("Add moderator", "mingleforum")."</h2>
|
||||
<form name='add_mod_form' method='post' action='admin.php?page=mfmods&mingleforum_action=moderators'>
|
||||
<table class='widefat'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Moderate</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<select name='addmod_user_id'><option selected='selected' value='add_mod_null'>".__("Select user", "mingleforum")."</option>";
|
||||
foreach($users as $user)
|
||||
echo "<option value='$user->ID'>$user->user_login ($user->ID)</option>";
|
||||
echo "</select>";
|
||||
echo "</td>
|
||||
<td>";
|
||||
echo "<p class='wpf-alignright'><input type='checkbox' id='mod_global' name='mod_global' onclick='invertAll(this, this.form, \"mod_forum_id\");' value='true' /> <strong>".__("Global moderator: (User can moderate all forums)", "mingleforum")."</strong></p>";
|
||||
foreach($groups as $group){
|
||||
$forums = $mingleforum->get_forums($group->id);
|
||||
echo "<p class='wpf-bordertop'><strong>".stripslashes($group->name)."</strong></p>";
|
||||
foreach($forums as $forum){
|
||||
echo "<p class='wpf-indent'><input type='checkbox' name='mod_forum_id[]' onclick='uncheckglobal(this, this.form);' id='mod_forum_id' value='$forum->id' /> $forum->name</p>";
|
||||
}
|
||||
}
|
||||
echo "</td></tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<span style='float:left'><input class='button' type='submit' name='add_mod_submit' value='".__("Add moderator", "mingleforum")."' /></span><span class='button' style='float:right'><a href='http://cartpauj.com' target='_blank'>cartpauj.com</a></span></td>
|
||||
</tr>
|
||||
</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>Nice TRY!</p>';
|
||||
}
|
52
fs-admin/wpf-usergroup-edit.php
Normal file
52
fs-admin/wpf-usergroup-edit.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
if(function_exists('home_url'))
|
||||
{
|
||||
if(isset($_POST['edit_usergroup_submit'])){
|
||||
global $wpdb, $table_prefix;
|
||||
$edit_usergroup_name = $wpdb->escape($_POST['edit_usergroup_name']);
|
||||
$edit_usergroup_description = $wpdb->escape($_POST['edit_usergroup_description']);
|
||||
$edit_usergroup_id = $wpdb->escape($_POST['edit_usergroup_id']);
|
||||
|
||||
if(!$edit_usergroup_name)
|
||||
echo "<div id='message' class='updated fade'><p>".__("You must specify a name for the User Group", "mingleforum")."</p></div>";
|
||||
|
||||
else if($wpdb->get_var("SELECT id FROM ".$table_prefix."forum_usergroups WHERE name = '$edit_usergroup_name' AND id <> $edit_usergroup_id"))
|
||||
echo "<div id='message' class='updated fade'><p>".__("You have choosen a name that already exists in the database, please specify another", "mingleforum")."</p></div>";
|
||||
|
||||
else{
|
||||
$wpdb->query("UPDATE ".$table_prefix."forum_usergroups SET name = '$edit_usergroup_name', description = '$edit_usergroup_description' WHERE id = $edit_usergroup_id" );
|
||||
echo "<div id='message' class='updated fade'><p>".__("User Group updated successfully", "mingleforum")."</p></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else{
|
||||
$ug_id = (is_numeric($_GET['usergroup_id']))?$_GET['usergroup_id']:0;
|
||||
global $mingleforum;
|
||||
$name = $mingleforum->get_usergroup_name($ug_id);
|
||||
echo "<h2>".__("Edit User Group", "mingleforum"). " \"$name\"</h2>";
|
||||
echo "<form name='edit_usergroup_form' action='' method='post'>";
|
||||
|
||||
echo "<table class='form-table'>
|
||||
<tr>
|
||||
<th>".__("Name:", "mingleforum")."</th>
|
||||
<td><input type='' value='$name' name='edit_usergroup_name' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>".__("Description:", "mingleforum")."</th>
|
||||
<td><textarea name='edit_usergroup_description' ".ADMIN_ROW_COL.">".$mingleforum->get_usergroup_description($ug_id)."</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><input type='submit' name='edit_usergroup_submit' value='".__("Save User Group", "mingleforum")."'</td>
|
||||
</tr>
|
||||
|
||||
<input type='hidden' value='{$ug_id}' name='edit_usergroup_id' />";
|
||||
echo "</table></form>";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>Nice TRY!</p>';
|
||||
}
|
1533
i18n/Template.pot
Normal file
1533
i18n/Template.pot
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-ar.mo
Normal file
BIN
i18n/mingleforum-ar.mo
Normal file
Binary file not shown.
1927
i18n/mingleforum-ar.po
Normal file
1927
i18n/mingleforum-ar.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-bg_BG.mo
Normal file
BIN
i18n/mingleforum-bg_BG.mo
Normal file
Binary file not shown.
1765
i18n/mingleforum-bg_BG.po
Normal file
1765
i18n/mingleforum-bg_BG.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-cs_CZ.mo
Normal file
BIN
i18n/mingleforum-cs_CZ.mo
Normal file
Binary file not shown.
1718
i18n/mingleforum-cs_CZ.po
Normal file
1718
i18n/mingleforum-cs_CZ.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-da_DK.mo
Normal file
BIN
i18n/mingleforum-da_DK.mo
Normal file
Binary file not shown.
1615
i18n/mingleforum-da_DK.po
Normal file
1615
i18n/mingleforum-da_DK.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-de_DE.mo
Normal file
BIN
i18n/mingleforum-de_DE.mo
Normal file
Binary file not shown.
1797
i18n/mingleforum-de_DE.po
Normal file
1797
i18n/mingleforum-de_DE.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-es_ES.mo
Normal file
BIN
i18n/mingleforum-es_ES.mo
Normal file
Binary file not shown.
1790
i18n/mingleforum-es_ES.po
Normal file
1790
i18n/mingleforum-es_ES.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-et.mo
Normal file
BIN
i18n/mingleforum-et.mo
Normal file
Binary file not shown.
1582
i18n/mingleforum-et.po
Normal file
1582
i18n/mingleforum-et.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-fa_IR.mo
Normal file
BIN
i18n/mingleforum-fa_IR.mo
Normal file
Binary file not shown.
1819
i18n/mingleforum-fa_IR.po
Normal file
1819
i18n/mingleforum-fa_IR.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-fi.mo
Normal file
BIN
i18n/mingleforum-fi.mo
Normal file
Binary file not shown.
1739
i18n/mingleforum-fi.po
Normal file
1739
i18n/mingleforum-fi.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-fi_FI.mo
Normal file
BIN
i18n/mingleforum-fi_FI.mo
Normal file
Binary file not shown.
1739
i18n/mingleforum-fi_FI.po
Normal file
1739
i18n/mingleforum-fi_FI.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-fr_FR.mo
Normal file
BIN
i18n/mingleforum-fr_FR.mo
Normal file
Binary file not shown.
1411
i18n/mingleforum-fr_FR.po
Normal file
1411
i18n/mingleforum-fr_FR.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-ge_GE.mo
Normal file
BIN
i18n/mingleforum-ge_GE.mo
Normal file
Binary file not shown.
1761
i18n/mingleforum-ge_GE.po
Normal file
1761
i18n/mingleforum-ge_GE.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-he_IL.mo
Normal file
BIN
i18n/mingleforum-he_IL.mo
Normal file
Binary file not shown.
1596
i18n/mingleforum-he_IL.po
Normal file
1596
i18n/mingleforum-he_IL.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-hr.mo
Normal file
BIN
i18n/mingleforum-hr.mo
Normal file
Binary file not shown.
1756
i18n/mingleforum-hr.po
Normal file
1756
i18n/mingleforum-hr.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-hu_HU.mo
Normal file
BIN
i18n/mingleforum-hu_HU.mo
Normal file
Binary file not shown.
1912
i18n/mingleforum-hu_HU.po
Normal file
1912
i18n/mingleforum-hu_HU.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-id_ID.mo
Normal file
BIN
i18n/mingleforum-id_ID.mo
Normal file
Binary file not shown.
1594
i18n/mingleforum-id_ID.po
Normal file
1594
i18n/mingleforum-id_ID.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-it_IT.mo
Normal file
BIN
i18n/mingleforum-it_IT.mo
Normal file
Binary file not shown.
1564
i18n/mingleforum-it_IT.po
Normal file
1564
i18n/mingleforum-it_IT.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-ja.mo
Normal file
BIN
i18n/mingleforum-ja.mo
Normal file
Binary file not shown.
1904
i18n/mingleforum-ja.po
Normal file
1904
i18n/mingleforum-ja.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-lv.mo
Normal file
BIN
i18n/mingleforum-lv.mo
Normal file
Binary file not shown.
1593
i18n/mingleforum-lv.po
Normal file
1593
i18n/mingleforum-lv.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-nb_NO.mo
Normal file
BIN
i18n/mingleforum-nb_NO.mo
Normal file
Binary file not shown.
1577
i18n/mingleforum-nb_NO.po
Normal file
1577
i18n/mingleforum-nb_NO.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-nl_NL.mo
Normal file
BIN
i18n/mingleforum-nl_NL.mo
Normal file
Binary file not shown.
1804
i18n/mingleforum-nl_NL.po
Normal file
1804
i18n/mingleforum-nl_NL.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-pl_PL.mo
Normal file
BIN
i18n/mingleforum-pl_PL.mo
Normal file
Binary file not shown.
1719
i18n/mingleforum-pl_PL.po
Normal file
1719
i18n/mingleforum-pl_PL.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-pt_BR.mo
Normal file
BIN
i18n/mingleforum-pt_BR.mo
Normal file
Binary file not shown.
1591
i18n/mingleforum-pt_BR.po
Normal file
1591
i18n/mingleforum-pt_BR.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-ro_RO.mo
Normal file
BIN
i18n/mingleforum-ro_RO.mo
Normal file
Binary file not shown.
1566
i18n/mingleforum-ro_RO.po
Normal file
1566
i18n/mingleforum-ro_RO.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-ru_RU.mo
Normal file
BIN
i18n/mingleforum-ru_RU.mo
Normal file
Binary file not shown.
1767
i18n/mingleforum-ru_RU.po
Normal file
1767
i18n/mingleforum-ru_RU.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-sk_SK.mo
Normal file
BIN
i18n/mingleforum-sk_SK.mo
Normal file
Binary file not shown.
1667
i18n/mingleforum-sk_SK.po
Normal file
1667
i18n/mingleforum-sk_SK.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-sl_SI.mo
Normal file
BIN
i18n/mingleforum-sl_SI.mo
Normal file
Binary file not shown.
1583
i18n/mingleforum-sl_SI.po
Normal file
1583
i18n/mingleforum-sl_SI.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-sv_SE.mo
Normal file
BIN
i18n/mingleforum-sv_SE.mo
Normal file
Binary file not shown.
1770
i18n/mingleforum-sv_SE.po
Normal file
1770
i18n/mingleforum-sv_SE.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-th.mo
Normal file
BIN
i18n/mingleforum-th.mo
Normal file
Binary file not shown.
1717
i18n/mingleforum-th.po
Normal file
1717
i18n/mingleforum-th.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-tr_TR.mo
Normal file
BIN
i18n/mingleforum-tr_TR.mo
Normal file
Binary file not shown.
1613
i18n/mingleforum-tr_TR.po
Normal file
1613
i18n/mingleforum-tr_TR.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-zh_CN.mo
Normal file
BIN
i18n/mingleforum-zh_CN.mo
Normal file
Binary file not shown.
1761
i18n/mingleforum-zh_CN.po
Normal file
1761
i18n/mingleforum-zh_CN.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
i18n/mingleforum-zh_TW.mo
Normal file
BIN
i18n/mingleforum-zh_TW.mo
Normal file
Binary file not shown.
1771
i18n/mingleforum-zh_TW.po
Normal file
1771
i18n/mingleforum-zh_TW.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
images/chart.png
Normal file
BIN
images/chart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
images/closed.gif
Normal file
BIN
images/closed.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
images/logo.png
Normal file
BIN
images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
images/logomain.png
Normal file
BIN
images/logomain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
images/table.png
Normal file
BIN
images/table.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
images/user.png
Normal file
BIN
images/user.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
285
js/plugins/bbcodev2/editor_plugin_src.js
Normal file
285
js/plugins/bbcodev2/editor_plugin_src.js
Normal file
@ -0,0 +1,285 @@
|
||||
|
||||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @id Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
// URL : http://support.utiliweb.fr/handlers/tiny_mce/plugins/bbcodev2/editor_plugin_src.js
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodev2Plugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
if (o.get)
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
|
||||
function replaceContent(component, tag) {
|
||||
var cm = ed.controlManager.get(component);
|
||||
if (ed.selection.getContent() !== '') {
|
||||
ed.selection.setContent('[' + tag + ']' + ed.selection.getContent() + '[/' + tag + ']');
|
||||
} else if (cm.isActive()) {
|
||||
ed.selection.setContent('[/' + tag + ']');
|
||||
cm.setActive(false);
|
||||
} else {
|
||||
ed.selection.setContent('[' + tag + ']');
|
||||
cm.setActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
ed.addCommand('preCmd', function () {
|
||||
replaceContent('pre', 'code');
|
||||
});
|
||||
ed.addCommand('ytCmd', function () {
|
||||
replaceContent('yt', 'yt');
|
||||
});
|
||||
ed.addCommand('mapCmd', function () {
|
||||
replaceContent('map', 'map');
|
||||
});
|
||||
ed.addCommand('spoilCmd', function () {
|
||||
replaceContent('spoil', 'spoiler');
|
||||
});
|
||||
|
||||
ed.addCommand('linkCmd', function () {
|
||||
var entry = prompt();
|
||||
if (entry)
|
||||
ed.selection.setContent('<a href="' + entry + '">' + ed.selection.getContent() + '</a>');
|
||||
});
|
||||
|
||||
ed.addCommand('imageCmd', function () {
|
||||
var entry = prompt();
|
||||
if (entry)
|
||||
ed.selection.setContent('<img src="' + entry + '" style="max-width:100%" />');
|
||||
});
|
||||
|
||||
ed.onInit.add(function (ed) {
|
||||
var cm = ed.controlManager;
|
||||
if (cm.get('pre'))
|
||||
cm.get('pre').settings.cmd = 'preCmd';
|
||||
if (cm.get('yt'))
|
||||
cm.get('yt').settings.cmd = 'ytCmd';
|
||||
if (cm.get('map'))
|
||||
cm.get('map').settings.cmd = 'mapCmd';
|
||||
if (cm.get('link'))
|
||||
cm.get('link').settings.cmd = 'linkCmd';
|
||||
if (cm.get('image'))
|
||||
cm.get('image').settings.cmd = 'imageCmd';
|
||||
if (cm.get('spoil'))
|
||||
cm.get('spoil').settings.cmd = 'spoilCmd';
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCodev2 Plugin',
|
||||
id : 'Moxiecode Systems AB',
|
||||
idurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcodev2',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in PunBB dialect
|
||||
_punbb_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
|
||||
// example: <strong> to [b]
|
||||
rep(/<p class=\"codeStyle\">(.*?)<\/p>/gi,"[code]$1[/code]");
|
||||
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code]$1[/code]");
|
||||
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code]$1[/code]");
|
||||
|
||||
rep(/<a target=\"_blank\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[link=$1]$2[/link]");
|
||||
rep(/<a target=\"_self\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<a href=\"([^"]*)\">(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<a href=\"([^"]*)\" target=\"_blank\">(.*?)<\/a>/gi,"[link=$1]$2[/link]");
|
||||
rep(/<a href=\"([^"]*)\" target=\"_self\">(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
|
||||
|
||||
|
||||
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[blockquote][color=$1]$2[/color][/blockquote]");
|
||||
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[blockquote][color=$1]$2[/color][/blockquote]");
|
||||
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<span style=\"font-size: (.*?)px;\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
rep(/<img class=\"normal\" src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
rep(/<img class=\"miniature\" src=\"(.*?)\".*?\/>/gi,"[img=miniature]$1[/img]");
|
||||
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
|
||||
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[blockquote]$1[/blockquote]");
|
||||
rep(/<span class=\"quoteStyle\" id=\"(.*?)\">(.*?)<\/span>/gi,"[quote=$1]$2[/quote]");
|
||||
rep(/<span id=\"(.*?)\" class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote=$1]$2[/quote]");
|
||||
rep(/<span class=\"hideStyle\">(.*?)<\/span>/gi,"[hide]$1[/hide]");
|
||||
rep(/<p class=\"quoteStyle\">(.*?)<\/p>/gi,"[blockquote]$1[/blockquote]");
|
||||
rep(/<p class=\"hideStyle\">(.*?)<\/p>/gi,"[hide]$1[/hide]");
|
||||
rep(/<p id=\"(.*?)\" class=\"quoteStyle\">(.*?)<\/p>/gi,"[quote=$1]$2[/quote]");
|
||||
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[blockquote]$1[/blockquote]");
|
||||
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
|
||||
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
|
||||
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
|
||||
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
|
||||
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<div class=\"youtube\" title=\"(.*?)\">.*?<\/div>/gi,"[video=youtube]$1[/video]");
|
||||
rep(/<div class=\"dailymotion\" title=\"(.*?)\">.*?<\/div>/gi,"[video=dailymotion]$1[/video]");
|
||||
rep(/<div class=\"veoh\" title=\"(.*?)\">.*?<\/div>/gi,"[video=veoh]$1[/video]");
|
||||
rep(/<div class=\"vimeo\" title=\"(.*?)\">.*?<\/div>/gi,"[video=vimeo]$1[/video]");
|
||||
rep(/<div class=\"jiwa\" title=\"(.*?)\">.*?<\/div>/gi,"[video=jiwa]$1[/video]");
|
||||
rep(/<div class=\"deezer\" title=\"(.*?)\">.*?<\/div>/gi,"[deezer]$1[/deezer]");
|
||||
rep(/<div class=\"picasa\" title=\"(.*?)\">.*?<\/div>/gi,"[picasa]$1[/picasa]");
|
||||
rep(/<span style=\"text-decoration: line-through;\">(.*?)<\/span>/gi,"[no]$1[/no]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<p style=\"text-align: center;\"><\/p>/gi,"\n");
|
||||
rep(/<p style=\"text-align: left;\"><\/p>/gi,"\n");
|
||||
rep(/<p style=\"text-align: right;\"><\/p>/gi,"\n");
|
||||
rep(/<p style=\"text-align: justify;\"><\/p>/gi,"\n");
|
||||
rep(/<p style=\"text-align: (.*?);\">(.*?)<\/p>/gi,"[$1]$2[/$1]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
|
||||
//listes
|
||||
rep(/<ul[^>]*>(.*?)<\/ul>/gi,"[list]$1[/list]");
|
||||
rep(/<ol style="list-style-type: lower-alpha;">(.*?)<\/ol>/gi,"[list=lower-alpha]$1[/list]");
|
||||
rep(/<ol[^>]*>(.*?)<\/ol>/gi,"[list=decimal]$1[/list]");
|
||||
rep(/<li>(.*?)<\/li>/gi,"[*]$1\n");
|
||||
|
||||
|
||||
//tableaux
|
||||
rep(/<table.*?><tbody.*?>(.*?)<\/tbody><\/table>/gi,"[tableau]$1[/tableau]");
|
||||
rep(/<table.*?>(.*?)<\/table>/gi,"[tableau]$1[/tableau]");
|
||||
rep(/<tr.*?><td.*?>/gi,"[ligne]");
|
||||
rep(/<\/td><\/tr>/gi,"[/ligne]");
|
||||
rep(/<\/td><td.*?>/gi,"[|]");
|
||||
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<p.*?>/gi,"");
|
||||
rep(/<\/p>/gi,"<br \/>");
|
||||
rep(/<br \/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<span style=\"color: (.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<span style=\"color: (.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<span style=\"color: (.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<span style=\"font-size: (.*?)px;\">(.*?)<\/span>/gi,"[size=$1]$2[\/size]");
|
||||
rep(/<span style=\"font-size: (.*?)px;\">(.*?)<\/span>/gi,"[size=$1]$2[\/size]");
|
||||
rep(/<span style=\"font-size: (.*?)px;\">(.*?)<\/span>/gi,"[size=$1]$2[\/size]");
|
||||
rep(/<\!--.*?-->/gi,"");
|
||||
rep(/<\/span>/gi,"");
|
||||
rep(/<span.*?>/gi,"");
|
||||
rep(/<div.*?>/gi,"");
|
||||
rep(/<\/div>/gi,"");
|
||||
rep(/<tr.*?>/gi,"");
|
||||
rep(/<\/tr>/gi,"");
|
||||
rep(/<\/table>/gi,"");
|
||||
rep(/<table.*?>/gi,"");
|
||||
rep(/<\/tbody>/gi,"");
|
||||
rep(/<tbody.*?>/gi,"");
|
||||
rep(/<td.*?>/gi,"");
|
||||
rep(/<\/td>/gi,"");
|
||||
rep(/ /gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from PunBB dialect
|
||||
_punbb_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
|
||||
// example: [b] to <strong>
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"<p class=\"codeStyle\">$1</p>");
|
||||
rep(/\n\n/g, "<p><\/p>");
|
||||