Currently, there are 0 users and 1 guest visiting this topic.
Author
Topic
#18417

Hi MillaN, First I’d like to thank you for this plugin!
I’d like to suggest you a couple of improvements:
1) Notice function like you have in GD-bbpress-tools
2) Custom Class for tag in uploader.php.

For point 1, I did a little change to try:

Version: 1.8.3 — In code/attachmenty/class.php line 9&10

class gdbbPressAttachments {
    private $wp_version;
    private $plugin_path;
    private $plugin_url;
+    private $notice = true;
+    private $restricted = false;

In code/attachmenty/class.php line 41-45

+  if ($this->notice) {
+    add_action('bbp_theme_before_reply_form_notices', array(&$this, 'show_notice'));
+    add_action('bbp_theme_before_topic_form_notices', array(&$this, 'show_notice'));
+  }

In code/attachmenty/class.php line 247-259

+  public function show_notice() {
+    $file_size = apply_filters('d4p_bbpressattchment_max_file_size', $this->get_file_size(), bbp_get_forum_id());
    	
+    echo '';
+    echo  sprintf( __('Maximum file size allowed is %s KB.', 'gd-bbpress-attachments'), $file_size );
+    if ($this->restricted) {
+      echo ''.__("Your account can't use Attachment, they will be stripped before saving.", "gd-bbpress-attachments");
+    }
+    do_action('d4p_bbpresattachment_bbcode_notice');
+    echo '';
+  }   

In code/attachmenty/front.php line 40

+  add_action('bbp_get_reply_content', array(&$this, 'embed_attachments'), 10, 2);

In forms/uploader.php line 40

–  <div class="bbp-template-notice">
–      <p><?php echo __("Maximum file size allowed is", "gd-bbpress-attachments")." ".$file_size." KB."; ?></p>
–  </div>
<p>
    <label for="bbp_topic_tags">
        <?php _e("Attachments", "gd-bbpress-attachments"); ?>:
    </label><br/>

    <input type="file" size="40" name="d4p_attachment[]"><br/>
    <a class="d4p-attachment-addfile" href="#"><?php _e("Add another file", "gd-bbpress-attachments"); ?></a>
</p>

For point 2 — I didn’t do any code changes, but I’d like to have theability to pass the class for tag in uploader.php, Example:

<p class="<?php $theclass; ?>">
    <label for="bbp_topic_tags">
        <?php _e("Attachments", "gd-bbpress-attachments"); ?>:
    </label><br/>

    <input type="file" size="40" name="d4p_attachment[]"><br/>
    <a class="d4p-attachment-addfile" href="#"><?php _e("Add another file", "gd-bbpress-attachments"); ?></a>
</p>

Thanks Again!
Gaston Besada

Topic Information
Viewing 1 replies (of 1 total)
Author
Replies
  • #19021

    I’am just testing this plugin

Viewing 1 replies (of 1 total)
  • The topic ‘Improvement suggestion: Notice class function and custom CSS in uploader’ is closed to new replies.