Example #1
0
 public function infuse_theme()
 {
     if (!empty($this->theme_data)) {
         add_to_head("<link href='" . THEMES . $this->theme_data['theme_file'] . "' rel='stylesheet' media='screen' />\n");
     } else {
         add_to_head("<link href='" . INCLUDES . "bootstrap/bootstrap.css' rel='stylesheet' media='screen' />\n");
     }
 }
Example #2
0
function load_tablesorter($id)
{
    // implementation: use in table();
    // to add: sortlist:[[0,0],[1,0]]
    add_to_head("<script type='text/javascript' src='" . DYNAMICS . "assets/tablesorter/jquery.tablesorter.min.js'></script>");
    add_to_jquery("\n        \$('#" . $id . "').tablesorter();\n        ");
    add_to_head("\n        <style>\n        /* tables */\n        table.tablesorter {}\n        table.tablesorter thead tr th, table.tablesorter tfoot tr th {}\n        table.tablesorter thead tr .header {\n        background-image: url(" . DYNAMICS . "assets/tablesorter/bg.gif);\n        background-repeat: no-repeat;\n        background-position: center right;\n        cursor: pointer;\n        }\n        table.tablesorter tbody td {}\n        table.tablesorter tbody tr.odd td {}\n        table.tablesorter thead tr .headerSortUp { background-image: url(" . DYNAMICS . "assets/tablesorter/asc.gif);    }\n        table.tablesorter thead tr .headerSortDown {\tbackground-image: url(" . DYNAMICS . "assets/tablesorter/desc.gif);    }\n        table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {    }\n        </style>\n        ");
    return "tablesorter";
}
Example #3
0
function form_datepicker($title, $input_name, $input_id, $input_value, $array = FALSE)
{
    if (!defined('DATEPICKER')) {
        define('DATEPICKER', TRUE);
        add_to_head("<link href='" . DYNAMICS . "assets/datepicker/css/datepicker3.css' rel='stylesheet' />");
        add_to_head("<script src='" . DYNAMICS . "assets/datepicker/js/bootstrap-datepicker.js'></script>");
    }
    $title2 = isset($title) && !empty($title) ? stripinput($title) : ucfirst(strtolower(str_replace("_", " ", $input_name)));
    $input_name = isset($input_name) && !empty($input_name) ? stripinput($input_name) : "";
    $input_id = isset($input_id) && !empty($input_id) ? stripinput($input_id) : "";
    if ($input_value && strstr($input_value, "-")) {
        // then this is date.
        $input_value = $input_value;
    } else {
        $input_value = $input_value ? date("d-m-Y", $input_value) : '';
    }
    if (!is_array($array)) {
        $placeholder = "";
        $date_format = "dd-mm-yyyy";
        $width = "250px";
        $required = 0;
        $safemode = 0;
        $deactivate = 0;
        $icon = '';
        $inline = 0;
        $error_text = '';
        $class = '';
    } else {
        $icon = array_key_exists('icon', $array) ? $array['icon'] : "";
        $placeholder = array_key_exists("placeholder", $array) ? $array['placeholder'] : "";
        $width = array_key_exists("width", $array) ? $array['width'] : "250px";
        $date_format = array_key_exists("date_format", $array) ? $array['date_format'] : "dd-mm-yyyy";
        $class = array_key_exists('class', $array) ? $array['class'] : "";
        $error_text = array_key_exists("error_text", $array) ? $array['error_text'] : "";
        $required = array_key_exists('required', $array) && $array['required'] == 1 ? 1 : 0;
        $safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? 1 : 0;
        $deactivate = array_key_exists('deactivate', $array) && $array['deactivate'] == 1 ? 1 : 0;
        $inline = array_key_exists("inline", $array) ? 1 : 0;
    }
    $html = "<div id='{$input_id}-field' class='form-group m-b-0 {$class} " . ($icon ? 'has-feedback' : '') . "'>\n";
    $html .= $title ? "<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 .= "<div class='input-group date' " . ($width ? "style='width:{$width};'" : '') . ">\n";
    $html .= "<input type='text' name='" . $input_name . "' id='" . $input_id . "' value='" . $input_value . "' class='form-control textbox' placeholder='{$placeholder}' />\n";
    $html .= $icon ? "<div class='form-control-feedback'><i class='glyphicon {$icon}'></i></div>\n" : '';
    $html .= "<span class='input-group-addon'><i class='entypo calendar'></i></span>\n";
    $html .= "</div>\n";
    $html .= "<div id='{$input_id}-help' style='display:inline-block !important;'></div>";
    $html .= $inline ? "</div>\n" : "";
    $html .= "</div>\n";
    // Generate Defender Strings
    $html .= "<input type='hidden' name='def[{$input_name}]' value='[type=date],[title={$title2}],[id={$input_id}],[required={$required}],[safemode={$safemode}]" . ($error_text ? ",[error_text={$error_text}]" : '') . "' readonly />";
    if ($deactivate !== 1) {
        add_to_jquery("\n        \$('#{$input_id}-field .input-group.date').datepicker({\n        format: '" . $date_format . "',\n        todayBtn: 'linked',\n        autoclose: true,\n        todayHighlight: true\n        });\n        ");
    }
    return $html;
}
function load_bootstrap()
{
    define('bootstrapped', TRUE);
    require_once INCLUDES . "output_handling_include.php";
    add_to_head("<meta http-equiv='X-UA-Compatible' content='IE=edge' />");
    add_to_head("<meta name='viewport' content='width=device-width, initial-scale=1.0' />");
    add_to_head("<script type='text/javascript' src='" . INCLUDES . "bootstrap/bootstrap.min.js'></script>");
    add_to_head("<script type='text/javascript' src='" . INCLUDES . "bootstrap/holder.js'></script>");
    add_to_head("<link href='" . INCLUDES . "bootstrap/bootstrap.min.css' rel='stylesheet' media='screen' />");
}
Example #5
0
 function display_forum_postform($info)
 {
     $locale = fusion_get_locale();
     add_to_head("<link rel='stylesheet' type='text/css' href='" . INFUSIONS . "forum/templates/css/forum.css'>");
     echo render_breadcrumbs();
     opentable($info['title']);
     // New template
     echo "<!--pre_form-->\n";
     echo "<h4 class='m-b-20'>" . $info['description'] . "</h4>\n";
     echo $info['openform'];
     echo $info['forum_field'];
     echo $info['subject_field'];
     echo $info['tags_field'];
     echo $info['message_field'];
     echo $info['edit_reason_field'];
     echo $info['forum_id_field'];
     echo $info['thread_id_field'];
     echo $info['poll_form'];
     $tab_title['title'][0] = $locale['forum_0602'];
     $tab_title['id'][0] = 'postopts';
     $tab_title['icon'][0] = '';
     $tab_active = tab_active($tab_title, 0);
     $tab_content = opentabbody($tab_title['title'][0], 'postopts', $tab_active);
     // first one is guaranteed to be available
     $tab_content .= "<div class='well m-t-20'>\n";
     $tab_content .= $info['delete_field'];
     $tab_content .= $info['sticky_field'];
     $tab_content .= $info['notify_field'];
     $tab_content .= $info['lock_field'];
     $tab_content .= $info['hide_edit_field'];
     $tab_content .= $info['smileys_field'];
     $tab_content .= $info['signature_field'];
     $tab_content .= "</div>\n";
     $tab_content .= closetabbody();
     if (!empty($info['attachment_field'])) {
         $tab_title['title'][1] = $locale['forum_0557'];
         $tab_title['id'][1] = 'attach_tab';
         $tab_title['icon'][1] = '';
         $tab_content .= opentabbody($tab_title['title'][1], 'attach_tab', $tab_active);
         $tab_content .= "<div class='well m-t-20'>\n" . $info['attachment_field'] . "</div>\n";
         $tab_content .= closetabbody();
     }
     echo opentab($tab_title, $tab_active, 'newthreadopts');
     echo $tab_content;
     echo closetab();
     echo $info['post_buttons'];
     echo $info['closeform'];
     echo "<!--end_form-->\n";
     closetable();
     if (!empty($info['last_posts_reply'])) {
         echo "<div class='well m-t-20'>\n";
         echo $info['last_posts_reply'];
         echo "</div>\n";
     }
 }
