function display_blog_item($info) { global $locale, $blog_settings; add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "blog/templates/css/blog.css' type='text/css'>"); add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />"); add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>"); add_to_footer('<script type="text/javascript"> $(document).ready(function() { $(".blog-image-overlay").colorbox({ transition: "elasic", height:"100%", width:"100%", maxWidth:"98%", maxHeight:"98%", scrolling:false, overlayClose:true, close:false, photo:true, onComplete: function(result) { $("#colorbox").live("click", function(){ $(this).unbind("click"); $.fn.colorbox.close(); }); }, onLoad: function () { } }); }); </script>'); ob_start(); $data = $info['blog_item']; echo "<div class='clearfix'>\n\t\t\t\t<div class='btn-group pull-right'>\n\t\t\t\t<a class='btn btn-default btn-sm' href='" . $data['print_link'] . "'>" . $locale['print'] . "</a>"; if ($data['admin_link']) { $admin_actions = $data['admin_link']; echo "<a class='btn btn-default btn-sm' href='" . $admin_actions['edit'] . "'>" . $locale['edit'] . "</a>\n"; echo "<a class='btn btn-default btn-sm' href='" . $admin_actions['delete'] . "'>" . $locale['delete'] . "</a>\n"; } echo "</div>"; echo "<div class='overflow-hide'>\n\t\t\t\t<h2 class='strong m-t-0 m-b-0'>" . $data['blog_subject'] . "</h2>\n\t\t\t\t<div class='blog-category'>" . $data['blog_category_link'] . "</div>\n\t\t\t\t<div class='m-t-20 m-b-20'>" . $data['blog_post_author'] . " " . $data['blog_post_time'] . "</div>\n\t\t\t</div>\n\t\t</div>"; echo "<div class='clearfix m-b-20'>\n"; if ($data['blog_image']) { echo "<a class='m-10 " . $data['blog_ialign'] . " blog-image-overlay' href='" . $data['blog_image_link'] . "'>"; echo "<img class='img-responsive' src='" . $data['blog_image_link'] . "' alt='" . $data['blog_subject'] . "' style='padding:5px; max-height:" . $blog_settings['blog_photo_h'] . "px; overflow:hidden;' />\n </a>"; } echo parse_textarea($data['blog_extended'], FALSE, FALSE); echo "</div>\n"; if ($info['blog_nav']) { echo "<div class='clearfix m-b-20'>\n<div class='pull-right'>\n" . $info['blog_nav'] . "</div>\n</div>\n"; } echo "<div class='m-b-20 well'>" . $data['blog_author_info'] . "</div>"; if ($data['blog_allow_comments']) { echo "<hr /> " . showcomments("B", DB_BLOG, "blog_id", $_GET['readmore'], INFUSIONS . "blog/blog.php?readmore=" . $_GET['readmore']) . ""; } if ($data['blog_allow_ratings']) { echo "<hr /> " . showratings("B", $_GET['readmore'], INFUSIONS . "blog/blog.php?readmore=" . $_GET['readmore']) . ""; } $str = ob_get_contents(); ob_end_clean(); return $str; }
function form_fileinput($title = false, $input_name, $input_id, $upload_path, $input_value = false, $array = false) { $title = isset($title) && !empty($title) ? stripinput($title) : ""; $title2 = isset($title) && !empty($title) ? stripinput($title) : ucfirst(strtolower(str_replace("_", " ", $input_name))); $input_name = isset($input_name) && !empty($input_name) ? stripinput($input_name) : ""; // ok, start if (!defined('form_fileinput')) { add_to_head("<link href='" . DYNAMICS . "assets/fileinput/css/fileinput.min.css' media='all' rel='stylesheet' type='text/css' />"); add_to_footer("<script src='" . DYNAMICS . "assets/fileinput/js/fileinput.min.js' type='text/javascript'></script>"); define('form_fileinput', true); } // 4 choices to sub-array // a. icon, b. button, c.dropdown list d.dropdown with modal if (!is_array($array)) { $array = array(); $required = 0; $safemode = 1; $deactivate = ""; $width = ""; $label = 'Browse ...'; $class = 'btn btn-primary btn-sm'; $helper_text = ''; $inline = ''; $url = ''; $type = 'image'; $max_size = ''; } else { $deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : ""; $label = array_key_exists('label', $array) ? $array['label'] : 'Browse ...'; $class = array_key_exists('class', $array) ? $array['class'] : 'btn-primary'; $required = array_key_exists('required', $array) && $array['required'] == 1 ? '1' : '0'; $safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? '1' : '0'; $width = array_key_exists('width', $array) ? $array['width'] : ""; $helper_text = array_key_exists("helper", $array) ? $array['helper'] : ""; $inline = array_key_exists('rowstart', $array) ? 1 : 0; $url = array_key_exists('url', $array) ? $array['url'] : ''; // for ajax uplaod file path $type = array_key_exists('image', $array) && $array['image'] == 1 ? 'image' : 'files'; // image only or all mimes. $max_size = array_key_exists('max_size', $array) && $array['max_size'] ? $array['max_size'] : '3145728'; // defaults to 3mb } $html = ''; $html .= "<div id='{$input_id}-field' class='form-group m-b-0'>\n"; $html .= "<label class='control-label " . ($inline ? "col-sm-3 col-md-3 col-lg-3" : '') . "' for='{$input_id}'>{$title} " . ($required == 1 ? "<span class='required'>*</span>" : '') . "</label>\n"; $html .= $inline ? "<div class='col-sm-9 col-md-9 col-lg-9'>\n" : ""; $html .= "<input type='file' name='{$input_name}' id='{$input_id}' class='input-sm file-preview-image' >\n"; $html .= "<input type='hidden' name='def[{$input_name}]' value='[type={$type}],[title={$title2}],[id={$input_id}],[required={$required}],[safemode={$safemode}],[path={$upload_path}],[maxsize={$max_size}]' readonly>"; $html .= "<div id='{$input_id}-help'></div>"; $html .= $inline ? "</div>\n" : ""; $html .= "</div>\n"; add_to_jquery("\n \$('#" . $input_id . "').fileinput({\n previewFileType: 'any',\n browseClass: 'btn btn-sm {$class}',\n uploadClass: 'btn btn-default btn-sm',\n captionClass : 'input-sm',\n removeClass : 'btn btn-sm btn-default',\n browseLabel: '{$label}',\n browseIcon: '<i class=\"entypo cloud m-r-10\"></i>',\n " . ($url ? "uploadUrl : '{$url}'," : '') . "\n " . ($url ? '' : 'showUpload: false') . "\n });\n "); return $html; }
function fusion_console() { if (iADMIN && checkrights('ERRO') || iSUPERADMIN) { $error_logs = new \PHPFusion\ErrorLogs(); $error_logs->compressed = 1; if (!defined('no_debugger')) { ob_start(); echo openmodal('tbody', 'Error Console', array('class' => 'modal-lg modal-center zindex-boost', 'button_id' => 'turbo_debugger')); $error_logs->show_footer_logs(); echo closemodal(); add_to_footer(ob_get_contents()); ob_end_clean(); } } }
function openmodal($id, $title, $opts = FALSE) { if (!empty($opts)) { // trigger via button or via load. if (array_key_exists('button_id', $opts) && $opts['button_id']) { add_to_jquery("\r\n \$('#" . $opts['button_id'] . "').bind('click', function(e){\r\n \$('#" . $id . "-Modal').modal('show');\r\n });\r\n "); } else { add_to_jquery("\r\n \$('#" . $id . "-Modal').modal('show');\r\n "); } } else { add_to_footer("\r\n <script type='text/javascript'>\r\n \$('#" . $id . "-Modal').modal('show');\r\n </script>\r\n "); } $html = ''; $html .= "<div class='modal fade' id='{$id}-Modal' tabindex='-1' role='dialog' aria-labelledby='{$id}-ModalLabel' aria-hidden='true'>\n"; $html .= "<div class='modal-dialog modal-lg'>\n"; $html .= "<div class='modal-content'>\n"; $html .= "<div class='modal-header'>"; $html .= "<button type='button' class='btn btn-sm pull-right btn-default' data-dismiss='modal'><i class='entypo cross'></i> Close</button>\n"; $html .= "<h4 class='modal-title text-dark' id='myModalLabel'>{$title}</h4>\n"; $html .= "</div>\n"; $html .= "<div class='modal-body'>\n"; return $html; }
public function displayInput() { global $locale; $this->method = "input"; $enctype = $this->showAvatarInput ? " enctype='multipart/form-data'" : ""; $this->html .= openform($this->formname, $this->formname, 'post', $this->formaction, array('enctype' => "" . ($this->showAvatarInput ? 1 : 0) . "", 'downtime' => 0)); // table based for 7. div based for 8. // do skeleton if (!$this->registration) { $title = "General Account Settings"; $Output = $this->renderBasicInputFields(); if (isset($_GET['profiles'])) { if ($_GET['profiles'] == 'biography') { $title = "User Information Settings"; $Output = $this->renderFields(); } elseif ($_GET['profiles'] == 'avatar' && $this->showAvatarInput) { $title = "Avatar Settings"; $Output = $this->renderAvatarInput(); } else { $title = ucwords($_GET['profiles']) . " Settings"; // this need fix. $Output = $this->renderFields(); } } } else { $title = $locale['u101']; $Output = $this->renderBasicInputFields(); $Output .= $this->renderFields(); } $this->html .= "<div class='row m-b-20'>\n"; if (!$this->registration) { add_to_title("Edit Profile"); $this->html .= "<div class='col-xs-12 col-sm-3 col-md-2 col-lg-3 p-r-0'>\n"; $this->html .= "<ul id='profile-li'>\n"; $this->html .= "<li " . (!isset($_GET['profiles']) ? "class='active'" : '') . "><a href='" . FUSION_SELF . "'><i class='entypo cog m-r-10'></i>General</a></li>\n"; $this->html .= "<li " . (isset($_GET['profiles']) && $_GET['profiles'] == 'biography' ? "class='active'" : '') . "><a href='" . FUSION_SELF . "?profiles=biography'><i class='entypo lock m-r-10'></i>User Information</a></li>\n"; $this->html .= $this->showAvatarInput ? "<li " . (isset($_GET['profiles']) && $_GET['profiles'] == 'avatar' ? "class='active'" : '') . " style='border-bottom:1px solid #ccc;'><a href='" . FUSION_SELF . "?profiles=avatar'><i class='entypo picture m-r-10'></i>Profile Picture</a></li>\n" : ''; $this->html .= $this->renderPageLink(); $this->html .= "</ul>\n"; $this->html .= "</div>\n"; $this->html .= "<div class='col-xs-12 col-sm-9 col-md-10 col-lg-9' style='border-left:1px solid #ccc;'>\n"; } else { $this->html .= "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; } $this->html .= "<div class='panel panel-default' style='border:0px;'>\n"; $this->html .= "<div class='panel-body'>\n"; $this->html .= "<table cellpadding='0' cellspacing='0' class='table center edit-profile table-responsive'>\n"; $this->html .= $Output; $this->html .= "</table>\n"; if ($this->displayValidation == 1) { $this->renderValidation(); } if ($this->displayTerms == 1) { $this->renderTerms(); } $this->renderButton(); $this->html .= "</div></div>\n"; $this->html .= "</div></div>\n"; $this->html .= "</table>\n</form>\n"; $this->js .= "<script type='text/javascript'>\n"; $this->js .= "/*<![CDATA[*/\n"; $this->js .= "\tfunction ValidateForm(frm) {\n"; $this->js .= "\t\tif (\$(frm.user_new_password).val() != \"\") {\n"; $this->js .= "\t\t\tif (\$(frm.user_new_password2).val() != \$(frm.user_new_password).val()) {\n"; $this->js .= "\t\t\t\t\$(frm.user_new_password2).addClass(\"tbl-error\");\n"; $this->js .= "\t\t\t\talert(\"" . $locale['u132'] . $locale['u143'] . "\");\n"; $this->js .= "\t\t\t\treturn false;\n"; $this->js .= "\t\t\t}\n"; $this->js .= "\t\t\t\$(frm.user_new_password2).removeClass(\"tbl-error\");\n"; if ($this->registration == false) { $this->js .= "\t\t\tif (\$(frm.user_password).val() == \"\") {\n"; $this->js .= "\t\t\t\t\$(frm.user_password).addClass(\"tbl-error\");\n"; $this->js .= "\t\t\t\talert(\"" . $locale['u138'] . "\");\n"; $this->js .= "\t\t\t\treturn false;\n"; $this->js .= "\t\t\t}\n"; } $this->js .= "\t\t\t\$(frm.user_password).removeClass(\"tbl-error\");\n"; $this->js .= "\t\t\tif (\$(frm.user_new_password).val() == \$(frm.user_password).val()) {\n"; $this->js .= "\t\t\t\t\$(frm.user_new_password).addClass(\"tbl-error\");\n"; $this->js .= "\t\t\t\t\$(frm.user_new_password2).addClass(\"tbl-error\");\n"; $this->js .= "\t\t\t\talert(\"" . $locale['u134'] . $locale['u146'] . $locale['u133'] . "\");\n"; $this->js .= "\t\t\t\treturn false;\n"; $this->js .= "\t\t\t}\n"; $this->js .= "\t\t\t\$(frm.user_new_password).removeClass(\"tbl-error\");\n"; $this->js .= "\t\t\t\$(frm.user_new_password2).removeClass(\"tbl-error\");\n"; $this->js .= "\t\t}\n"; $this->js .= $this->javaScriptRequired; $this->js .= "\t}\n"; $this->js .= $this->javaScriptOther; $this->js .= "/*]]>*/\n"; $this->js .= "</script>\n"; add_to_footer($this->js); add_to_jquery("\r\n \$('#" . $this->postName . "').bind('click', function(e){ ValidateForm('#" . $this->formname . "')});\r\n "); echo $this->html; }
function render_admin_panel() { global $locale, $userdata, $defender, $pages, $aidlink, $admin; $languages = fusion_get_enabled_languages(); // Admin panel page echo "<div id='admin-panel' class='clearfix in'>\n"; // Top header section echo "<section id='acp-header' class='pull-left affix clearfix' data-offset-top='0' data-offset-bottom='0'>\n"; // Top content sections navigation echo "<nav>\n"; echo "<ul class='top-left-menu pull-left m-l-15'>\n"; echo "<li><a title='" . $locale['ac00'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=0'>" . $locale['ac00'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac01'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=1'>" . $locale['ac01'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac02'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=2'>" . $locale['ac02'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac03'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=3'>" . $locale['ac03'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac04'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=4'>" . $locale['ac04'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac05'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=5'>" . $locale['ac05'] . "</a></li>\n"; echo "</ul>\n"; echo "</nav>\n"; // Top navigation echo "<nav>\n"; // Top right menu links echo "<ul class='top-right-menu pull-right m-r-15'>\n"; echo "<li class='dropdown'>\n"; echo "<a class='dropdown-toggle pointer' data-toggle='dropdown'>" . display_avatar($userdata, '25px', '', '', '') . " " . $locale['logged'] . "<strong>" . $userdata['user_name'] . "</strong> <span class='caret'></span>\n</a>\n"; echo "<ul class='dropdown-menu' role='menu'>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "edit_profile.php'>" . $locale['edit'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['view'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li class='divider'> </li>\n"; echo "<li><a class='display-block' href='" . FUSION_REQUEST . "&logout'>" . $locale['admin-logout'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "index.php?logout=yes'>" . $locale['logout'] . "</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; if (count($languages) > 1) { echo "<li class='dropdown'><a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . $locale['282'] . "'><i class='fa fa-globe fa-lg fa-fw'></i> " . translate_lang_names(LANGUAGE) . "<span class='caret'></span></a>\n"; echo "<ul class='dropdown-menu'>\n"; foreach ($languages as $language_folder => $language_name) { echo "<li><a class='display-block' href='" . clean_request("lang=" . $language_folder, array("lang"), FALSE) . "'><img class='m-r-5' src='" . BASEDIR . "locale/{$language_folder}/{$language_folder}-s.png'> {$language_name}</a></li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; // .top-right-menu echo "</nav>\n"; echo "</section>\n"; // Content section echo "<div class='content-wrapper display-table pull-left'>\n"; // Main content wrapper echo "<div id='acp-content' class='m-t-20 col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; // Render breadcrumbs echo render_breadcrumbs(); // Get and render notices $notices = getNotices(); echo renderNotices($notices); // Render the content echo CONTENT; echo "</div>\n"; // #acp-content // Footer section echo "<footer class='m-l-20 display-inline-block m-t-20 m-b-20'>\n"; // Copyright echo "Old_School Admin © " . date("Y") . " created by <a href='https://www.php-fusion.co.uk'><strong>PHP-Fusion Inc.</strong></a>\n"; echo showcopyright(); // Render time if (fusion_get_settings('rendertime_enabled')) { echo "<br /><br />"; // Make showing of queries and memory usage separate settings echo showrendertime(); echo showMemoryUsage(); } echo "<hr />\n"; echo showFooterErrors(); echo "</footer>\n"; echo "</div>\n"; // .acp-main echo "</div>\n"; // #admin-panel // Wrappers echo "</div></div></div></div>\n"; add_to_footer("<script src='" . THEMES . "admin_themes/Old_School/includes/jquery.slimscroll.min.js'></script>"); add_to_jquery("\n// Initialize slimscroll\n\$('#adl').slimScroll({\n\theight: null\n});\n"); }
function form_address($title = false, $input_name, $input_id, $input_value = false, $array = false) { if (isset($title) && $title !== "") { $title = stripinput($title); } else { $title = ""; } if (isset($input_name) && $input_name !== "") { $input_name = stripinput($input_name); } else { $input_name = ""; } if (isset($input_id) && $input_id !== "") { $input_id = stripinput($input_id); } else { $input_id = ""; } $input_id = str_replace(" ", "", $input_id); $input_id = str_replace("/", "", $input_id); if (!defined("SELECT2")) { define("SELECT2", true); add_to_footer("<script src='" . DYNAMICS . "assets/select2/select2.min.js'></script>"); add_to_head("<link href='" . DYNAMICS . "assets/select2/select2.css' rel='stylesheet' />"); } require INCLUDES . "geomap/geomap.inc.php"; // NOTE (remember to parse readback value as such): // $input_value = "Lot 87, Taman Khidmat,|Lorong Pokok Seraya 3A,|North-Korea|Sabah|Kota Kinabalu|89350"; if (isset($input_value) && !empty($input_value)) { if (!is_array($input_value)) { $input_value = construct_array($input_value, "", "|"); } } else { $input_value['0'] = ""; $input_value['1'] = ""; $input_value['2'] = ""; $input_value['3'] = ""; $input_value['4'] = ""; $input_value['5'] = ""; } if (!is_array($array)) { $array = array(); $before = ""; $after = ""; $required = ""; $deactivate = ""; $width = ""; $class = ""; $well = ""; $required = 0; $safemode = 0; $stacking = 0; $helper_text = ""; } else { $deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : ""; $class = array_key_exists('class', $array) ? $array['class'] : ""; $width = array_key_exists('width', $array) ? $array['width'] : ""; $well = array_key_exists('well', $array) ? "style='margin-top:-10px;'" : ""; $required = array_key_exists('required', $array) && $array['required'] == 1 ? 1 : 0; $safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? 1 : 0; $stacking = array_key_exists("stacking", $array) ? 1 : ""; $helper_text = array_key_exists("helper", $array) ? $array['helper'] : ""; } $html = ""; $html .= "<div class='field'/>\n"; $html .= $title ? "<label for='{$input_id}'/><h3>{$title} " . ($required == 1 ? "<span class='required'>*</span>" : '') . "</h3></label>\n" : ''; $html .= "<div class='ui left labeled input'/>\n"; $html .= "<input type='text' name='" . $input_name . "[]' class='form-control input-sm' id='" . $input_id . "-street' value='" . $input_value['0'] . "' placeholder='Street Address 1' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . " />\n"; $html .= $required ? "<div class='ui corner label'/><i class='icon asterisk'/></i></div>\n" : ''; $html .= "<div id='{$input_id}-help'></div>"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<div class='field'>\n"; $html .= "<div class='ui left labeled input'/>\n"; $html .= "<input type='text' name='" . $input_name . "[]' class='form-control input-sm' id='" . $input_id . "-street2' value='" . $input_value['1'] . "' placeholder='Street Address 2' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . ">"; $html .= "<div id='{$input_id}-help'></div>"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<div id='{$input_id}-field' class='three fields'/>\n"; $html .= "<div class='field'>\n"; $html .= "<div class='ui left labeled input'/>\n"; $html .= "<select name='" . $input_name . "[]' id='{$input_id}-country' style='width:100%;'/>\n"; $html .= "<option value=''></option>"; foreach ($countries as $arv => $countryname) { // outputs: key, value, class - in order $country_key = str_replace(" ", "-", $countryname); if ($input_value['2'] == $country_key) { $select = "selected"; } else { $select = ""; } $html .= "<option value='{$country_key}' {$select}>{$countryname}</option>"; } $html .= "</select>\n"; $html .= "<div id='{$input_id}-help'></div>"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<div class='field'>\n"; $html .= "<div class='ui left labeled input'/>\n"; $html .= "<div id='state-spinner' style='display:none;'>\n<img src='" . IMAGES . "loader.gif'>\n</div>\n"; $html .= "<input type='hidden' name='" . $input_name . "[]' id='{$input_id}-state' value='" . $input_value['3'] . "' style='width:100%;' />\n"; $html .= "<div id='{$input_id}-help'></div>"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<div class='field'>\n"; $html .= "<div class='ui left labeled input'/>\n"; $html .= "<input type='text' name='" . $input_name . "[]' id='" . $input_id . "-city' value='" . $input_value['4'] . "' placeholder='City' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . ">"; $html .= "<div id='{$input_id}-help'></div>"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<div id='{$input_id}-field' class='three fields'/>\n"; $html .= "<div class='field'>\n"; $html .= "<div class='ui left labeled input'/>\n"; $html .= "<input type='text' name='" . $input_name . "[]' id='" . $input_id . "-postcode' value='" . $input_value['5'] . "' placeholder='Postcode' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . ">"; $html .= "<div id='{$input_id}-help'></div>"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<input type='hidden' name='def[{$input_name}][]' value='[type=textbox],[title={$title} Street Address 1],[id=" . $input_id . "-street],[required={$required}],[safemode={$safemode}]' readonly />\n"; $html .= "<input type='hidden' name='def[{$input_name}][]' value='[type=textbox],[title={$title} Street Address 2],[id=" . $input_id . "-street2],[required={$required}],[safemode={$safemode}]' readonly>"; $html .= "<input type='hidden' name='def[{$input_name}][]' value='[type=dropdown],[title={$title} Country],[id=" . $input_id . "-country],[required={$required}],[safemode={$safemode}]' readonly />\n"; $html .= "<input type='hidden' name='def[{$input_name}][]' value='[type=dropdown],[title={$title} State],[id=" . $input_id . "-state],[required={$required}],[safemode={$safemode}]' readonly />\n"; $html .= "<input type='hidden' name='def[{$input_name}][]' value='[type=textbox],[title={$title} City],[id=" . $input_id . "-city],[required={$required}],[safemode={$safemode}]' readonly>"; $html .= "<input type='hidden' name='def[{$input_name}][]' value='[type=textbox],[title={$title} Postcode],[id=" . $input_id . "-postcode],[required={$required}],[safemode={$safemode}]' readonly>"; $html .= "</div>\n"; add_to_jquery("\n \$('#{$input_id}-country').select2({placeholder: 'Country'});\n \$('#" . $input_id . "-country').bind('change', function(){\n\n var ce_id = \$(this).val();\n \$.ajax({\n url: '" . INCLUDES . "geomap/form_geomap.json.php',\n type: 'GET',\n data: { id : ce_id },\n dataType: 'json',\n beforeSend: function(e) {\n// \$('#state-spinner').show();\n },\n success: function(data) {\n// \$('#state-spinner').hide();\n \$('#" . $input_id . "-state').select2({\n placeholder: 'Select State',\n allowClear: true,\n data : data\n });\n },\n error : function() {\n \$.pnotify({title: 'Error! Something went wrong.',\n text: 'We cannot read the database, please recheck source codes.',\n icon: 'pngicon-l-badge-multiply',\n width: 'auto'\n });\n }\n })\n }).trigger('change');\n "); /* add_to_jquery(" //function icon(item) { // if(!item.id) {return item.text;} // var icon = 'pngicon-flag-'+ item.id.toLowerCase(); // return '<i style=\"float:left; margin-top:5px;\" class=\"' + icon + '\"/></i>' + item.text; //} $('#".$input_id."-country').select2({ placeholder: 'Select Country', allowClear:true, formatResult: icon, formatSelection: icon, escapeMarkup: function(m) { return m; } }); $('#".$input_id."-state').select2({ placeholder: 'Select State', allowClear:true, data: [{id:'0', 'text' :'Select Country to View State'}] }); "); /* $html .= add_to_jquery("$('#".$input_id."-country').chained('#".$input_id."-country');"); */ return $html; }
$viewthread_js .= "/*<![CDATA[*/"; $viewthread_js .= "jQuery(document).ready(function(){"; if (!empty($highlight_js) || !empty($colorbox_js) || !empty($edit_reason_js)) { $viewthread_js .= $highlight_js . $colorbox_js . $edit_reason_js; } $viewthread_js .= "jQuery('a[href=#top]').click(function(){"; $viewthread_js .= "jQuery('html, body').animate({scrollTop:0}, 'slow');"; $viewthread_js .= "return false;"; $viewthread_js .= "});"; $viewthread_js .= "});"; // below functions could be made more unobtrusive thanks to jQuery, giving a more accessible cms $viewthread_js .= "function jumpforum(forum_id){"; $viewthread_js .= "document.location.href='" . FORUM . "viewforum.php?forum_id='+forum_id;"; $viewthread_js .= "}"; if (iMOD) { // only moderators need this javascript $viewthread_js .= "function setChecked(frmName,chkName,val){"; $viewthread_js .= "dml=document.forms[frmName];"; $viewthread_js .= "len=dml.elements.length;"; $viewthread_js .= "for(i=0;i<len;i++){"; $viewthread_js .= "if(dml.elements[i].name==chkName){"; $viewthread_js .= "dml.elements[i].checked=val;"; $viewthread_js .= "}"; $viewthread_js .= "}"; $viewthread_js .= "}"; } $viewthread_js .= "/*]]>*/"; $viewthread_js .= "</script>"; add_to_footer($viewthread_js); //unset($viewthread_js); require_once THEMES . "templates/footer.php";
/** * News Item Page Template * @param $info */ function render_news_item($info) { global $aidlink; $locale = fusion_get_locale(); $news_settings = get_settings('news'); $data = $info['news_item']; add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "news/templates/css/news.css' type='text/css'>"); add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />"); add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>"); add_to_footer('<script type="text/javascript"> $(document).ready(function() { $(".news-image-overlay").colorbox({ transition: "elasic", height:"100%", width:"100%", maxWidth:"98%", maxHeight:"98%", scrolling:false, overlayClose:true, close:false, photo:true, onComplete: function(result) { $("#colorbox").live("click", function(){ $(this).unbind("click"); $.fn.colorbox.close(); }); }, onLoad: function () { } }); }); </script>'); opentable($locale['news_0004']); echo render_breadcrumbs(); echo "<!--news_pre_readmore-->"; echo "<article class='news-item' style='display:block; width:100%; overflow:hidden;'>\n"; echo "<h2 class='text-center'>" . $data['news_subject'] . "</h2>\n"; echo "<div class='news_news text-dark m-t-20 m-b-20'>\n"; if ($data['news_image_src']) { echo "<a class='" . $data['news_ialign'] . " news-image-overlay' href='" . $data['news_image_src'] . "'>\n <img class='img-responsive' src='" . $data['news_image_src'] . "' alt='" . $data['news_subject'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; overflow:hidden;' /></a>"; } elseif (!empty($data['news_image']) && !empty($data['news_cat_image_src'])) { echo "<a class='" . $data['news_ialign'] . "' href='" . INFUSIONS . "news/news.php?cat_id=" . $data['news_cat_id'] . "'>\n <img class='img-responsive' src='" . IMAGES_NC . $data['news_cat_image_src'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; alt='" . $data['news_cat_name'] . "' />\n </a>"; } echo $data['news_news']; echo "</div>\n"; echo "<div class='news_extended text-dark m-t-20 m-b-20'>" . $data['news_extended'] . "</div>\n"; echo "<div style='clear:both;'></div>\n"; echo "<div class='well m-t-5 text-center'>\n"; echo "<span class='news-action m-r-10'><i class='fa fa-user'></i>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>\n"; echo "<span class='news-action m-r-10'><i class='fa fa-calendar'></i>" . showdate("newsdate", $data['news_datestamp']) . "</span>\n"; echo "<span class='news-action'><i class='fa fa-eye'></i><span class='text-dark m-r-10'>" . number_format($data['news_reads']) . "</span>\n</span>"; echo $data['news_allow_comments'] ? display_comments($data['news_comments'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#comments") : ''; echo $data['news_allow_ratings'] ? "<span class='m-r-10'>" . display_ratings($data['news_sum_rating'], $data['news_count_votes'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#ratings") . " </span>" : ''; echo "<a class='m-r-10' title='" . $locale['news_0002'] . "' href='" . BASEDIR . "print.php?type=N&item_id=" . $data['news_id'] . "'><i class='fa fa-print'></i></a>"; echo iADMIN && checkrights("N") ? "<a title='" . $locale['news_0003'] . "' href='" . INFUSIONS . "news/news_admin.php" . $aidlink . "&action=edit&section=news_form&news_id=" . $data['news_id'] . "' title='" . $locale['news_0003'] . "' />" . $locale['news_0003'] . "</a>\n" : ""; echo "</div>"; echo "<!--news_sub_readmore-->"; echo !isset($_GET['readmore']) && $data['news_ext'] == "y" ? "<div class='m-t-20'>\n<a href='" . INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "' class='button'>" . $locale['news_0001'] . "</a>\n</div>\n" : ""; if ($data['page_count'] > 0) { echo "<div class='text-center m-t-10'>\n" . makepagenav($_GET['rowstart'], 1, $data['page_count'], 3, INFUSIONS . "news/news.php?readmore=" . $_GET['readmore'] . "&") . "\n</div>\n"; } if ($data['news_allow_comments']) { echo "<hr />" . showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n"; } if ($data['news_allow_ratings']) { echo "<hr />" . showratings("N", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n"; } echo "</article>\n"; closetable(); }
foreach ($swords as $hlight) { $higlight .= "'" . $hlight . "'"; $higlight .= $i < $c_swords ? "," : ""; $i++; } add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery.highlight.js'></script>"); $highlight_js = "<script type='text/javascript'>"; $highlight_js .= "/*<![CDATA[*/"; $highlight_js .= "jQuery(document).ready(function(){"; $highlight_js .= "jQuery('.search_result').highlight([" . $higlight . "],{wordsOnly:true});"; $highlight_js .= "jQuery('.highlight').css({backgroundColor:'#FFFF88'});"; //better via theme or settings $highlight_js .= "});"; $highlight_js .= "/*]]>*/"; $highlight_js .= "</script>"; add_to_footer($highlight_js); if ($_GET['stype'] == "all") { $dh = opendir(INCLUDES . "search"); while (FALSE !== ($entry = readdir($dh))) { if ($entry != "." && $entry != ".." && preg_match("/include.php/i", $entry)) { include INCLUDES . "search/" . $entry; } } closedir($dh); } else { include INCLUDES . "search/search_" . $_GET['stype'] . "_include.php"; } $c_iwords = count($iwords); if ($c_iwords) { $txt = ""; for ($i = 0; $i < $c_iwords; $i++) {
<?php /* Updated 2014/July - https://github.com/sciactive/pnotify */ require_once __DIR__ . '/../output_handling_include.php'; if (!defined('NOTIFICATION_UI')) { define('NOTIFICATION_UI', TRUE); add_to_footer("<script type='text/javascript' src='" . INCLUDES . "notify/pnotify.js'></script>\n"); } /** * Pop up notification * @param $title * @param $text * @param array $options */ function notify($title, $text, array $options = array()) { // init library $default_options = array("sticky" => TRUE, "animation" => 1, "icon" => "notify_icon n-attention"); $options += $default_options; $sticky = $options['sticky'] == TRUE ? "hide:false," : ""; switch ($options['animation']) { case 1: $animation = "animation: 'show',"; break; case 2: $animation = "animation: 'fade',"; break; case 3: $animation = "animation: 'slide',"; break; default:
/** * Input to save date using datepicker * Datetimepicker documentation - http://eonasdan.github.io/bootstrap-datetimepicker/Options/ * * @param $input_name * @param string $label * @param string $input_value * @param array $options * <ul> * <li><strong>class</strong> (string): Empty string by default. * The value of attribute class of the input.</li> * <li><strong>date_format</strong> (string): dd-mm-yyyy by default. * Date format for datepicker plugin.</li> * <li><strong>deactivate</strong> (boolean): FALSE by default. * You can pass TRUE and turn off the javascript datepicker plugin</li> * <li><strong>error_text</strong> (string): empty string by default. * An error message</li> * <li><strong>fieldicon_off</strong> (boolean): FALSE by default. * If TRUE, the calendar icon will be not displayed in the input.</li> * <li><strong>inline</strong> (boolean): FALSE by default. * TRUE if the input should be an inline element.</li> * <li><strong>input_id</strong> (string): $input name by default. * The value of attribute id of input.</li> * <li><strong>required</strong> (boolean): FALSE by default</li> * <li><strong>type</strong> (string): timestamp by default. * Valid types: * <ul> * <li>date: The date will be saved as mysql date.</li> * <li>timestamp: A timestamp will be saved as an integer</li> * </ul> * </li> * <li><strong>week_start</strong> (int): 0 by default. * An integer between 0 and 6. It is the same as * the attribute weekStart of datepicker.</li> * <li><strong>width</strong> (string): 250px by default. * A valid value for CSS width</li> * </ul> * * Callback Usages !important * ========================== * Configuration when type is 'timestamp' * Token used for $options['date_format_php'] is the <a href="http://php.net/manual/en/function.date.php">PHP token equivalent.</a> * Token used for $options['date_format_js'] must be formatted with <a href="http://momentjs.com/docs/#/displaying/">moment.js.</a> * Both token must match each other to parse the callback properly. * * Currently, only user birthdate in `entire project` uses date format. * * Joining 2 datepickers (Start and End) * ======================================= * In Start Datepicker, add $options['join_to_id'] with End Datepicker's input_id * In End Datepicker, add $options['join_from_id'] with Start Datepicker's input_id * * @return string */ function form_datepicker($input_name, $label = '', $input_value = '', array $options = array()) { global $defender, $locale; if (!defined('DATEPICKER')) { define('DATEPICKER', TRUE); add_to_head("<link href='" . DYNAMICS . "assets/datepicker/css/datetimepicker.min.css' rel='stylesheet' />"); add_to_footer("<script src='" . DYNAMICS . "assets/datepicker/js/moment.min.js'></script>"); add_to_footer("<script src='" . DYNAMICS . "assets/datepicker/js/datetimepicker.min.js'></script>"); add_to_head("<script src='" . DYNAMICS . "assets/datepicker/locale/." . $locale['datepicker'] . ".js'></script>"); } $title = $label ? stripinput($label) : ucfirst(strtolower(str_replace("_", " ", $input_name))); $input_name = stripinput($input_name); $default_options = array('input_id' => $input_name, 'required' => FALSE, 'placeholder' => '', 'deactivate' => FALSE, 'width' => '280px', 'class' => '', 'inline' => FALSE, 'error_text' => $locale['error_input_default'], "date_format_js" => "YYYY-M-DD, H:mm:ss", "date_format_php" => "Y-m-d H:i:s", "delimiter" => "-", 'fieldicon_off' => FALSE, "filtered_dates" => array(), "include_filtered_dates" => (bool) FALSE, "weekend" => array(), "disable_weekend" => (bool) FALSE, 'type' => "timestamp", "tip" => "", "showTime" => (bool) FALSE, 'week_start' => fusion_get_settings('week_start'), "join_to_id" => "", "join_from_id" => ""); $options += $default_options; if (!empty($input_value)) { if ($options['type'] == "timestamp") { $input_value = date($options['date_format_php'], $input_value); } elseif ($options['type'] == "date") { if (stristr($input_value, $options['delimiter'])) { $input_value = explode($options['delimiter'], $input_value); if (count($input_value) == 3) { $params = array("year" => $input_value[0], "month" => $input_value[1], "day" => $input_value[2]); if (checkdate($params['month'], $params['day'], $params['year'])) { $input_value = implode("-", $params) . " 00:00:00"; } else { addNotice("warning", "Please ensure your date input value is formatted in date('Y-m-d', callback_data))"); } } else { addNotice("warning", "Please ensure your date format has only year, month and day"); } } } } else { $input_value = ""; } if (!$options['width']) { $options['width'] = $default_options['width']; } // Format disabled or enabled dates as JS array $dateFilter = array(); if (!empty($options['filtered_dates']) && is_array($options['filtered_dates'])) { $date_filtered = ""; $dateFilter[0] = "disabledDates: "; if ($options['include_filtered_dates'] == TRUE) { $dateFilter[0] = "enabledDates: "; } foreach ($options['filtered_dates'] as $key => $value) { $date_filtered[] = date("m/d/Y", $value); } $dateFilter[1] = (string) "['" . implode("','", $date_filtered) . "']"; } // Format for Weekend $weekendFilter = array(); if ($options['disable_weekend']) { $weekendFilter[0] = "daysOfWeekDisabled: "; $weekendFilter[1] = !empty($options['weekend']) && is_array($options['weekend']) ? "[" . implode(",", $options['weekend']) . "]" : "[0,6]"; } if (!in_array($options['type'], array('date', 'timestamp'))) { $options['type'] = $default_options['type']; } $options['week_start'] = (int) $options['week_start']; $error_class = ""; if ($defender->inputHasError($input_name)) { $error_class = "has-error "; if (!empty($options['error_text'])) { $new_error_text = $defender->getErrorText($input_name); if (!empty($new_error_text)) { $options['error_text'] = $new_error_text; } addNotice("danger", "<strong>{$title}</strong> - " . $options['error_text']); } } $input_id = $options['input_id'] ?: $default_options['input_id']; $html = "<div id='{$input_id}-field' class='form-group " . $error_class . $options['class'] . "'>\n"; $html .= $label ? "<label class='control-label " . ($options['inline'] ? "col-xs-12 col-sm-3 col-md-3 col-lg-3 p-l-0" : '') . "' for='{$input_id}'>{$label} " . ($options['required'] ? "<span class='required'>*</span> " : '') . "\n\t" . ($options['tip'] ? "<i class='pointer fa fa-question-circle' title='" . $options['tip'] . "'></i>" : '') . "\n\t</label>\n" : ''; $html .= $options['inline'] ? "<div class='col-xs-12 col-sm-9 col-md-9 col-lg-9'>\n" : ""; $html .= "<div class='input-group date' " . ($options['width'] ? "style='width:" . $options['width'] . ";'" : '') . ">\n"; $html .= "<input type='text' name='" . $input_name . "' id='" . $input_id . "' value='" . $input_value . "' class='form-control textbox' placeholder='" . $options['placeholder'] . "' />\n"; $html .= "<span class='input-group-addon " . ($options['fieldicon_off'] ? 'display-none' : '') . "'><i class='entypo calendar'></i></span>\n"; $html .= "</div>\n"; $html .= $options['required'] == 1 && $defender->inputHasError($input_name) || $defender->inputHasError($input_name) ? "<div id='" . $input_id . "-help' class='label label-danger p-5 display-inline-block'>" . $options['error_text'] . "</div>" : ""; $html .= $options['inline'] ? "</div>\n" : ""; $html .= "</div>\n"; $defender->add_field_session(array('input_name' => $input_name, 'type' => $options['type'], 'title' => $title, 'id' => $input_id, 'required' => $options['required'], 'safemode' => TRUE, 'error_text' => $options['error_text'], "delimiter" => $options['delimiter'])); if (!$options['deactivate']) { /** * Bind to and from together */ $bindingJs = ""; if (!empty($options['join_from_id'])) { $bindingJs = "\n var fromVal = \$('#" . $options['join_from_id'] . "').val();\n var toVal = \$('#" . $input_id . "').val();\n if (fromVal) {\n \$('#{$input_id}-field .input-group.date').data('DateTimePicker').minDate(fromVal);\n }\n if (toVal) {\n \$('#" . $options['join_from_id'] . "-field .input-group.date').data('DateTimePicker').maxDate(toVal);\n }\n \$('#" . $options['join_from_id'] . "-field .input-group.date').on('dp.change', function(e) {\n \$('#{$input_id}-field .input-group.date').data('DateTimePicker').minDate(e.date);\n });\n \$('#{$input_id}-field .input-group.date').on('dp.change', function(e) {\n \$('#" . $options['join_from_id'] . "-field .input-group.date').data('DateTimePicker').maxDate(e.date);\n });\n "; } add_to_jquery("\n \$('#{$input_id}-field .input-group.date').datetimepicker({\n locale: moment.locale('" . $locale['datepicker'] . "', {\n week: { dow: " . $options['week_start'] . " }\n }),\n showTodayButton: true,\n showClear: true,\n showClose: true,\n allowInputToggle: true,\n " . ($options['showTime'] == TRUE ? "sideBySide: true," : "") . "\n " . (!empty($dateFilter) ? $dateFilter[0] . $dateFilter[1] . "," : "") . "\n " . (!empty($weekendFilter) ? $weekendFilter[0] . $weekendFilter[1] . "," : "") . "\n format: '" . $options['date_format_js'] . "',\n " . (!empty($options['join_from_id']) ? "useCurrent: false" : "") . "\n });\n " . $bindingJs . "\n "); } return (string) $html; }
| Affero GPL license. You can redistribute it and/or | modify it under the terms of this license which you | can read by viewing the included agpl.txt or online | at www.gnu.org/licenses/agpl.html. Removal of this | copyright header is strictly prohibited without | written permission from the original author(s). +--------------------------------------------------------*/ require_once "../maincore.php"; if (!checkrights("P") || !defined("iAUTH") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) { redirect("../index.php"); } require_once THEMES . "templates/admin_header.php"; include LOCALE . LOCALESET . "admin/panels.php"; add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery-ui.js'></script>"); add_to_head("<link rel='stylesheet' href='" . THEMES . "templates/panels.css' type='text/css' media='all' />"); add_to_footer("<script type='text/javascript'>\n\$(document).ready(function() {\n\t\$('.pdisabled').fadeTo(0, .5);\n\t\$('.panels-list').sortable({\n\t\thandle : '.handle',\n\t\tplaceholder: 'state-highlight',\n\t\tconnectWith: '.connected',\n\t\tscroll: true,\n\t\taxis: 'y',\n\t\tupdate: function () {\n\t\t\tvar ul = \$(this),\n\t\t\t\torder = ul.sortable('serialize'),\n\t\t\t\ti = 0;\n\t\t\t\$('#info').load('panels_updater.php" . $aidlink . "&'+order);\n\t\t\tul.find('.num').each(function(i) {\n\t\t\t\t\$(this).text(i+1);\n\t\t\t});\n\t\t\tul.find('li').removeClass('tbl2').removeClass('tbl1');\n\t\t\tul.find('li:odd').addClass('tbl2');\n\t\t\tul.find('li:even').addClass('tbl1');\n\t\t\twindow.setTimeout('closeDiv();',2500);\n\t\t},\n\t\treceive: function () {\n\t\t\tvar ul = \$(this),\n\t\t\t\torder = ul.sortable('serialize'),\n\t\t\t\tpdata = ul.attr('data-side');\n\t\t\t\tif (pdata == 1) { var psidetext = '" . $locale['420'] . "'; }\n\t\t\t\tif (pdata == 2) { var psidetext = '" . $locale['421'] . "'; }\n\t\t\t\tif (pdata == 3) { var psidetext = '" . $locale['425'] . "'; }\n\t\t\t\tif (pdata == 4) { var psidetext = '" . $locale['422'] . "'; }\n\t\t\tul.find('.pside').each(function() {\n\t\t\t\t\$(this).text(psidetext);\n\t\t\t});\n\t\t\t\$('#info').load('panels_updater.php" . $aidlink . "&panel_side='+pdata+'&'+order);\n\t\t}\n\t});\n});\n</script>"); if (isset($_GET['action']) && $_GET['action'] == "delete" && (isset($_GET['panel_id']) && isnum($_GET['panel_id']))) { $data = dbarray(dbquery("SELECT panel_side, panel_order FROM " . DB_PANELS . " WHERE panel_id='" . $_GET['panel_id'] . "'")); $result = dbquery("DELETE FROM " . DB_PANELS . " WHERE panel_id='" . $_GET['panel_id'] . "'"); $result = dbquery("UPDATE " . DB_PANELS . " SET panel_order=panel_order-1 WHERE panel_side='" . $data['panel_side'] . "' AND panel_order>='" . $data['panel_order'] . "'"); redirect(FUSION_SELF . $aidlink); } if (isset($_GET['action']) && $_GET['action'] == "setstatus" && (isset($_GET['panel_id']) && isnum($_GET['panel_id']))) { $result = dbquery("UPDATE " . DB_PANELS . " SET panel_status='" . intval($_GET['status']) . "' WHERE panel_id='" . $_GET['panel_id'] . "'"); } opentable($locale['400']); echo "<div id='info'></div>\n"; $side = array("1" => $locale['420'], "2" => $locale['421'], "3" => $locale['425'], "4" => $locale['422']); $panels = array("1" => array(), "2" => array(), "3" => array(), "4" => array()); $result = dbquery("SELECT panel_id, panel_name, panel_side, panel_order, panel_type, panel_access, panel_status\n\tFROM " . DB_PANELS . "\n\tORDER BY panel_side,panel_order"); while ($data = dbarray($result)) {
/** Use this function to show error logs */ public function showFooterErrors() { $locale = self::$locale; $aidlink = fusion_get_aidlink(); $html = ""; if (iADMIN && checkrights("ERRO") && (count($this->errors) || count($this->new_errors)) && !defined("NO_DEBUGGER")) { $html = "<i class='fa fa-bug fa-lg'></i></button><strong>\n"; $html .= str_replace(array("[ERROR_LOG_URL]", "[/ERROR_LOG_URL]"), array("<a id='footer_debug' href='" . ADMIN . "errors.php" . $aidlink . "'>", "</a>"), $locale['err_101']); $html .= "</strong><span class='badge m-l-10'>L: " . count($this->errors) . "</span>\n"; $html .= "<span class='badge m-l-10'>N: " . count($this->new_errors) . "</span>\n"; $cHtml = openmodal('tbody', 'Error Console', array('class' => 'modal-lg modal-center zindex-boost', 'button_id' => 'footer_debug')); $cHtml .= $this->getErrorLogs(); $cHtml .= closemodal(); add_to_footer($cHtml); } return $html; }
$submit_js .= "}"; /************ news ******/ $submit_js .= "function validateNews(frm){"; $submit_js .= 'if(frm.news_subject.value=="" || frm.news_body.value==""){'; $submit_js .= 'alert("' . $locale['550'] . '"); return false;'; $submit_js .= "}"; $submit_js .= "}"; /************ articles **/ $submit_js .= "function validateArticle(frm){"; $submit_js .= 'if(frm.article_subject.value=="" || frm.article_snippet.value=="" || frm.article_body.value==""){'; $submit_js .= 'alert("' . $locale['550'] . '"); return false;'; $submit_js .= "}"; $submit_js .= "}"; /************ photos ****/ $submit_js .= "function validatePhoto(frm){"; $submit_js .= 'if(frm.photo_title.value=="" || frm.photo_description.value=="" || frm.photo_pic_file.value==""){'; $submit_js .= 'alert("' . $locale['550'] . '"); return false;'; $submit_js .= "}"; $submit_js .= "}"; /************ downloads */ $submit_js .= "function validateDownload(frm){"; $submit_js .= 'if(frm.download_title.value=="" || frm.download_description_short.value=="" || (frm.download_url.value=="" && frm.download_file.value=="")){'; $submit_js .= 'alert("' . $locale['550'] . '"); return false;'; $submit_js .= "}"; $submit_js .= "}"; /************ -- end -- */ $submit_js .= "/*]]>*/"; $submit_js .= "</script>"; add_to_footer($submit_js); unset($submit_js); require_once THEMES . "templates/footer.php";
function form_select_chain($title, $input_name, $input_id, $option_array, $input_value = FALSE, $chain_to_parent_id, $array = FALSE) { global $_POST; if (!defined("SELECT2")) { define("SELECT2", TRUE); add_to_footer("<script src='" . DYNAMICS . "select2/select2.min.js'></script>"); add_to_head("<link href='" . DYNAMICS . "select2/select2.css' rel='stylesheet' />"); } if (!defined("CHAIN")) { define("CHAIN", TRUE); add_to_footer("<script src='" . DYNAMICS . "chainselect/jquery.chained.js'></script>"); } if (isset($title) && $title !== "") { $title = stripinput($title); } else { $title = ""; } if (isset($is_order) && $is_order !== "") { $is_order = stripinput($is_order); } else { $is_order = ""; } if (!is_array($array)) { $array = array(); $state_validation = ""; $required = ""; $placeholder = ""; $deactivate = ""; $labeloff = ""; $multiple = ""; $width = "style='width:250px;'"; $allowclear = ""; $well = ""; } else { $required = array_key_exists('required', $array) ? $array['required'] : ""; $is_multiple = array_key_exists('is_multiple', $array) ? $array['is_multiple'] : ""; $placeholder = array_key_exists('placeholder', $array) ? $array['placeholder'] : ""; $deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : ""; $labeloff = array_key_exists('labeloff', $array) ? $array['labeloff'] : ""; $width = array_key_exists('width', $array) ? "style='width:" . $array['width'] . "'" : "style='width:250px;'"; $well = array_key_exists('well', $array) ? "well" : ""; $allowclear = $placeholder !== "" ? "allowClear:true" : ""; // $requested by Tyler for his project if ($required == "1" && empty($_POST['$input_name'])) { $state_validation = "has-error"; } else { $state_validation = ""; } $multiple = $is_multiple == "1" ? "multiple" : ""; } $html = ""; if (!empty($title)) { $html .= "<div class='form-group " . $state_validation . "'>"; $html .= "<label for='{$input_id}' class='col-sm-12 col-md-3 col-lg-3 control-label'>{$title}</label>"; $html .= "<div class='col-sm-12 col-md-9 col-lg-9 {$well}'>"; } $html .= "<select name='{$input_name}' id='{$input_id}' {$width} " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . " {$multiple}>"; $html .= "<option value=''></option>"; if (is_array($option_array)) { foreach ($option_array as $arr) { // outputs: key, value, class - in order //print_p($arr); /* * "key" => array("value"=>"", "class"=>""); * */ if ($is_order == 1) { if ($input_value !== "" && $arr['3'] == "1") { $select = "selected"; } else { $select = ""; } } else { // $arr['1'] = link_value if ($input_value !== "" && $input_value == $arr['1']) { $select = "selected"; } else { $select = ""; } } // the fapi requires = array("1"=>"country", "2"=>"value"); // $arr['2'] = parent value. if (array_key_exists("2", $arr)) { $subclass = "class='" . $arr['2'] . "'"; } else { $subclass = ""; } // this one is used as chain selects $html .= "<option {$subclass} value='" . $arr['1'] . "' {$select}>" . $arr['0'] . "</option>"; } } else { $html .= "<option value=''></option>"; } $html .= "</select>"; $html .= add_to_jquery("\n \$('#" . $input_id . "').select2({\n \tplaceholder: '" . $placeholder . "',\n\t\t{$allowclear}\n\t\t});\n "); $html .= add_to_jquery("\n \$('#" . $input_id . "').chained('#" . $chain_to_parent_id . "');\n "); if (!empty($title)) { $html .= "</div></div>"; } return $html; }
/** * Select2 hierarchy * Returns a full hierarchy nested dropdown. * @param $input_name * @param string $label * @param bool $input_value * @param array $options * @param $db - your db * @param $name_col - the option text to show * @param $id_col - unique id * @param $cat_col - parent id * ## The rest of the Params are used by the function itself -- no need to handle ## * @param bool $self_id - not required * @param bool $id - not required * @param bool $level - not required * @param bool $index - not required * @param bool $data - not required * @return string */ function form_select_tree($input_name, $label = "", $input_value = FALSE, array $options = array(), $db, $name_col, $id_col, $cat_col, $self_id = FALSE, $id = FALSE, $level = FALSE, $index = FALSE, $data = FALSE) { global $defender, $locale; if (!defined("SELECT2")) { define("SELECT2", TRUE); add_to_footer("<script src='" . DYNAMICS . "assets/select2/select2.min.js' /></script>\n"); add_to_head("<link href='" . DYNAMICS . "assets/select2/select2.css' rel='stylesheet' />\n"); } $title = $label ? stripinput($label) : ucfirst(strtolower(str_replace("_", " ", $input_name))); $default_options = array('required' => FALSE, 'regex' => '', 'input_id' => $input_name, 'placeholder' => $locale['choose'], 'deactivate' => FALSE, 'safemode' => FALSE, 'allowclear' => FALSE, 'multiple' => FALSE, 'width' => '250px', 'keyflip' => FALSE, 'tags' => FALSE, 'jsonmode' => FALSE, 'chainable' => FALSE, 'maxselect' => FALSE, 'error_text' => $locale['error_input_default'], 'class' => '', 'inline' => FALSE, 'tip' => '', 'delimiter' => ',', 'callback_check' => '', 'file' => '', 'parent_value' => $locale['root'], 'add_parent_opts' => FALSE, 'disable_opts' => '', 'hide_disabled' => FALSE, 'no_root' => FALSE, 'show_current' => FALSE, 'query' => ''); $options += $default_options; $options['input_id'] = trim($options['input_id'], "[]"); if ($options['multiple']) { if ($input_value) { $input_value = construct_array($input_value, 0, $options['delimiter']); } else { $input_value = array(); } } if (!$options['width']) { $options['width'] = $default_options['width']; } $allowclear = $options['placeholder'] && $options['multiple'] || $options['allowclear'] ? "allowClear:true" : ''; $disable_opts = ''; if ($options['disable_opts']) { $disable_opts = is_array($options['disable_opts']) ? $options['disable_opts'] : explode(',', $options['disable_opts']); } /* Child patern */ $opt_pattern = str_repeat("—", $level); if (!$level) { $level = 0; if (!isset($index[$id])) { $index[$id] = array('0' => $locale['no_opts']); } $error_class = ""; if ($defender->inputHasError($input_name)) { $error_class = "has-error "; if (!empty($options['error_text'])) { $new_error_text = $defender->getErrorText($input_name); if (!empty($new_error_text)) { $options['error_text'] = $new_error_text; } addNotice("danger", "<strong>{$title}</strong> - " . $options['error_text']); } } $html = "<div id='" . $options['input_id'] . "-field' class='form-group " . $error_class . $options['class'] . "' " . ($options['inline'] && $options['width'] && !$label ? "style='width: " . $options['width'] . "'" : '') . ">\n"; $html .= $label ? "<label class='control-label " . ($options['inline'] ? "col-xs-12 col-sm-3 p-l-0" : 'col-xs-12 p-l-0') . "' for='" . $options['input_id'] . "'>{$label} " . ($options['required'] == TRUE ? "<span class='required'>*</span>" : '') . " " . ($options['tip'] ? "<i class='pointer fa fa-question-circle' label=\"" . $options['tip'] . "\"></i>" : '') . "</label>\n" : ''; $html .= $options['inline'] ? "<div class='col-xs-12 " . ($label ? "col-sm-9 col-md-9 col-lg-9" : "col-sm-12") . "'>\n" : ""; } if ($level == 0) { $html =& $html; add_to_jquery("\n\t\t\$('#" . $options['input_id'] . "').select2({\n\t\tplaceholder: '" . $options['placeholder'] . "',\n\t\t{$allowclear}\n\t\t});\n\t\t"); if (is_array($input_value) && $options['multiple']) { // stores as value; $vals = ''; foreach ($input_value as $arr => $val) { $vals .= $arr == count($input_value) - 1 ? "'{$val}'" : "'{$val}',"; } add_to_jquery("\$('#" . $options['input_id'] . "').select2('val', [{$vals}]);"); } $html .= "<select name='{$input_name}' id='" . $options['input_id'] . "' style='width: " . ($options['width'] ? $options['width'] : $default_options['width']) . "' " . ($options['deactivate'] ? " disabled" : "") . ($options['multiple'] ? " multiple" : "") . ">"; $html .= $options['allowclear'] ? "<option value=''></option>" : ''; if ($options['no_root'] == FALSE) { // api options to remove root from selector. used in items creation. $this_select = ''; if ($input_value !== NULL) { if ($input_value !== '') { $this_select = 'selected'; } } $html .= $options['add_parent_opts'] == TRUE ? "<option value='0' " . $this_select . ">{$opt_pattern} " . $locale['parent'] . "</option>\n" : "<option value='0' " . $this_select . " >{$opt_pattern} " . $options['parent_value'] . "</option>\n"; } $index = dbquery_tree($db, $id_col, $cat_col, $options['query']); $data = dbquery_tree_data($db, $id_col, $cat_col, $options['query']); } if (!$id) { $id = 0; } if (isset($index[$id])) { foreach ($index[$id] as $key => $value) { //$hide = $disable_branch && $value == $self_id ? 1 : 0; $html =& $html; $name = $data[$value][$name_col]; $name = PHPFusion\QuantumFields::parse_label($name); $select = $input_value !== "" && $input_value == $value ? 'selected' : ''; $disabled = $disable_opts && in_array($value, $disable_opts) ? TRUE : FALSE; $hide = $disabled && $options['hide_disabled'] ? TRUE : FALSE; // do a disable for filter_opts item. $html .= !$hide ? "<option value='{$value}' " . $select . " " . ($disable_opts && in_array($value, $disable_opts) ? 'disabled' : '') . " >{$opt_pattern} {$name} " . ($options['show_current'] && $self_id == $value ? '(Current Item)' : '') . "</option>\n" : ''; if (isset($index[$value]) && !$hide) { $html .= form_select_tree($input_name, $label, $input_value, $options, $db, $name_col, $id_col, $cat_col, $self_id, $value, $level + TRUE, $index, $data); } } } if (!$level) { $html =& $html; $html .= "</select>"; $html .= $options['required'] == 1 && $defender->inputHasError($input_name) || $defender->inputHasError($input_name) ? "<div id='" . $options['input_id'] . "-help' class='label label-danger p-5 display-inline-block'>" . $options['error_text'] . "</div>" : ""; $html .= $options['inline'] ? "</div>\n" : ''; $html .= "</div>\n"; if ($options['required']) { $html .= "<input class='req' id='dummy-" . $options['input_id'] . "' type='hidden'>\n"; // for jscheck } $input_name = $options['multiple'] ? str_replace("[]", "", $input_name) : $input_name; $defender->add_field_session(array('input_name' => $input_name, 'title' => trim($title, '[]'), 'id' => $options['input_id'], 'type' => 'dropdown', 'regex' => $options['regex'], 'required' => $options['required'], 'safemode' => $options['safemode'], 'error_text' => $options['error_text'], 'callback_check' => $options['callback_check'], 'delimiter' => $options['delimiter'])); } return $html; }
function form_select_order($title, $input_name, $input_id, $option_array, $input_value = false, $chain_to_parent_id, $array = false) { global $_POST; if (!defined("SELECT2")) { define("SELECT2", true); add_to_footer("<script src='" . TEMPLATES_LIB . "select2/select2.min.js'></script>"); add_to_head("<link href='" . TEMPLATES_LIB . "select2/select2.css' rel='stylesheet' />"); } if (!defined("SELECTCHAIN")) { define("SELECTCHAIN", true); add_to_head("<script type='text/javascript' src='" . TEMPLATES_LIB . "chainselect/jquery.chained.js'></script>"); } if (isset($title) && $title !== "") { $title = stripinput($title); } else { $title = ""; } if (isset($input_name) && $input_name !== "") { $input_name = stripinput($input_name); } else { $input_name = ""; } if (isset($desc) && $desc !== "") { $desc = stripinput($desc); } else { $desc = ""; } if (isset($input_value) && $input_value !== "") { $input_value = stripinput($input_value); } else { $input_value = ""; } if (isset($is_order) && $is_order !== "") { $is_order = stripinput($is_order); } else { $is_order = ""; } if (!is_array($array)) { $array = array(); $state_validation = ""; $required = ""; $placeholder = ""; $deactivate = ""; $labeloff = ""; $multiple = ""; $allowclear = ""; $width = "style='width:250px;'"; } else { $required = array_key_exists('required', $array) ? $array['required'] : ""; $is_multiple = array_key_exists('is_multiple', $array) ? $array['is_multiple'] : ""; $placeholder = array_key_exists('placeholder', $array) ? $array['placeholder'] : ""; $deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : ""; $labeloff = array_key_exists('labeloff', $array) ? $array['labeloff'] : ""; $width = array_key_exists('width', $array) ? "style='width:" . $array['width'] . "'" : "style='width:250px;'"; $allowclear = $placeholder !== "" ? "allowClear:true" : ""; // $requested by Tyler for his project if ($required == "1" && empty($_POST['$input_name'])) { $state_validation = "has-error"; } else { $state_validation = ""; } $multiple = $is_multiple == "1" ? "multiple" : ""; } $html = ""; $html .= "<div class='form-group " . $state_validation . " lres'><label class='col-lg-3 control-label' for='{$input_id}'>{$title}</label>"; $html .= "<div class='col-lg-9'>"; $html .= "<select name='{$input_name}' id='{$input_id}' {$width} {$multiple}>"; if (is_array($option_array)) { foreach ($option_array as $arr) { // outputs: key, value, class - in order // will not select //print_p($option_array); //print_p($input_value); // accepts format input: /* * $arr['cat'] = "the parent's value" * $arr['order'] = "the order" * $arr['title'] = "the name" */ if ($input_value !== "" && $arr['order'] == $input_value) { $select = "selected"; } else { $select = ""; } if (array_key_exists("cat", $arr)) { $subclass = "class='" . $arr['cat'] . "'"; } else { $subclass = ""; } // this one is used as chain selects $html .= "<option {$subclass} value='" . $arr['order'] . "'>" . $arr['title'] . "</option>"; } } else { $html .= "<option value=''></option>"; } $html .= "</select>"; $html .= add_to_jquery("\n \$('#" . $input_id . "').select2({\n \tplaceholder: '" . $placeholder . "',\n\t\t{$allowclear}\n\t\t});\n "); $html .= add_to_jquery("\n \$('#" . $input_id . "').chained('#" . $chain_to_parent_id . "');\n "); $html .= "</div></div>"; return $html; }
protected function displayRanksForm() { global $aidlink; if (isset($_POST['cancel_rank'])) { redirect(clean_request("", array("rank_id", "ref"), FALSE)); } add_to_footer("<script src='" . FORUM . "admin/admin_rank.js'></script>"); $this->data['rank_language'] = LANGUAGE; $array_apply_normal_opts = array(USER_LEVEL_MEMBER => self::$locale['424'], '104' => self::$locale['425'], USER_LEVEL_ADMIN => self::$locale['426'], USER_LEVEL_SUPER_ADMIN => self::$locale['427']); // Special Select $groups_arr = getusergroups(); $groups_except = array(USER_LEVEL_PUBLIC, USER_LEVEL_MEMBER, USER_LEVEL_ADMIN, USER_LEVEL_SUPER_ADMIN); $group_opts = array(); foreach ($groups_arr as $group) { if (!in_array($group[0], $groups_except)) { $group_opts[$group[0]] = $group[1]; } } $language_opts = fusion_get_enabled_languages(); $this->post_forum_ranks(); $form_action = FUSION_SELF . $aidlink . '§ion=fr'; if (isset($_GET['rank_id']) && isnum($_GET['rank_id'])) { $result = dbquery("SELECT * FROM " . DB_FORUM_RANKS . " WHERE rank_id='" . intval($_GET['rank_id']) . "'"); if (dbrows($result) > 0) { $this->data = dbarray($result); $form_action = FUSION_SELF . $aidlink . "§ion=fr&rank_id=" . $_GET['rank_id']; } else { redirect(clean_request("", array("rank_id", "ref"), FALSE)); } } $html = openform('rank_form', 'post', $form_action, array('class' => 'm-t-20')) . form_text('rank_title', self::$locale['420'], $this->data['rank_title'], array('required' => 1, 'error_text' => self::$locale['414'], "inline" => TRUE)) . form_select('rank_image', self::$locale['421'], $this->data['rank_image'], array('options' => $this->get_rank_images(), 'placeholder' => self::$locale['choose'], "inline" => TRUE)); if (multilang_table("FR")) { $html .= form_select('rank_language', self::$locale['global_ML100'], $this->data['rank_language'], array('options' => $language_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE)); } else { $html .= form_hidden('rank_language', '', $this->data['rank_language']); } $html .= form_checkbox('rank_type', self::$locale['429'], $this->data['rank_type'], array("options" => array(2 => self::$locale['429a'], 1 => self::$locale['429b'], 0 => self::$locale['429c']), "type" => "radio", "inline" => TRUE)) . form_text('rank_posts', self::$locale['422'], $this->data['rank_posts'], array('inline' => TRUE, 'type' => 'number', 'width' => '10%', 'disabled' => $this->data['rank_type'] != 0)) . "<span id='select_normal' " . ($this->data['rank_type'] == 2 ? "class='display-none'" : "") . " >" . form_select('rank_apply_normal', self::$locale['423'], $this->data['rank_apply'], array('options' => $array_apply_normal_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE)) . "</span>\n<span id='select_special'" . ($this->data['rank_type'] != 2 ? " class='display-none'" : "") . ">" . form_select('rank_apply_special', self::$locale['423'], $this->data['rank_apply'], array('options' => $group_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE)) . "</span>\n" . form_button('save_rank', self::$locale['428'], self::$locale['428'], array('class' => 'btn-primary m-r-10')) . form_button('cancel_rank', self::$locale['cancel'], self::$locale['cancel'], array('class' => 'btn-default')) . closeform(); return $html; /* echo "<td class='tbl'><strong>".self::$locale['429']."</strong></td>\n"; echo "<td class='tbl'>\n"; echo "<label><input type='radio' name='rank_type' value='2'".($rank_type == 2 ? " checked='checked'" : "")." /> ".self::$locale['429a']."</label>\n"; echo "<label><input type='radio' name='rank_type' value='1'".($rank_type == 1 ? " checked='checked'" : "")." /> ".self::$locale['429b']."</label>\n"; echo "<label><input type='radio' name='rank_type' value='0'".($rank_type == 0 ? " checked='checked'" : "")." /> ".self::$locale['429c']."</label>\n"; echo "</td>\n"; echo "</tr>\n<tr>\n"; */ }
function form_select_tree($title, $input_name, $input_id, $input_value = FALSE, $array = FALSE, $db, $name_col, $id_col, $cat_col, $self_id = FALSE, $id = FALSE, $level = FALSE, $index = FALSE, $data = FALSE) { global $_POST, $locale; if (!defined("SELECT2")) { define("SELECT2", TRUE); add_to_footer("<script src='" . DYNAMICS . "assets/select2/select2.min.js' /></script>\n"); add_to_head("<link href='" . DYNAMICS . "assets/select2/select2.css' rel='stylesheet' />\n"); } $title2 = isset($title) && !empty($title) ? stripinput($title) : ucfirst(strtolower(str_replace("_", " ", $input_name))); $input_value = isset($input_value) ? stripinput($input_value) : ''; if (isset($name) && $name != "") { $name = stripinput($name); } else { $name = ""; } if (isset($id_col) && $id_col != "") { $id_col = stripinput($id_col); } else { $id_col = ""; } if (isset($cat_col) && $cat_col != "") { $cat_col = stripinput($cat_col); } else { $cat_col = ""; } if (!is_array($array)) { $array = array(); $state_validation = ""; $required = 0; $safemode = 0; $allowclear = ""; $placeholder = $locale['choose']; $deactivate = ""; $labeloff = ""; $multiple = ""; $stacking = 0; $width = "style='width:90%;'"; $add_parent_opts = 0; $no_root = 0; $inline = ''; $include_opts = ''; // for selective input. will not show items if value not in array. } else { $multiple = array_key_exists('is_multiple', $array) ? $array['is_multiple'] : ""; $placeholder = array_key_exists('placeholder', $array) ? $array['placeholder'] : $locale['choose']; $allowclear = !empty($placeholder) && $multiple !== 1 ? "allowClear:true" : ""; $deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : ""; $labeloff = array_key_exists('labeloff', $array) ? $array['labeloff'] : ""; $helper_text = array_key_exists("helper", $array) ? $array['helper'] : ""; $required = array_key_exists('required', $array) && $array['required'] == 1 ? 1 : 0; $safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? 1 : 0; $stacking = array_key_exists('stacking', $array) && $array['stacking'] == 1 ? 1 : 0; $add_parent_opts = array_key_exists('add_parent_opts', $array) && $array['add_parent_opts'] == 1 ? 1 : 0; $no_root = array_key_exists('no_root', $array) && $array['no_root'] == 1 ? 1 : 0; $width = array_key_exists('width', $array) ? $array['width'] : ''; $multiple = $multiple == 1 ? "multiple" : ""; $inline = array_key_exists("rowstart", $array) ? 1 : 0; $include_opts = array_key_exists("include_opts", $array) ? $array['include_opts'] : ''; } // Patterns if (!$level) { $level = 0; $html = ""; $html .= "<div id='{$input_id}-field' class='form-group m-b-0'>\n"; $html .= "<label class='control-label " . ($inline ? "col-sm-3 col-md-3 col-lg-3" : '') . "' for='{$input_id}'>{$title} " . ($required == 1 ? "<span class='required'>*</span>" : '') . "</label>\n"; $html .= $inline ? "<div class='col-sm-9 col-md-9 col-lg-9'>\n" : ""; } $opt_pattern = str_repeat("—", $level); // no need to count here, it's cosmetics. if ($level == "0") { add_to_jquery("\n \$('#" . $input_id . "').select2({\n placeholder: '" . $placeholder . "',\n {$allowclear}\n });\n "); $html .= "<select name='{$input_name}' id='{$input_id}' " . ($width ? "style='width: {$width}'" : "style='min-width: 250px'") . " " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . " {$multiple}>"; if ($allowclear) { $html .= "<option value=''></option>"; } if ($no_root !== 1) { // api options to remove root from selector. used in items creation. $this_select = ''; if ($input_value !== NULL) { if ($input_value == '0') { $this_select = "selected"; } } $html .= $add_parent_opts == '1' ? "<option value='0' " . $this_select . ">{$opt_pattern} " . $locale['parent'] . "</option>\n" : "<option value='0' {$this_select}>{$opt_pattern} Root</option>\n"; } $index = dbquery_tree($db, $id_col, $cat_col); $data = dbquery_tree_data($db, $id_col, $cat_col); } if (!$id) { $id = 0; } if (isset($index[$id])) { foreach ($index[$id] as $key => $value) { $html =& $html; $name = $data[$value][$name_col]; $select = $input_value !== "" && $input_value == $value ? 'selected' : ''; if (isset($include_opts) && is_array($include_opts)) { $html .= in_array($value, $include_opts) ? "<option value='{$value}' " . $select . " " . ($self_id == $value ? 'disabled' : '') . ">{$opt_pattern} {$name} " . ($self_id == $value ? '(Current Item)' : '') . "</option>\n" : ''; } else { $html .= "<option value='{$value}' " . $select . " " . ($self_id == $value ? 'disabled' : '') . ">{$opt_pattern} {$name} " . ($self_id == $value ? '(Current Item)' : '') . "</option>\n"; } if (isset($index[$value])) { $html .= form_select_tree($title, $input_name, $input_id, $input_value, $array, $db, $name_col, $id_col, $cat_col, $self_id, $value, $level + 1, $index, $data); } } } if (!$level) { $html .= "</select>"; $html .= "<br/><div id='{$input_id}-help' style='display:inline-block !important;'></div>"; $html .= "<input type='hidden' name='def[{$input_name}]' value='[type=dropdown],[title={$title2}],[id={$input_id}],[required={$required}],[safemode={$safemode}]' readonly>"; $html .= "</div>\n"; } return $html; }
function form_fileinput($input_name, $label = '', $input_value = FALSE, array $options = array()) { global $locale, $defender; $title = $label ? stripinput($label) : ucfirst(strtolower(str_replace("_", " ", $input_name))); $input_name = isset($input_name) && !empty($input_name) ? stripinput($input_name) : ""; $template_choices = array('classic', 'modern', 'thumbnail'); $default_options = array("input_id" => $input_name, "upload_path" => IMAGES, "required" => FALSE, "safemode" => FALSE, "deactivate" => FALSE, "preview_off" => FALSE, "type" => "image", "width" => "100%", "label" => $locale['browse'], "inline" => TRUE, "class" => "", "tip" => "", "ext_tip" => "", "error_text" => $locale['error_input_file'], "btn_class" => "btn-default", "icon" => "fa fa-upload", "jsonurl" => FALSE, "valid_ext" => ".jpg,.png,.PNG,.JPG,.JPEG,.gif,.GIF,.bmp,.BMP", "thumbnail" => FALSE, "thumbnail_w" => 300, "thumbnail_h" => 300, "thumbnail_folder" => "", "thumbnail_suffix" => "_t1", "thumbnail2" => FALSE, "thumbnail2_w" => 600, "thumbnail2_h" => 400, "thumbnail2_suffix" => "_t2", "delete_original" => FALSE, "max_width" => 1800, "max_height" => 1600, "max_byte" => 1500000, "max_count" => 1, "multiple" => FALSE, "template" => "classic"); $options += $default_options; if (!is_dir($options['upload_path'])) { $options['upload_path'] = IMAGES; } $options['thumbnail_folder'] = rtrim($options['thumbnail_folder'], "/"); if (!in_array($options['template'], $template_choices)) { $options['template'] = "classic"; } $options['input_id'] = trim($options['input_id'], "[]"); $error_class = ""; if ($defender->inputHasError($input_name)) { $error_class = "has-error "; if (!empty($options['error_text'])) { addNotice("danger", "<strong>{$title}</strong> - " . $options['error_text']); } } // default max file size $format = ''; $browseLabel = $locale['df_300']; // file type if single filter, if not will accept as object if left empty. $type_for_js = NULL; if ($options['type']) { if (!stristr($options['type'], ',') && $options['type']) { if ($options['type'] == 'image') { $format = "image/*"; $browseLabel = $locale['df_301']; } elseif ($options['type'] == 'video') { $format = "video/*"; $browseLabel = $locale['df_302']; } elseif ($options['type'] == 'audio') { $format = "audio/*"; $browseLabel = $locale['df_303']; } } $type_for_js = json_encode((array) $options['type']); } $value = ''; if (!empty($input_value)) { if (is_array($input_value)) { foreach ($input_value as $value) { $value[] = "<img class='img-responsive' src='" . $value . "/>"; } } else { $value = "<img class='img-responsive' src='" . $input_value . "'/>"; } $value = json_encode($value); } if (!defined('form_fileinput')) { add_to_head("<link href='" . DYNAMICS . "assets/fileinput/css/fileinput.min.css' media='all' rel='stylesheet' type='text/css' />"); add_to_footer("<script src='" . DYNAMICS . "assets/fileinput/js/fileinput.min.js' type='text/javascript'></script>"); define('form_fileinput', TRUE); } $html = "<div id='" . $options['input_id'] . "-field' class='form-group " . $error_class . $options['class'] . "' " . ($options['width'] && !$label ? "style='width: " . $options['width'] . " !important;'" : '') . ">\n"; $html .= $label ? "<label class='control-label " . ($options['inline'] ? "col-xs-12 col-sm-3 col-md-3 col-lg-3 p-l-0" : '') . "' for='" . $options['input_id'] . "'>{$label} " . ($options['required'] ? "<span class='required'>*</span>" : '') . "\n\t" . ($options['tip'] ? "<i class='pointer fa fa-question-circle' title='" . $options['tip'] . "'></i>" : '') . "\n\t</label>\n" : ''; $html .= $options['inline'] ? "<div class='col-xs-12 " . ($label ? "col-sm-9 col-md-9 col-lg-9" : "col-sm-12") . "'>\n" : ""; $html .= "<input type='file' " . ($format ? "accept='" . $format . "'" : '') . " name='" . $input_name . "' id='" . $options['input_id'] . "' style='width:" . $options['width'] . "' " . ($options['deactivate'] ? 'readonly' : '') . " " . ($options['multiple'] ? "multiple='1'" : '') . " />\n"; $html .= $options['ext_tip'] ? "<br/>\n<span class='tip'><i>" . $options['ext_tip'] . "</i></span>" : ""; $html .= $options['required'] == 1 && $defender->inputHasError($input_name) || $defender->inputHasError($input_name) ? "<div id='" . $options['input_id'] . "-help' class='label label-danger p-5 display-inline-block'>" . $options['error_text'] . "</div>" : ""; $html .= $options['inline'] ? "</div>\n" : ""; $html .= "</div>\n"; $defender->add_field_session(array('input_name' => trim($input_name, '[]'), 'type' => (array) $options['type'] == array('image') ? 'image' : 'file', 'title' => $title, 'id' => $options['input_id'], 'required' => $options['required'], 'safemode' => $options['safemode'], 'error_text' => $options['error_text'], 'path' => $options['upload_path'], 'thumbnail_folder' => $options['thumbnail_folder'], 'thumbnail' => $options['thumbnail'], 'thumbnail_suffix' => $options['thumbnail_suffix'], 'thumbnail_w' => $options['thumbnail_w'], 'thumbnail_h' => $options['thumbnail_h'], 'thumbnail2' => $options['thumbnail2'], 'thumbnail2_w' => $options['thumbnail2_w'], 'thumbnail2_h' => $options['thumbnail2_h'], 'thumbnail2_suffix' => $options['thumbnail2_suffix'], 'delete_original' => $options['delete_original'], 'max_width' => $options['max_width'], 'max_height' => $options['max_height'], 'max_count' => $options['max_count'], 'max_byte' => $options['max_byte'], 'multiple' => $options['multiple'], 'valid_ext' => $options['valid_ext'])); switch ($options['template']) { case "classic": add_to_jquery("\n \$('#" . $options['input_id'] . "').fileinput({\n allowedFileTypes: " . $type_for_js . ",\n allowedPreviewTypes : " . $type_for_js . ",\n " . ($value ? "initialPreview: " . $value . ", " : '') . "\n " . ($options['preview_off'] ? "showPreview: false, " : '') . "\n browseClass: 'btn " . $options['btn_class'] . " button',\n uploadClass: 'btn btn-default button',\n captionClass : '',\n removeClass : 'btn btn-default button',\n browseLabel: '" . $browseLabel . "',\n browseIcon: '<i class=\"" . $options['icon'] . " m-r-10\"></i>',\n " . ($options['jsonurl'] ? "uploadUrl : '" . $options['url'] . "'," : '') . "\n " . ($options['jsonurl'] ? '' : 'showUpload: false') . "\n });\n "); break; case "modern": add_to_jquery("\n \$('#" . $options['input_id'] . "').fileinput({\n allowedFileTypes: " . $type_for_js . ",\n allowedPreviewTypes : " . $type_for_js . ",\n " . ($value ? "initialPreview: " . $value . ", " : '') . "\n " . ($options['preview_off'] ? "showPreview: false, " : '') . "\n browseClass: 'btn btn-modal',\n uploadClass: 'btn btn-modal',\n captionClass : '',\n removeClass : 'btn button',\n browseLabel: '" . $browseLabel . "',\n browseIcon: '<i class=\"fa fa-plus m-r-10\"></i>',\n showCaption: false,\n showRemove: false,\n showUpload: false,\n layoutTemplates: {\n main2: '<div class=\"btn-photo-upload btn-link\">'+' {browse}'+' </div></span></div> {preview}',\n },\n });\n "); break; case "thumbnail": add_to_jquery("\n \$('#" . $options['input_id'] . "').fileinput({\n allowedFileTypes: " . $type_for_js . ",\n allowedPreviewTypes : " . $type_for_js . ",\n " . ($value ? "initialPreview: " . $value . ", " : '') . "\n " . ($options['preview_off'] ? "showPreview: false, " : '') . "\n defaultPreviewContent: '<img class=\"img-responsive\" src=\"" . IMAGES . "no_photo.png\" alt=\"" . $browseLabel . "\" style=\"width:100%;\">',\n browseClass: 'btn btn-sm btn-block btn-default',\n uploadClass: 'btn btn-modal',\n captionClass : '',\n removeClass : 'btn button',\n browseLabel: '" . $browseLabel . "',\n browseIcon: '<i class=\"fa fa-plus m-r-10\"></i>',\n showCaption: false,\n showRemove: false,\n showUpload: false,\n layoutTemplates: {\n main2: '<div class=\"panel panel-default\">'+'{preview}'+'<div class=\"panel-body\">'+' {browse}'+'</div></div>',\n },\n });\n "); break; } return $html; }
die("Access Denied"); } $before = "<div class='quote extended'><p class='citation'>"; $endbefore = "</p><div class='blockquote'>"; $after = "</div></div>"; //Broken quotes $match = '#\\[quote ((name=|post=)|name=post=|name=([\\w\\d ]+?)( *?)post=|name=( *?)post=([\\0-9]+?))?\\]#si'; //Fix broken quotes $text = preg_replace($match, '[quote]', $text); //Extended quotes regex $exta = '\\[quote name=([\\w\\d ]+?) post=([\\0-9]+?)\\]'; //name and post $extb = '\\[quote name=([\\w\\d ]+?)\\]'; //name only //Count all quotes $qcount = substr_count($text, '[quote]'); $qcount = $qcount + preg_match_all('#' . $exta . '#si', $text, $matches); $qcount = $qcount + preg_match_all('#' . $extb . '#si', $text, $matches); for ($i = 0; $i < $qcount; $i++) { //Replace default quotes $text = preg_replace('#\\[quote\\](.*?)\\[/quote\\]#si', $before . $locale['bb_quote'] . $endbefore . '$1' . $after, $text); //replace default quote //HTML //Replace extended quotes $text = preg_replace('#' . $exta . '(.*?)\\[/quote\\]#si', $before . '<a class=\'quote-link\' rel=\'$2\' href=\'viewthread.php?pid=$2\' target=\'_blank\'>$1 ' . $locale['bb_wrote'] . ': <span class=\'goto-post-arrow\'>↑</span></a>' . $endbefore . '$3' . $after, $text); //replace quote with valid name and post //HTML $text = preg_replace('#' . $extb . '(.*?)\\[/quote\\]#si', $before . '$1' . $endbefore . '$2' . $after, $text); //replace quote with valid name and no post //HTML } if (function_exists('add_to_footer')) { add_to_footer("<script type='text/javascript'>/* <![CDATA[ */\njQuery(document).ready(function() {\n/*!\n * Extended Quote BBcode for PHP-Fusion\n * with jQuery Quote Collapse\n *\n * Author: JoiNNN\n *\n * Copyright (c) 2002 - 2012 by Nick Jones\n * Released as free software without warranties under GNU Affero GPL v3. \n */\n\nvar quoteColHeight\t= 184,\t\t\t//0 - disables quote collapse\n\tcolCls\t\t\t= 'collapsed',\t//class when collapsed\n\texpCls\t\t\t= 'expanded';\t//class when expanded\n\nif (quoteColHeight > 0) {\n// On page load\njQuery('.quote').each(function() {\n\tvar quote\t\t= jQuery(this),\n\t\tblock\t\t= quote.find('.blockquote').first();\n\n\t//On load add expand link if quote is long enough\n\tif (block.height() > quoteColHeight) {\n\t\tquote.addClass(colCls);\n\t\tquote.find('.citation').first().prepend('<a href=\"#\" class=\"toggle-quote ' + colCls + ' flright\">" . $locale['bb_quote_expand'] . "</a>');\n\t\tblock.css({'height': quoteColHeight, 'overflow': 'hidden'});\n\t}\n});\n\n// On click\njQuery('.toggle-quote').click(function(e) {\n\te.preventDefault();\n\tvar toggler\t\t= jQuery(this),\n\t\tquote\t\t= toggler.parent().parent(),\n\t\tblock\t\t= quote.find('.blockquote').first();\n\n\tif (block.height() > quoteColHeight) {\n\t\tblock.stop().animate({'height': quoteColHeight + 'px'}, 200);\n\t\ttoggler.html('" . $locale['bb_quote_expand'] . "');\n\t\ttoggler.removeClass(expCls).addClass(colCls);\n\t\tquote.removeClass(expCls).addClass(colCls);\n\t} else {\n\t\tblock.stop().animate({'height': block[0].scrollHeight + 'px'}, 200, function() {\n\t\t\tjQuery(this).css({'height': 'auto'});\n\t\t});\n\t\ttoggler.html('" . $locale['bb_quote_collapse'] . "');\n\t\ttoggler.removeClass(colCls).addClass(expCls);\n\t\tquote.removeClass(colCls).addClass(expCls);\n\t}\n});\n\n// Scroll to quoted post if is on the same page as the quote, instead of opening a new tab\njQuery('.quote-link').click(function(e) {\n\tvar pid = jQuery(this).attr('rel');\n\tif (jQuery('#post_' + pid).length) {\n\t\tvar target =jQuery('#post_' + pid).offset().top;\n\t\tjQuery('html, body').animate({scrollTop:target}, 200);\n\t\te.preventDefault();\n\t}\n});\n\n}\n});/* ]]> */\n</script>"); }
function render_admin_panel() { global $locale, $userdata, $defender, $pages, $aidlink, $admin; $languages = fusion_get_enabled_languages(); // Admin panel page echo "<div id='admin-panel' class='clearfix in'>\n"; // Top header section echo "<section id='acp-header' class='pull-left affix clearfix' data-offset-top='0' data-offset-bottom='0'>\n"; // Top left logo echo "<div class='brand'>\n"; echo "<div class='pull-right'>\n"; echo "</div>\n</div>\n"; // Top navigation echo "<nav>\n"; // Top side panel toggler echo "<ul class='venus-toggler'>\n"; echo "<li><a id='toggle-canvas' class='pointer' style='border-left:none;'><i class='fa fa-bars fa-lg'></i></a></li>\n"; echo "</ul>\n"; echo $admin->horiziontal_admin_nav(true); // Top right menu links echo "<ul class='top-right-menu pull-right m-r-15'>\n"; echo "<li class='dropdown'>\n"; echo "<a class='dropdown-toggle pointer' data-toggle='dropdown'>" . display_avatar($userdata, '25px', '', '', '') . " " . $locale['logged'] . "<strong>" . $userdata['user_name'] . "</strong> <span class='caret'></span>\n</a>\n"; echo "<ul class='dropdown-menu' role='menu'>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "edit_profile.php'>" . $locale['edit'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['view'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li class='divider'> </li>\n"; echo "<li><a class='display-block' href='" . FUSION_REQUEST . "&logout'>" . $locale['admin-logout'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "index.php?logout=yes'>" . $locale['logout'] . "</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; echo "<li><a title='" . $locale['settings'] . "' href='" . ADMIN . "settings_main.php" . $aidlink . "'><i class='fa fa-cog fa-lg'></i></a></li>\n"; echo "<li><a title='" . fusion_get_settings('sitename') . "' href='" . BASEDIR . "index.php'><i class='fa fa-home fa-lg'></i></a>\n</li>\n"; echo "<li><a title='" . $locale['message'] . "' href='" . BASEDIR . "messages.php'><i class='fa fa-envelope-o fa-lg'></i></a>\n</li>\n"; if (count($languages) > 1) { echo "<li class='dropdown'><a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . $locale['282'] . "'><i class='fa fa-globe fa-lg fa-fw'></i> " . translate_lang_names(LANGUAGE) . "<span class='caret'></span></a>\n"; echo "<ul class='dropdown-menu'>\n"; foreach ($languages as $language_folder => $language_name) { echo "<li><a class='display-block' href='" . clean_request("lang=" . $language_folder, array("lang"), FALSE) . "'><img class='m-r-5' src='" . BASEDIR . "locale/{$language_folder}/{$language_folder}-s.png'> {$language_name}</a></li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; // .top-right-menu echo "</nav>\n"; echo "</section>\n"; // Content section echo "<div class='content-wrapper display-table pull-left'>\n"; // Left side panel echo "<div id='acp-left' class='pull-left affix' data-offset-top='0' data-offset-bottom='0'>\n"; // collapse to top menu on sm and xs echo "<div class='panel panel-default admin'><div class='panel-body clearfix'>\n"; echo "<div class='pull-left m-r-10'>\n" . display_avatar($userdata, '50px', '', '', '') . "</div>\n"; echo "<span class='overflow-hide m-t-10'><h4 class='m-b-0 text-stronger'>\n" . $userdata['user_name'] . "</h4>\n" . getuserlevel($userdata['user_level']) . "</span></div>\n"; echo "</div>\n"; echo $admin->vertical_admin_nav(); echo "</div>\n"; // #acp-left // Control panel content wrapper echo "<div id='acp-main' class='clearfix' style='vertical-align:top;'>\n"; // Main content wrapper echo "<div id='acp-content' class='m-t-20 col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; // Render breadcrumbs echo render_breadcrumbs(); // Get and render notices $notices = getNotices(); echo renderNotices($notices); // Render the content echo CONTENT; echo "</div>\n"; // #acp-content // Footer section echo "<footer class='m-l-20 display-inline-block m-t-20 m-b-20'>\n"; // Copyright echo "Venus Admin © " . date("Y") . " created by <a href='https://www.php-fusion.co.uk'><strong>PHP-Fusion Inc.</strong></a>\n"; echo showcopyright(); // Render time if (fusion_get_settings('rendertime_enabled')) { echo "<br /><br />"; // Make showing of queries and memory usage separate settings echo showrendertime(); echo showMemoryUsage(); } echo "</footer>\n"; echo "</div>\n"; // .acp-main echo "</div>\n"; // .content-wrapper echo "</div>\n"; // #admin-panel add_to_footer("<script src='" . THEMES . "admin_themes/Venus/includes/jquery.slimscroll.min.js'></script>"); if (!isset($_COOKIE['acp_sidemenu'])) { setcookie("acp_sidemenu", 1, 64800); } add_to_jquery("\n\t// Initialize slimscroll\n\t\$('#adl').slimScroll({\n\t\theight: null\n\t});\n\n\t// Function to toggle side menu\n\tfunction toggleSideMenu(state) {\n\t\tvar panel_state = null;\n\t\tif (state == 'show') {\n\t\t\t\$('#admin-panel').addClass('in');\n\t\t\tvar panel_state = 1;\n\t\t} else if (state == 'hide') {\n\t\t\t\$('#admin-panel').removeClass('in');\n\t\t\tvar panel_state = 0;\n\t\t} else {\n\t\t\t\$('#admin-panel').toggleClass('in');\n\t\t\tvar panel_state = \$('#admin-panel').hasClass('in');\n\t\t}\n\t\tif (panel_state) {\n\t\t\t\$.cookie('" . COOKIE_PREFIX . "acp_sidemenu', '1', {expires: 164800});\n\t\t} else {\n\t\t\t\$.cookie('" . COOKIE_PREFIX . "acp_sidemenu', '0', {expires: 164800});\n\t\t}\n\t}\n\n\t// Adjust side menu height on page load, resize or orientation change\n\t\$(window).on('load resize orientationchange', function(event) {\n\t\tvar init_hgt = \$(window).height();\n\t\tvar small = \$('.brand-text').is(':visible');\n\t\tvar panel_height = (small ? init_hgt-125 : init_hgt-80);\n\t\tvar hgt = \$(this).height();\n\t\t\$('#acp-left').css('height', hgt);\n\t\t\$('.admin-vertical-link').css('height', panel_height);\n\t\t// Hide side menu on orientation change\n\t\t//if (event.type === 'orientationchange') {\n\t\t//\ttoggleSideMenu('show');\n\t\t//}\n\t});\n\t// Side menu toggler\n\t\$('#toggle-canvas').on('click', toggleSideMenu);\n\t"); }
/** * Formatted value of a variable to debug * @param mixed $array * @param boolean $modal TRUE if you want to render it as a modal dialog */ function print_p($array, $modal = FALSE) { if ($modal == TRUE) { ob_start(); echo openmodal('Debug', 'Debug'); } echo "<pre style='white-space:pre-wrap !important;'>"; echo htmlspecialchars(print_r($array, TRUE), ENT_QUOTES, 'utf-8'); echo "</pre>"; if ($modal == TRUE) { echo closemodal(); add_to_footer(ob_get_contents()); ob_end_clean(); } }
/** * HTML template for forum move */ private function display_forum_move_form() { ob_start(); echo openmodal('move', self::$locale['forum_060'], array('static' => 1, 'class' => 'modal-md')); echo openform('moveform', 'post', FUSION_REQUEST); echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-5 col-md-5 col-lg-5'>\n"; echo "<span class='text-dark strong'>" . self::$locale['forum_052'] . "</span><br/>\n"; echo "</div><div class='col-xs-12 col-sm-7 col-md-7 col-lg-7'>\n"; echo form_select_tree('move_threads', '', $_GET['forum_id'], array('width' => '100%', 'inline' => TRUE, 'disable_opts' => $_GET['forum_id'], 'hide_disabled' => 1, 'no_root' => 1), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat', $_GET['forum_id']); echo form_checkbox('delete_threads', self::$locale['forum_053'], ''); echo "</div>\n</div>\n"; echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-5 col-md-5 col-lg-5'>\n"; echo "<span class='text-dark strong'>" . self::$locale['forum_054'] . "</span><br/>\n"; // if you move, then need new hcat_key echo "</div><div class='col-xs-12 col-sm-7 col-md-7 col-lg-7'>\n"; echo form_select_tree('move_forums', '', $_GET['forum_id'], array('width' => '100%', 'inline' => TRUE, 'disable_opts' => $_GET['forum_id'], 'hide_disabled' => 1, 'no_root' => 1), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat', $_GET['forum_id']); echo form_checkbox('delete_forums', self::$locale['forum_055'], ''); echo "</div>\n</div>\n"; echo "<div class='clearfix'>\n"; echo form_hidden('forum_id', '', $_GET['forum_id']); echo form_hidden('forum_branch', '', $_GET['forum_branch']); echo form_button('forum_remove', self::$locale['forum_049'], 'forum_remove', array('class' => 'btn-sm btn-danger m-r-10', 'icon' => 'fa fa-trash')); echo "<button type='button' class='btn btn-sm btn-default' data-dismiss='modal'>" . self::$locale['close'] . "</button>\n"; echo "</div>\n"; echo closeform(); echo closemodal(); add_to_footer(ob_get_contents()); ob_end_clean(); }
if (preg_match("/^([a-z0-9_-]){2,50}\$/i", $settings['admin_theme']) && file_exists(THEMES . "admin_themes/" . $settings['admin_theme'] . "/acp_theme.php")) { require_once THEMES . "admin_themes/" . $settings['admin_theme'] . "/acp_theme.php"; } else { die('WARNING: Invalid Admin Panel Theme'); // TODO: improve this } if (iMEMBER) { $result = dbquery("UPDATE " . DB_USERS . " SET user_lastvisit=UNIX_TIMESTAMP(NOW()), user_ip='" . USER_IP . "', user_ip_type='" . USER_IP_TYPE . "' WHERE user_id='" . $userdata['user_id'] . "'"); } $bootstrap_theme_css_src = ''; // Load bootstrap if ($settings['bootstrap']) { define('BOOTSTRAPPED', TRUE); $bootstrap_theme_css_src = INCLUDES . "bootstrap/bootstrap.css"; add_to_footer("<script type='text/javascript' src='" . INCLUDES . "bootstrap/bootstrap.min.js'></script>"); add_to_footer("<script type='text/javascript' src='" . INCLUDES . "bootstrap/holder.js'></script>"); } require_once THEMES . "templates/panels.php"; ob_start(); require_once ADMIN . "admin.php"; $admin = new \PHPFusion\Admin(); @(list($title) = dbarraynum(dbquery("SELECT admin_title FROM " . DB_ADMIN . " WHERE admin_link='" . FUSION_SELF . "'"))); \PHPFusion\OutputHandler::setTitle($GLOBALS['locale']['global_123'] . $GLOBALS['locale']['global_201'] . ($title ? $title . $GLOBALS['locale']['global_201'] : "")); // Use infusion_db file to modify admin properties $infusion_folder = makefilelist(INFUSIONS, ".|..|", "", "folders"); if (!empty($infusion_folder)) { foreach ($infusion_folder as $folder) { if (file_exists(INFUSIONS . $folder . "/infusion_db.php")) { require_once INFUSIONS . $folder . "/infusion_db.php"; } }
echo openmodal("permalinkHelper", $locale['408'], array("button_id" => "pButton")); if (!empty($regex)) { echo "<table class='table table-responsive table-striped'>\n"; foreach ($regex as $key => $values) { echo "<tr>\n"; echo "<td>" . $key . "</td>\n"; echo "<td>" . $values . "</td>\n"; echo "<td>\n"; echo isset($permalink_tags_desc[$key]) ? $permalink_tags_desc[$key] : $locale['na']; echo "</td>\n"; echo "</tr>\n"; } echo "</table>\n"; } echo closemodal(); add_to_footer(ob_get_contents()); ob_end_clean(); echo "<div class='text-right display-block'>\n"; echo form_button("pButton", $locale['help'], $locale['help'], array("input_id" => "pButton", "type" => "button")); echo form_button("savepermalinks", $locale['save_changes'], $locale['413'], array("class" => "m-l-10 btn-primary", "input_id" => "save_top")); echo "</div>\n"; // Driver Rules Installed echo "<h4>\n" . $locale['409'] . "</h4>\n"; $i = 1; foreach ($driver as $data) { echo "<div class='list-group-item m-b-20'>\n"; $source = preg_replace("/%(.*?)%/i", "<kbd class='m-2'>%\$1%</kbd>", $data['pattern_source']); $target = preg_replace("/%(.*?)%/i", "<kbd class='m-2'>%\$1%</kbd>", $data['pattern_target']); echo "<p class='m-t-10 m-b-10'>\n <label class='label' style='background:#ddd; color: #000; font-weight:normal; font-size: 1rem;'>\n " . $target . "\n</label>\n"; echo "</p>\n"; // new text input
/** * Moving Posts */ private function mod_move_posts() { global $locale; if (isset($_POST['move_posts']) && iMOD) { $remove_first_post = FALSE; $f_post_blo = FALSE; if (isset($_POST['delete_post']) && !empty($_POST['delete_post'])) { $first_post = dbarray(dbquery("SELECT post_id FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . intval($this->thread_id) . "' ORDER BY post_datestamp ASC LIMIT 1")); /** * Scan for Posts */ $move_posts = ""; $array_post = array(); $first_post_found = FALSE; foreach ($_POST['delete_post'] as $move_post_id) { if (isnum($move_post_id)) { $move_posts .= ($move_posts ? "," : "") . $move_post_id; $array_post[] = $move_post_id; if ($move_post_id == $first_post['post_id']) { $first_post_found = TRUE; } } } // triggered move post if ($move_posts) { // validate whether the selected post exists $move_result = dbquery("SELECT forum_id, thread_id, COUNT(post_id) 'num_posts'\n\t\t\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . "\n\t\t\t\t\t\t\t\t\tWHERE post_id IN (" . $move_posts . ")\n\t\t\t\t\t\t\t\t\tAND thread_id='" . intval($this->thread_id) . "'\n\t\t\t\t\t\t\t\t\tGROUP BY thread_id"); if (dbrows($move_result) > 0) { $pdata = dbarray($move_result); $post_count = dbcount("(post_id)", DB_FORUM_POSTS, "thread_id='" . intval($pdata['thread_id']) . "'"); ob_start(); echo openmodal('forum0300', $locale['forum_0300'], array('class' => 'modal-md')); if ($first_post_found) { // there is a first post. echo "<div id='close-message'><div class='admin-message alert alert-info m-t-10'>"; if ($pdata['num_posts'] != $post_count) { $remove_first_post = TRUE; echo $locale['forum_0305'] . "<br />\n"; // trying to remove first post with other post in the thread } else { echo $locale['forum_0306'] . "<br />\n"; // confirm ok to remove first post. } if ($remove_first_post && count($array_post) == 1) { echo "<br /><strong>" . $locale['forum_0307'] . "</strong><br /><br />\n"; // no post to move. echo "<a href='" . INFUSIONS . "forum/viewthread.php?thread_id=" . $pdata['thread_id'] . "&rowstart=" . $_GET['rowstart'] . "'>" . $locale['forum_0309'] . "</a>"; $f_post_blo = TRUE; } echo "</div></div>\n"; } if (!isset($_POST['new_forum_id']) && !$f_post_blo) { $fl_result = dbquery("\n\t\t\t\t\t\t\t\t\t\tSELECT f.forum_id, f.forum_name, f.forum_type, f2.forum_name 'forum_cat_name',\n\t\t\t\t\t\t\t\t\t\t(\tSELECT COUNT(thread_id) FROM " . DB_FORUM_THREADS . " th WHERE f.forum_id=th.forum_id AND th.thread_id !='" . intval($this->thread_id) . "'\n\t\t\t\t\t\t\t\t\t\t\tGROUP BY th.forum_id\n\t\t\t\t\t\t\t\t\t\t) AS threadcount\n\t\t\t\t\t\t\t\t\t\t\tFROM " . DB_FORUMS . " f\n\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\n\t\t\t\t\t\t\t\t\t\tWHERE " . groupaccess('f.forum_access') . "\n\t\t\t\t\t\t\t\t\t\tORDER BY f2.forum_order ASC, f.forum_order ASC\n\t\t\t\t\t\t\t\t\t\t"); if (dbrows($fl_result) > 0) { $exclude_opts = array(); while ($data = dbarray($fl_result)) { if (empty($data['threadcount']) || $data['forum_type'] == '1') { $exclude_opts[] = $data['forum_id']; } } echo openform('modopts', 'post', $this->form_action); echo form_select_tree('new_forum_id', $locale['forum_0301'], '', array('disable_opts' => $exclude_opts, 'no_root' => 1, 'inline' => 1), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat'); foreach ($array_post as $value) { echo form_hidden("delete_post[]", "", $value, array("input_id" => "delete_post[{$value}]")); } echo form_hidden('move_posts', '', 1); echo "<div class='clearfix'>\n<div class='col-xs-12 col-md-offset-3 col-lg-offset-3'>\n"; echo form_button($locale['forum_0302'], $locale['forum_0208'], $locale['forum_0208'], array('inline' => 1, 'class' => 'btn-primary')); echo "</div>\n</div>\n"; echo closeform(); } else { echo "<div class='well'>\n"; echo "<strong>" . $locale['forum_0310'] . "</strong><br /><br />\n"; echo "<a href='" . INFUSIONS . "forum/viewthread.php?thread_id=" . $pdata['thread_id'] . "&rowstart=" . $_GET['rowstart'] . "'>" . $locale['forum_0309'] . "</a><br /><br />\n"; echo "</div>\n"; } } elseif (isset($_POST['new_forum_id']) && isnum($_POST['new_forum_id']) && !isset($_POST['new_thread_id']) && !$f_post_blo) { // Select Threads in Selected Forum. // build the list. $tl_result = dbquery("\n\t\t\t\t\t\t\tSELECT thread_id, thread_subject\n\t\t\t\t\t\t\tFROM " . DB_FORUM_THREADS . "\n\t\t\t\t\t\t\tWHERE forum_id='" . intval($_POST['new_forum_id']) . "' AND thread_id !='" . intval($pdata['thread_id']) . "' AND thread_hidden='0'\n\t\t\t\t\t\t\tORDER BY thread_subject ASC\n\t\t\t\t\t\t\t"); if (dbrows($tl_result) > 0) { $forum_list = array(); while ($tl_data = dbarray($tl_result)) { $forum_list[$tl_data['thread_id']] = $tl_data['thread_subject']; } echo openform('modopts', 'post', $this->form_action . "&sv", array('max_tokens' => 1, 'downtime' => 1)); echo form_hidden('new_forum_id', '', $_POST['new_forum_id']); echo form_select('new_thread_id', $locale['forum_0303'], '', array('options' => $forum_list, 'inline' => 1)); foreach ($array_post as $value) { echo form_hidden("delete_post[]", "", $value, array("input_id" => "delete_post[{$value}]")); } echo form_hidden('move_posts', '', 1); echo form_button($locale['forum_0304'], $locale['forum_0208'], $locale['forum_0208'], array('class' => 'btn-primary btn-sm')); } else { echo $locale['forum_0308'] . "<br /><br />\n"; echo "<a href='" . INFUSIONS . "forum/viewthread.php?thread_id=" . $pdata['thread_id'] . "'>" . $locale['forum_0309'] . "</a>\n"; } } elseif (isset($_GET['sv']) && isset($_POST['new_forum_id']) && isnum($_POST['new_forum_id']) && isset($_POST['new_thread_id']) && isnum($_POST['new_thread_id'])) { // Execute move and redirect after $move_posts_add = ""; if (!dbcount("(thread_id)", DB_FORUM_THREADS, "thread_id='" . intval($_POST['new_thread_id']) . "' AND forum_id='" . intval($_POST['new_forum_id']) . "'")) { redirect($this->form_action . "&error=1"); } foreach ($array_post as $move_post_id) { if (isnum($move_post_id)) { if ($first_post_found && $remove_first_post) { if ($move_post_id != $first_post['post_id']) { $move_posts_add .= ($move_posts_add ? "," : "") . $move_post_id; } $pdata['num_posts'] = $pdata['num_posts'] - 1; } else { $move_posts_add = $move_post_id . ($move_posts_add ? "," : "") . $move_posts_add; } } } if ($move_posts_add) { $posts_ex = dbcount("(post_id)", DB_FORUM_POSTS, "thread_id='" . intval($pdata['thread_id']) . "' AND post_id IN (" . $move_posts_add . ")"); if ($posts_ex) { $result = dbquery("UPDATE " . DB_FORUM_POSTS . " SET forum_id='" . intval($_POST['new_forum_id']) . "', thread_id='" . intval($_POST['new_thread_id']) . "' WHERE post_id IN (" . $move_posts_add . ")"); $result = dbquery("UPDATE " . DB_FORUM_ATTACHMENTS . " SET thread_id='" . intval($_POST['new_thread_id']) . "' WHERE post_id IN(" . $move_posts_add . ")"); $new_thread = dbarray(dbquery("\n\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT forum_id, thread_id, post_id, post_author, post_datestamp\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . "\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE thread_id='" . intval($_POST['new_thread_id']) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY post_datestamp DESC\n\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t")); $result = dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_lastpost='" . intval($new_thread['post_datestamp']) . "', thread_lastpostid='" . intval($new_thread['post_id']) . "',\n\t\t\t\t\t\t\t\t\tthread_postcount=thread_postcount+" . intval($pdata['num_posts']) . ", thread_lastuser='******'post_author']) . "' WHERE thread_id='" . intval($_POST['new_thread_id']) . "'"); $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . intval($new_thread['post_datestamp']) . "', forum_postcount=forum_postcount+" . intval($pdata['num_posts']) . ", forum_lastuser='******'post_author'] . "' WHERE forum_id='" . intval($_POST['new_forum_id']) . "'"); $old_thread = dbarray(dbquery("\n\t\t\t\t\t\t\t\t\tSELECT forum_id, thread_id, post_id, post_author, post_datestamp\n\t\t\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . " WHERE thread_id='" . intval($pdata['thread_id']) . "' ORDER BY post_datestamp DESC\n\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t")); if (!dbcount("(post_id)", DB_FORUM_POSTS, "thread_id='" . intval($pdata['thread_id']) . "'")) { $new_last_post = dbarray(dbquery("SELECT post_author, post_datestamp FROM " . DB_FORUM_POSTS . " WHERE forum_id='" . intval($pdata['forum_id']) . "' ORDER BY post_datestamp DESC LIMIT 1 ")); $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . intval($new_last_post['post_datestamp']) . "', forum_postcount=forum_postcount-" . intval($pdata['num_posts']) . ", forum_threadcount=forum_threadcount-1, forum_lastuser='******'post_author']) . "' WHERE forum_id='" . intval($pdata['forum_id']) . "'"); $result = dbquery("DELETE FROM " . DB_FORUM_THREADS . " WHERE thread_id='" . intval($pdata['thread_id']) . "'"); $result = dbquery("DELETE FROM " . DB_FORUM_THREAD_NOTIFY . " WHERE thread_id='" . intval($pdata['thread_id']) . "'"); $result = dbquery("DELETE FROM " . DB_FORUM_POLL_VOTERS . " WHERE thread_id='" . intval($pdata['thread_id']) . "'"); $result = dbquery("DELETE FROM " . DB_FORUM_POLL_OPTIONS . " WHERE thread_id='" . intval($pdata['thread_id']) . "'"); $result = dbquery("DELETE FROM " . DB_FORUM_POLLS . " WHERE thread_id='" . intval($pdata['thread_id']) . "'"); } else { $result = dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_lastpost='" . intval($old_thread['post_datestamp']) . "',\n\t\t\t\t\t\t\t\t\t\tthread_lastpostid='" . intval($old_thread['post_id']) . "', thread_postcount=thread_postcount-" . intval($pdata['num_posts']) . ", thread_lastuser='******'post_author']) . "' WHERE thread_id='" . intval($pdata['thread_id']) . "'"); $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . intval($old_thread['post_datestamp']) . "', forum_postcount=forum_postcount-" . intval($pdata['num_posts']) . ", forum_lastuser='******'post_author']) . "' WHERE forum_id='" . intval($pdata['forum_id']) . "'"); } $pid = count($array_post) - 1; redirect(INFUSIONS . "forum/viewthread.php?thread_id=" . intval($_POST['new_thread_id']) . "&pid=" . $array_post[$pid] . "#post_" . $array_post[$pid]); } else { addNotice('danger', $locale['error-MP002']); redirect($this->form_action); } } else { addNotice('danger', $locale['error-MP003']); redirect($this->form_action); } } echo closemodal(); add_to_footer(ob_get_contents()); ob_end_clean(); } else { addNotice('danger', $locale['error-MP002']); redirect($this->form_action); } } else { addNotice('danger', $locale['error-MP003']); redirect($this->form_action); } } else { addNotice('danger', $locale['error-MP003']); redirect($this->form_action); } } }
function form_textarea($input_name, $label = '', $input_value = '', array $options = array()) { global $locale, $defender, $userdata; // for editor $title = $label ? stripinput($label) : ucfirst(strtolower(str_replace("_", " ", $input_name))); $input_name = isset($input_name) && !empty($input_name) ? stripinput($input_name) : ""; require_once INCLUDES . "bbcode_include.php"; require_once INCLUDES . "html_buttons_include.php"; include_once LOCALE . LOCALESET . "admin/html_buttons.php"; include_once LOCALE . LOCALESET . "error.php"; if (!empty($options['bbcode'])) { $options['type'] = "bbcode"; } elseif (!empty($options['html'])) { $options['type'] = "html"; } $options = array('input_id' => !empty($options['input_id']) ? $options['input_id'] : $input_name, "type" => !empty($options['type']) && in_array($options['type'], array("html", "bbcode", "tinymce")) ? $options['type'] : "", 'required' => !empty($options['required']) && $options['required'] == 1 ? '1' : '0', 'placeholder' => !empty($options['placeholder']) ? $options['placeholder'] : '', 'deactivate' => !empty($options['deactivate']) && $options['deactivate'] == 1 ? '1' : '', 'width' => !empty($options['width']) ? $options['width'] : '100%', 'height' => !empty($options['height']) ? $options['height'] : '80px', 'class' => !empty($options['class']) ? $options['class'] : '', 'inline' => !empty($options['inline']) && $options['inline'] == 1 ? '1' : '0', 'length' => !empty($options['length']) ? $options['length'] : '200', 'error_text' => !empty($options['error_text']) ? $options['error_text'] : $locale['error_input_default'], 'safemode' => !empty($options['safemode']) && $options['safemode'] == 1 ? '1' : '0', 'form_name' => !empty($options['form_name']) ? $options['form_name'] : 'input_form', 'tinymce' => !empty($options['tinymce']) && in_array($options['tinymce'], array(TRUE, 'simple', 'advanced')) ? $options['tinymce'] : "simple", 'no_resize' => !empty($options['no_resize']) && $options['no_resize'] == '1' ? '1' : '0', 'autosize' => !empty($options['autosize']) && $options['autosize'] == 1 ? '1' : '0', 'preview' => !empty($options['preview']) && $options['preview'] == TRUE ? TRUE : FALSE, 'path' => !empty($options['path']) && $options['path'] ? $options['path'] : IMAGES, 'maxlength' => !empty($options['maxlength']) && isnum($options['maxlength']) ? $options['maxlength'] : '', 'tip' => !empty($options['tip']) ? $options['tip'] : ''); if ($options['type'] == "tinymce") { $tinymce_list = array(); $image_list = makefilelist(IMAGES, ".|..|"); $image_filter = array('png', 'PNG', 'bmp', 'BMP', 'jpg', 'JPG', 'jpeg', 'gif', 'GIF', 'tiff', 'TIFF'); foreach ($image_list as $image_name) { $image_1 = explode('.', $image_name); $last_str = count($image_1) - 1; if (in_array($image_1[$last_str], $image_filter)) { $tinymce_list[] = array('title' => $image_name, 'value' => IMAGES . $image_name); } } $tinymce_list = json_encode($tinymce_list); $tinymce_smiley_vars = ""; if (!defined('tinymce')) { add_to_head("<style type='text/css'>.mceIframeContainer iframe{width:100%!important; height:30px;}</style>"); add_to_footer("<script type='text/javascript' src='" . INCLUDES . "jscripts/tinymce/tinymce.min.js'></script>"); define('tinymce', TRUE); // PHP-Fusion Parse Cache Smileys $smileys = cache_smileys(); $tinymce_smiley_vars = ""; if (!empty($smileys)) { $tinymce_smiley_vars = "var shortcuts = {\n"; foreach ($smileys as $params) { $tinymce_smiley_vars .= "'" . strtolower($params['smiley_code']) . "' : '<img alt=\"" . $params['smiley_text'] . "\" src=\"" . IMAGES . "smiley/" . $params['smiley_image'] . "\"/>',\n"; } $tinymce_smiley_vars .= "};\n"; $tinymce_smiley_vars .= "\n\t\t\t\ted.on('keyup load', function(e){\n\t\t\t\t\tvar marker = tinymce.activeEditor.selection.getBookmark();\n\t\t\t\t\t// Store editor contents\n\t\t\t\t\tvar content = tinymce.activeEditor.getContent({'format':'raw'});\n\t\t\t\t\t// Loop through all shortcuts\n\t\t\t\t\tfor(var key in shortcuts){\n\t\t\t\t\t\t// Check if the editor html contains the looped shortcut\n\t\t\t\t\t\tif(content.toLowerCase().indexOf(key) != -1) {\n\t\t\t\t\t\t\t// Escaping special characters to be able to use the shortcuts in regular expression\n\t\t\t\t\t\t\tvar k = key.replace(/[<>*()?']/ig, \"\\\$&\");\n\t\t\t\t\t\t\ttinymce.activeEditor.setContent(content.replace(k, shortcuts[key]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Now put cursor back where it was\n\t\t\t\t\ttinymce.activeEditor.selection.moveToBookmark(marker);\n\t\t\t\t});\n\t\t\t\t"; } } // Mode switching for TinyMCE switch ($options['tinymce']) { case 'advanced': add_to_jquery("\n tinymce.init({\n selector: '#" . $options['input_id'] . "',\n theme: 'modern',\n entity_encoding : 'raw',\n width: '100%',\n height: 300,\n plugins: [\n 'advlist autolink autoresize link image lists charmap print preview hr anchor pagebreak spellchecker',\n 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',\n 'save table contextmenu directionality template paste textcolor'\n ],\n image_list: {$tinymce_list},\n content_css: '" . THEMES . "admin_templates/" . fusion_get_settings("admin_theme") . "/acp_styles.css',\n toolbar1: 'insertfile undo redo | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | newdocument fullscreen preview cut copy paste pastetext spellchecker searchreplace code',\n toolbar2: 'styleselect formatselect removeformat | fontselect fontsizeselect bold italic underline strikethrough subscript superscript blockquote | forecolor backcolor',\n toolbar3: 'hr pagebreak insertdatetime | link unlink anchor | image media | table charmap visualchars visualblocks emoticons',\n image_advtab: true,\n style_formats: [\n {title: 'Bold text', inline: 'b'},\n {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},\n {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},\n {title: 'Example 1', inline: 'span', classes: 'example1'},\n {title: 'Example 2', inline: 'span', classes: 'example2'},\n {title: 'Table styles'},\n {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}\n ],\n setup: function(ed) {\n \t\t\t\t\t// add tabkey listener\n \t\t\t\t\ted.on('keydown', function(event) {\n \t\t\t\t\tif (event.keyCode == 9) { // tab pressed\n \t\t\t\t\t\tif (event.shiftKey) { ed.execCommand('Outdent'); } else { ed.execCommand('Indent'); }\n \t\t\t\t\t\tevent.preventDefault();\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// auto smileys parsing\n\t\t\t\t\t\t" . $tinymce_smiley_vars . "\n\t\t\t\t}\n });\n "); break; case 'simple': add_to_jquery("\n tinymce.init({\n selector: '#" . $options['input_id'] . "',\n theme: 'modern',\n menubar: false,\n statusbar: false,\n content_css: '" . THEMES . "/templates/tinymce.css',\n image_list: {$tinymce_list},\n plugins: [\n 'advlist autolink autoresize link lists charmap print preview hr anchor pagebreak spellchecker',\n 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',\n 'contextmenu directionality template paste bbcode autoresize'\n ],\n height: 30,\n image_advtab: true,\n toolbar1: 'undo redo | bold italic underline | bullist numlist blockquote | hr media | fullscreen',\n entity_encoding : 'raw',\n language: '" . $locale['tinymce'] . "',\n object_resizing: false,\n resize: false,\n relative_urls: false,\n setup: function(ed) {\n \t\t\t\t\t// add tabkey listener\n \t\t\t\t\ted.on('keydown', function(event) {\n \t\t\t\t\tif (event.keyCode == 9) { // tab pressed\n \t\t\t\t\t\tif (event.shiftKey) { ed.execCommand('Outdent'); } else { ed.execCommand('Indent'); }\n \t\t\t\t\t\tevent.preventDefault();\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// auto smileys parsing\n\t\t\t\t\t\t" . $tinymce_smiley_vars . "\n\t\t\t\t}\n });\n "); add_to_jquery("\n\t\t\t\t\$('#inject').bind('click', function() {\n\t\t\t\t\ttinyMCE.activeEditor.execCommand(\"mceInsertContent\", true, '[b]I am injecting in stuff..[/b]');\n\t\t\t\t\t});\n\t\t\t\t"); break; case 'default': add_to_jquery("\n tinymce.init({\n selector: '#" . $options['input_id'] . "',\n theme: 'modern',\n entity_encoding : 'raw',\n language:'" . $locale['tinymce'] . "',\n setup: function(ed) {\n \t\t\t\t\t// add tabkey listener\n \t\t\t\t\ted.on('keydown', function(event) {\n \t\t\t\t\tif (event.keyCode == 9) { // tab pressed\n \t\t\t\t\t\tif (event.shiftKey) { ed.execCommand('Outdent'); } else { ed.execCommand('Indent'); }\n \t\t\t\t\t\tevent.preventDefault();\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// auto smileys parsing\n\t\t\t\t\t\t" . $tinymce_smiley_vars . "\n\t\t\t\t}\n });\n "); break; } } else { if (!defined('autogrow') && $options['autosize']) { define('autogrow', TRUE); add_to_footer("<script src='" . DYNAMICS . "assets/autosize/jquery.autosize.min.js'></script>"); } if ($options['autosize']) { add_to_jquery("\n\t\t \$('#" . $options['input_id'] . "').autosize();\n\t\t "); } } if ($input_value !== '') { $input_value = html_entity_decode(stripslashes($input_value), ENT_QUOTES, $locale['charset']); $input_value = str_replace("<br />", "", $input_value); } $error_class = ""; if ($defender->inputHasError($input_name)) { $error_class = "has-error "; if (!empty($options['error_text'])) { $new_error_text = $defender->getErrorText($input_name); if (!empty($new_error_text)) { $options['error_text'] = $new_error_text; } addNotice("danger", "<strong>{$title}</strong> - " . $options['error_text']); } } $html = "<div id='" . $options['input_id'] . "-field' class='form-group " . $error_class . $options['class'] . "' " . ($options['inline'] && $options['width'] && !$label ? "style='width: " . $options['width'] . " !important;'" : '') . ">\n"; $html .= $label ? "<label class='control-label " . ($options['inline'] ? "col-xs-12 col-sm-3 col-md-3 col-lg-3 p-l-0" : '') . "' for='" . $options['input_id'] . "'>{$label} " . ($options['required'] == 1 ? "<span class='required'>*</span>" : '') . " " . ($options['tip'] ? "<i class='pointer fa fa-question-circle' title='" . $options['tip'] . "'></i>" : '') . "</label>\n" : ''; $html .= $options['inline'] ? "<div class='col-xs-12 " . ($label ? "col-sm-9 col-md-9 col-lg-9 p-r-0" : "col-sm-12 p-l-0") . "'>\n" : ""; $tab_active = 0; $tab_title = array(); if ($options['preview'] && ($options['type'] == "html" || $options['type'] == "bbcode")) { $tab_title['title'][] = $locale['preview']; $tab_title['id'][] = "prw-" . $options['input_id']; $tab_title['icon'][] = ''; $tab_title['title'][] = $locale['texts']; $tab_title['id'][] = "txt-" . $options['input_id']; $tab_title['icon'][] = ''; $tab_active = tab_active($tab_title, 1); $html .= opentab($tab_title, $tab_active, $options['input_id'] . "-link", "", "editor-wrapper"); $html .= opentabbody($tab_title['title'][1], "txt-" . $options['input_id'], $tab_active); } $html .= $options['type'] == "html" || $options['type'] == "bbcode" ? "<div class='panel panel-default panel-txtarea m-b-0' " . ($options['preview'] ? "style='border-top:0 !important; border-radius:0 !important;'" : '') . ">\n<div class='panel-heading clearfix' style='padding-bottom:0 !important;'>\n" : ''; if ($options['type'] == "bbcode" && $options['form_name']) { $html .= display_bbcodes('90%', $input_name, $options['form_name']); } elseif ($options['type'] == "html" && $options['form_name']) { $html .= display_html($options['form_name'], $input_name, TRUE, TRUE, TRUE, $options['path']); } $html .= $options['type'] == "html" || $options['type'] == "bbcode" ? "</div>\n<div class='panel-body p-0'>\n" : ''; $html .= "<textarea name='{$input_name}' style='width:100%; height:" . $options['height'] . "; " . ($options['no_resize'] ? 'resize: none;' : '') . "' class='form-control p-15 m-0 " . $options['class'] . " " . ($options['autosize'] ? 'animated-height' : '') . " " . ($options['type'] == "html" || $options['type'] == "bbcode" ? "no-shadow no-border" : '') . " textbox ' placeholder='" . $options['placeholder'] . "' id='" . $options['input_id'] . "' " . ($options['deactivate'] ? 'readonly' : '') . ($options['maxlength'] ? "maxlength='" . $options['maxlength'] . "'" : '') . ">" . $input_value . "</textarea>\n"; if ($options['type'] == "html" || $options['type'] == "bbcode") { $html .= "</div>\n<div class='panel-footer clearfix'>\n"; $html .= "<div class='overflow-hide'><small>" . $locale['word_count'] . ": <span id='" . $options['input_id'] . "-wordcount'></span></small></div>"; add_to_jquery("\n\t\tvar init_str = \$('#" . $options['input_id'] . "').val().replace(/<[^>]+>/ig, '').replace(/\\n/g,'').replace(/ /g, '').length;\n\t\t\$('#" . $options['input_id'] . "-wordcount').text(init_str);\n\t\t\$('#" . $options['input_id'] . "').on('input propertychange paste', function() {\n\t\tvar str = \$(this).val().replace(/<[^>]+>/ig, '').replace(/\\n/g,'').replace(/ /g, '').length;\n\t\t\$('#" . $options['input_id'] . "-wordcount').text(str);\n\t\t});\n\t\t"); $html .= "</div>\n</div>\n"; } if ($options['preview'] && ($options['type'] == "bbcode" || $options['type'] == "html")) { $html .= closetabbody(); $html .= opentabbody($tab_title['title'][0], "prw-" . $options['input_id'] . "", $tab_active); $html .= "No Result"; $html .= closetabbody(); $html .= closetab(); add_to_jquery("\n\t\t// preview syntax\n\t\tvar form = \$('#" . $options['form_name'] . "');\n\t\t\$('#tab-prw-" . $options['input_id'] . "').bind('click',function(){\n\t\tvar text = \$('#" . $options['input_id'] . "').val();\n\t\tvar format = '" . ($options['type'] == "bbcode" ? 'bbcode' : 'html') . "';\n\t\tvar data = {\n\t\t\t" . (defined('ADMIN_PANEL') ? "'mode': 'admin', " : "") . "\n\t\t\t'text' : text,\n\t\t\t'editor' : format,\n\t\t\t'url' : '" . $_SERVER['REQUEST_URI'] . "',\n\t\t};\n\t\tvar sendData = form.serialize() + '&' + \$.param(data);\n\t\t\$.ajax({\n\t\t\turl: '" . INCLUDES . "dynamics/assets/preview/preview.ajax.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'html',\n\t\t\tdata : sendData,\n\t\t\tsuccess: function(result){\n\t\t\t//console.log(result);\n\t\t\t\$('#prw-" . $options['input_id'] . "').html(result);\n\t\t\t},\n\t\t\terror: function(result) {\n\t\t\t\tnew PNotify({\n\t\t\t\t\ttitle: '" . $locale['error_preview'] . "',\n\t\t\t\t\ttext: '" . $locale['error_preview_text'] . "',\n\t\t\t\t\ticon: 'notify_icon n-attention',\n\t\t\t\t\tanimation: 'fade',\n\t\t\t\t\twidth: 'auto',\n\t\t\t\t\tdelay: '3000'\n\t\t\t\t});\n\t\t\t}\n\t\t\t});\n\t\t});\n\t\t"); } $html .= $options['required'] == 1 && $defender->inputHasError($input_name) || $defender->inputHasError($input_name) ? "<div id='" . $options['input_id'] . "-help' class='label label-danger p-5 display-inline-block'>" . $options['error_text'] . "</div>" : ""; $html .= $options['inline'] ? "</div>\n" : ''; $html .= "</div>\n"; $defender->add_field_session(array('input_name' => $input_name, 'type' => 'textarea', 'title' => $label, 'id' => $options['input_id'], 'required' => $options['required'], 'safemode' => $options['safemode'], 'error_text' => $options['error_text'])); return $html; }
if (file_exists(THEME . "locale/" . $settings['locale'] . ".php")) { include THEME . "locale/" . $settings['locale'] . ".php"; } else { include THEME . "locale/English.php"; } global $aidlink, $locale; echo open_grid('footer', 1); echo "<div class='footer-row row'>\n"; echo "<div class='col-xs-12 col-sm-3 col-md-3 col-lg-3'>\n"; echo "<img style='width:80%;' class='img-responsive' src='" . THEME . "images/htmlcss.jpg'>"; echo "</div>\n"; echo "<div class='col-xs-12 col-sm-9 col-md-9 col-lg-9 footer-right-col'>\n"; echo "<div class='pull-right'>\n"; echo "<h1><a href='#top'><i style='font-size:50px;' class='entypo mid-opacity up-circled'></i></a></h1>\n"; echo "</div>\n"; echo "<p class='text-left'>" . stripslashes(strip_tags($settings['footer'])) . "</p>\r\n\t<p>" . showcopyright() . "</p>\r\n\t<p>Septenary Theme by <a href='http://www.phpfusionmods.co.uk' target='_blank'>Craig</a> and <a href='http://www.guildsquare.com' target='_blank'>Hien</a></p>\r\n\t<p>"; if ($settings['visitorcounter_enabled']) { echo "" . showcounter(); } if ($settings['rendertime_enabled'] == '1' || $settings['rendertime_enabled'] == '2') { if ($settings['visitorcounter_enabled']) { echo " | "; } echo showrendertime(); } echo "</p>\n"; echo "</div>\n"; echo "</div>\n"; echo close_grid(1); add_to_footer("<script type='text/javascript'>\r\nfunction ValidateForm(frm) {\r\n\tif(frm.stext.value=='') {\r\n\t\talert('You Must Enter Something In The Search!');\r\n\treturn false;\r\n\t}\r\n\tif(frm.stext.value.length < 3){\r\n\t\talert('Search text must be at least 3 characters long!');\r\n\treturn false;\r\n\t}\r\n}\r\n</script>");