Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Nulled_Icode, thank you so much for making this plugin public. I’ve never ventured to write a plugin, but you made it so clear and simple I’ve actually understood how to use wp,php,js,sql. I’m now modifying your thank post plugin into a voting plugin – giving people the opportunity to vote YES or NO on a certain post (like a motion to approve something by a board of directors). It’s going good so far.

    Once again, thank you for writing clean code, and for sharing it freely. I’ll let you know once my modifications are done.

    @fabregus,

    Here’s a hint for you:

    function get_thanks (){
    			global $wpdb,$post;
    			$table = $wpdb->prefix.$this->table;
    			$thanks = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $table WHERE post_id='$post->ID' "));
    
    			return $thanks;
    
    		}

    You can actually make the same mySQL inquiry anywhere inside wordpress as long as you call global $wpdb. The most important line in that code above is this:
    SELECT COUNT(*) FROM $table WHERE post_id='$post->ID'
    That’s a mySQL query that will count all entries that have your current post’s ID attached to it. $table should be wp_thank if you have not changed prefix when you set up wordpress. Hope this helps you out.

    Yeah, I’ve seen this happen in the Dashboard. No weird plugins installed, any menu item. It’s a bug.

    Thread Starter question_man

    (@question_man)

    Possible improvement in bp-chat.php:

    echo "<div id='shoutboxwrapper' class='jqDnR'><div id='moveme' class='jqHandle jqDrag'>" . __("Click and drag", "bp-chat") . "</div><div class='closemetop'><a id='shoutBoxMin' href='#' style='font-size:14px;text-decoration:none;width: 16px;padding-right: 4px;'><img src='https://aicm.us/wp-content/plugins/buddypress-ajax-chat/bp-chat/chat/img/minimizebutton.jpg' alt='-'/></a><a id='shoutBoxMax' href='#' style='font-size:14px;text-decoration:none'><img src='https://aicm.us/wp-content/plugins/buddypress-ajax-chat/bp-chat/chat/img/maximizebutton.jpg' alt='+'/></a><a style='font-size:14px;text-decoration:none' href='?close=yes' id='shoutboxclosetop' alt='Close'><img src='https://aicm.us/wp-content/plugins/buddypress-ajax-chat/bp-chat/chat/img/closebutton.jpg' alt='X'/></a></div>";
    	echo "<div id='shoutboxBody'>";
    	echo "<iframe id='shoutBoxFrame' src='" . get_bloginfo('wpurl') . "/wp-content/plugins/buddypress-ajax-chat/bp-chat/chat/indexShoutBox.php'  width='100%' height='338' frameborder='0' scrolling='no'></iframe>";
    	echo "</div>";
    	echo "<div id='shoutboxBottom'>";
    	echo "<div style='text-align:center;color:black;'><a href='".$bp->loggedin_user->domain . $bp->chat->slug."'>". __("Go to full chat", "bp-chat") ."</a></div><div style='text-align:center;color:black'></div><br/></div>";
        echo "</div>";
        echo "<script>\n";
        echo "jQuery('#shoutBoxMin').click(function ()\n";
        echo "{\n";
        echo "  jQuery('div#shoutboxBody').hide('fast');\n";
    ?>
    jQuery('#shoutboxwrapper').animate(
        {"bottom": "-=340px"},
        "fast"
    );
        jQuery('#shoutBoxMin').hide('slow');
        jQuery('#shoutBoxMax').show('slow');
    <?php
        echo "});\n";
        echo "\n";
        echo "jQuery('#shoutBoxMax').click(function ()\n";
        echo "{\n";
        echo "  jQuery('div#shoutboxBody').show('fast');\n";
    ?>
    jQuery('#shoutboxwrapper').animate(
        {"bottom": "+=340px"},
        "fast"
    );
    jQuery('#shoutBoxMin').show('slow');
    jQuery('#shoutBoxMax').hide('slow');
    <?php
        echo "});\n";
        echo "\n";
        // minimizing shoutbox automatically - addon
        echo "  jQuery('div#shoutboxBody').hide('fast');jQuery('#shoutBoxMin').hide('slow');\n";
        echo "</script>\n";
    }
    Thread Starter question_man

    (@question_man)

    Well, in the mean time, I have the following workaround:

    Add this to wp-content/plugins/buddypress/bp-themes/bp-default/footer.php:
    (bp-default is your theme’s name)

    <script type="text/javascript">
    	jQuery('div#shoutboxBody').hide('fast');
    </script>

    This will make your shoutbox “hide” by itself right after the page fully loads.

    Thread Starter question_man

    (@question_man)

    Oh I see. Thank you. My keys and salts have been created anyway, without allowing that connection so I guess it doesn’t bother it that it can’t create those at api.wordpress.com.

Viewing 5 replies - 1 through 5 (of 5 total)