Example #6
0
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;
}
Example #7
0
function render_admin_login()
{
    global $locale, $aidlink, $userdata, $defender;
    // TODO: Remove this, add the required styling to acp_styles.css
    add_to_head("<link rel='stylesheet' href='" . THEMES . "templates/setup_styles.css' type='text/css' />");
    echo "<aside class='block-container'>\n";
    echo "<div class='block'>\n";
    echo "<div class='block-content clearfix' style='font-size:13px;'>\n";
    echo "<h6><strong>" . $locale['280'] . "</strong></h6>\n";
    echo "<img src='" . IMAGES . "php-fusion-icon.png' class='pf-logo position-absolute' alt='PHP-Fusion'/>";
    echo "<p class='fusion-version text-right mid-opacity text-smaller'>" . $locale['version'] . fusion_get_settings('version') . "</p>";
    echo "<div class='row m-0'>\n<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>";
    $form_action = FUSION_SELF . $aidlink == ADMIN . "index.php" . $aidlink ? FUSION_SELF . $aidlink . "&amp;pagenum=0" : FUSION_SELF . "?" . FUSION_QUERY;
    echo openform('admin-login-form', 'post', $form_action, array('max_tokens' => 1));
    openside('');
    if (!$defender->safe()) {
        setNotice('danger', $locale['global_182']);
    }
    // Get all notices
    $notices = getNotices();
    echo renderNotices($notices);
    echo "<div class='m-t-10 clearfix row'>\n";
    echo "<div class='col-xs-3 col-sm-3 col-md-3 col-lg-3'>\n";
    echo "<div class='pull-right'>\n";
    echo display_avatar($userdata, '90px');
    echo "</div>\n";
    echo "</div>\n<div class='col-xs-9 col-sm-9 col-md-8 col-lg-7'>\n";
    echo "<div class='clearfix'>\n";
    $label = "<span class='h5 display-inline' style='color: #222'><strong>" . $locale['welcome'] . ", " . $userdata['user_name'] . "</strong><br/>" . getuserlevel($userdata['user_level']) . "</span>";
    add_to_head('<style>#admin_password-field .required {display:none}</style>');
    echo form_text('admin_password', $label, '', array('callback_check' => 'check_admin_pass', 'placeholder' => $locale['281'], 'autocomplete_off' => 1, 'type' => 'password', 'required' => 1));
    echo "</div>\n";
    echo "</div>\n";
    echo "</div>\n";
    closeside();
    echo form_button('admin_login', $locale['login'], 'Sign in', array('class' => 'btn-primary btn-block'));
    echo closeform();
    echo "</div>\n</div>\n";
    // .col-*, .row
    echo "</div>\n";
    // .block-content
    echo "</div>\n";
    // .block
    echo "<div class='copyright-note clearfix m-t-10'>" . showcopyright() . "</div>\n";
    echo "</aside>\n";
}
Example #8
0
function render_admin_login()
{
    global $locale, $aidlink, $userdata;
    echo "<section class='login-bg'>\n";
    echo "<aside class='block-container'>\n";
    echo "<div class='block'>\n";
    echo "<div class='block-content clearfix' style='font-size:13px;'>\n";
    echo "<h6><strong>" . $locale['280'] . "</strong></h6>\n";
    echo "<img src='" . IMAGES . "php-fusion-icon.png' class='pf-logo position-absolute' alt='PHP-Fusion'/>";
    echo "<p class='fusion-version text-right mid-opacity text-smaller'>" . $locale['version'] . fusion_get_settings('version') . "</p>";
    echo "<div class='row m-0'>\n<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>";
    $form_action = FUSION_SELF . $aidlink == ADMIN . "index.php" . $aidlink ? FUSION_SELF . $aidlink . "&amp;pagenum=0" : FUSION_SELF . "?" . FUSION_QUERY;
    // Get all notices
    $notices = getNotices();
    echo renderNotices($notices);
    echo openform('admin-login-form', 'post', $form_action);
    openside('');
    echo "<div class='m-t-10 clearfix row'>\n";
    echo "<div class='col-xs-3 col-sm-3 col-md-3 col-lg-3'>\n";
    echo "<div class='pull-right'>\n";
    echo display_avatar($userdata, '90px');
    echo "</div>\n";
    echo "</div>\n<div class='col-xs-9 col-sm-9 col-md-8 col-lg-7'>\n";
    echo "<div class='clearfix'>\n";
    add_to_head('<style>#admin_password-field .required {display:none}</style>');
    echo "<h5><strong>" . $locale['welcome'] . ", " . $userdata['user_name'] . "</strong><br/>" . getuserlevel($userdata['user_level']) . "</h5>";
    echo form_text('admin_password', "", "", array('callback_check' => 'check_admin_pass', 'placeholder' => $locale['281'], 'error_text' => $locale['global_182'], 'autocomplete_off' => TRUE, 'type' => 'password', 'required' => TRUE));
    echo "</div>\n";
    echo "</div>\n";
    echo "</div>\n";
    closeside();
    echo form_button('admin_login', $locale['login'], $locale['login'], array('class' => 'btn-primary btn-block'));
    echo closeform();
    echo "</div>\n</div>\n";
    // .col-*, .row
    echo "</div>\n";
    // .block-content
    echo "</div>\n";
    // .block
    echo "<div class='copyright-note clearfix m-t-10'>" . showcopyright() . "</div>\n";
    echo "</aside>\n";
    echo "</section>\n";
}
Example #9
0
function form_colorpicker($input_name, $label = '', $input_value = '', array $options = array())
{
    global $defender, $locale;
    if (!defined("COLORPICKER")) {
        define("COLORPICKER", TRUE);
        add_to_head("<link href='" . DYNAMICS . "assets/colorpick/css/bootstrap-colorpicker.css' rel='stylesheet' media='screen' />");
        add_to_head("<script src='" . DYNAMICS . "assets/colorpick/js/bootstrap-colorpicker.js'></script>");
    }
    $title = $label ? stripinput($label) : ucfirst(strtolower(str_replace("_", " ", $input_name)));
    $input_name = stripinput($input_name);
    $input_value = stripinput($input_value);
    $default_options = array('input_id' => $input_name, 'required' => FALSE, 'placeholder' => '', 'deactivate' => FALSE, 'width' => '250px', 'class' => '', 'inline' => FALSE, 'error_text' => $locale['error_input_default'], 'safemode' => FALSE, 'icon' => "", "tip" => "", 'format' => 'hex');
    $options += $default_options;
    if (!$options['width']) {
        $options['width'] = $default_options['width'];
    }
    $input_id = $options['input_id'] ?: $default_options['input_id'];
    $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='{$input_id}-field' class='form-group clearfix m-b-10 " . $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" : '') . "' 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" : "<br/>\n";
    $html .= "<div id='{$input_id}' style='width: " . $options['width'] . "' class='input-group colorpicker-component bscp colorpicker-element m-b-10' data-color='{$input_value}' data-color-format='" . $options['format'] . "'>";
    $html .= "<input type='text' name='{$input_name}' class='form-control " . $options['class'] . "' id='" . $input_id . "' value='{$input_value}' data-color-format='" . $options['format'] . "' placeholder='" . $options['placeholder'] . "' " . ($options['deactivate'] ? "readonly" : "") . ">";
    $html .= "<span id='{$input_id}-cp' class='input-group-addon'>";
    $html .= "<i style='background: rgba(255,255,255,1);'></i>";
    $html .= "</span></div>";
    $html .= $options['inline'] ? "</div>\n" : "";
    $html .= "</div>\n";
    $defender->add_field_session(array('input_name' => $input_name, 'type' => 'color', 'title' => $title, 'id' => $input_id, 'required' => $options['required'], 'safemode' => $options['safemode'], 'error_text' => $options['error_text']));
    add_to_jquery("\$('#{$input_id}').colorpicker({ format : '" . $options['format'] . "'  });");
    return $html;
}
Example #10
0
 private function __construct()
 {
     global $aidlink;
     $locale = fusion_get_locale("", LOCALE . LOCALESET . "admin/sitelinks.php");
     $this->language_opts = fusion_get_enabled_languages();
     $this->link_index = dbquery_tree(DB_SITE_LINKS, 'link_id', 'link_cat');
     $this->position_opts = array('1' => $locale['SL_0025'], '2' => $locale['SL_0026'], '3' => $locale['SL_0027'], '4' => $locale['custom'] . " ID");
     $_GET['link_id'] = isset($_GET['link_id']) && isnum($_GET['link_id']) ? $_GET['link_id'] : 0;
     $_GET['link_cat'] = isset($_GET['link_cat']) && isnum($_GET['link_cat']) ? $_GET['link_cat'] : 0;
     $_GET['action'] = isset($_GET['action']) ? $_GET['action'] : '';
     self::link_breadcrumbs($this->link_index);
     // must move this out.
     add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery-ui.js'></script>");
     add_to_jquery("\n\t\t\$('#site-links').sortable({\n\t\t\thandle : '.handle',\n\t\t\tplaceholder: 'state-highlight',\n\t\t\tconnectWith: '.connected',\n\t\t\tscroll: true,\n\t\t\taxis: 'y',\n\t\t\tupdate: function () {\n\t\t\t\tvar ul = \$(this),\n                order = ul.sortable('serialize'),\n                i = 0;\n\t\t\t\t\$('#info').load('" . ADMIN . "includes/site_links_updater.php" . $aidlink . "&' +order+ '&link_cat=" . intval($_GET['link_cat']) . "');\n\t\t\t\tul.find('.num').each(function(i) {\n\t\t\t\t\t\$(this).text(i+1);\n\t\t\t\t});\n\t\t\t\tul.find('li').removeClass('tbl2').removeClass('tbl1');\n\t\t\t\tul.find('li:odd').addClass('tbl2');\n\t\t\t\tul.find('li:even').addClass('tbl1');\n\t\t\t\twindow.setTimeout('closeDiv();',2500);\n\t\t\t}\n\t\t});\n\n\t\tfunction checkLinkPosition( val ) {\n            if ( val == 4 ) {\n                \$('#link_position_id').prop('disabled', false).show();\n            } else {\n                \$('#link_position_id').prop('disabled', true).hide();\n            }\n        }\n\t\t");
     switch ($_GET['action']) {
         case 'edit':
             $this->data = self::load_sitelinks($_GET['link_id']);
             if (!$this->data['link_id']) {
                 redirect(FUSION_SELF . $aidlink);
             }
             $this->form_action = FUSION_SELF . $aidlink . "&amp;action=edit&amp;section=nform&amp;link_id=" . $_GET['link_id'] . "&amp;link_cat=" . $_GET['link_cat'];
             add_breadcrumb(array("link" => $this->form_action, "title" => $locale['SL_0011']));
             break;
         case 'delete':
             $result = self::delete_sitelinks($_GET['link_id']);
             if ($result) {
                 addNotice("success", $locale['SL_0017']);
                 redirect(FUSION_SELF . $aidlink);
             }
             break;
         default:
             $this->form_action = FUSION_SELF . $aidlink . "&amp;section=link_form";
             add_breadcrumb(array("link" => $this->form_action, "title" => $locale['SL_0010']));
             break;
     }
 }
