function showMemoryUsage()
{
    $locale = array();
    include LOCALE . LOCALESET . "global.php";
    $memory_allocated = parsebytesize(memory_get_peak_usage(TRUE));
    $memory_used = parsebytesize(memory_get_peak_usage(FALSE));
    return " | " . $locale['global_174'] . ": " . $memory_used . "/" . $memory_allocated;
}
Exemplo n.º 2
0
 public static function theme_uploader()
 {
     global $locale, $aidlink, $defender;
     if (isset($_POST['upload'])) {
         require_once INCLUDES . "infusions_include.php";
         $src_file = 'theme_files';
         $target_folder = THEMES;
         $valid_ext = '.zip';
         $max_size = 5 * 1000 * 1000;
         $upload = upload_file($src_file, '', $target_folder, $valid_ext, $max_size);
         if ($upload['error'] != '0') {
             $defender->stop();
             switch ($upload['error']) {
                 case 1:
                     addNotice('danger', sprintf($locale['theme_error_001'], parsebytesize($max_size, 2)));
                     break;
                 case 2:
                     addNotice('danger', $locale['theme_error_002']);
                     break;
                 case 3:
                     addNotice('danger', $locale['theme_error_003']);
                     break;
                 case 4:
                     addNotice('danger', $locale['theme_error_004']);
                     break;
                 default:
                     addNotice('danger', $locale['theme_error_003']);
             }
         } else {
             $target_file = $target_folder . $upload['target_file'];
             if (is_file($target_file)) {
                 $path = pathinfo(realpath($target_file), PATHINFO_DIRNAME);
                 if (class_exists('ZipArchive')) {
                     $zip = new ZipArchive();
                     $res = $zip->open($target_file);
                     if ($res === TRUE) {
                         // checks if first folder is theme.php
                         if ($zip->locateName('theme.php') !== FALSE) {
                             // extract it to the path we determined above
                             $zip->extractTo($path);
                             addNotice('success', $locale['theme_success_001']);
                         } else {
                             $defender->stop();
                             addNotice('danger', $locale['theme_error_005']);
                         }
                         $zip->close();
                         @unlink($target_file);
                         redirect(FUSION_SELF . $aidlink);
                     } else {
                         addNotice('danger', $locale['theme_error_005']);
                         @unlink($target_file);
                         redirect(FUSION_SELF . $aidlink);
                     }
                 } else {
                     addNotice('warning', $locale['theme_error_006']);
                     @unlink($target_file);
                     redirect(FUSION_SELF . $aidlink);
                 }
             }
         }
     }
     echo openform('inputform', 'post', FUSION_SELF . $aidlink, array('enctype' => 1, 'max_tokens' => 1));
     echo form_fileinput('theme_files', $locale['theme_1007'], '', array());
     echo form_button('upload', $locale['theme_1007'], 'upload theme', array('class' => 'btn btn-primary'));
     echo closeform();
 }
Exemplo n.º 3
0
 protected function verify_image_upload()
 {
     $locale = fusion_get_locale();
     require_once INCLUDES . "infusions_include.php";
     if ($this->field_config['multiple']) {
         $target_folder = $this->field_config['path'];
         $target_width = $this->field_config['max_width'];
         $target_height = $this->field_config['max_height'];
         $max_size = $this->field_config['max_byte'];
         $delete_original = $this->field_config['delete_original'];
         $thumb1 = $this->field_config['thumbnail'];
         $thumb2 = $this->field_config['thumbnail2'];
         $thumb1_ratio = 1;
         $thumb1_folder = $this->field_config['path'] . $this->field_config['thumbnail_folder'] . "/";
         $thumb1_suffix = $this->field_config['thumbnail_suffix'];
         $thumb1_width = $this->field_config['thumbnail_w'];
         $thumb1_height = $this->field_config['thumbnail_h'];
         $thumb2_ratio = 0;
         $thumb2_folder = $this->field_config['path'] . $this->field_config['thumbnail_folder'] . "/";
         $thumb2_suffix = $this->field_config['thumbnail2_suffix'];
         $thumb2_width = $this->field_config['thumbnail2_w'];
         $thumb2_height = $this->field_config['thumbnail2_h'];
         $query = '';
         if (!empty($_FILES[$this->field_config['input_name']]['name']) && is_uploaded_file($_FILES[$this->field_config['input_name']]['tmp_name'][0]) && $this->safe()) {
             $result = array();
             for ($i = 0; $i <= count($_FILES[$this->field_config['input_name']]['name']) - 1; $i++) {
                 if (is_uploaded_file($_FILES[$this->field_config['input_name']]['tmp_name'][$i])) {
                     $image = $_FILES[$this->field_config['input_name']];
                     $target_name = $_FILES[$this->field_config['input_name']]['name'][$i];
                     if ($target_name != "" && !preg_match("/[^a-zA-Z0-9_-]/", $target_name)) {
                         $image_name = $target_name;
                     } else {
                         $image_name = stripfilename(substr($image['name'][$i], 0, strrpos($image['name'][$i], ".")));
                     }
                     $image_ext = strtolower(strrchr($image['name'][$i], "."));
                     $image_res = array();
                     if (filesize($image['tmp_name'][$i]) > 10 && @getimagesize($image['tmp_name'][$i])) {
                         $image_res = @getimagesize($image['tmp_name'][$i]);
                     }
                     $image_info = array("image" => FALSE, "image_name" => $image_name . $image_ext, "image_ext" => $image_ext, "image_size" => $image['size'], "image_width" => $image_res[0], "image_height" => $image_res[1], "thumb1" => FALSE, "thumb1_name" => "", "thumb2" => FALSE, "thumb2_name" => "", "error" => 0);
                     if ($image_ext == ".gif") {
                         $filetype = 1;
                     } elseif ($image_ext == ".jpg") {
                         $filetype = 2;
                     } elseif ($image_ext == ".png") {
                         $filetype = 3;
                     } else {
                         $filetype = FALSE;
                     }
                     if ($image['size'][$i] > $max_size) {
                         // Invalid file size
                         $image_info['error'] = 1;
                     } elseif (!$filetype || !verify_image($image['tmp_name'][$i])) {
                         // Unsupported image type
                         $image_info['error'] = 2;
                     } elseif ($image_res[0] > $target_width || $image_res[1] > $target_height) {
                         // Invalid image resolution
                         $image_info['error'] = 3;
                     } else {
                         if (!file_exists($target_folder)) {
                             mkdir($target_folder, 0755);
                         }
                         $image_name_full = filename_exists($target_folder, $image_name . $image_ext);
                         $image_name = substr($image_name_full, 0, strrpos($image_name_full, "."));
                         $image_info['image_name'] = $image_name_full;
                         $image_info['image'] = TRUE;
                         move_uploaded_file($image['tmp_name'][$i], $target_folder . $image_name_full);
                         if (function_exists("chmod")) {
                             chmod($target_folder . $image_name_full, 0755);
                         }
                         if ($query && !dbquery($query)) {
                             // Invalid query string
                             $image_info['error'] = 4;
                             if (file_exists($target_folder . $image_name_full)) {
                                 @unlink($target_folder . $image_name_full);
                             }
                         } elseif ($thumb1 || $thumb2) {
                             require_once INCLUDES . "photo_functions_include.php";
                             $noThumb = FALSE;
                             if ($thumb1) {
                                 if ($image_res[0] <= $thumb1_width && $image_res[1] <= $thumb1_height) {
                                     $noThumb = TRUE;
                                     $image_info['thumb1_name'] = $image_info['image_name'];
                                     $image_info['thumb1'] = TRUE;
                                 } else {
                                     if (!file_exists($thumb1_folder)) {
                                         mkdir($thumb1_folder, 0755, TRUE);
                                     }
                                     $image_name_t1 = filename_exists($thumb1_folder, $image_name . $thumb1_suffix . $image_ext);
                                     $image_info['thumb1_name'] = $image_name_t1;
                                     $image_info['thumb1'] = TRUE;
                                     if ($thumb1_ratio == 0) {
                                         createthumbnail($filetype, $target_folder . $image_name_full, $thumb1_folder . $image_name_t1, $thumb1_width, $thumb1_height);
                                     } else {
                                         createsquarethumbnail($filetype, $target_folder . $image_name_full, $thumb1_folder . $image_name_t1, $thumb1_width);
                                     }
                                 }
                             }
                             if ($thumb2) {
                                 if ($image_res[0] < $thumb2_width && $image_res[1] < $thumb2_height) {
                                     $noThumb = TRUE;
                                     $image_info['thumb2_name'] = $image_info['image_name'];
                                     $image_info['thumb2'] = TRUE;
                                 } else {
                                     if (!file_exists($thumb2_folder)) {
                                         mkdir($thumb2_folder, 0755, TRUE);
                                     }
                                     $image_name_t2 = filename_exists($thumb2_folder, $image_name . $thumb2_suffix . $image_ext);
                                     $image_info['thumb2_name'] = $image_name_t2;
                                     $image_info['thumb2'] = TRUE;
                                     if ($thumb2_ratio == 0) {
                                         createthumbnail($filetype, $target_folder . $image_name_full, $thumb2_folder . $image_name_t2, $thumb2_width, $thumb2_height);
                                     } else {
                                         createsquarethumbnail($filetype, $target_folder . $image_name_full, $thumb2_folder . $image_name_t2, $thumb2_width);
                                     }
                                 }
                             }
                             if ($delete_original && !$noThumb) {
                                 unlink($target_folder . $image_name_full);
                                 $image_info['image'] = FALSE;
                             }
                         }
                     }
                 } else {
                     $image_info = array("error" => 5);
                 }
                 if ($image_info['error'] != 0) {
                     $this->stop();
                     // return FALSE if possible
                     switch ($image_info['error']) {
                         case 1:
                             // Invalid file size
                             addNotice('danger', sprintf($locale['df_416'], parsebytesize($this->field_config['max_byte'])));
                             self::setInputError($this->field_name);
                             break;
                         case 2:
                             // Unsupported image type
                             addNotice('danger', sprintf($locale['df_417'], ".gif .jpg .png"));
                             self::setInputError($this->field_name);
                             break;
                         case 3:
                             // Invalid image resolution
                             addNotice('danger', sprintf($locale['df_421'], $this->field_config['max_width'], $this->field_config['max_height']));
                             self::setInputError($this->field_name);
                             break;
                         case 4:
                             // Invalid query string
                             addNotice('danger', $locale['df_422']);
                             self::setInputError($this->field_name);
                             break;
                         case 5:
                             // Image not uploaded
                             addNotice('danger', $locale['df_423']);
                             self::setInputError($this->field_name);
                             break;
                     }
                     $result[$i] = $image_info;
                 } else {
                     $result[$i] = $image_info;
                 }
             }
             // end for
             return $result;
         } else {
             return array();
         }
     } else {
         if (!empty($_FILES[$this->field_config['input_name']]['name']) && is_uploaded_file($_FILES[$this->field_config['input_name']]['tmp_name']) && $this->safe()) {
             $upload = upload_image($this->field_config['input_name'], $_FILES[$this->field_config['input_name']]['name'], $this->field_config['path'], $this->field_config['max_width'], $this->field_config['max_height'], $this->field_config['max_byte'], $this->field_config['delete_original'], $this->field_config['thumbnail'], $this->field_config['thumbnail2'], 1, $this->field_config['path'] . $this->field_config['thumbnail_folder'] . "/", $this->field_config['thumbnail_suffix'], $this->field_config['thumbnail_w'], $this->field_config['thumbnail_h'], 0, $this->field_config['path'] . $this->field_config['thumbnail_folder'] . "/", $this->field_config['thumbnail2_suffix'], $this->field_config['thumbnail2_w'], $this->field_config['thumbnail2_h']);
             if ($upload['error'] != 0) {
                 $this->stop();
                 switch ($upload['error']) {
                     case 1:
                         // Invalid file size
                         addNotice('danger', sprintf($locale['df_416'], parsebytesize($this->field_config['max_byte'])));
                         self::setInputError($this->field_name);
                         break;
                     case 2:
                         // Unsupported image type
                         addNotice('danger', sprintf($locale['df_417'], ".gif .jpg .png"));
                         self::setInputError($this->field_name);
                         break;
                     case 3:
                         // Invalid image resolution
                         addNotice('danger', sprintf($locale['df_421'], $this->field_config['max_width'], $this->field_config['max_height']));
                         self::setInputError($this->field_name);
                         break;
                     case 4:
                         // Invalid query string
                         addNotice('danger', $locale['df_422']);
                         self::setInputError($this->field_name);
                         break;
                     case 5:
                         // Image not uploaded
                         addNotice('danger', $locale['df_423']);
                         self::setInputError($this->field_name);
                         break;
                 }
                 return $upload;
             } else {
                 return $upload;
             }
         } else {
             return array();
         }
     }
 }
