WordPress.org

Ready to get started?Download WordPress

Forums

MyBB Cross-Postalicious
[resolved] Stop Displaying Drafts (2 posts)

  1. kab012345
    Member
    Posted 12 months ago #

    I need to figure out where to add visible=1 so that no drafts are no longer being displayed in the widget. Can anyone help with this? I know that it must go in the mybbxp-recent-topics-widget.php file, but I cannot figure out the SQL code. I have tried editing the following code but I have only been able to produce the mybbdb->last_error. Any help on the right code would be very helpful.

    $sql = 'select tid, subject from '
    				. $options['db_prefix'] . 'threads' // sanitized in MyBBXPSettings
    				. ' where fid in( '
    				. $instance['fids'] // sanitized below
    				. ') and visible=1' // <<<<I TRIED THIS>>>
    				. 'order by '
    				. ($instance['define_recent'] == 'created' ? 'dateline' : 'lastpost') // sanitized below and inline
    				. ' desc limit '
    				. $instance['num_topics'] // sanitized below
    				. ';';

    http://wordpress.org/extend/plugins/mybb-cross-postalicious/

  2. kab012345
    Member
    Posted 12 months ago #

    If anyone is curious, I just figured it out. Here is the code (Lines 54-63) to PREVENT any drafts from displaying in the recent topics widget.

    $sql = 'select tid, subject from '
    				. $options['db_prefix'] . 'threads' // sanitized in MyBBXPSettings
    				. ' where visible=1'
    				. ' and fid in( '
    				. $instance['fids'] // sanitized below
    				. ') order by '
    				. ($instance['define_recent'] == 'created' ? 'dateline' : 'lastpost') // sanitized below and inline
    				. ' desc limit '
    				. $instance['num_topics'] // sanitized below
    				. ';';

Reply

You must log in to post.

About this Plugin

About this Topic

Tags