function showcomments($ctype, $cdb, $ccol, $cid, $clink = "")
{
    global $settings, $userdata, $locale;
    include LOCALE . LOCALESET . "comments.php";
    require_once INCLUDES . "bbcode_include.php";
    add_to_head("<script type='text/javascript' src='" . INCLUDES . "comments_include/comments.js'></script>");
    add_to_head("<script type='text/javascript'>\n            var ctype = '" . $ctype . "';\n            if (ctype == 'MG') {\n                var cid = window.cidas;\n            } else {\n                var cid = '" . $cid . "';\n            }\n            var basedir = '" . BASEDIR . "';\n\t\t\tvar locale_noc = '" . $locale['c101'] . "';\n\t\t\tvar locale_edit = '" . $locale['c108'] . "';\n\t\t\tvar locale_del = '" . $locale['c109'] . "';\n    </script>");
    echo "<br /><br />";
    opentable($locale['c100']);
    echo "<div id='comments_load' style='display:none;text-align:center;'><img src='" . INCLUDES . "comments_include/load.gif' alt='' style='border:0;' /></div><div id='comments'></div>";
    closetable();
    echo "<br /><br />";
    opentable($locale['c102']);
    if (iMEMBER) {
        echo "<div align='center'>";
        echo "<a id='edit_comment' name='edit_comment'></a>";
        echo "<form name='comment_form' method='post' action='#'>";
        echo "<input type='hidden' name='comment_name' value='" . $userdata['user_id'] . "' />";
        echo "<input type='hidden' name='cid' value='" . $cid . "' />";
        echo "<input type='hidden' name='ctype' value='" . $ctype . "' />";
        echo "<input type='hidden' name='edited_id' value='' />";
        echo "<input type='hidden' name='edited_id' value='' />";
        echo "<textarea name='comment_message' cols='70' rows='6' class='textbox' style='width:360px'></textarea><br />";
        echo "<div align='center'>" . display_bbcodes("360px", "comment_message", "comment_form") . "</div>";
        echo "<input type='submit' name='post_comment' value='" . $locale['c102'] . "' class='button' /> ";
        echo "<input type='submit' name='edit_comment' value='" . $locale['c103'] . "' class='button' /> ";
        echo "</form>";
        echo "<div id='comment_load' style='display:none;text-align:center;height:140px;'><img src='" . INCLUDES . "comments_include/load.gif' alt='' style='border:0;margin-top:50px;' /></div>";
        echo "<br />";
        echo "</div>";
    } else {
        echo "<div style='text-align:center'>" . $locale['c105'] . "</div><br />";
    }
    closetable();
    echo "<div style='text-align:center;width:100%;'>AL jQ comments <a href='http://fusion.annetlab.tk'>Fusion @ AnnetLab</a> &copy; 2011-2012</div>";
}
Example #12
0
 private function set_ThreadJs()
 {
     $viewthread_js = '';
     //javascript to footer
     $highlight_js = "";
     $colorbox_js = "";
     $edit_reason_js = '';
     /** javascript **/
     // highlight jQuery plugin
     if (isset($_GET['highlight'])) {
         $words = explode(" ", urldecode($_GET['highlight']));
         $higlight = "";
         $i = 1;
         $c_words = count($words);
         foreach ($words as $hlight) {
             $hlight = htmlentities($hlight, ENT_QUOTES);
             $higlight .= "'" . $hlight . "'";
             $higlight .= $i < $c_words ? "," : "";
             $i++;
         }
         add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery.highlight.js'></script>");
         $highlight_js .= "\$('.search_result').highlight([" . $higlight . "],{wordsOnly:true});";
         $highlight_js .= "\$('.highlight').css({backgroundColor:'#FFFF88'});";
         //better via theme or settings
     }
     $edit_reason_js .= "\n\t\t\t\$('.reason_div').hide();\n\t\t\t\$('div').find('.reason_button').css({cursor: 'pointer' });\n\t\t\t\$('.reason_button').bind('click', function(e) {\n\t\t\t\tvar target = \$(this).data('target');\n\t\t\t\t\$('#'+target).stop().slideToggle('fast');\n\t\t\t});\n\t\t\t";
     // viewthread javascript, moved to footer
     if (!empty($highlight_js) || !empty($colorbox_js) || !empty($edit_reason_js)) {
         $viewthread_js .= $highlight_js . $colorbox_js . $edit_reason_js;
     }
     $viewthread_js .= "\$('a[href=#top]').click(function(){";
     $viewthread_js .= "\$('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='" . INFUSIONS . "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_jquery($viewthread_js);
 }