Exemplo n.º 4
0
        }
        add_to_title($locale['global_200'] . $locale['news_0400']);
        echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
        echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['news_0703']) . "</div>\n";
        echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=n", array("enctype" => $news_settings['news_allow_submission_files'] ? TRUE : FALSE));
        echo form_text('news_subject', $locale['news_0200'], $criteriaArray['news_subject'], array("required" => TRUE, "inline" => TRUE));
        if (multilang_table("NS")) {
            echo form_select('news_language', $locale['global_ML100'], $criteriaArray['news_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
        } else {
            echo form_hidden('news_language', '', $criteriaArray['news_language']);
        }
        echo form_select('news_keywords', $locale['news_0205'], $criteriaArray['news_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['news_0205a'], "width" => "100%", "error_text" => $locale['news_0255'], "tags" => TRUE, "multiple" => TRUE));
        echo form_select_tree("news_cat", $locale['news_0201'], $criteriaArray['news_cat'], array("width" => "250px", "inline" => TRUE, "parent_value" => $locale['news_0202'], "query" => multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : ""), DB_NEWS_CATS, "news_cat_name", "news_cat_id", "news_cat_parent");
        if ($news_settings['news_allow_submission_files']) {
            $file_input_options = array('upload_path' => IMAGES_N, 'max_width' => $news_settings['news_photo_max_w'], 'max_height' => $news_settings['news_photo_max_h'], 'max_byte' => $news_settings['news_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $news_settings['news_thumb_w'], 'thumbnail_h' => $news_settings['news_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $news_settings['news_photo_w'], 'thumbnail2_h' => $news_settings['news_photo_h'], 'type' => 'image', "inline" => TRUE);
            echo form_fileinput("news_image", $locale['news_0216'], "", $file_input_options);
            echo "<div class='small col-sm-offset-3 m-b-10'><span class='p-l-15'>" . sprintf($locale['news_0217'], parsebytesize($news_settings['news_photo_max_b'])) . "</span></div>\n";
            $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
            echo form_select('news_ialign', $locale['news_0218'], $criteriaArray['news_ialign'], array("options" => $alignOptions, "inline" => TRUE));
        }
        echo form_textarea('news_news', $locale['news_0203'], $criteriaArray['news_snippet'], array("required" => TRUE, "html" => TRUE, "form_name" => "submit_form", "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE));
        echo form_textarea('news_body', $locale['news_0203b'], $criteriaArray['news_body'], array("required" => $news_settings['news_extended_required'] ? TRUE : FALSE, "html" => TRUE, "form_name" => "submit_form", "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE));
        echo fusion_get_settings("site_seo") ? "" : form_button('preview_news', $locale['news_0240'], $locale['news_0240'], array('class' => 'btn-primary m-r-10'));
        echo form_button('submit_news', $locale['news_0700'], $locale['news_0700'], array('class' => 'btn-primary'));
        echo closeform();
        echo "</div>\n</div>\n";
    }
} else {
    echo "<div class='well text-center'>" . $locale['news_0138'] . "</div>\n";
}
closetable();
Exemplo n.º 5
0
     echo "<input type='file' name='download_file' class='textbox' style='width:150px;' /><br />\n";
     echo sprintf($locale['433'], parsebytesize($settings['download_max_b']), str_replace(',', ' ', $settings['download_types'])) . "<br />\n";
     echo "<label><input type='checkbox' name='calc_upload' id='calc_upload' value='1' /> " . $locale['432'] . "</label>\n";
 }
 echo "</td>\n</tr>\n";
 if ($settings['download_screenshot']) {
     echo "<tr>\n";
     echo "<td class='tbl1' style='width:80px; vertical-align:top;'>" . $locale['434'] . "</td>\n<td class='tbl1' style='vertical-align:top;'>\n";
     if (!empty($download_image) && !empty($download_image_thumb)) {
         echo "<img src='" . DOWNLOADS . "images/" . $download_image_thumb . "' /><br />\n";
         echo "<label><input type='checkbox' name='del_image' value='1' /> " . $locale['431'] . "</label>\n";
         echo "<input type='hidden' name='download_image' value='" . $download_image . "' />";
         echo "<input type='hidden' name='download_image_thumb' value='" . $download_image_thumb . "' />";
     } else {
         echo "<input type='file' name='download_image' class='textbox' style='width:150px;' /><br />\n";
         echo sprintf($locale['433b'], parsebytesize($settings['download_screen_max_b']), str_replace(',', ' ', ".jpg,.gif,.png"), $settings['download_screen_max_w'], $settings['download_screen_max_h']) . "<br />\n";
     }
     echo "</td>\n</tr>\n";
 }
 echo "<tr>\n";
 echo "<td class='tbl1' style='width:80px;'>" . $locale['423'] . "</td>\n";
 echo "<td class='tbl1'><select name='download_cat' class='textbox'>\n" . $editlist . "</select></td>\n";
 echo "</tr>\n";
 echo "<tr>\n<td class='tbl1' style='width:80px;'>" . $locale['424'] . "</td>\n";
 echo "<td class='tbl1'><input type='text' name='download_license' value='" . $download_license . "' class='textbox' style='width:150px;' /></td>\n";
 echo "</tr>\n";
 echo "<tr>\n<td class='tbl1' style='width:80px;'>" . $locale['425'] . "</td>\n";
 echo "<td class='tbl1'><input type='text' name='download_os' value='" . $download_os . "' class='textbox' style='width:150px;' /></td>\n";
 echo "</tr>\n";
 echo "<tr>\n<td class='tbl1' style='width:80px;'>" . $locale['426'] . "</td>\n";
 echo "<td class='tbl1'><input type='text' name='download_version' value='" . $download_version . "' class='textbox' style='width:150px;' /></td>\n";
Exemplo n.º 6
0
 echo "<!--sub_forum_post_message-->";
 if ($data['post_attachments'] > 0) {
     // Pimped: Multi-Upload
     $att_result = dbquery("SELECT attach_id, attach_ext, attach_name, attach_counter\r\n\t\t\tFROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . (int) $data['post_id'] . "'");
     if (dbrows($att_result)) {
         $print_files = '';
         $print_images = '';
         $count_files = 0;
         $count_images = 0;
         while ($att_data = dbarray($att_result)) {
             if (in_array($att_data['attach_ext'], $imagetypes) && file_exists(FORUM_ATT . $att_data['attach_name']) && @getimagesize(FORUM_ATT . $att_data['attach_name'])) {
                 $print_images .= "\n" . display_image($att_data['attach_name']) . "<br />[" . parsebytesize(filesize(FORUM_ATT . $att_data['attach_name'])) . "]<br /><br />\n";
                 $count_images++;
             } elseif (file_exists(FORUM_ATT . $att_data['attach_name'])) {
                 $print_files .= "\n<a href='" . FORUM . "file.php?getfile=" . $att_data['attach_id'] . "'>" . $att_data['attach_name'] . "</a>";
                 $print_files .= " [" . parsebytesize(filesize(FORUM_ATT . $att_data['attach_name']));
                 $print_files .= ", " . sprintf($locale['507c'], $att_data['attach_counter']) . "]<br />\n";
                 $count_files++;
             }
         }
         if ($print_files != '') {
             echo "\n<fieldset class='forum_attachments'>";
             echo "<legend class='forum_attachments_legend'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . ($count_files > 1 ? $locale['507b'] : $locale['507']) . "</legend>";
             echo "<div class='forum_attachments_content'>" . $print_files . "</div>";
             echo "</fieldset>\n";
         }
         if ($print_images != '') {
             if ($print_files != '') {
                 echo "<br />";
             }
             echo "\n<fieldset class='forum_attachments'>";
Exemplo n.º 7
0
 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'])) {
     echo "<tr>\n<td width='145' class='tbl2'>" . $locale['464'] . "</td>\n";
     echo "<td class='tbl1'><input type='file' name='attach' class='textbox' style='width:200px;' /><br />\n";
     echo "<span class='small2'>" . sprintf($locale['466'], parsebytesize($settings['attachmax']), str_replace(',', ' ', $settings['attachtypes'])) . "</span></td>\n";
     echo "</tr>\n";
 }
 if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
     echo "<tr>\n<td align='center' colspan='2' class='tbl2'>" . $locale['467'] . "</td>\n";
     echo "</tr>\n<tr>\n";
     echo "<td width='145' class='tbl2'>" . $locale['469'] . "</td>\n";
     echo "<td class='tbl1'><input type='text' name='poll_title' value='" . $poll_title . "' class='textbox' maxlength='255' style='width:250px' /></td>\n";
     echo "</tr>\n";
     $i = 1;
     if (isset($poll_opts) && is_array($poll_opts) && count($poll_opts)) {
         foreach ($poll_opts as $poll_option) {
             echo "<tr>\n<td width='145' class='tbl2'>" . $locale['470'] . " " . $i . "</td>\n";
             echo "<td class='tbl1'><input type='text' name='poll_options[{$i}]' value='" . $poll_option . "' class='textbox' maxlength='255' style='width:250px'>";
             if ($i == count($poll_opts)) {
                 echo " <input type='submit' name='add_poll_option' value='" . $locale['471'] . "' class='button' />";
Exemplo n.º 8
0
    echo "<div class='col-xs-12 col-sm-6'>\n";
    $image_thumb = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2']);
    echo "<label>" . thumbnail($image_thumb, '100px');
    echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['delete'] . "</label>\n";
    echo "</div>\n";
    echo "<div class='col-xs-12 col-sm-6'>\n";
    $alignOptions = array('pull-left' => $locale['left'], 'blog-img-center' => $locale['center'], 'pull-right' => $locale['right']);
    echo form_select('blog_ialign', $locale['blog_0442'], $data['blog_ialign'], array("options" => $alignOptions, "inline" => FALSE));
    echo "</div>\n</div>\n";
    echo "<input type='hidden' name='blog_image' value='" . $data['blog_image'] . "' />\n";
    echo "<input type='hidden' name='blog_image_t1' value='" . $data['blog_image_t1'] . "' />\n";
    echo "<input type='hidden' name='blog_image_t2' value='" . $data['blog_image_t2'] . "' />\n";
} else {
    $file_input_options = array('upload_path' => IMAGES_B, 'max_width' => $blog_settings['blog_photo_max_w'], 'max_height' => $blog_settings['blog_photo_max_h'], 'max_byte' => $blog_settings['blog_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $blog_settings['blog_thumb_w'], 'thumbnail_h' => $blog_settings['blog_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $blog_settings['blog_photo_w'], 'thumbnail2_h' => $blog_settings['blog_photo_h'], 'type' => 'image');
    echo form_fileinput("blog_image", $locale['blog_0439'], "", $file_input_options);
    echo "<div class='small m-b-10'>" . sprintf($locale['blog_0440'], parsebytesize($blog_settings['blog_photo_max_b'])) . "</div>\n";
    $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
    echo form_select('blog_ialign', $locale['blog_0442'], $data['blog_ialign'], array("options" => $alignOptions));
}
closeside();
openside('');
echo "<label><input type='checkbox' name='blog_draft' value='yes'" . ($data['blog_draft'] ? "checked='checked'" : "") . " /> " . $locale['blog_0431'] . "</label><br />\n";
echo "<label><input type='checkbox' name='blog_sticky' value='yes'" . ($data['blog_sticky'] ? "checked='checked'" : "") . "  /> " . $locale['blog_0432'] . "</label><br />\n";
if (fusion_get_settings("tinymce_enabled") != 1) {
    echo "<label><input type='checkbox' name='line_breaks' value='yes'" . ($data['blog_breaks'] ? "checked='checked'" : "") . " /> " . $locale['blog_0433'] . "</label><br />\n";
}
closeside();
echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-5 col-lg-4'>\n";
openside("");
if (!fusion_get_settings("comments_enabled") || !fusion_get_settings("ratings_enabled")) {
    $sys = "";
Exemplo n.º 9
0
/**
 * Displays News Form
 */
function display_news_form()
{
    global $aidlink;
    if (isset($_POST['cancel'])) {
        redirect(FUSION_SELF . $aidlink);
    }
    $formaction = FUSION_REQUEST;
    $locale = fusion_get_locale();
    $userdata = fusion_get_userdata();
    $news_settings = fusion_get_settings("news");
    $edit = isset($_GET['action']) && $_GET['action'] == 'edit' && isset($_GET['news_id']) && isnum($_GET['news_id']) ? TRUE : FALSE;
    add_breadcrumb(array('link' => '', 'title' => $edit ? $locale['news_0003'] : $locale['news_0002']));
    $data = array('news_id' => 0, 'news_draft' => 0, 'news_sticky' => 0, 'news_news' => '', 'news_datestamp' => time(), 'news_extended' => '', 'news_keywords' => '', 'news_breaks' => 'n', 'news_allow_comments' => 1, 'news_allow_ratings' => 1, 'news_language' => LANGUAGE, 'news_visibility' => 0, 'news_subject' => '', 'news_start' => '', 'news_end' => '', 'news_cat' => 0, 'news_image' => '', 'news_ialign' => 'pull-left');
    if (fusion_get_settings("tinymce_enabled")) {
        $data['news_breaks'] = 'n';
    } else {
        $data['news_breaks'] = 'y';
    }
    if (isset($_POST['save']) or isset($_POST['save_and_close'])) {
        $news_news = "";
        if ($_POST['news_news']) {
            $news_news = str_replace("src='" . str_replace("../", "", IMAGES_N), "src='" . IMAGES_N, fusion_get_settings('allow_php_exe') ? htmlspecialchars($_POST['news_news']) : stripslashes($_POST['news_news']));
            $news_news = parse_textarea($news_news);
        }
        $news_extended = "";
        if ($_POST['news_extended']) {
            $news_extended = str_replace("src='" . str_replace("../", "", IMAGES_N), "src='" . IMAGES_N, fusion_get_settings('allow_php_exe') ? htmlspecialchars($_POST['news_extended']) : stripslashes($_POST['news_extended']));
            $news_extended = parse_textarea($news_extended);
        }
        $data = array('news_id' => form_sanitizer($_POST['news_id'], 0, 'news_id'), 'news_subject' => form_sanitizer($_POST['news_subject'], '', 'news_subject'), 'news_cat' => form_sanitizer($_POST['news_cat'], 0, 'news_cat'), 'news_news' => form_sanitizer($news_news, "", "news_news"), 'news_extended' => form_sanitizer($news_extended, "", "news_extended"), 'news_keywords' => form_sanitizer($_POST['news_keywords'], '', 'news_keywords'), 'news_datestamp' => form_sanitizer($_POST['news_datestamp'], '', 'news_datestamp'), 'news_start' => form_sanitizer($_POST['news_start'], 0, 'news_start'), 'news_end' => form_sanitizer($_POST['news_end'], 0, 'news_end'), 'news_visibility' => form_sanitizer($_POST['news_visibility'], 0, 'news_visibility'), 'news_draft' => isset($_POST['news_draft']) ? "1" : "0", 'news_sticky' => isset($_POST['news_sticky']) ? "1" : "0", 'news_allow_comments' => isset($_POST['news_allow_comments']) ? "1" : "0", 'news_allow_ratings' => isset($_POST['news_allow_ratings']) ? "1" : "0", 'news_language' => form_sanitizer($_POST['news_language'], '', 'news_language'), 'news_image' => "", 'news_ialign' => "", 'news_image_t1' => "", 'news_image_t2' => "");
        if (isset($_FILES['news_image'])) {
            // when files is uploaded.
            $upload = form_sanitizer($_FILES['news_image'], '', 'news_image');
            if (!empty($upload) && !$upload['error']) {
                $data['news_image'] = $upload['image_name'];
                $data['news_image_t1'] = $upload['thumb1_name'];
                $data['news_image_t2'] = $upload['thumb2_name'];
                $data['news_ialign'] = isset($_POST['news_ialign']) ? form_sanitizer($_POST['news_ialign'], "pull-left", "news_ialign") : "pull-left";
            }
        } else {
            // when files not uploaded. but there should be exist check.
            $data['news_image'] = isset($_POST['news_image']) ? $_POST['news_image'] : "";
            $data['news_image_t1'] = isset($_POST['news_image_t1']) ? $_POST['news_image_t1'] : "";
            $data['news_image_t2'] = isset($_POST['news_image_t2']) ? $_POST['news_image_t2'] : "";
            $data['news_ialign'] = isset($_POST['news_ialign']) ? form_sanitizer($_POST['news_ialign'], "pull-left", "news_ialign") : "pull-left";
        }
        if (fusion_get_settings('tinymce_enabled') != 1) {
            $data['news_breaks'] = isset($_POST['line_breaks']) ? "y" : "n";
        } else {
            $data['news_breaks'] = "n";
        }
        if ($data['news_sticky'] == "1") {
            $result = dbquery("UPDATE " . DB_NEWS . " SET news_sticky='0' WHERE news_sticky='1'");
        }
        // reset other sticky
        // delete image
        if (isset($_POST['del_image'])) {
            if (!empty($data['news_image']) && file_exists(IMAGES_N . $data['news_image'])) {
                unlink(IMAGES_N . $data['news_image']);
            }
            if (!empty($data['news_image_t1']) && file_exists(IMAGES_N_T . $data['news_image_t1'])) {
                unlink(IMAGES_N_T . $data['news_image_t1']);
            }
            if (!empty($data['news_image_t2']) && file_exists(IMAGES_N_T . $data['news_image_t2'])) {
                unlink(IMAGES_N_T . $data['news_image_t2']);
            }
            $data['news_image'] = "";
            $data['news_image_t1'] = "";
            $data['news_image_t2'] = "";
        }
        if (defender::safe()) {
            if (dbcount("('news_id')", DB_NEWS, "news_id='" . $data['news_id'] . "'")) {
                dbquery_insert(DB_NEWS, $data, 'update');
                addNotice('success', $locale['news_0101']);
            } else {
                $data['news_name'] = $userdata['user_id'];
                dbquery_insert(DB_NEWS, $data, 'save');
                addNotice('success', $locale['news_0100']);
            }
            if (isset($_POST['save_and_close'])) {
                redirect(clean_request("", array("ref"), FALSE));
            } else {
                redirect(FUSION_REQUEST);
            }
        }
    } elseif (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_POST['news_id']) && isnum($_POST['news_id'])) || isset($_GET['news_id']) && isnum($_GET['news_id'])) {
        $result = dbquery("SELECT * FROM " . DB_NEWS . " WHERE news_id='" . (isset($_POST['news_id']) ? $_POST['news_id'] : $_GET['news_id']) . "'");
        if (dbrows($result)) {
            $data = dbarray($result);
        } else {
            redirect(FUSION_SELF . $aidlink);
        }
    }
    $result = dbquery("SELECT news_cat_id, news_cat_name FROM " . DB_NEWS_CATS . " " . (multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : "") . " ORDER BY news_cat_name");
    $news_cat_opts = array();
    $news_cat_opts['0'] = $locale['news_0202'];
    if (dbrows($result)) {
        while ($odata = dbarray($result)) {
            $news_cat_opts[$odata['news_cat_id']] = $odata['news_cat_name'];
        }
    }
    echo "<div class='m-t-20'>\n";
    $news_settings = get_settings("news");
    echo openform('news_form', 'post', $formaction, array('enctype' => 1));
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n";
    echo form_hidden('news_id', "", $data['news_id']);
    echo form_text('news_subject', $locale['news_0200'], $data['news_subject'], array('required' => 1, 'max_length' => 200, 'error_text' => $locale['news_0250']));
    echo form_select('news_keywords', $locale['news_0205'], $data['news_keywords'], array("max_length" => 320, "placeholder" => $locale['news_0205a'], "width" => "100%", "error_text" => $locale['news_0255'], "tags" => TRUE, "multiple" => TRUE));
    echo "<div class='pull-left m-r-10 display-inline-block'>\n";
    echo form_datepicker('news_start', $locale['news_0206'], $data['news_start'], array('placeholder' => $locale['news_0208'], "join_to_id" => "news_end"));
    echo "</div>\n<div class='pull-left m-r-10 display-inline-block'>\n";
    echo form_datepicker('news_end', $locale['news_0207'], $data['news_end'], array('placeholder' => $locale['news_0208'], "join_from_id" => "news_start"));
    echo "</div>\n";
    echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-5 col-lg-4'>\n";
    openside('');
    echo form_select_tree("news_cat", $locale['news_0201'], $data['news_cat'], array("width" => "100%", "inline" => TRUE, "parent_value" => $locale['news_0202'], "query" => multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : ""), DB_NEWS_CATS, "news_cat_name", "news_cat_id", "news_cat_parent");
    echo form_select('news_visibility', $locale['news_0209'], $data['news_visibility'], array('options' => fusion_get_groups(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
    if (multilang_table("NS")) {
        echo form_select('news_language', $locale['global_ML100'], $data['news_language'], array('options' => fusion_get_enabled_languages(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
    } else {
        echo form_hidden('news_language', '', $data['news_language']);
    }
    echo form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-r-10'));
    echo form_button('save', $locale['news_0241'], $locale['news_0241'], array('class' => 'btn-success'));
    echo form_button("save_and_close", "Save and Close", "save_and_close", array("class" => "btn-primary m-l-10"));
    closeside();
    echo "</div>\n</div>\n";
    $snippetSettings = array("required" => TRUE, "preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "placeholder" => $locale['news_0203a'], "form_name" => "news_form");
    if (fusion_get_settings("tinymce_enabled")) {
        $snippetSettings = array("required" => TRUE, "type" => "tinymce", "tinymce" => "advanced");
    }
    echo form_textarea('news_news', $locale['news_0203'], $data['news_news'], $snippetSettings);
    if (!fusion_get_settings("tinymce_enabled")) {
        $extendedSettings = array("preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "placeholder" => $locale['news_0203b'], "form_name" => "news_form");
    } else {
        $extendedSettings = array("type" => "tinymce", "tinymce" => "advanced");
    }
    echo form_textarea('news_extended', $locale['news_0204'], $data['news_extended'], $extendedSettings);
    // second row
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n";
    openside('');
    if ($data['news_image'] != "" && $data['news_image_t1'] != "") {
        $image_thumb = get_news_image_path($data['news_image'], $data['news_image_t1'], $data['news_image_t2']);
        if (!$image_thumb) {
            $image_thumb = IMAGES . "imagenotfound70.jpg";
        }
        echo "<div class='row'>\n";
        echo "<div class='col-xs-12 col-sm-6'>\n";
        echo "<label><img class='img-responsive img-thumbnail' src='" . $image_thumb . "' alt='" . $locale['news_0216'] . "' /><br />\n";
        echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['delete'] . "</label>\n";
        echo "</div>\n";
        echo "<div class='col-xs-12 col-sm-6'>\n";
        $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
        echo form_select('news_ialign', $locale['news_0218'], $data['news_ialign'], array("options" => $alignOptions, "inline" => FALSE));
        echo "</div>\n</div>\n";
        echo "<input type='hidden' name='news_image' value='" . $data['news_image'] . "' />\n";
        echo "<input type='hidden' name='news_image_t1' value='" . $data['news_image_t1'] . "' />\n";
        echo "<input type='hidden' name='news_image_t2' value='" . $data['news_image_t2'] . "' />\n";
    } else {
        $file_input_options = array('upload_path' => IMAGES_N, 'max_width' => $news_settings['news_photo_max_w'], 'max_height' => $news_settings['news_photo_max_h'], 'max_byte' => $news_settings['news_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $news_settings['news_thumb_w'], 'thumbnail_h' => $news_settings['news_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $news_settings['news_photo_w'], 'thumbnail2_h' => $news_settings['news_photo_h'], 'type' => 'image');
        echo form_fileinput("news_image", $locale['news_0216'], "", $file_input_options);
        echo "<div class='small m-b-10'>" . sprintf($locale['news_0217'], parsebytesize($news_settings['news_photo_max_b'])) . "</div>\n";
        $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
        echo form_select('news_ialign', $locale['news_0218'], $data['news_ialign'], array("options" => $alignOptions));
    }
    closeside();
    openside('');
    echo "<label><input type='checkbox' name='news_draft' value='yes'" . ($data['news_draft'] ? "checked='checked'" : "") . " /> " . $locale['news_0210'] . "</label><br />\n";
    echo "<label><input type='checkbox' name='news_sticky' value='yes'" . ($data['news_sticky'] ? "checked='checked'" : "") . "  /> " . $locale['news_0211'] . "</label><br />\n";
    echo form_hidden('news_datestamp', '', $data['news_datestamp']);
    if (fusion_get_settings("tinymce_enabled") != 1) {
        echo "<label><input type='checkbox' name='line_breaks' value='yes'" . ($data['news_breaks'] ? "checked='checked'" : "") . " /> " . $locale['news_0212'] . "</label><br />\n";
    }
    closeside();
    echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-5 col-lg-4'>\n";
    openside("");
    if (!fusion_get_settings("comments_enabled") || !fusion_get_settings("ratings_enabled")) {
        $sys = "";
        if (!fusion_get_settings("comments_enabled") && !fusion_get_settings("ratings_enabled")) {
            $sys = $locale['comments_ratings'];
        } elseif (!fusion_get_settings("comments_enabled")) {
            $sys = $locale['comments'];
        } else {
            $sys = $locale['ratings'];
        }
        echo "<div class='alert alert-warning'>" . sprintf($locale['news_0253'], $sys) . "</div>\n";
    }
    echo "<label><input type='checkbox' name='news_allow_comments' value='yes' onclick='SetRatings();'" . ($data['news_allow_comments'] ? "checked='checked'" : "") . " /> " . $locale['news_0213'] . "</label><br/>";
    echo "<label><input type='checkbox' name='news_allow_ratings' value='yes'" . ($data['news_allow_ratings'] ? "checked='checked'" : "") . " /> " . $locale['news_0214'] . "</label>";
    closeside();
    echo "</div>\n</div>\n";
    echo form_button('preview', $locale['news_0240'], $locale['news_0240'], array('class' => 'btn-default m-r-10'));
    echo form_button('save', $locale['news_0241'], $locale['news_0241'], array('class' => 'btn-success'));
    echo form_button("save_and_close", "Save and Close", "save_and_close", array("class" => "btn-primary m-l-10"));
    echo closeform();
    echo "</div>\n";
}
Exemplo n.º 10
0
     echo "<div class='row'>\n";
     echo "<div class='col-xs-12 col-sm-6'>\n";
     echo "<label><img class='img-responsive img-thumbnail' src='" . IMAGES_N_T . $callback_data['news_image_t1'] . "' alt='" . $locale['news_0216'] . "' /><br />\n";
     echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['delete'] . "</label>\n";
     echo "</div>\n";
     echo "<div class='col-xs-12 col-sm-6'>\n";
     $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
     echo form_select('news_ialign', $locale['news_0218'], $callback_data['news_ialign'], array("options" => $alignOptions, "inline" => FALSE));
     echo "</div>\n</div>\n";
     echo "<input type='hidden' name='news_image' value='" . $callback_data['news_image'] . "' />\n";
     echo "<input type='hidden' name='news_image_t1' value='" . $callback_data['news_image_t1'] . "' />\n";
     echo "<input type='hidden' name='news_image_t2' value='" . $callback_data['news_image_t2'] . "' />\n";
 } else {
     $file_input_options = array('upload_path' => IMAGES_N, 'max_width' => $news_settings['news_photo_max_w'], 'max_height' => $news_settings['news_photo_max_h'], 'max_byte' => $news_settings['news_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $news_settings['news_thumb_w'], 'thumbnail_h' => $news_settings['news_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $news_settings['news_photo_w'], 'thumbnail2_h' => $news_settings['news_photo_h'], 'type' => 'image');
     echo form_fileinput("news_image", $locale['news_0216'], "", $file_input_options);
     echo "<div class='small m-b-10'>" . sprintf($locale['news_0217'], parsebytesize($news_settings['news_photo_max_b'])) . "</div>\n";
     $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
     echo form_select('news_ialign', $locale['news_0218'], $callback_data['news_ialign'], array("options" => $alignOptions));
 }
 closeside();
 $snippetSettings = array("required" => TRUE, "preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "placeholder" => $locale['news_0203a'], "form_name" => "inputform");
 if (fusion_get_settings("tinymce_enabled")) {
     $snippetSettings = array("required" => TRUE);
 }
 echo form_textarea('news_news', $locale['news_0203'], $callback_data['news_news'], $snippetSettings);
 echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-5 col-lg-4'>\n";
 openside("");
 echo form_select_tree("news_cat", $locale['news_0201'], $callback_data['news_cat'], array("width" => "100%", "inline" => TRUE, "parent_value" => $locale['news_0202'], "query" => multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : ""), DB_NEWS_CATS, "news_cat_name", "news_cat_id", "news_cat_parent");
 echo form_select('news_visibility', $locale['news_0209'], $callback_data['news_visibility'], array('options' => fusion_get_groups(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
 if (multilang_table("NS")) {
     echo form_select('news_language', $locale['global_ML100'], $callback_data['news_language'], array('options' => fusion_get_enabled_languages(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
	<td><input type="text" class="textbox" name="url"
		value="' . $url . '" size="40" maxlegth="200"></td>
</tr>
<tr>
	<td></td>
	<td><span class="small2">' . $locale['PDP220'] . '</span></td>
</tr>';
}
if ($do_edit || empty($pdp->settings['file_ext'])) {
    $src_upload = '';
} else {
    $src_upload = "\n<tr>\n\t<td></td>\n\t<td><strong>" . $locale['PDP133'] . "</strong></td>\n</tr>\n<tr>\n\t<td valign='top'>" . $locale['PDP219'] . ":</td>\n";
    if (!$upload_dir_access) {
        $src_upload .= "<td><span class='small2'>" . str_replace("%s", '<strong>' . $upload_dir . '</strong>', $locale['PDP900'][PDP_EUPDIR]) . "</span></td>";
    } else {
        $src_upload .= "<td><input type='file' class='textbox' name='upload' size='50'></td>\n</tr>\n<tr>\n\t<td></td>\n\t<td><span class='small2'>" . $locale['PDP034'] . ": " . parsebytesize($pdp->settings['file_max']) . " (" . str_replace(",", ", ", $pdp->settings['file_ext']) . ")</span></td>\n";
    }
    $src_upload .= "</tr>\n";
}
// determine what to show and why
$src_read_only = "";
if ($do_edit) {
    $is_external = pdp_is_external($url);
    if (iPDP_MOD) {
    } else {
        $src_ftp = "";
        if (!$is_external) {
            $src_url = "";
            $src_read_only = "<tr><td><b>" . pdp_cleanup_filename($url) . "</b></td></tr>\n";
        }
    }
Exemplo n.º 12
0
             if ($data['photo_thumb2']) {
                 $info['photo_thumb'] = IMAGES_G . "/" . $wm_file1;
             }
             $info['photo_filename'] = IMAGES_G . "/" . $wm_file2;
         }
     } else {
         if ($data['photo_thumb2']) {
             $info['photo_thumb'] = INFUSIONS . "gallery/photo.php?photo_id=" . $_GET['photo_id'];
         }
         $info['photo_filename'] = INFUSIONS . "gallery/photo.php?photo_id=" . $_GET['photo_id'] . "&amp;full";
     }
     $info['photo_size'] = @getimagesize(IMAGES_G . $data['photo_filename']);
 } else {
     $info += array("photo_thumb2" => $data['photo_thumb2'] ? IMAGES_G_T . $data['photo_thumb2'] : "", "photo_thumb1" => $data['photo_thumb1'] ? IMAGES_G_T . $data['photo_thumb1'] : "", "photo_filename" => IMAGES_G . $data['photo_filename'], "photo_size" => getimagesize(IMAGES_G . $data['photo_filename']));
 }
 $info += array("photo_description" => $data['photo_description'] ? nl2br(parse_textarea($data['photo_description'])) : '', "photo_byte" => parsebytesize($gallery_settings['photo_watermark'] ? filesize(IMAGES_G . $data['photo_filename']) : filesize(IMAGES_G . $data['photo_filename'])), "photo_comment" => $data['photo_allow_comments'] ? number_format($data['comment_count']) : 0, "photo_ratings" => $data['photo_allow_ratings'] && $data['count_votes'] > 0 ? number_format(ceil($data['sum_rating'] / $data['count_votes'])) : '0');
 if (isset($prev['photo_id']) && isnum($prev['photo_id']) || isset($next['photo_id']) && isnum($next['photo_id'])) {
     if (isset($prev) && isset($first)) {
         $info['nav']['first'] = array('link' => INFUSIONS . "gallery/gallery.php?photo_id=" . $first['photo_id'], 'name' => $locale['459']);
     }
     if (isset($prev)) {
         $info['nav']['prev'] = array('link' => INFUSIONS . "gallery/gallery.php?photo_id=" . $prev['photo_id'], 'name' => $locale['451']);
     }
     if (isset($next)) {
         $info['nav']['next'] = array('link' => INFUSIONS . "gallery/gallery.php?photo_id=" . $next['photo_id'], 'name' => $locale['452']);
     }
     if (isset($next) && isset($last)) {
         $info['nav']['last'] = array('link' => INFUSIONS . "gallery/gallery.php?photo_id=" . $last['photo_id'], 'name' => $locale['460']);
     }
 }
 $info += $data;
Exemplo n.º 13
0
 echo "</tr>\n<tr>\n";
 echo "<td width='100' class='tbl'>" . $locale['423'] . (!(bool) IF_MULTI_LANGUAGE ? '' : " (" . $locale['440'] . ")") . "</td>\n";
 // Pimped
 echo "<td width='80%' class='tbl'><select name='news_cat' class='textbox'>\n";
 echo "<option value='0'>" . $locale['424'] . "</option>\n" . $news_cat_opts . "</select></td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td class='tbl' valign='top'>" . $locale['439'] . ":</td>\n<td class='tbl' valign='top'>";
 if ($news_image != "" && $news_image_t1 != "") {
     echo "<label><img src='" . IMAGES_N_T . $news_image_t2 . "' alt='" . $locale['439'] . "' /><br />\n";
     echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['421'] . "</label>\n";
     echo "<input type='hidden' name='news_image' value='" . $news_image . "' />\n";
     echo "<input type='hidden' name='news_image_t1' value='" . $news_image_t1 . "' />\n";
     echo "<input type='hidden' name='news_image_t2' value='" . $news_image_t2 . "' />\n";
 } else {
     echo "<input type='file' name='news_image' class='textbox' style='width:250px;' /><br />\n";
     echo sprintf($locale['442'], parsebytesize($settings['news_photo_max_b'])) . "\n";
 }
 echo "</td>\n</tr>\n<tr>\n";
 echo "<td valign='top' width='100' class='tbl'>" . $locale['425'] . "</td>\n";
 echo "<td width='80%' class='tbl'><textarea name='body' cols='95' rows='10' class='textbox' style='width:98%'>" . $body . "</textarea></td>\n";
 echo "</tr>\n";
 if (!isset($_COOKIE['news_wysiwyg_editor']) || !$_COOKIE['news_wysiwyg_editor'] || !$settings['wysiwyg_enabled']) {
     echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
     echo display_html("inputform", "body", true, true, true, IMAGES_N);
     echo "</td>\n</tr>\n";
 }
 echo "<tr>\n<td valign='top' width='100' class='tbl'>" . $locale['426'] . "</td>\n";
 echo "<td class='tbl'><textarea name='body2' cols='95' rows='10' class='textbox' style='width:98%'>" . $body2 . "</textarea></td>\n";
 echo "</tr>\n";
 if (!isset($_COOKIE['news_wysiwyg_editor']) || !$_COOKIE['news_wysiwyg_editor'] || !$settings['wysiwyg_enabled']) {
     echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
Exemplo n.º 14
0
 echo "<table width='100%' border='0' cellpadding='0' cellspacing='1' class='tbl-border'>\r\n\t<tr>\r\n\t<td width='155'>\r\n\t";
 if ($d_addons['addon_img'] == "" || !file_exists(ADDON_SCRN . "t_" . $d_addons['addon_img'])) {
     echo "<img src='" . ADDON_IMG . "addon_logo.png'>";
 } else {
     add_to_head("<script type='text/javascript' src='lightbox/prototype.js'></script>\r\n    <script type='text/javascript' src='lightbox/scriptaculous.js?load=effects,builder'></script>\r\n    <script type='text/javascript' src='lightbox/lightbox.js'></script>\r\n    <link rel='stylesheet' href='lightbox/lightbox.css' type='text/css' media='screen' />");
     echo "<div align='center'><a href='img/screenshots/" . $d_addons['addon_img'] . "' rel='lightbox' style='outline: none;border:none;'>\r\n    <img src='" . ADDON_SCRN . "t_" . $d_addons['addon_img'] . "' style='outline: none;border:none;'></a></div>\n";
 }
 $status_check = dbarray(dbquery("SELECT addon_author_status FROM " . DB_ADDONS . " WHERE addon_author_name = '" . $d_addons['addon_author_name'] . "'"));
 if ($status_check['addon_author_status'] == '2') {
     echo "<br />\n<center><img src='" . ADDON_IMG . "approved_addon.png' alt='' border='0' /></center>\n";
 }
 if ($d_addons['addon_share_status']) {
     include ADDON_INC . "share_links_include.php";
 }
 echo "</td>\r\n\t<td>\r\n\t<table width='100%' border='0' cellpadding='0' cellspacing='1' class='tbl-border'>\r\n\t<tr>\r\n\t<td class='tbl2' width='80' nowrap><b>" . $locale['addondb401'] . ":</b></td>\r\n\t<td class='tbl1' nowrap>" . $new . " " . $d_addons['addon_name'] . "</td>\r\n\t<td class='tbl1' nowrap rowspan='9' align='center'><b>" . $locale['addondb421'] . $d_addons['addon_name'] . "</b><br />\r\n\t<a href='" . FUSION_SELF . "?download=" . $d_addons['addon_id'] . "' title='" . $locale['addondb502'] . "'><img border='0' src='" . ADDON_IMG . "download.png' alt='' /></a><br />" . $download_count . "\r\n\t<br /><br />";
 echo $locale['addondb440'] . "[" . parsebytesize(filesize(ADDON . "files/" . $d_addons['addon_download'])) . "]";
 echo "</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class='tbl2' nowrap><b>" . $locale['addondb402'] . ":</b></td>\r\n\t<td class='tbl1' nowrap>" . $d_addons['addon_version'] . "</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class='tbl2' nowrap><b>" . $locale['addondb403'] . ":</b></td>\r\n\t<td class='tbl1' nowrap>" . $d_addons['addon_cat_name'] . "</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class='tbl2' nowrap><b>" . $locale['addondb404'] . ":</b></td>\r\n\t<td class='tbl1' nowrap>" . $ver . "&nbsp;(" . $addon_types[$d_addons['addon_type']] . ")</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class='tbl2' nowrap><b>" . $locale['addondb405'] . ":</b></td>\n";
 $user_auth = dbarray(dbquery("SELECT \r\n\t                                     user_id, \r\n\t                                     user_name,\r\n\t                                     user_hide_email,  \r\n\t                                     user_status \r\n\t                                     FROM " . DB_USERS . " \r\n\t                                     WHERE \r\n\t                                     user_name = '" . $d_addons['addon_author_name'] . "'\r\n\t                                     "));
 if ($user_auth['user_hide_email'] != "1" && $d_addons['addon_author_email'] != "") {
     $author_email = "<a href='mailto:" . $d_addons['addon_author_email'] . "' title='" . $locale['addondb500'] . "' class='button'><span>" . $locale['addondb419'] . "</span></a>";
 } else {
     $author_email = "";
 }
 if ($d_addons['addon_author_www'] != "") {
     $author_www = " <a href='" . $urlprefix . $d_addons['addon_author_www'] . "' target='_blank' title='" . $locale['addondb501'] . "' class='button'><span>" . $locale['addondb420'] . "</span></a>";
 } else {
     $author_www = "";
 }
 echo "<td class='tbl1' nowrap>" . (isset($user_auth['user_name']) ? profile_link($user_auth['user_id'], $user_auth['user_name'], $user_auth['user_status']) : $d_addons['addon_author_name']) . " " . $author_email . " " . $author_www . "</td>\r\n\t</tr>\n";
 if ($d_addons['addon_co_author_name'] != "") {
     echo "<tr>\r\n\t<td class='tbl2' nowrap><b>" . $locale['addondb405c'] . ":</b></td>\r\n\t<td class='tbl1' nowrap>" . $d_addons['addon_co_author_name'] . "</td>\r\n\t</tr>\n";
Exemplo n.º 15
0
<tr>
	<td align="right">' . $locale['PRP704'] . ':</td>
	<td>
		<input type="text" name="upload_image" value="' . substr($prp->settings['upload_image'], strlen(BASEDIR)) . '" size="50" maxlength="200" class="textbox"><br />' . $locale['prp_status'] . ': ' . $status_upload_image . '</td>
</tr>
<tr>
	<td align="right">' . $locale['PRP722'] . ':</td>
	<td>
		<input type="text" value="' . $prp->settings['image_ext'] . '" size="50" class="textbox" name="image_ext" /><br />
		<span class="small2">' . $locale['PRP713'] . ' ' . $locale['PRP714'] . '</span>
	</td>
</tr>
<tr>
	<td align="right">' . $locale['PRP716'] . ':<br><span class="small2">' . $locale['PRP717'] . '</span></td>
	<td>' . $upload_max_filesize . '<br />
		<input type="text" value="' . $prp->settings['image_max'] . '" size="14" maxlength="12" class="textbox" name="image_max">' . ' =' . parsebytesize($prp->settings['image_max']) . ' (' . $status_image_maxsize . ')<br><span class="small2">' . $locale['PRP719'] . '</span></td>
</tr>
<tr>
	<td align="right">' . $locale['PRP716'] . ':<br><span class="small2">' . $locale['PRP747'] . '</span></td>
	<td>
		<input type="text" name="image_max_w" value="' . $prp->settings['image_max_w'] . '" size="5" maxlength="5" class="textbox">' . ' x <input type="text" name="image_max_h" value="' . $prp->settings['image_max_h'] . '" size="5" maxlength="5" class="textbox">' . ' <span class="small2">' . $locale['PRP748'] . '</span>' . ' <br><input type="checkbox" id="is0" name="image_scale"' . ($prp->settings['image_scale'] == "yes" ? ' checked="checked"' : '') . '> <label for="is0">' . $locale['PRP749'] . '</label>
	</td>
</tr>
<tr>
	<td align="right">' . $locale['PRP760'] . ':</td>
	<td><input type="text" size="5" maxlength="3"' . ' value="' . $prp->settings['default_max_pics'] . '"' . ' class="textbox" name="default_max_pics">' . ' <span class="small2">(' . $locale['PRP731'] . ')</span><br />
		[<span class="small2">' . $locale['PRP761'] . '</span>]
	</td>
</tr>
</tbody>
</table>
Exemplo n.º 16
0
 $i_images = 0;
 if (dbrows($a_result)) {
     if (checkgroup($fdata['forum_attach_download'])) {
         while ($a_data = dbarray($a_result)) {
             if (!file_exists(FORUM . "attachments/" . $a_data['attach_name'])) {
                 break;
             }
             if (in_array($a_data['attach_ext'], $imagetypes) && @getimagesize(FORUM . "attachments/" . $a_data['attach_name'])) {
                 $a_images .= display_image_attach($a_data['attach_name'], "100", "100", $data['post_id']) . "\n";
                 $i_images++;
             } else {
                 if ($i_files > 0) {
                     $a_files .= "<br />\n";
                 }
                 $a_files .= "<a href='" . FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "&amp;getfile=" . $a_data['attach_id'] . "'>" . $a_data['attach_name'] . "</a>&nbsp;";
                 $a_files .= "[<span class='small'>" . parsebytesize(filesize(FORUM . "attachments/" . $a_data['attach_name'])) . " / " . $a_data['attach_count'] . $locale['507a'] . "</span>]\n";
                 $i_files++;
             }
         }
     } else {
         $a_files = $locale['507b'];
     }
     if ($a_files) {
         echo "<div class='emulated-fieldset'>\n";
         echo "<span class='emulated-legend'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . $locale['506'] . ($i_files > 1 ? $locale['506d'] : $locale['506c']) . "</span>\n";
         echo "<div class='attachments-list'>" . $a_files . "</div>\n";
         echo "</div>\n";
     }
     if ($a_images) {
         $colorbox_rel[] = $data['post_id'];
         echo "<div class='emulated-fieldset'>\n";
Exemplo n.º 17
0
 /**
  * Display Forum Form
  */
 public function display_forum_form()
 {
     require_once INCLUDES . 'photo_functions_include.php';
     require_once INCLUDES . 'infusions_include.php';
     $forum_settings = $this->get_forum_settings();
     $language_opts = fusion_get_enabled_languages();
     add_breadcrumb(array('link' => '', 'title' => self::$locale['forum_001']));
     if (!isset($_GET['action']) && $_GET['parent_id']) {
         $data['forum_cat'] = $_GET['parent_id'];
     }
     $type_opts = array('1' => self::$locale['forum_opts_001'], '2' => self::$locale['forum_opts_002'], '3' => self::$locale['forum_opts_003'], '4' => self::$locale['forum_opts_004']);
     $forum_image_path = FORUM . "images/";
     if (isset($_POST['remove_image']) && isset($_POST['forum_id'])) {
         $data['forum_id'] = form_sanitizer($_POST['forum_id'], '', 'forum_id');
         if ($data['forum_id']) {
             $data = self::get_forum($data['forum_id']);
             if (!empty($data)) {
                 $forum_image = $forum_image_path . $data['forum_image'];
                 if (!empty($data['forum_image']) && file_exists($forum_image) && !is_dir($forum_image)) {
                     @unlink($forum_image);
                     $data['forum_image'] = '';
                 }
                 dbquery_insert(DB_FORUMS, $data, 'update');
                 addNotice('success', self::$locale['forum_notice_8']);
                 redirect(FUSION_REQUEST);
             }
         }
     }
     opentable(self::$locale['forum_001']);
     echo openform('inputform', 'post', FUSION_REQUEST, array('enctype' => 1));
     echo "<div class='row'>\n<div class='col-xs-12 col-sm-8 col-md-8 col-lg-8'>\n";
     echo form_text('forum_name', self::$locale['forum_006'], $this->data['forum_name'], array('required' => 1, 'error_text' => self::$locale['forum_error_1'])) . form_textarea('forum_description', self::$locale['forum_007'], $this->data['forum_description'], array('autosize' => 1, 'type' => 'bbcode', 'form_name' => 'inputform', 'preview' => TRUE)) . form_text('forum_alias', self::$locale['forum_011'], $this->data['forum_alias']);
     echo "</div><div class='col-xs-12 col-sm-4 col-md-4 col-lg-4'>\n";
     openside('');
     $self_id = $this->data['forum_id'] ? $this->data['forum_id'] : '';
     echo form_select_tree('forum_cat', self::$locale['forum_008'], $this->data['forum_cat'], array('add_parent_opts' => 1, 'disable_opts' => $self_id, 'hide_disabled' => 1), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat', $self_id) . form_select('forum_type', self::$locale['forum_009'], $this->data['forum_type'], array("options" => $type_opts)) . form_select('forum_language', self::$locale['forum_010'], $this->data['forum_language'], array("options" => $language_opts)) . form_text('forum_order', self::$locale['forum_043'], $this->data['forum_order'], array('number' => 1)) . form_button('save_forum', $this->data['forum_id'] ? self::$locale['forum_000a'] : self::$locale['forum_000'], self::$locale['forum_000'], array('class' => 'btn btn-sm btn-success'));
     closeside();
     echo "</div>\n</div>\n";
     echo "<div class='row'>\n<div class='col-xs-12 col-sm-8 col-md-8 col-lg-8'>\n";
     echo form_select('forum_meta', self::$locale['forum_012'], $this->data['forum_meta'], array('tags' => 1, 'multiple' => 1, 'width' => '100%'));
     if ($this->data['forum_image'] && file_exists(FORUM . "images/" . $this->data['forum_image'])) {
         openside();
         echo "<div class='pull-left m-r-10'>\n";
         echo thumbnail(FORUM . "images/" . $this->data['forum_image'], '80px', '80px');
         echo "</div>\n<div class='overflow-hide'>\n";
         echo "<span class='strong'>" . self::$locale['forum_013'] . "</span><br/>\n";
         $image_size = @getimagesize(FORUM . "images/" . $this->data['forum_image']);
         echo "<span class='text-smaller'>" . sprintf(self::$locale['forum_027'], $image_size[0], $image_size[1]) . "</span><br/>";
         echo form_hidden('forum_image', '', $this->data['forum_image']);
         echo form_button('remove_image', self::$locale['forum_028'], self::$locale['forum_028'], array('class' => 'btn-danger btn-sm m-t-10', 'icon' => 'fa fa-trash'));
         echo "</div>\n";
         closeside();
     } else {
         $tab_title['title'][] = self::$locale['forum_013'];
         $tab_title['id'][] = 'fir';
         $tab_title['icon'][] = '';
         $tab_title['title'][] = self::$locale['forum_014'];
         $tab_title['id'][] = 'ful';
         $tab_title['icon'][] = '';
         $tab_active = tab_active($tab_title, 0);
         echo opentab($tab_title, $tab_active, 'forum-image-tab', FALSE, "m-t-20 m-b-20");
         // Upload Image
         echo opentabbody($tab_title['title'][0], 'fir', $tab_active);
         echo "<span class='display-inline-block m-t-10 m-b-10'>" . sprintf(self::$locale['forum_015'], parsebytesize($forum_settings['forum_attachmax'])) . "</span>\n";
         $fileOptions = array("upload_path" => $forum_image_path, "thumbnail" => TRUE, "thumbnail_folder" => $forum_image_path, "type" => "image", "delete_original" => TRUE, "max_count" => $forum_settings['forum_attachmax']);
         echo form_fileinput('forum_image', "", '', $fileOptions);
         echo closetabbody();
         // Upload image via Web Address
         echo opentabbody($tab_title['title'][1], 'ful', $tab_active);
         echo "<span class='display-inline-block m-t-10 m-b-10'>" . self::$locale['forum_016'] . "</strong></span>\n";
         $header_opts = array('0' => 'Local Server', '1' => 'URL');
         echo form_select('forum_image_header', self::$locale['forum_056'], '', array('inline' => TRUE, 'options' => $header_opts));
         echo form_text('forum_image_url', self::$locale['forum_014'], '', array('placeholder' => 'images/forum/', 'inline' => TRUE));
         echo closetabbody();
         echo closetab();
     }
     echo form_textarea('forum_rules', self::$locale['forum_017'], $this->data['forum_rules'], array('autosize' => 1, 'bbcode' => 1));
     echo "</div><div class='col-xs-12 col-sm-4 col-md-4 col-lg-4'>\n";
     openside('');
     // need to get parent category
     echo form_select_tree('forum_permissions', self::$locale['forum_025'], $this->data['forum_branch'], array('no_root' => 1, 'deactivate' => $this->data['forum_id'] ? TRUE : FALSE), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat');
     if ($this->data['forum_id']) {
         echo form_button('jp_forum', self::$locale['forum_029'], self::$locale['forum_029'], array('class' => 'btn-sm btn-default m-r-10'));
     }
     closeside();
     openside('');
     echo form_checkbox('forum_lock', self::$locale['forum_026'], $this->data['forum_lock'], array("reverse_label" => TRUE)) . form_checkbox('forum_users', self::$locale['forum_024'], $this->data['forum_users'], array("reverse_label" => TRUE)) . form_checkbox('forum_quick_edit', self::$locale['forum_021'], $this->data['forum_quick_edit'], array("reverse_label" => TRUE)) . form_checkbox('forum_merge', self::$locale['forum_019'], $this->data['forum_merge'], array("reverse_label" => TRUE)) . form_checkbox('forum_allow_attach', self::$locale['forum_020'], $this->data['forum_allow_attach'], array("reverse_label" => TRUE)) . form_checkbox('forum_allow_poll', self::$locale['forum_022'], $this->data['forum_allow_poll'], array("reverse_label" => TRUE)) . form_hidden('forum_id', '', $this->data['forum_id']) . form_hidden('forum_branch', '', $this->data['forum_branch']);
     closeside();
     echo "</div>\n</div>\n";
     echo form_button('save_forum', $this->data['forum_id'] ? self::$locale['forum_000a'] : self::$locale['forum_000'], self::$locale['forum_000'], array('class' => 'btn-sm btn-success'));
     echo closeform();
     closetable();
 }
Exemplo n.º 18
0
 private function renderAvatarInput()
 {
     global $locale, $settings;
     $html = '';
     $html .= "";
     $html .= "<tr>\n";
     $html .= "<td valign='top' style='border-top:0px;' class='tbl" . $this->getErrorClass("user_avatar") . "'>";
     $html .= "<label for='user_avatar_upload'>" . $locale['u185'] . "</label></td>\n";
     $html .= "<td style='border-top:0px;' class='tbl" . $this->getErrorClass("user_avatar") . "'>";
     if (isset($this->userData['user_avatar']) && $this->userData['user_avatar'] != "") {
         $html .= "<label for='user_avatar_upload'><img class='img-thumbnail' src='" . IMAGES . "avatars/" . $this->userData['user_avatar'] . "' alt='" . $locale['u185'] . "' />";
         $html .= "</label>\n<br />\n";
         $html .= "<input type='checkbox' name='delAvatar' value='1' class='textbox' /> " . $locale['u187'] . "<br />\n<br />\n";
     }
     $html .= "<input type='file' id='user_avatar_upload' name='user_avatar' class='textbox' style='width:200px;' /><br />\n";
     $html .= "<span class='small2'>" . $locale['u186'] . "</span><br />\n<span class='small2'>";
     $html .= sprintf($locale['u184'], parsebytesize($settings['avatar_filesize']), $settings['avatar_width'], $settings['avatar_height']);
     $html .= "</span>\n";
     $html .= "</td>\n</tr>\n";
     return $html;
 }
Exemplo n.º 19
0
         $i++;
         $k = 1;
     }
     redirect(FUSION_SELF . $aidlink);
 }
 if (isset($_GET['status']) && !isset($message)) {
     if ($_GET['status'] == "sn") {
         $message = $locale['410'];
     } elseif ($_GET['status'] == "su") {
         $message = $locale['411'];
     } elseif ($_GET['status'] == "se") {
         $message = $locale['414'] . "<br />\n<span class='small'>";
         if ($_GET['error'] == 1) {
             $message .= $locale['415'] . "</span>";
         } elseif ($_GET['error'] == 2) {
             $message .= sprintf($locale['416'], parsebytesize($settings['photo_max_b'])) . "</span>";
         } elseif ($_GET['error'] == 3) {
             $message .= $locale['417'] . "</span>";
         } elseif ($_GET['error'] == 4) {
             $message .= sprintf($locale['418'], $settings['photo_max_w'], $settings['photo_max_h']) . "</span>";
         } elseif ($_GET['error'] == 5) {
             $message .= "No Album title entered</span>";
         }
     } elseif ($_GET['status'] == "delt") {
         $message = $locale['412'];
     } elseif ($_GET['status'] == "dely") {
         $message = $locale['413'];
     } elseif ($_GET['status'] == "deln") {
         $message = $locale['419'];
     }
     if (isset($message)) {
Exemplo n.º 20
0
$locale['u160'] = "Registrace dokončena";
$locale['u161'] = "Nyní se můžete přihlásit.";
$locale['u162'] = "Váš účet bude brzy aktivován administrátorem.";
$locale['u163'] = "Profil byl úspěšně aktualizován.";
$locale['u164'] = "Aktualizace selhala";
$locale['u165'] = "Registrace selhala";
$locale['u167'] = "kvůli následujícím důvodům:";
$locale['u168'] = "Prosím zkuste to znovu.";
$locale['u169'] = "Profil aktualizován";
$locale['u170'] = "Registrace proběhla úspěšně";
$locale['u171'] = "Váš účet byl ověřen.";
$locale['u172'] = "Člen byl úspěšně přidán.";
$locale['u173'] = "Zpět na Administraci uživatelů.";
$locale['u174'] = "Přidat dalšího člena.";
// Avatar upload
$locale['u180'] = "Váš avatar překročil povolenou velikost souboru, povolená velikost je " . parsebytesize($settings['avatar_filesize']) . ".";
$locale['u181'] = "Váš avatar je nejspíše v nepodporovaném formátu obrázku, podporované typy obrázku jsou jpg, png a gif.";
$locale['u182'] = "Váš avatar překročil " . $settings['avatar_width'] . "x" . $settings['avatar_height'] . " pixelů.";
$locale['u183'] = "Váš avatar nebyl správně nahrán.";
$locale['u184'] = "Maximální velikost souboru: %s / Maximální velikost: %ux%u pixelů";
$locale['u185'] = "Avatar";
$locale['u186'] = "Pro nahrání obrázku klikněte na Vybrat soubor";
$locale['u187'] = "Vymazat";
// Captcha and terms
$locale['u190'] = "Validační kód";
$locale['u191'] = "Vložte validační kód";
$locale['u192'] = "Podmínky dohody";
$locale['u193'] = "Četl jsem podmínky [LINK]Podmínky dohody[/LINK] a souhlasím s nimi.";
$locale['u194'] = "Nepsrávný validační kód.";
$locale['u195'] = "Nelze vynechat Captcha kód.";
// E-mail Change Confirmation
Exemplo n.º 21
0
 public function render_edit_form()
 {
     global $locale, $userdata, $forum_settings, $defender;
     $thread_data = $this->thread_info['thread'];
     if ((!iMOD or !iSUPERADMIN) && $thread_data['thread_locked']) {
         redirect(INFUSIONS . 'forum/index.php');
     }
     if (isset($_GET['post_id']) && isnum($_GET['post_id'])) {
         add_to_title($locale['global_201'] . $locale['forum_0503']);
         add_breadcrumb(array('link' => '', 'title' => $locale['forum_0503']));
         $result = dbquery("SELECT tp.*, tt.thread_subject, tt.thread_poll, tt.thread_author, tt.thread_locked, MIN(tp2.post_id) AS first_post\n\t\t\t\tFROM " . DB_FORUM_POSTS . " tp\n\t\t\t\tINNER JOIN " . DB_FORUM_THREADS . " tt on tp.thread_id=tt.thread_id\n\t\t\t\tINNER JOIN " . DB_FORUM_POSTS . " tp2 on tp.thread_id=tp2.thread_id\n\t\t\t\tWHERE tp.post_id='" . intval($_GET['post_id']) . "' AND tp.thread_id='" . intval($thread_data['thread_id']) . "' AND tp.forum_id='" . intval($thread_data['forum_id']) . "'\n\t\t\t\tGROUP BY tp2.post_id\n\t\t\t\t");
         if (dbrows($result) > 0) {
             $post_data = dbarray($result);
             if ((iMOD or iSUPERADMIN) || $this->getThreadPermission("can_reply") && $post_data['post_author'] == $userdata['user_id']) {
                 $is_first_post = $post_data['post_id'] == $this->thread_info['post_firstpost'] ? TRUE : FALSE;
                 // no edit if locked
                 if ($post_data['post_locked'] && !iMOD) {
                     redirect(INFUSIONS . "forum/postify.php?post=edit&error=5&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $post_data['post_id']);
                 }
                 // no edit if time limit reached
                 if (!iMOD && ($forum_settings['forum_edit_timelimit'] > 0 && time() - $forum_settings['forum_edit_timelimit'] * 60 > $post_data['post_datestamp'])) {
                     redirect(INFUSIONS . "forum/postify.php?post=edit&error=6&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $post_data['post_id']);
                 }
                 // execute form post actions
                 if (isset($_POST['post_edit'])) {
                     require_once INCLUDES . "flood_include.php";
                     // all data is sanitized here.
                     if (!flood_control("post_datestamp", DB_FORUM_POSTS, "post_author='" . $userdata['user_id'] . "'")) {
                         // have notice
                         $post_data = array('forum_id' => $thread_data['forum_id'], 'thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], "thread_subject" => "", 'post_message' => form_sanitizer($_POST['post_message'], '', 'post_message'), 'post_showsig' => isset($_POST['post_showsig']) ? 1 : 0, 'post_smileys' => isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? 1 : 0, 'post_author' => $userdata['user_id'], 'post_datestamp' => $post_data['post_datestamp'], 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => $userdata['user_id'], 'post_edittime' => time(), 'post_editreason' => form_sanitizer($_POST['post_editreason'], '', 'post_editreason'), 'post_hidden' => 0, 'notify_me' => 0, 'post_locked' => $forum_settings['forum_edit_lock'] || isset($_POST['post_locked']) ? 1 : 0);
                         // require thread_subject if first post
                         if ($is_first_post == TRUE) {
                             $post_data['thread_subject'] = form_sanitizer($_POST['thread_subject'], '', 'thread_subject');
                         }
                         if ($defender->safe()) {
                             // Prepare forum merging action
                             $last_post_author = dbarray(dbquery("SELECT post_author FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC LIMIT 1"));
                             if ($last_post_author == $post_data['post_author'] && $thread_data['forum_merge']) {
                                 $last_message = dbarray(dbquery("SELECT post_id, post_message FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC"));
                                 $post_data['post_id'] = $last_message['post_id'];
                                 $post_data['post_message'] = $last_message['post_message'] . "\n\n" . $locale['forum_0640'] . " " . showdate("longdate", time()) . ":\n" . $post_data['post_message'];
                                 dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
                             } else {
                                 dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
                             }
                             // Delete attachments if there is any
                             foreach ($_POST as $key => $value) {
                                 if (!strstr($key, "delete_attach")) {
                                     continue;
                                 }
                                 $key = str_replace("delete_attach_", "", $key);
                                 $result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . $post_data['post_id'] . "' AND attach_id='" . (isnum($key) ? $key : 0) . "'");
                                 if (dbrows($result) != 0 && $value) {
                                     $adata = dbarray($result);
                                     unlink(FORUM . "attachments/" . $adata['attach_name']);
                                     dbquery("DELETE FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . $post_data['post_id'] . "' AND attach_id='" . (isnum($key) ? $key : 0) . "'");
                                 }
                             }
                             if (!empty($_FILES) && is_uploaded_file($_FILES['file_attachments']['tmp_name'][0]) && $this->getThreadPermission("can_upload_attach")) {
                                 $upload = form_sanitizer($_FILES['file_attachments'], '', 'file_attachments');
                                 if ($upload['error'] == 0) {
                                     foreach ($upload['target_file'] as $arr => $file_name) {
                                         $attachment = array('thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], 'attach_name' => $file_name, 'attach_mime' => $upload['type'][$arr], 'attach_size' => $upload['source_size'][$arr], 'attach_count' => '0');
                                         dbquery_insert(DB_FORUM_ATTACHMENTS, $attachment, 'save', array('keep_session' => TRUE));
                                     }
                                 }
                             }
                             if ($defender->safe()) {
                                 redirect(INFUSIONS . "forum/postify.php?post=edit&error=0&amp;forum_id=" . intval($post_data['forum_id']) . "&amp;thread_id=" . intval($post_data['thread_id']) . "&amp;post_id=" . intval($post_data['post_id']));
                             }
                         }
                     }
                 }
                 // template data
                 $form_action = INFUSIONS . "forum/viewthread.php?action=edit&amp;forum_id=" . $thread_data['forum_id'] . "&amp;thread_id=" . $thread_data['thread_id'] . "&amp;post_id=" . $_GET['post_id'];
                 // get attachment.
                 $attachments = array();
                 $attach_rows = 0;
                 if ($this->getThreadPermission("can_upload_attach") && !empty($this->thread_info['post_items'][$post_data['post_id']]['post_attachments'])) {
                     // need id
                     $a_result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . intval($post_data['post_id']) . "' AND thread_id='" . intval($thread_data['thread_id']) . "'");
                     $attach_rows = dbrows($a_result);
                     if ($attach_rows > 0) {
                         while ($a_data = dbarray($a_result)) {
                             $attachments[] = $a_data;
                         }
                     }
                 }
                 $info = array('title' => $locale['forum_0507'], 'description' => $locale['forum_2000'] . $thread_data['thread_subject'], 'openform' => openform('input_form', 'post', $form_action, array('enctype' => $this->getThreadPermission("can_upload_attach") ? TRUE : FALSE)), 'closeform' => closeform(), 'forum_id_field' => form_hidden('forum_id', '', $post_data['forum_id']), 'thread_id_field' => form_hidden('thread_id', '', $post_data['thread_id']), "forum_field" => "", 'subject_field' => $this->thread_info['post_firstpost'] == $_GET['post_id'] ? form_text('thread_subject', $locale['forum_0600'], $thread_data['thread_subject'], array('required' => TRUE, 'placeholder' => $locale['forum_2001'], "class" => 'm-t-20 m-b-20')) : form_hidden("thread_subject", "", $thread_data['thread_subject']), 'message_field' => form_textarea('post_message', $locale['forum_0601'], $post_data['post_message'], array('required' => TRUE, 'autosize' => TRUE, 'no_resize' => TRUE, 'preview' => TRUE, 'form_name' => 'input_form', 'bbcode' => TRUE)), 'delete_field' => form_checkbox('delete', $locale['forum_0624'], '', array('class' => 'm-b-0')), 'edit_reason_field' => form_text('post_editreason', $locale['forum_0611'], $post_data['post_editreason'], array('placeholder' => '', 'class' => 'm-t-20 m-b-20')), 'attachment_field' => $this->getThreadPermission("can_upload_attach") ? form_fileinput('file_attachments[]', $locale['forum_0557'], "", array('input_id' => 'file_attachments', 'upload_path' => INFUSIONS . 'forum/attachments/', 'type' => 'object', 'preview_off' => TRUE, 'multiple' => TRUE, 'max_count' => $attach_rows > 0 ? $forum_settings['forum_attachmax_count'] - $attach_rows : $forum_settings['forum_attachmax_count'], 'valid_ext' => $forum_settings['forum_attachtypes'])) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t <div class='m-b-20'>\n<small>" . sprintf($locale['forum_0559'], parsebytesize($forum_settings['forum_attachmax']), str_replace('|', ', ', $forum_settings['forum_attachtypes']), $forum_settings['forum_attachmax_count']) . "</small>\n</div>\n" : "", "poll_form" => "", 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0')), 'signature_field' => array_key_exists("user_sig", $userdata) && $userdata['user_sig'] ? form_checkbox('post_showsig', $locale['forum_0623'], $post_data['post_showsig'], array('class' => 'm-b-0')) : '', 'sticky_field' => (iMOD || iSUPERADMIN) && $is_first_post ? form_checkbox('thread_sticky', $locale['forum_0620'], $thread_data['thread_sticky'], array('class' => 'm-b-0')) : '', 'lock_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_locked', $locale['forum_0621'], $thread_data['thread_locked'], array('class' => 'm-b-0')) : '', 'hide_edit_field' => form_checkbox('hide_edit', $locale['forum_0627'], '', array('class' => 'm-b-0')), 'post_locked_field' => iMOD || iSUPERADMIN ? form_checkbox('post_locked', $locale['forum_0628'], $post_data['post_locked'], array('class' => 'm-b-0')) : '', 'notify_field' => '', 'post_buttons' => form_button('post_edit', $locale['forum_0504'], $locale['forum_0504'], array('class' => 'btn-primary')) . form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-l-10')), 'last_posts_reply' => '');
                 $a_info = '';
                 if (!empty($attachments)) {
                     foreach ($attachments as $a_data) {
                         $a_info .= "<label><input type='checkbox' name='delete_attach_" . $a_data['attach_id'] . "' value='1' /> " . $locale['forum_0625'] . "</label>\n" . "<a href='" . INFUSIONS . "forum/attachments/" . $a_data['attach_name'] . "'>" . $a_data['attach_name'] . "</a> [" . parsebytesize($a_data['attach_size']) . "]\n" . "<br/>\n";
                     }
                     $info['attachment_field'] = $a_info . $info['attachment_field'];
                 }
                 postform($info);
             } else {
                 redirect(INFUSIONS . 'forum/index.php');
                 // no access
             }
         } else {
             redirect(INFUSIONS . "forum/postify.php?post=edit&error=4&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $_GET['post_id']);
         }
     } else {
         redirect(INFUSIONS . 'forum/index.php');
     }
 }
Exemplo n.º 22
0
 public function get_profile_input()
 {
     global $locale;
     $this->method = "input";
     $section_links = $this->renderPageLink();
     $_GET['section'] = isset($_GET['section']) && isset($section_links[$_GET['section']]) ? $_GET['section'] : 1;
     if ($_GET['section'] == '1') {
         $user_name = isset($_POST['user_name']) ? $_POST['user_name'] : $this->userData['user_name'];
         $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : $this->userData['user_email'];
         $user_hide_email = isset($_POST['user_hide_email']) ? $_POST['user_hide_email'] : $this->userData['user_hide_email'];
         $this->info['user_name'] = form_para($locale['u129'], 'account', 'profile_category_name');
         if (iADMIN || $this->_userNameChange) {
             $this->info['user_name'] .= form_text('user_name', $locale['u127'], $user_name, array('max_length' => 30, 'required' => 1, 'error_text' => $locale['u122'], 'inline' => 1));
         }
         // User Password
         $this->info['user_password'] = form_para($locale['u132'], 'password', 'profile_category_name');
         if ($this->registration || $this->admin_mode) {
             $this->info['user_password'] .= form_text('user_password1', $locale['u134a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u134'] . $locale['u143a'], 'required' => $this->admin_mode ? FALSE : TRUE));
             $this->info['user_password'] .= form_text('user_password2', $locale['u134b'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133'], 'required' => $this->admin_mode ? FALSE : TRUE));
         } else {
             $this->info['user_password'] .= form_hidden('user_id', '', isset($this->userData['user_id']) && isnum($this->userData['user_id']) ? $this->userData['user_id'] : 0);
             $this->info['user_password'] .= form_text('user_password', $locale['u135a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
             $this->info['user_password'] .= form_text('user_password1', $locale['u135b'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
             $this->info['user_password'] .= form_text('user_password2', $locale['u135c'], '', array('class' => 'm-b-0', 'type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
             $this->info['user_password'] .= "<input type='hidden' name='user_hash' value='" . $this->userData['user_password'] . "' />\n";
         }
         $this->info['user_password'] .= "<div class='col-xs-12 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-3'><span class='text-smaller'>" . $locale['u147'] . "</span></div>\n";
         // Admin Password - not available for everyone except edit profile.
         $this->info['user_admin_password'] = '';
         if (!$this->registration && iADMIN && !defined('ADMIN_PANEL')) {
             if ($this->userData['user_admin_password']) {
                 $this->info['user_admin_password'] = form_text('user_admin_password', $locale['u144a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
                 $this->info['user_admin_password'] .= form_text('user_admin_password1', $locale['u144'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
             } else {
                 $this->info['user_admin_password'] = form_text('user_admin_password', $locale['u144'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
             }
             $this->info['user_admin_password'] .= form_text('user_admin_password2', $locale['u145'], '', array('class' => 'm-b-0', 'type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
             $this->info['user_admin_password'] .= "<div class='col-xs-12 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-3'><span class='text-smaller'>" . $locale['u147'] . "</span></div>\n";
         }
         // User Password Verification
         $this->info['user_password_verify'] = iADMIN && checkrights("M") ? "" : form_text('user_password_verify', $locale['u135a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
         // Avatar Field
         $this->info['user_avatar'] = '';
         if (!$this->registration) {
             if (isset($this->userData['user_avatar']) && $this->userData['user_avatar'] != "") {
                 $this->info['user_avatar'] = "<label for='user_avatar_upload'><img src='" . IMAGES . "avatars/" . $this->userData['user_avatar'] . "' alt='" . $locale['u185'] . "' />\n\t\t\t\t\t\t\t\t\t\t\t</label>\n<br />\n\n\t\t\t\t\t\t\t\t\t\t\t" . form_checkbox("delAvatar", $locale['u187'], "", array("reverse_label" => TRUE));
             } else {
                 $this->info['user_avatar'] = form_fileinput('user_avatar', $locale['u185'], '', array('upload_path' => IMAGES . "avatars/", 'input_id' => 'user_avatar_upload', 'type' => 'image', 'max_byte' => fusion_get_settings('avatar_filesize'), 'max_height' => fusion_get_settings('avatar_width'), 'max_width' => fusion_get_settings('avatar_height'), 'inline' => TRUE, 'thumbnail' => 0, 'width' => '100%', "delete_original" => FALSE, 'class' => 'm-t-10 m-b-0', "error_text" => $locale['u180'], "template" => "modern"));
                 $this->info['user_avatar'] .= "<div class='col-xs-12 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-3'>\n\t\t\t\t\t" . sprintf($locale['u184'], parsebytesize(fusion_get_settings('avatar_filesize')), fusion_get_settings('avatar_width'), fusion_get_settings('avatar_height')) . "</div>\n";
             }
         }
         // Email
         $this->info['user_email'] = form_text('user_email', $locale['u128'], $user_email, array('type' => 'email', "required" => TRUE, 'inline' => 1, 'max_length' => '100', 'error_text' => $locale['u126']));
         // Hide email toggler
         $this->info['user_hide_email'] = form_btngroup('user_hide_email', $locale['u051'], $user_hide_email, array('inline' => TRUE, $options = array($locale['u053'], $locale['u052'])));
         // Captcha
         if ($this->displayValidation == 1 && !defined('ADMIN_PANEL')) {
             $this->info['validate'] = $this->renderValidation();
         }
         // Website terms
         if ($this->displayTerms == 1) {
             $this->info['terms'] = $this->renderTerms();
         }
     }
     $this->info += array('register' => $this->registration, 'pages' => $this->paginate && !$this->registration ? $this->info['section'] = $section_links : '', 'openform' => openform($this->formname, 'post', FUSION_REQUEST, array('enctype' => $this->showAvatarInput ? TRUE : FALSE)), 'closeform' => closeform(), 'button' => $this->renderButton());
     $this->get_userFields();
     return (array) $this->info;
 }
Exemplo n.º 23
0
$locale['u160'] = "Tilmeldingen er gennemført";
$locale['u161'] = "Du kan nu logge ind på siden.";
$locale['u162'] = "En administrator vil aktivere din konto meget snart.";
$locale['u163'] = "Profilen blev opdateret.";
$locale['u164'] = "Opdateringen lykkedes ikke";
$locale['u165'] = "Der opstod fejl i tilmeldingen";
$locale['u167'] = "af følgende årsag(er):";
$locale['u168'] = "Forsøg igen.";
$locale['u169'] = "Profilen er opdateret";
$locale['u170'] = "Tilmeldingen er gennemført";
$locale['u171'] = "Dine kontooplysninger er blevet verificeret.";
$locale['u172'] = "Brugeren er tilføjet.";
$locale['u173'] = "Tilbage til brugeradministration.";
$locale['u174'] = "Tilføj endnu en bruger?";
// Avatar upload
$locale['u180'] = "Dit profilbillede var for stort. Grænsen er " . parsebytesize($settings['avatar_filesize']) . ".";
$locale['u181'] = "Dit profilbillede ser ud til at være af en forbudt filtype. Der må kun  bruges filer af typen jpg, png og gif.";
$locale['u182'] = "Dit profilbillede var større end " . $settings['avatar_width'] . "x" . $settings['avatar_height'] . " pixels.";
$locale['u183'] = "Dit profilbillede blev ikke uploadet korrekt.";
$locale['u184'] = "Maksimal filstørrelse: %s / Maksimal størrelse: %ux%u pixels";
$locale['u185'] = "Profilbillede: ";
$locale['u186'] = "Klik på <i>gennemse</i> for at uploade et billede";
$locale['u187'] = "Slet";
// Captcha and terms
$locale['u190'] = "Sikkerhedskode";
$locale['u191'] = "Indskriv sikkerhedskode";
$locale['u192'] = "Tilmeldingsbetingelser";
$locale['u193'] = "Jeg har læst [LINK]tilmeldingsbetingelserne[/LINK] og er indforstået med dem.";
$locale['u194'] = "Forkert sikkerhedskode.";
$locale['u195'] = "Der skal indskrives en sikkerhedskode.";
// E-mail Change Confirmation
    $sel_ftp .= "</select>\n";
} else {
    $sel_ftp = "<span class='small2'>" . $locale['PDP017'] . "</span>";
}
if (!$upload_dir_access) {
    $upload = "<span class='small2'>" . str_replace("%s", "<b>" . $pdp->settings['upload_image'] . "</b>", $locale['PDP900'][PDP_EUPDIR]) . "</span>";
} elseif (!$more_pics) {
    $upload = "<span class='small2'>" . str_replace("%s", $download->data['max_pics'], $locale['PDP152']) . "</span>\n";
} else {
    if (empty($pdp->settings['image_ext'])) {
        $upload = "<span class='small2'>" . $locale['PDP055'] . "</span>";
    } else {
        if ($pic['pic_id']) {
            $upload = '<strong>' . $pic['pic_url'] . '</strong>';
        } else {
            $upload = "<input type='file' name='upload'" . " class='textbox' size='50'><br />" . "<span class='small2'>" . parsebytesize($pdp->settings['image_max']) . " / " . str_replace(",", ", ", $pdp->settings['image_ext']);
            if ($pdp->settings['image_max_w']) {
                $upload .= "<br>" . $pdp->settings['image_max_w'] . "x" . $pdp->settings['image_max_h'];
                if ($pdp->settings['image_scale'] == "yes") {
                    $upload .= " (" . $locale['PDP150'] . ")";
                }
            }
            $upload .= "</span>";
        }
    }
}
$src_url = '-';
if (!$pic['pic_id'] || pdp_is_external($pic['pic_url'])) {
    $src_url = '<input type="text" class="textbox" name="url" maxlegth="255" size="60" value="' . $pic['pic_url'] . '">';
}
pdp_close_tab();
Exemplo n.º 25
0
            echo "<a class='fancybox' title='" . $data['photo_title'] . "' href='" . PHOTODIR . $data['photo_filename'] . "' rel='group' ><!--photogallery_photo_" . (int) $_GET['photo_id'] . "-->";
            #'".BASEDIR."photo.php?photo_id=".(int)$_GET['photo_id']."'
            #'".PHOTODIR.$data['photo_filename']."'
            #'".BASEDIR."showphoto.php?photo_id=".(int)$_GET['photo_id']."'
        } else {
            echo "<a href=\"javascript:;\" onclick=\"window.open('showphoto.php?photo_id=" . (int) $_GET['photo_id'] . "','','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=" . ($photo_size[0] + 20) . ",height=" . ($photo_size[1] + 20) . "')\" class='photogallery_photo_link'><!--photogallery_photo_" . (int) $_GET['photo_id'] . "-->";
        }
        echo "<img src='" . (isset($photo_thumb) && !empty($photo_thumb) ? $photo_thumb : $photo_file) . "' alt='" . $data['photo_filename'] . "' title='" . $locale['453'] . "' style='border:0px' class='photogallery_photo' /></a>\n</div>\n";
        echo "<div align='center' style='margin:5px 0px 5px 0px' class='photogallery_photo_desc'><!--photogallery_photo_desc-->\n";
        if ($data['photo_description']) {
            echo nl2br(parseubb($data['photo_description'], "b|i|u|center|small|url|mail|img|quote")) . "<br /><br />\n";
        }
        echo $locale['433'] . showdate("shortdate", $data['photo_datestamp']) . "<br />\n";
        echo $locale['434'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br />\n";
        echo $locale['454'] . "{$photo_size['0']} x {$photo_size['1']} " . $locale['455'] . "<br />\n";
        echo $locale['456'] . parsebytesize($settings['photo_watermark'] ? filesize(PHOTODIR . $data['photo_filename']) : filesize($photo_file)) . "<br />\n";
        $photo_comments = dbcount("(comment_id)", DB_COMMENTS, "comment_type='P' AND comment_item_id='" . (int) $_GET['photo_id'] . "'");
        echo ($photo_comments == 1 ? $locale['436b'] : $locale['436']) . $photo_comments . "<br />\n";
        echo $locale['437'] . ($data['count_votes'] > 0 ? str_repeat("<img src='" . get_image("star") . "' alt='*' style='vertical-align:middle' />", ceil($data['sum_rating'] / $data['count_votes'])) : $locale['438']) . "<br />\n";
        echo $locale['457'] . $data['photo_views'] . "\n</div>\n";
        closetable();
        if ($data['photo_allow_comments']) {
            require_once INCLUDES . "comments_include.php";
            showcomments("P", DB_PHOTOS, "photo_id", $_GET['photo_id'], FUSION_SELF . "?photo_id=" . $_GET['photo_id']);
        }
        if ($data['photo_allow_ratings'] && $settings['ratings_enabled'] == "1") {
            require INCLUDES . "ratings_include.php";
            showratings("P", $_GET['photo_id'], FUSION_SELF . "?photo_id=" . $_GET['photo_id']);
        }
    }
} elseif (isset($_GET['album_id']) && isnum($_GET['album_id'])) {
Exemplo n.º 26
0
$locale['u160'] = "Registration complete";
$locale['u161'] = "You can now log in.";
$locale['u162'] = "An administrator will activate your account shortly.";
$locale['u163'] = "Profile was sucessfully updated.";
$locale['u164'] = "Update failed";
$locale['u165'] = "Registration failed";
$locale['u167'] = "for the following reason(s):";
$locale['u168'] = "Please Try Again.";
$locale['u169'] = "Profile updated";
$locale['u170'] = "Registration successful";
$locale['u171'] = "Your account has been verified.";
$locale['u172'] = "Member successfully added.";
$locale['u173'] = "Back to User Management.";
$locale['u174'] = "Add another member.";
// Avatar upload
$locale['u180'] = "Your avatar exceeded file size allowed, the limit is " . parsebytesize($settings['avatar_filesize']) . ".";
$locale['u181'] = "Your avatar appears to be an unsupported image type, supported image types are jpg, png and gif.";
$locale['u182'] = "Your avatar exceeded " . $settings['avatar_width'] . "x" . $settings['avatar_height'] . " pixels.";
$locale['u183'] = "Your avatar was not uploaded correctly.";
$locale['u184'] = "Max. file size: %s / Max. size: %ux%u pixels";
$locale['u185'] = "Avatar";
$locale['u186'] = "Click Browse to upload an image";
$locale['u187'] = "Delete";
// Captcha and terms
$locale['u190'] = "Validation Code";
$locale['u191'] = "Enter Validation Code";
$locale['u192'] = "Terms of Agreement";
$locale['u193'] = "I have read the <a href='" . BASEDIR . "print.php?type=T' target='_blank'>Terms of Agreement</a> and I agree with them.";
$locale['u194'] = "Incorrect validation code.";
$locale['u195'] = "Captcha code can not be left empty.";
// E-mail Change Confirmation
Exemplo n.º 27
0
     } else {
         echo $is_mod ? $locale['user1'] : getuserlevel($data['user_level']);
     }
 }
 echo "</span><br /><br />\n";
 echo "<!--forum_thread_user_info--><span class='small'><strong>" . $locale['502'] . "</strong> " . $data['user_posts'] . "</span><br />\n";
 echo "<span class='small'><strong>" . $locale['504'] . "</strong> " . showdate("%d.%m.%y", $data['user_joined']) . "</span><br />\n";
 echo "<br /></td>\n<td valign='top' class='tbl1'>\n";
 if (iMOD) {
     echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='" . $data['post_id'] . "' /></div>\n";
 }
 echo nl2br(parseubb($message));
 echo "<!--sub_forum_post_message-->";
 if ($data['attach_id']) {
     if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM . "attachments/" . $data['attach_name'])) {
         echo "\n<hr />\n" . $data['user_name'] . $locale['506'] . "<br /><br />\n" . display_image($data['attach_name']) . "<br />[" . parsebytesize(filesize(FORUM . "attachments/" . $data['attach_name'])) . "]\n";
     } else {
         echo "\n<hr />\n" . $data['user_name'] . $locale['507'] . "<br />\n<a href='" . FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "&amp;getfile=" . $data['post_id'] . "'>" . $data['attach_name'] . "</a>";
     }
 }
 if ($data['post_edittime'] != "0") {
     echo "\n<hr />\n" . $locale['508'] . "<a href='../profile.php?lookup=" . $data['post_edituser'] . "'>" . $data['edit_name'] . "</a>" . $locale['509'] . showdate("forumdate", $data['post_edittime']);
 }
 if ($data['post_showsig'] && array_key_exists("user_sig", $data) && $data['user_sig']) {
     echo "\n<hr />" . nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color"));
 }
 echo "<!--sub_forum_post--></td>\n</tr>\n";
 echo "<tr>\n<td class='tbl2' style='width:140px;white-space:nowrap'>";
 if ($settings['forum_ips'] && iMEMBER || iMOD) {
     echo "<strong>" . $locale['571'] . "</strong>: " . $data['post_ip'];
 } else {
Exemplo n.º 28
0
// add features to purge all album photos and it's administration
// add features to move all album photos to another album.
echo openform('albumform', 'post', FUSION_REQUEST, array('enctype' => TRUE, 'class' => 'm-t-20'));
echo "<div class='row'>\n<div class='col-xs-12 col-sm-8'>\n";
echo form_hidden('album_id', '', $data['album_id']);
echo form_text('album_title', $locale['album_0001'], $data['album_title'], array('placeholder' => $locale['album_0002'], 'inline' => TRUE, 'required' => TRUE, "error_text" => $locale['album_0015']));
echo form_select("album_keywords", $locale['album_0005'], $data['album_keywords'], array('max_length' => 320, 'width' => '100%', 'placeholder' => $locale['album_0006'], 'tags' => TRUE, 'multiple' => TRUE, "inline" => TRUE));
echo form_textarea('album_description', $locale['album_0003'], $data['album_description'], array('placeholder' => $locale['album_0004'], 'inline' => 1));
if ($data['album_image'] || $data['album_thumb1']) {
    echo "<div class='well col-sm-offset-3'>\n";
    echo form_hidden("album_image", "", $data['album_image']);
    echo form_hidden("album_thumb2", "", $data['album_thumb2']);
    echo form_hidden("album_thumb1", "", $data['album_thumb1']);
    echo "<label for='del_image'>\n";
    echo displayAlbumImage($data['album_image'], $data['album_thumb1'], $data['album_thumb2'], "");
    echo "</label>\n";
    echo form_checkbox("del_image", $locale['album_0016'], "");
    echo "</div>\n";
} else {
    $album_upload_settings = array("upload_path" => INFUSIONS . "gallery/photos/", 'thumbnail_folder' => 'thumbs', 'thumbnail' => TRUE, 'thumbnail_w' => $gll_settings['thumb_w'], 'thumbnail_h' => $gll_settings['thumb_h'], 'thumbnail_suffix' => '_t1', 'thumbnail2' => TRUE, 'thumbnail2_w' => $gll_settings['photo_w'], 'thumbnail2_h' => $gll_settings['photo_h'], 'thumbnail2_suffix' => '_t2', 'max_width' => $gll_settings['photo_max_w'], 'max_height' => $gll_settings['photo_max_h'], 'max_byte' => $gll_settings['photo_max_b'], 'multiple' => 0, 'delete_original' => FALSE, "inline" => TRUE, "template" => "modern", "class" => "m-b-0");
    echo form_fileinput('album_image', $locale['album_0009'], "", $album_upload_settings);
    echo "<div class='m-b-10 col-xs-12 col-sm-offset-3'>" . sprintf($locale['album_0010'], parsebytesize($gll_settings['photo_max_b']), str_replace(',', ' ', ".jpg,.gif,.png"), $gll_settings['photo_max_w'], $gll_settings['photo_max_h']) . "</div>\n";
}
echo "</div>\n";
echo "<div class='col-xs-12 col-sm-4'>\n";
echo form_select('album_access', $locale['album_0007'], $data['album_access'], array('options' => fusion_get_groups(), 'inline' => TRUE));
echo form_select('album_language', $locale['album_0008'], $data['album_language'], array('options' => fusion_get_enabled_languages(), 'inline' => TRUE));
echo form_text('album_order', $locale['album_0011'], $data['album_order'], array("type" => "number", 'inline' => TRUE));
echo "</div>\n</div>\n";
echo form_button('save_album', $locale['album_0012'], $locale['album_0012'], array('class' => 'btn-success btn-sm m-r-10'));
echo closeform();
Exemplo n.º 29
0
         } else {
             if ($fb4['attach_count']) {
                 $fb_res = dbquery("select * from " . DB_PREFIX . "fb_attachments where attach_id='" . $a_data['attach_id'] . "'");
                 if (dbrows($fb_res)) {
                     $fb_data = dbarray($fb_res);
                     $count = $fb_data['attach_count'] . ($fb_data['attach_count'] == "1" ? $locale['fb510'] : $locale['fb509']);
                 } else {
                     $count = "0" . $locale['fb509'];
                 }
             } else {
                 $count = "";
             }
             if ($i_files > 0) {
                 $a_files .= "<br />";
             }
             $a_files .= "<a href='" . FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "&amp;getfile=" . $a_data['attach_id'] . "'>" . $a_data['attach_name'] . "</a> [<span class='small'>" . parsebytesize(filesize(FORUM . "attachments/" . $a_data['attach_name'])) . " / " . $count . "</span>]\n";
             $i_files++;
         }
     }
     if ($a_files) {
         echo "<br /><br /><fieldset style='border:1px solid #ccc;width:320px;'>\n\t\t\t\t<legend>" . $locale['fb568'] . "</legend>\n\t\t\t\t<div style='padding:3px;width:320px;'>{$a_files}</div>\n\t\t\t</fieldset><br />\n";
     }
     if ($a_images) {
         if (!$a_files) {
             echo "<br /><br />\n";
         }
         echo "<fieldset style='border:1px solid #ccc;width:320px;'>\n\t\t\t\t<legend>" . $locale['fb567'] . "</legend>\n\t\t\t\t<div style='padding:3px;width:320px;'>{$a_images}</div>\n\t\t\t</fieldset><br />\n";
     }
 }
 if ($data['post_showsig'] && array_key_exists("user_sig", $data) && $data['user_sig']) {
     echo "\n<div class='tbl-border' style='height:2px;overflow:hidden; margin-top:5px; margin-bottom:5px;width:320px;'>&nbsp;</div>" . nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color"));
Exemplo n.º 30
0
 echo "<table align='center' cellspacing='0' cellpadding='0'>\n<tr>\n";
 echo "<td valign='top'>\n";
 echo "<table align='center' cellspacing='0' cellpadding='0'>\n<tr>\n";
 echo "<td colspan='2' class='tbl2' align='left'>" . $locale['451'] . "</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['414'] . "</td>\n";
 echo "<td class='tbl'>" . $db_name . "</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['415'] . "</td>\n";
 echo "<td class='tbl'>" . $db_prefix . "</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['452'] . "</td>\n";
 echo "<td class='tbl'>" . parsebytesize(get_database_size(), 2, false) . " (" . get_table_count() . " " . $locale['419'] . ")</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['453'] . "</td>\n";
 echo "<td class='tbl'>" . parsebytesize(get_database_size($db_prefix), 2, false) . " (" . get_table_count($db_prefix) . " " . $locale['419'] . ")</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='left' colspan='2' class='tbl2'>" . $locale['454'] . "</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['431'] . " <span style='color:#ff0000'>*</span></td>\n";
 echo "<td class='tbl'><input type='text' name='backup_filename' value='backup_" . stripsiteinput($settings['sitename']) . "_" . date('Y-m-d-Hi') . "' class='textbox' style='width:200px;' /></td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['455'] . "</td>\n";
 echo "<td class='tbl'><select name='backup_type' class='textbox' style='width:150px;'>\n";
 if (function_exists("gzencode")) {
     echo "<option value='.gz' selected='selected'>.sql.gz " . $locale['456'] . "</option>\n";
 }
 echo "<option value='.sql'>.sql</option>\n";
 echo "</select></td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td align='right' class='tbl'>" . $locale['460'] . " <span style='color:#ff0000'>*</span></td>\n";