2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
2013-05-20 17:25:44 -07:00
|
|
|
/**
|
2009-11-12 15:11:17 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2009-11-18 01:06:08 +00:00
|
|
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
2009-11-12 15:11:17 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
2013-05-20 17:25:44 -07:00
|
|
|
* @DEPRECATED FILE
|
2009-11-12 15:11:17 +00:00
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
|
2012-06-02 08:12:16 +00:00
|
|
|
// IMPORTANT : Entire file is deprecated. see: bbcode_shortcodes.php and bbcode_hanlder.php
|
|
|
|
// Left in place only for BC.
|
2013-05-20 17:25:44 -07:00
|
|
|
/**
|
2020-12-21 10:00:28 -08:00
|
|
|
* @deprecated use $frm->bbarea() instead.
|
2013-05-20 17:25:44 -07:00
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
function ren_help($mode = 1, $addtextfunc = "addtext", $helpfunc = "help")
|
|
|
|
{
|
|
|
|
// ren_help() is deprecated - use display_help().
|
|
|
|
return display_help("helpb", $mode, $addtextfunc, $helpfunc = "help");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-02 08:24:56 +00:00
|
|
|
// DONE - full rewrite, EVERYTHING - bbcode class (php + JS), core callbacks, tooltip help, optimize
|
2013-04-24 03:53:02 -07:00
|
|
|
/**
|
|
|
|
* @DEPRECATED use $frm->bbarea() instead.
|
|
|
|
*/
|
2009-09-19 15:21:51 +00:00
|
|
|
function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $helpfunc = "help", $helpsize = '')
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2012-06-02 08:12:16 +00:00
|
|
|
|
2013-04-24 03:53:02 -07:00
|
|
|
$options = array('trigger' => $addtextfunc );
|
2012-06-02 08:12:16 +00:00
|
|
|
|
2013-04-24 03:53:02 -07:00
|
|
|
return e107::getBB()->renderButtons($mode,'data',$options); // guessing the name of the textarea as 'data' no indicator unfortunately.
|
|
|
|
// may cause pre-image and pre-file selector issues.
|
2012-06-02 08:12:16 +00:00
|
|
|
|
2013-04-24 03:53:02 -07:00
|
|
|
|
2011-05-10 12:47:03 +00:00
|
|
|
// if(defsettrue('e_WYSIWYG')) { return; }
|
2013-04-24 03:53:02 -07:00
|
|
|
|
|
|
|
/*
|
2009-09-19 15:21:51 +00:00
|
|
|
global $tp, $pref, $eplug_bb, $bbcode_func, $register_bb, $bbcode_help, $bbcode_helpactive, $bbcode_helptag, $bbcode_helpsize;
|
|
|
|
$bbcode_helpsize = $helpsize;
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
$bbcode_func = $addtextfunc;
|
|
|
|
$bbcode_help = $helpfunc;
|
|
|
|
$bbcode_helptag = $tagid;
|
2012-05-28 13:06:09 +00:00
|
|
|
|
|
|
|
// $arr = get_defined_vars();
|
|
|
|
// print_a($arr);
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
// load the template
|
|
|
|
if(is_readable(THEME."bbcode_template.php"))
|
|
|
|
{
|
|
|
|
include(THEME."bbcode_template.php");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-03-20 23:50:30 -07:00
|
|
|
include(e_CORE."templates/bbcode_template.php");
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if($mode != 2 && $mode != "forum")
|
|
|
|
{
|
|
|
|
$bbcode_helpactive = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load the Plugin bbcode AFTER the templates, so they can modify or replace.
|
2008-11-08 17:24:37 +00:00
|
|
|
if (!empty($pref['e_bb_list']))
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2008-11-08 17:24:37 +00:00
|
|
|
foreach($pref['e_bb_list'] as $val)
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2008-11-08 17:24:37 +00:00
|
|
|
if(is_readable(e_PLUGIN.$val."/e_bb.php"))
|
|
|
|
{
|
|
|
|
require(e_PLUGIN.$val."/e_bb.php");
|
|
|
|
}
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-19 15:21:51 +00:00
|
|
|
$temp = array();
|
2006-12-02 04:36:16 +00:00
|
|
|
$temp['news'] = $BBCODE_TEMPLATE_NEWSPOST;
|
2009-01-07 15:40:06 +00:00
|
|
|
$temp['submitnews'] = $BBCODE_TEMPLATE_SUBMITNEWS;
|
2006-12-02 04:36:16 +00:00
|
|
|
$temp['extended'] = $BBCODE_TEMPLATE_NEWSPOST;
|
|
|
|
$temp['admin'] = $BBCODE_TEMPLATE_ADMIN;
|
2009-10-23 19:54:48 +00:00
|
|
|
$temp['mailout'] = $BBCODE_TEMPLATE_MAILOUT;
|
2011-05-05 11:30:00 +00:00
|
|
|
$temp['page'] = $BBCODE_TEMPLATE_CPAGE;
|
2006-12-02 04:36:16 +00:00
|
|
|
$temp['maintenance']= $BBCODE_TEMPLATE_ADMIN;
|
2012-06-02 08:12:16 +00:00
|
|
|
$temp['comment'] = $BBCODE_TEMPLATE;
|
|
|
|
$temp['signature'] = $BBCODE_TEMPLATE_SIGNATURE;
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-09-19 15:21:51 +00:00
|
|
|
if(isset($temp[$mode]))
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
|
|
|
$BBCODE_TEMPLATE = $temp[$mode];
|
|
|
|
}
|
2010-01-10 13:18:08 +00:00
|
|
|
|
2011-05-10 12:47:03 +00:00
|
|
|
$visible = deftrue('e_WYSIWYG') ? "style='display:none'" : "";
|
|
|
|
|
2010-02-10 21:53:56 +00:00
|
|
|
if(is_readable(e_CORE."shortcodes/batch/bbcode_shortcodes.php"))
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2012-05-28 13:06:09 +00:00
|
|
|
|
|
|
|
$sc = e107::getScBatch('bbcode');
|
|
|
|
|
|
|
|
if($tagid == 'data') // BC fix.
|
|
|
|
{
|
|
|
|
$tagid = 'data_';
|
|
|
|
}
|
|
|
|
|
|
|
|
$data = array(
|
|
|
|
'tagid' => $tagid,
|
|
|
|
'template' => $mode,
|
|
|
|
'trigger' => $addtextfunc,
|
|
|
|
'hint_func' => $helpfunc,
|
|
|
|
'hint_active' => $bbcode_helpactive,
|
|
|
|
'size' => $helpsize
|
|
|
|
);
|
|
|
|
|
2012-11-02 00:23:59 +00:00
|
|
|
$sc->setVars($data);
|
2012-05-28 13:06:09 +00:00
|
|
|
|
|
|
|
return "<div id='bbcode-panel-".$tagid."' class='mceToolbar bbcode-panel' {$visible}>".$tp->parseTemplate($BBCODE_TEMPLATE)."</div>";
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-10 21:53:56 +00:00
|
|
|
return "ERROR: ".e_CORE."shortcodes/batch/bbcode_shortcodes.php IS NOT READABLE.";
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
2013-04-24 03:53:02 -07:00
|
|
|
*/
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-04 10:54:24 -07:00
|
|
|
/**
|
|
|
|
* @param $formid
|
|
|
|
* @return string
|
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
function Size_Select($formid='size_selector') {
|
|
|
|
$text ="<!-- Start of Size selector -->
|
|
|
|
<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>";
|
|
|
|
$text .="<div style='position:absolute; bottom:30px; right:125px'>";
|
|
|
|
$text .= "<table class='fborder' style='background-color: #fff'>
|
|
|
|
<tr><td class='forumheader3'>
|
|
|
|
<select class='tbox' name='preimageselect' onchange=\"addtext(this.value); expandit('{$formid}')\">
|
|
|
|
<option value=''>".LANHELP_41."</option>";
|
|
|
|
|
|
|
|
$sizes = array(7,8,9,10,11,12,14,15,18,20,22,24,26,28,30,36);
|
|
|
|
foreach($sizes as $s){
|
|
|
|
$text .= "<option value='[size=".$s."][/size]'>".$s."px</option>\n";
|
|
|
|
}
|
|
|
|
$text .="</select></td></tr> \n </table></div>
|
|
|
|
</div>\n<!-- End of Size selector -->";
|
|
|
|
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-04 10:54:24 -07:00
|
|
|
/**
|
|
|
|
* @param $formid
|
|
|
|
* @return string
|
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
function Color_Select($formid='col_selector') {
|
|
|
|
|
|
|
|
$text = "<!-- Start of Color selector -->
|
2012-05-28 13:06:09 +00:00
|
|
|
<div style='width: 221px; position: absolute; left:340px; top:60px; margin-right:auto; margin-left:auto; display:none; z-index: 1000; id='{$formid}' onclick=\"expandit(this)\" >
|
|
|
|
<div style='border:1px solid black; position: absolute; top:30px; width: 221px; '>";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2022-03-31 08:24:34 -07:00
|
|
|
$text .= "<script>
|
2006-12-02 04:36:16 +00:00
|
|
|
//<![CDATA[
|
|
|
|
var maxtd = 18;
|
|
|
|
var maxtddiv = -1;
|
|
|
|
var coloursrgb = new Array('00', '33', '66', '99', 'cc', 'ff');
|
|
|
|
var coloursgrey = new Array('000000', '333333', '666666', '999999', 'cccccc', 'ffffff');
|
|
|
|
var colourssol = new Array('ff0000', '00ff00', '0000ff', 'ffff00', '00ffff', 'ff00ff');
|
|
|
|
var rowswitch = 0;
|
|
|
|
var rowline = '';
|
|
|
|
var rows1 = '';
|
|
|
|
var rows2 = '';
|
|
|
|
var notr = 0;
|
|
|
|
var tdblk = '<td style=\'background-color: #000000; cursor: default; height: 10px; width: 10px;\'><\/td>';
|
|
|
|
var g = 1;
|
|
|
|
var s = 0;
|
2007-08-16 19:30:49 +00:00
|
|
|
var i, j, k;
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
function td_render(color) {
|
|
|
|
return '<td style=\'background-color: #' + color + '; height: 10px; width: 10px;\' onmousedown=\"addtext(\'[color=#' + color + '][/color]\')\"><\/td>';
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i < coloursrgb.length; i++) {
|
|
|
|
for (j=0; j < coloursrgb.length; j++) {
|
|
|
|
for (k=0; k < coloursrgb.length; k++) {
|
|
|
|
maxtddiv++;
|
|
|
|
if (maxtddiv % maxtd == 0) {
|
|
|
|
if (rowswitch) {
|
|
|
|
if (notr < 5){
|
|
|
|
rows1 += '<\/tr><tr>' + td_render(coloursgrey[g]) + tdblk;
|
|
|
|
g++;
|
|
|
|
}
|
|
|
|
rowswitch = 0;
|
|
|
|
notr++;
|
|
|
|
}else{
|
|
|
|
rows2 += '<\/tr><tr>' + td_render(colourssol[s]) + tdblk;
|
|
|
|
s++;
|
|
|
|
rowswitch = 1;
|
|
|
|
}
|
|
|
|
maxtddiv = 0;
|
|
|
|
}
|
|
|
|
rowline = td_render(coloursrgb[j] + coloursrgb[k] + coloursrgb[i]);
|
|
|
|
if (rowswitch) {
|
|
|
|
rows1 += rowline;
|
|
|
|
}else{
|
|
|
|
rows2 += rowline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-05-17 20:15:04 +00:00
|
|
|
document.write('<table cellspacing=\'1\' cellpadding=\'0\' style=\'cursor: pointer; background-color: #000; width: 100%; border: 0px\'><tr>');
|
2006-12-02 04:36:16 +00:00
|
|
|
document.write(td_render(coloursgrey[0]) + tdblk + rows1 + rows2);
|
|
|
|
document.write('<\/tr><\/table>');
|
|
|
|
//]]>
|
|
|
|
</script>";
|
|
|
|
|
|
|
|
$text .="</div>
|
|
|
|
</div>
|
|
|
|
<!-- End of Color selector -->";
|
|
|
|
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-04 10:54:24 -07:00
|
|
|
/**
|
|
|
|
* @param $formid
|
|
|
|
* @return string
|
|
|
|
*/
|
2011-05-05 11:30:00 +00:00
|
|
|
function PreImage_Select($formid='preimage_selector')
|
|
|
|
{
|
|
|
|
global $bbcode_imagedir;
|
|
|
|
|
|
|
|
$med = e107::getMedia();
|
|
|
|
|
|
|
|
$text ="<!-- Start of PreImage selector -->";
|
|
|
|
|
|
|
|
$text .= $med->imageSelect($bbcode_imagedir,$formid);
|
|
|
|
|
|
|
|
return $text;
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
2009-12-07 20:48:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Parameter '$bbcode_filedir' removed - not used in code.
|
2022-04-04 10:54:24 -07:00
|
|
|
/**
|
|
|
|
* @param $formid
|
|
|
|
* @return string
|
|
|
|
*/
|
2010-02-10 21:53:56 +00:00
|
|
|
function PreFile_Select($formid='prefile_selector')
|
2009-12-07 20:48:04 +00:00
|
|
|
{
|
2006-12-02 04:36:16 +00:00
|
|
|
require_once(e_HANDLER."userclass_class.php");
|
2010-01-10 13:18:08 +00:00
|
|
|
global $IMAGES_DIRECTORY, $fl;
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2010-01-10 13:18:08 +00:00
|
|
|
$sql = e107::getDb();
|
2011-05-05 11:30:00 +00:00
|
|
|
$fl = e107::getFile();
|
|
|
|
|
2009-12-07 20:48:04 +00:00
|
|
|
$filelist = array();
|
|
|
|
$downloadList = array();
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
|
2009-12-07 20:48:04 +00:00
|
|
|
$tmp = $fl->get_files(e_FILE.'downloads/');
|
|
|
|
foreach($tmp as $value)
|
|
|
|
{
|
|
|
|
if(!in_array($value['fname'], $downloadList))
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2009-12-07 20:48:04 +00:00
|
|
|
$filelist[] = array('id' => 0, 'name' => $value['fname'], 'url' => $value['fname']);
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
2009-12-07 20:48:04 +00:00
|
|
|
}
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
$text ="<!-- Start of PreFile selector -->
|
|
|
|
<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>";
|
|
|
|
$text .="<div style='position:absolute; bottom:30px; right:75px'>";
|
|
|
|
$text .= "<table class='fborder' style='background-color: #fff'>
|
|
|
|
<tr><td class='forumheader3' style='white-space: nowrap'>";
|
|
|
|
|
|
|
|
|
|
|
|
if(!count($filelist))
|
|
|
|
{
|
|
|
|
$text .= LANHELP_40;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$text .= "<select class='tbox' name='prefileselect' onchange=\"addtext(this.value); expandit('{$formid}')\">
|
|
|
|
<option value=''>".LANHELP_43."</option>";
|
|
|
|
foreach($filelist as $file)
|
|
|
|
{
|
2007-05-17 20:15:04 +00:00
|
|
|
if(isset($file['class']))
|
|
|
|
{
|
|
|
|
$ucinfo = "^".$file['class'];
|
|
|
|
$ucname = r_userclass_name($file['class']);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$ucinfo = "";
|
|
|
|
$ucname = r_userclass_name(0);
|
|
|
|
}
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2007-05-17 20:15:04 +00:00
|
|
|
if($file['id'])
|
|
|
|
{
|
2009-10-23 19:54:48 +00:00
|
|
|
$text .= "<option value=\"[file={e_BASE}request.php?".$file['id']."{$ucinfo}]".htmlspecialchars($file['name'])."[/file]\">".htmlspecialchars($file['name'])." - {$ucname}</option>\n";
|
2007-05-17 20:15:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-23 19:54:48 +00:00
|
|
|
$text .= "<option value=\"[file={e_BASE}request.php?".htmlspecialchars($file['url'])."{$ucinfo}]".htmlspecialchars($file['name'])."[/file]\">".htmlspecialchars($file['name'])." - {$ucname}</option>\n";
|
2007-05-17 20:15:04 +00:00
|
|
|
}
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
$text .="</select>";
|
|
|
|
}
|
|
|
|
|
|
|
|
$text .="</td></tr> \n </table></div>
|
|
|
|
</div>\n<!-- End of PreFile selector -->\n";
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
2022-04-04 10:54:24 -07:00
|
|
|
/**
|
|
|
|
* @param $formid
|
|
|
|
* @return string
|
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
function Emoticon_Select($formid='emoticon_selector') {
|
2013-05-20 17:10:38 -07:00
|
|
|
// require_once(e_HANDLER."emote.php");
|
2006-12-02 04:36:16 +00:00
|
|
|
$text ="<!-- Start of Emoticon selector -->
|
|
|
|
<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}' onclick=\"this.style.display='none'\" >
|
|
|
|
<div style='position:absolute; bottom:30px; right:75px; width:221px; height:133px; overflow:auto;'>
|
|
|
|
<table class='fborder' style='background-color:#fff;'>
|
|
|
|
<tr><td class='forumheader3'>
|
|
|
|
".r_emote()."
|
|
|
|
</td></tr></table>
|
|
|
|
</div>
|
|
|
|
</div>\n<!-- End of Emoticon selector -->\n";
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|