| This program is released as free software under the
| 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";
require_once THEMES . "templates/header.php";
define("EDOC", INFUSIONS . "edocs/");
define("EDOC_IMGS", EDOC . "imgs/");
define("EDOC_INC", EDOC . "inc/");
define("EDOC_LOC", EDOC . "locale/");
require EDOC_INC . "functions.php";
add_to_head("\r\n<script type='text/javascript' src='" . STATIC_DOMAIN . "js/scroll.js'></script>\r\n");
include LOCALE . LOCALESET . "admin/main.php";
if (file_exists(EDOC_LOC . "/" . $settings['locale'] . "/index.php")) {
    include EDOC_LOC . "/" . $settings['locale'] . "/header.php";
    include EDOC_LOC . "/" . $settings['locale'] . "/content_admin.php";
    include EDOC_LOC . "/" . $settings['locale'] . "/user_admin.php";
    include EDOC_LOC . "/" . $settings['locale'] . "/system_admin.php";
    include EDOC_LOC . "/" . $settings['locale'] . "/settings_admin.php";
} else {
    include EDOC_LOC . "English/header.php";
    include EDOC_LOC . "English/content_admin.php";
    include EDOC_LOC . "English/user_admin.php";
    include EDOC_LOC . "English/system_admin.php";
    include EDOC_LOC . "English/settings_admin.php";
}
$author = " Philip Daly | Johan Wilson";
Example #14
0
     } else {
         if ($data['photo_thumb2']) {
             $photo_thumb = "photo.php?photo_id=" . $_GET['photo_id'];
         }
         $photo_file = "photo.php?photo_id=" . $_GET['photo_id'] . "&amp;full";
     }
     $photo_size = @getimagesize(PHOTODIR . $data['photo_filename']);
 } else {
     $photo_thumb = $data['photo_thumb2'] ? PHOTODIR . $data['photo_thumb2'] : "";
     $photo_file = PHOTODIR . $data['photo_filename'];
     $photo_size = @getimagesize($photo_file);
 }
 add_to_title($locale['global_201'] . $data['photo_title']);
 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_head("<script type='text/javascript'>\n\n\t\t\t/* <![CDATA[ */\n\n\t\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\tjQuery('a.photogallery_photo_link').colorbox({\n\t\t\t\t\t\twidth:'80%', height:'80%', photo:true\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t/* ]]>*/\n\n\t\t</script>\n");
 echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n<td class='tbl2'>\n";
 echo "<a href='" . FUSION_SELF . "'>" . $locale['400'] . "</a> &gt;\n";
 echo "<a href='" . FUSION_SELF . "?album_id=" . $data['album_id'] . "'>" . $data['album_title'] . "</a>\n";
 echo ($data['photo_title'] ? " &gt; <strong>" . $data['photo_title'] . "</strong>" : "") . "\n</td>\n";
 if (isset($prev['photo_id']) && isnum($prev['photo_id']) || isset($next['photo_id']) && isnum($next['photo_id'])) {
     if (isset($prev) && isset($first)) {
         echo "<td width='1%' class='tbl2'><a href='" . FUSION_SELF . "?photo_id=" . $first['photo_id'] . "' title='" . $locale['459'] . "'>" . get_image("go_first", $locale['459'], "border:none;", "", "") . "</a></td>\n";
     }
     if (isset($prev)) {
         echo "<td width='1%' class='tbl2'><a href='" . FUSION_SELF . "?photo_id=" . $prev['photo_id'] . "' title='" . $locale['451'] . "'>" . get_image("go_previous", $locale['451'], "border:none;", "", "") . "</a></td>\n";
     }
     if (isset($next)) {
         echo "<td width='1%' class='tbl2'><a href='" . FUSION_SELF . "?photo_id=" . $next['photo_id'] . "' title='" . $locale['452'] . "'>" . get_image("go_next", $locale['452'], "border:none;", "", "") . "</a></td>\n";
     }
     if (isset($next) && isset($last)) {
Example #15
0
| 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_head("<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)) {
Example #16
0
    if ($settings['enable_deactivation'] == "1" || $members_markinactive) {
        echo $locale['sta007'] . " " . $members_markinactive . "<br />\n";
    }
    if ($settings['enable_deactivation'] == "1") {
        echo $locale['sta008'] . " " . $members_inactive . "<br />\n";
    }
}
echo "</td>\n<td valign='top' width='25%' class='small'>\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#news_submissions'>" . $locale['254'] . "</a>" : $locale['254']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='n'") . "<br />\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#article_submissions'>" . $locale['255'] . "</a>" : $locale['255']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='a'") . "<br />\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#link_submissions'>" . $locale['256'] . "</a>" : $locale['256']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='l'") . "<br />\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#photo_submissions'>" . $locale['260'] . "</a>" : $locale['260']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='p'") . "\r\n</td>\n<td valign='top' width='25%' class='small'>\r\n" . $locale['257'] . " " . dbcount("(comment_id)", DB_COMMENTS) . "<br />\r\n" . $locale['258'] . " " . dbcount("(shout_id)", DB_SHOUTBOX) . "<br />\r\n" . $locale['259'] . " " . dbcount("(post_id)", DB_POSTS) . "<br />\r\n" . $locale['261'] . " " . dbcount("(photo_id)", DB_PHOTOS) . "\r\n</td>\n</tr>\n</table>\n";
closetable();
// Admin Notes Panel
// Author: Johan Wilson (Barspin)
// Contact: barspin@blendtek.net
// modified by slaughter for PiF
if ($settings['adminmenue_notes']) {
    include_once INCLUDES . "bbcode_include.php";
    add_to_head("<script type='text/javascript'>\r\n\$(function(){\r\n\$('.loding').hide();\r\n\t\$('#notes_q div').hover(function() {\r\n\t\t\$(this).find('.loding').show();\r\n\t}, function() {\r\n\t\t\$(this).find('.loding').hide();\r\n\t});\r\n\$('#notes_q a').click(function(){\r\nvar element = \$(this);\r\nvar noteid = element.attr('id');\r\nvar info = 'id=' + noteid;\r\n\$(element).find('.loding').hide();\r\n\$(element).parent('li').animate({'opacity': .5 });\r\n\$(element).append(\"<img src='" . IMAGES . "ajax-loader.gif' alt='Loading' style='vertical-align:middle;border:0;' />\");\r\n\$.ajax({\r\n type: 'GET',\r\n url: '" . FUSION_SELF . $aidlink . "',\r\n data: info,\r\n success: function(){\r\n element.parent().eq(0).fadeOut('fast');\r\n }\r\n});\r\nreturn false;\r\n}); \r\n\$('#notes_submit').click(function(){\r\nvar loading = \$('div#note_loading').html(\"<img src='" . IMAGES . "ajax-loader.gif' alt='Loading' style='vertical-align:middle;border:0;' />\"); \r\nvar content = \$('#notes_content').val();\r\nvar name = \$('#note_name').val();\r\nvar url = 'submit=1&content=' + content + '&submit=1&name=' + name;\r\nvar type = \$('#notes_content').val();\r\nif (type == '') {\r\n \$(loading).hide();\r\n} else {\r\n \$(loading).show();\r\n \$.ajax({\r\n  type: 'POST',\r\n  url: '" . FUSION_SELF . $aidlink . "',\r\n  data: url,\r\n  success: function(){\r\n  \$('div#note_loading').after(\"<div style='float:left' class='admin_note'><strong>\" + name + \"</strong>&nbsp;<img src='' alt='' style='height:16px;width:0px;' /><br /><div class='shoutboxdate'>" . showdate("%d %b %H:%M", time()) . "</div><div class='notify'>\" + content + \"</div></div>\");\r\n  \$(loading).hide();\r\n  \$('#notes_content').val('');\r\n  }\r\n });\r\n}\r\n\r\nreturn false;\r\n});\r\n});\r\n</script>\r\n\r\n<style type='text/css'>\r\n.notify{background:#FFD6D6 none repeat scroll 0 0;border-bottom:2px solid #EF706F;border-top:2px solid #EF706F;color:#CC0000;padding:2px;margin-bottom:5px;margin-top: 2px;}\r\n.admin_note{min-width:100px;margin:3px;padding:3px 0;list-style-type:none;overflow:auto;}\r\n</style>");
    openside($locale['note_01'], true);
    echo "<div id='notes' style='float:left'>\n";
    echo "<form id='notes_form' action='" . FUSION_SELF . $aidlink . "' method='post'>\n";
    echo "<input type='hidden' name='note_name' id='note_name' value='" . $userdata['user_name'] . "' maxlength='30' />\n";
    echo "<br/>\n<textarea name='notes_content' id='notes_content' class='textbox' cols='20' rows='4' style='width:140px'></textarea><br />\n";
    echo "" . display_bbcodes("150px;", "notes_content", "notes_form", "smiley|b|u|url") . "";
    echo "<input type='submit' id='notes_submit' name='notes_submit' class='button' value='" . $locale['note_02'] . "' />\n";
    echo "</form>\n";
    echo "</div><br />\n";
    $result = dbquery("SELECT note_id, note_name, note_text, note_datestamp FROM " . DB_ADMIN_NOTES . " ORDER BY note_id DESC");
    echo "<div class='admin_notes' id='notes_q'>";
    echo "<div id='note_loading'></div>\n";
    while ($data = dbarray($result)) {
        echo "<div style='float:left' class='admin_note'>";
        echo "<strong>" . $data['note_name'] . "</strong>&nbsp;";
Example #17
0
    /**
     * 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&amp;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 . "&amp;action=edit&amp;section=news_form&amp;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'] . "&amp;") . "\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();
    }
Example #18
0
 /**
  * Adds Theme Javascript and Meta header
  */
 private function setHeader()
 {
     if (FUSION_SELF !== "maintenance.php" && FUSION_SELF !== "go.php") {
         add_to_head("<script src='" . THEME . "includes/search.js'></script>");
         add_to_head("<meta name='viewport' content='width=device-width, initial-scale=1'>\n\t\t\t<!--[if lt IE 8]>\n\t\t\t<div style=' clear: both; text-align:center; position: relative;'>\n\t\t\t<a href='http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode'>\n\t\t\t<img src='http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg' border='0' height='42' width='820' alt='You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today.' />\n\t\t\t</a>\n\t\t\t</div>\n\t\t\t<![endif]-->\n\t\t\t<!--[if lt IE 9]>\n\t\t\t<script src='" . THEME . "js/html5.js'></script>\n\t\t\t<script src='" . THEME . "js/css3-mediaqueries.js'></script>\n\t\t\t<![endif]-->\n\t\t\t");
     }
 }
Example #19
0
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;
}
Example #20
0
 echo "<td valign='top' width='145' class='tbl2'>" . $locale['463'] . "</td>\n";
 echo "<td class='tbl1'>\n";
 if (iMOD || iSUPERADMIN) {
     echo "<label><input type='checkbox' name='sticky_thread' value='1'" . $sticky_thread_check . " /> " . $locale['480'] . "</label><br />\n";
     echo "<label><input type='checkbox' name='lock_thread' value='1'" . $lock_thread_check . " /> " . $locale['481'] . "</label><br />\n";
 }
 echo "<label><input type='checkbox' name='disable_smileys' value='1'" . $disable_smileys_check . " /> " . $locale['482'] . "</label>";
 if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
     echo "<br />\n<label><input type='checkbox' name='show_sig' value='1'" . $sig_checked . " /> " . $locale['483'] . "</label>";
 }
 if ($settings['thread_notify']) {
     echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'" . $notify_checked . " /> " . $locale['486'] . "</label>";
 }
 echo "</td>\n</tr>\n";
 if ($fdata['forum_attach'] && checkgroup($fdata['forum_attach'])) {
     add_to_head("<script type='text/javascript' src='" . INCLUDES . "multi_attachment.js'></script>\n");
     echo "<tr>\n<td width='145' class='tbl2'>" . $locale['464'] . "</td>\n";
     echo "<td class='tbl1'><input id='my_file_element' type='file' name='file_1' class='textbox' style='width:200px;' /><br />\n";
     echo "<span class='small2'>" . sprintf($locale['466'], parsebytesize($settings['attachmax']), str_replace(',', ' ', $settings['attachtypes']), $settings['attachmax_count']) . "</span><br />\n";
     echo "<div id='files_list'></div>\n";
     echo "<script>\n";
     echo "/* <![CDATA[ */\n";
     echo "<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->\n";
     echo "var multi_selector = new MultiSelector( document.getElementById( \"files_list\" ), " . $settings['attachmax_count'] . " );\n";
     echo "<!-- Pass in the file element -->\n";
     echo "multi_selector.addElement( document.getElementById( \"my_file_element\" ) );\n";
     echo "/* ]]>*/\n";
     echo "</script>\n";
     echo "</td>\n";
     echo "</tr>\n";
 }
Example #21
0
     $c_words = count($words);
     foreach ($words as $hlight) {
         $hlight = htmlentities($hlight, ENT_QUOTES);
         $higlight .= "'" . $hlight . "'";
         $higlight .= $i < $c_words ? "," : "";
         $i++;
     }
     add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery.highlight.js'></script>");
     $highlight_js .= "jQuery('.search_result').highlight([" . $higlight . "],{wordsOnly:true});";
     $highlight_js .= "jQuery('.highlight').css({backgroundColor:'#FFFF88'});";
     //better via theme or settings
 }
 // colourbox jQuery plugin
 if (count($colorbox_rel) > 0) {
     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>");
     $colorbox_js .= "jQuery('a[rel^=\"attach\"]').colorbox({";
     $colorbox_js .= "current:'" . $locale['506e'] . " {current} " . $locale['506f'] . " {total}',width:'80%',height:'80%'";
     $colorbox_js .= "});";
 }
 unset($colorbox_rel);
 // edit reason
 if ($edit_reason) {
     $edit_reason_js .= "jQuery('div[id^=\"reason_div_pid\"]').hide();";
     $edit_reason_js .= "jQuery('div').find('a[id^=\"reason_pid\"]').css({cursor:'pointer'})";
     $edit_reason_js .= ".removeAttr('href')";
     $edit_reason_js .= ".attr('title','" . str_replace("'", "&#39;", $locale['508b']) . "')";
     $edit_reason_js .= ".bind('click',function(){";
     $edit_reason_js .= "jQuery('#reason_div_pid_'+this.rel).stop().slideToggle('fast');";
     $edit_reason_js .= "});";
 }
Example #22
0
function showchart($id, $primary, $secondary = false, $array = false)
{
    if (!defined("xcharts")) {
        define("xcharts", true);
        add_to_head("<script src='" . DYNAMICS . "charts/xcharts/d3.v3.min.js' charset='utf-8'></script>");
        add_to_head("<script src='" . DYNAMICS . "charts/xcharts/xcharts.min.js'></script>\n");
        add_to_head("<link href='" . DYNAMICS . "charts/xcharts/xcharts.css' rel='stylesheet' type='text/css' media='screen' />");
    }
    $vis_type = array("bar" => "bar", "cumulative" => "cumulative", "line" => "line", "line-dotted" => "line-dotted");
    $scale_type = array("0" => "ordinal", "1" => "linear", "2" => "time", "3" => "exponential");
    if (isset($array) && is_array($array)) {
        $axisPaddingLeft = array_key_exists("axisPaddingLeft", $array) ? $array['axisPaddingLeft'] : 20;
        $paddingLeft = array_key_exists("paddingLeft", $array) ? $array['paddingLeft'] : 30;
        $axisPaddingBottom = array_key_exists("axisPaddingBottom", $array) ? $array['axisPaddingBottom'] : 5;
        $paddingBottom = array_key_exists("paddingBottom", $array) ? $array['paddingBottom'] : 20;
        $hideY = array_key_exists("hideY", $array) ? add_to_head("<style>#{$id} .axisY { display:none; }</style>") : "";
        $hideX = array_key_exists("hideX", $array) ? add_to_head("<style>#{$id} .axisX { display:none; }</style>") : "";
        $height = array_key_exists("height", $array) ? $array['height'] : "200px";
        $x_scale_type = array_key_exists("x_scale", $array) ? $scale_type[$array['x_scale']] : $scale_type['0'];
        $y_scale_type = array_key_exists("y_scale", $array) ? $scale_type[$array['y_scale']] : $scale_type['1'];
        $type = array_key_exists("type", $array) ? $vis_type[$array['type']] : $vis_type['bar'];
    } else {
        $axisPaddingLeft = 20;
        $paddingLeft = 0;
        $axisPaddingBottom = 5;
        $paddingBottom = 20;
        $hideY = "";
        $hideX = "";
        $height = "200px";
        $x_scale_type = $scale_type['0'];
        $y_scale_type = $scale_type['1'];
        $type = $vis_type['bar'];
    }
    $html = "";
    $html .= "<figure style='width:100%; min-height:{$height}' id='{$id}'></figure>";
    // demo data
    //new xChart('bar', {"xScale":"ordinal","yScale":"linear","type":"bar",
    // "main":[{"className":".pizza","data":[{"x":"Pepperoni","y":12},{"x":"Cheese","y":8}]}],
    // "comp":[{"className":".pizza","type":"line-dotted","data":[{"x":"Pepperoni","y":10},{"x":"Cheese","y":4}]}]},
    //'#pizza');
    //    'type': '$type',
    $data = " {\n    'xScale': '{$x_scale_type}',\n    'yScale': '{$y_scale_type}',\n\n    'main':";
    $data .= $primary;
    if ($secondary !== "") {
        $data .= ",";
        $data .= "'comp':";
        $data .= $secondary;
    }
    $data .= "}";
    $opts = "{\n    paddingLeft : {$paddingLeft} ,\n    axisPaddingLeft : {$axisPaddingLeft},\n    axisPaddingBottom : {$axisPaddingBottom},\n    paddingBottom : {$paddingBottom}\n    }";
    $html .= add_to_jquery("\n    var {$id} = new xChart('{$type}', {$data}, '#{$id}', {$opts});\n    ");
    return $html;
    //return print_p($secondary);
    //return print_p($data);
}
define("IS_FORUM", true);
if ($settings['ads_vf_show']) {
    if (file_exists(LOCALE . LOCALESET . "ads_system.php")) {
        include_once LOCALE . LOCALESET . "ads_system.php";
    } else {
        include_once LOCALE . "English/ads_system.php";
    }
}
if ($settings['warning_system']) {
    include_once INCLUDES . "warning.inc.php";
}
// Pimped
if ($settings['forum_post_ratings']) {
    // Pimped
    require_once FORUM_INC . "forum_post_rating.php";
    add_to_head("<script type='text/javascript'><!--\r\nfunction show(id) {\r\nvar d = document.getElementById(id);\r\nif (d.style.display=='none') { d.style.display='block'; } else { d.style.display='none'; }\r\n}\r\n//--></script>\r\n<script src='" . FORUM_INC . "forum_post_rating_boxover.js' type='text/javascript'></script>");
}
$posts_per_page = $settings['posts_per_page'];
add_to_title($locale['global_200'] . $locale['400']);
if (!isset($_GET['thread_id']) || !isnum($_GET['thread_id'])) {
    redirect(make_url(FORUM . "index.php", BASEDIR . "forum", "", ".html"));
}
// Pimped: make_url
if (!isset($_GET['page']) || !isnum($_GET['page'])) {
    $_GET['page'] = 0;
}
$_GET['rowstart'] = $_GET['page'] > 0 ? ($_GET['page'] - 1) * $posts_per_page : "0";
$result = dbquery("SELECT t.thread_id, t.thread_subject, t.thread_lastpost, t.thread_poll, t.thread_sticky, t.thread_locked, t.thread_resolved, t.thread_author,\r\n\tf.forum_id, f.forum_cat, f.forum_parent, f.forum_name, f.forum_moderators, f.forum_access,\r\n\tf.forum_post, f.forum_reply, f.forum_vote, f.forum_attach, f.forum_markresolved,\r\n\tf2.forum_name AS forum_cat_name\r\n\tFROM " . DB_THREADS . " t\r\n\tLEFT JOIN " . DB_FORUMS . " f ON t.forum_id=f.forum_id\r\n\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\r\n\tWHERE t.thread_id='" . (int) $_GET['thread_id'] . "' AND t.thread_hidden='0' LIMIT 1\r\n");
// Pimped #
if (dbrows($result)) {
    $fdata = dbarray($result);
Example #24
0
+--------------------------------------------------------+
| This program is released as free software under the
| 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("ERRO") || !defined("iAUTH") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) {
    die("Acces Denied");
}
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/errors.php";
add_to_head("<link rel='stylesheet' href='" . THEMES . "templates/errors.css' type='text/css' media='all' />");
// Setting maximum number of folders for an URL
function getMaxFolders($url, $level = 2)
{
    $return = "";
    $tmpUrlArr = explode("/", $url);
    if (count($tmpUrlArr) > $level) {
        $tmpUrlArr = array_reverse($tmpUrlArr);
        for ($i = 0; $i < $level; $i++) {
            $return = $tmpUrlArr[$i] . ($i > 0 ? "/" . $return : "");
        }
    } else {
        $return = implode("/", $tmpUrlArr);
    }
    return $return;
}
| Copyright (C) 2002 - 2013 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: captcha_display.php
| Author: Hans Kristian Flaatten
+--------------------------------------------------------+
| This program is released as free software under the
| 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).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
require_once "recaptchalib.php";
$lang = array("en", "nl", "fr", "de", "pt", "ru", "es", "tr");
$recaptchaLocale = "";
if (!isset($locale['recaptcha']) || !in_array($locale['recaptcha'], $lang)) {
    if (isset($locale['recaptcha']) && isset($locale['recaptcha_l10n'])) {
        $recaptchaLocale = "\n\t" . "custom_translations : {" . $locale['recaptcha_l10n'] . "}, ";
    } elseif (!isset($locale['recaptcha'])) {
        $locale['recaptcha'] = "en";
    }
}
add_to_head("<script type=\"text/javascript\">\n/*<![CDATA[*/\nvar RecaptchaOptions = { " . $recaptchaLocale . "\n   lang : '" . $locale['recaptcha'] . "',\n   theme : '" . $settings['recaptcha_theme'] . "'\n};\n/*]]>*/\n</script>");
// Hid extra input
$_CAPTCHA_HIDE_INPUT = true;
echo recaptcha_get_html($settings['recaptcha_public']);
<?php

defined("IN_FUSION") or die;
if (!isset($catalog_setting)) {
    require_once INFUSIONS . "al_catalog/infusion_db.php";
    add_to_head("<link rel='stylesheet' href='" . AL_CATALOG_DIR . "asset/catalog-styles.css' />");
}
require_once INFUSIONS . "al_catalog/functions.php";
if (file_exists(AL_CATALOG_DIR . "locale/" . $settings['locale'] . ".php")) {
    include AL_CATALOG_DIR . "locale/" . $settings['locale'] . ".php";
} else {
    include AL_CATALOG_DIR . "locale/Russian.php";
}
$cats_result = dbquery("SELECT * FROM " . DB_AL_CATALOG_CATS);
if (dbrows($cats_result)) {
    $cats_assoc = array();
    while ($cc = dbarray($cats_result)) {
        $cats_assoc[$cc['ctg_cat_id']] = $cc;
    }
    $cats_tree = build_cats_tree_array($cats_assoc);
    opentable($locale['ctg42']);
    echo build_cats_tree_list($cats_tree, isset($_GET['cat_id']) && isnum($_GET['cat_id']) ? $_GET['cat_id'] : 0);
    closetable();
}
Example #27
0
| Author: Hien (Frederick MC Chan)
+--------------------------------------------------------+
| This program is released as free software under the
| 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).
+--------------------------------------------------------*/
define("SUB_START_PAGE", "aaaa");
/**
 * Thread Page HTML
 */
if (!function_exists('render_thread')) {
    add_to_head("<link rel='stylesheet' type='text/css' href='" . INFUSIONS . "forum/templates/css/forum.css'>");
    function render_thread($info)
    {
        global $locale;
        $buttons = !empty($info['buttons']) ? $info['buttons'] : array();
        $data = !empty($info['thread']) ? $info['thread'] : array();
        $pdata = !empty($info['post_items']) ? $info['post_items'] : array();
        $icon = array('', '', 'fa fa-trophy fa-fw');
        $p_title = array();
        echo render_breadcrumbs();
        echo "<div class='clearfix'>\n";
        if (isset($info['page_nav'])) {
            echo "<div id='forum_top' class='pull-right m-t-10 text-lighter clearfix'>\n" . $info['page_nav'] . "</div>\n";
        }
        echo "<h2 class='m-t-0 thread-header pull-left m-r-20'>\n\t\t" . ($data['thread_sticky'] == TRUE ? "<i title='" . $locale['forum_0103'] . "' class='" . get_forumIcons("sticky") . "'></i>" : "") . "\n\t\t" . ($data['thread_locked'] == TRUE ? "<i title='" . $locale['forum_0102'] . "' class='" . get_forumIcons("lock") . "'></i>" : "") . "\n\t\t" . $data['thread_subject'] . "</h2>\n";
        echo "</div>\n";
<?php

if (!defined("IN_FUSION")) {
    die("denied");
}
require_once INFUSIONS . "al_streams/infusion_db.php";
if (file_exists(INFUSIONS . "al_streams_panel/" . $settings['locale'] . ".php")) {
    include INFUSIONS . "al_streams_panel/" . $settings['locale'] . ".php";
} else {
    include INFUSIONS . "al_streams_panel/Russian.php";
}
add_to_head("<link rel='stylesheet' type='text/css' href='" . INFUSIONS . "al_streams_panel/style.css' />");
$result = dbquery("SELECT st.*,u.user_name FROM " . DB_SS_STREAMS . " st LEFT JOIN " . DB_USERS . " u ON u.user_id=st.st_user ORDER BY st_id DESC");
openside($locale['alstrp1']);
if (dbrows($result)) {
    echo "<ul id='alstrp-list'>";
    echo "<li id='alstrp-loader' style='width:100%;text-align:center;'><img src='" . INFUSIONS . "al_streams_panel/loading.gif' /> Loading data...</li>";
    echo "<li id='alstrp-nostr'>" . $locale['alstrp3'] . "</li>";
    $ids = array();
    $i = 0;
    while ($data = dbarray($result)) {
        $i++;
        $ids[$i] = array("provider" => $data['st_provider'], "ident" => $data['st_provider_id'], "id" => $data['st_id']);
    }
    echo "</ul>";
    $ids_json = json_encode($ids);
    echo "<script type='text/javascript'>\n\n    \$(document).ready(function(){\n        \n        var xxx = '" . $ids_json . "';\n        var ids = eval( '(' +xxx+ ')' );\n        var num = '" . $i . "';\n        var bdir = '" . BASEDIR . "';\n        //var count_live = 0;\n        //\$('#alstrp-nostr').hide();\n\n        for (var i = 1;i <= num; i++) {\n        \n            \$.ajax({\n                type: 'post',\n                url: bdir+'infusions/al_streams/backend.php',\n                dataType: 'json',\n                cache: true,\n                data: {\n                    provider: ids[i].provider,\n                    provider_id: ids[i].ident,\n                    id: ids[i].id,\n                    action: 'get_info'\n                },\n                success: function(data){\n                    if (data.is_live == 1) {\n                        var info = '<a href=\\''+bdir+'profile.php?lookup='+data.user_id+'\\'>'+data.user_name+'</a><br />" . $locale['alstrp4'] . "'+data.view+' " . $locale['alstrp5'] . "'+data.online_chat;\n                        \$('#alstrp-list').append('<li><a href=\\'streams.php?action=view&id='+data.sid+'\\'><img src=\\''+data.img+'\\' width=\\'200\\' height=\\'120\\' /></a><br />'+info+'</li>');\n                        //count_live++;\n                        \$('#alstrp-nostr').hide();\n                    } else {\n                        //alert(num);\n                        //if (i > num) {\n                            //\$('#alstrp-nostr').show();\n                        //}\n                    }\n                \n\n                    \n                }\n            });\n            \n        //if (i = num) {\n        //if (count_live == 0) {\n//            \$('#alstrp-list').html('<li>" . $locale['alstrp3'] . "</li>');\n//        }\n//        }\n        }\n            \$('li#alstrp-loader').fadeOut();\n            \n\n    });\n\n\n</script>";
} else {
    echo $locale['alstrp2'];
}
closeside();
Example #29
0
| This program is released as free software under the
| 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).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
/**
 * UserFields form HTML
 */
if (!function_exists('render_userform')) {
    add_to_head("<link href='" . THEMES . "templates/global/css/profile.css' rel='stylesheet'/>\n");
    function render_userform($info)
    {
        $open = "";
        $close = "";
        $tab_title = array();
        /**
         * $info['sections'] are category pages
         */
        if (isset($info['section']) && count($info['section']) > 1) {
            foreach ($info['section'] as $page_section) {
                $tab_title['title'][$page_section['id']] = $page_section['name'];
                $tab_title['id'][$page_section['id']] = $page_section['id'];
                $tab_title['icon'][$page_section['id']] = '';
            }
            $open = opentab($tab_title, $_GET['section'], 'user-profile-form', 1);
Example #30
0
     $phpinfo = "<table cellpadding='0' cellspacing='1' class='tbl-border tab' style='width:100%;' id='folders'>\n";
     $phpinfo .= "<tr>\n<td class='tbl2' style='width:50%'>" . $locale['423'] . "</td><td class='tbl2' style='text-align:right'>" . (ini_get('safe_mode') ? $locale['421'] : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl1' style='width:50%'>" . $locale['424'] . "</td><td class='tbl1' style='text-align:right'>" . (ini_get('register_globals') ? $locale['421'] : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl2' style='width:50%'>" . $locale['425'] . " GD (" . $locale['431'] . ")</td><td class='tbl2' style='text-align:right'>" . (extension_loaded('gd') ? $locale['421'] . " (" . $gd_ver[0] . ")" : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl1' style='width:50%'>" . $locale['425'] . " zlib</td><td class='tbl1' style='text-align:right'>" . (extension_loaded('zlib') ? $locale['421'] : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl2' style='width:50%'>" . $locale['425'] . " Magic_quotes_gpc</td><td class='tbl2' style='text-align:right'>" . (ini_get('magic_quotes_gpc') ? $locale['421'] : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl1' style='width:50%'>" . $locale['426'] . "</td><td class='tbl1' style='text-align:right'>" . (ini_get('file_uploads') ? $locale['421'] . " (" . ini_get('upload_max_filesize') . "B)" : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl2' style='width:50%'>" . $locale['428'] . "</td><td class='tbl2' style='text-align:right'>" . (ini_get('display_errors') ? $locale['421'] : $locale['422']) . "</td></tr>\n";
     $phpinfo .= "<tr>\n<td class='tbl1' style='width:50%'>" . $locale['429'] . "</td><td class='tbl1' style='text-align:right'>" . (ini_get('disable_functions') ? ini_get('disable_functions') : $locale['430']) . "</td></tr>\n";
     $phpinfo .= "</table>\n";
 } else {
     //folder permissions
     if ($_GET['page'] == 3) {
         $status = '';
         $folders = array('administration/db_backups/' => true, 'images/' => true, 'images/imagelist.js' => true, 'images/articles/' => true, 'images/avatars/' => true, 'images/news/' => true, 'images/news/thumbs/' => true, 'images/news_cats/' => true, 'images/photoalbum/' => true, 'images/photoalbum/submissions/' => true, 'forum/attachments/' => true, 'ftp_upload/' => true, 'downloads/' => true, 'downloads/images' => true, 'robots.txt' => true, 'config.php' => false);
         add_to_head("<style type='text/css'>.passed {color:green;} .failed {color:red; text-transform: uppercase; font-weight:bold;}</style>\n");
         //Check file/folder writeable
         $i = 0;
         foreach ($folders as $folder => $writeable) {
             $row_class = $i % 2 ? "tbl1" : "tbl2";
             $status .= "<tr>\n<td class='" . $row_class . "' style='width:50%'>" . $folder . "</td><td class='" . $row_class . "' style='text-align:right'>";
             if (is_writable(BASEDIR . $folder) == true) {
                 $status .= "<span class='" . ($writeable == true ? "passed" : "failed") . "'>" . $locale['441'] . "</span>";
             } else {
                 $status .= "<span class='" . ($writeable == true ? "failed" : "passed") . "'>" . $locale['442'] . "</span>";
             }
             $status .= " (" . substr(sprintf('%o', fileperms(BASEDIR . $folder)), -4) . ")</td></tr>\n";
             $i++;
         }
         $phpinfo = "<table cellpadding='0' cellspacing='1' class='tbl-border tab' style='width:100%;' id='folders'>\n";
         $phpinfo .= $status;