WordPress.org

Ready to get started?Download WordPress

Forums

MyBB Cross-Postalicious
[resolved] Is possible not post all post? (8 posts)

  1. acquariusoft
    Member
    Posted 1 year ago #

    It's possible not post all post to the forum but only x words and the link to the post in the forum?
    like read all on the blog post!!

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

  2. mechter
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, the cross-post content is completely customizable. When editing/creating a post, look for the "MyBB Cross-Postalicious" box. Check the "Cross-post?" checkbox if it's unchecked and enter any message you like in the box with the headline "Content of cross-post:". Make sure to read what's written under that box to understand how to link to your post.

    You can customize the default message in Settings -> MyBBXP.

    If you'd like to automate this process to match your exact needs (e.g. display 100 words of current post and the link automatically), you'd have to hack the code for that.

  3. acquariusoft
    Member
    Posted 1 year ago #

    tnx it works very well!!

    another suggestion, is possible truncate title to 85 characters for not have error with long title?

  4. mechter
    Member
    Plugin Author

    Posted 1 year ago #

    np. I suspect by truncating the title you mean the title of the blog post which is somehow too long for your MyBB forum. I have not run into this problem yet, so there is no easy way to do this. However, the hard way is quite simple, so you may want to give it a try.

    Open the plugin file wp-content/plugins/mybb-cross-postalicious/classes/MyBBXPCrossPoster.php and go to line 89. You should find this:

    // parse postlink and title
    $cross_post_title = preg_replace('/!TITLE!/', $post->post_title, $cross_post_title);
    ...

    You can fit the wordpress "trim words" function (https://codex.wordpress.org/Function_Reference/wp_trim_words) in there, for example like this:

    // parse postlink and title
    $cross_post_title = preg_replace('/!TITLE!/', $post->post_title, $cross_post_title);
    $cross_post_title = wp_trim_words($cross_post_title, 80);
    ...

  5. acquariusoft
    Member
    Posted 1 year ago #

    tnx tnx tnx!!!

    only a little question, i don't want disable comment and pingback on my post.
    How can i do this?

    Why you don't insert the trim and this as option in your plugin? i think can be very usefull!!

  6. mechter
    Member
    Plugin Author

    Posted 1 year ago #

    First, I actually added the pingback/comment disabling as a feature because otherwise you'll have two places to post comments: the blog and the forums. That may confuse your users and double your administrative workload. That being said, you can disable this behavior for any future cross-posting by editing the file wp-content/plugins/mybb-cross-postalicious/mybb-cross-postalicious.php. Lines 43 and 44 should read:

    add_filter('comment_status_pre', array($myBBXPVar, 'comment_and_ping_stati_pre'));
    add_filter('ping_status_pre', array($myBBXPVar, 'comment_and_ping_stati_pre'));

    Delete these two lines, they cause wordpress to disable pingback and comments on every cross-posted blog post. In addition, in case you'd ever want to make use of the manual linking of blog/forum posts, open wp-content/plugins/mybb-cross-postalicious/classes/MyBBXPSettings.php, go to line 234-239. They should read:

    $sql = "update $wpdb->posts set comment_status='closed', ping_status='closed' where ID=%d";
    $wpdb->query($wpdb->prepare($sql, $wpid));
    if ($wpdb->last_error) {
        $this->messageHandler->error($wpdb->last_error . ', Query: ' . $wpdb->last_query , __FILE__, __LINE__);
        return;
    }

    These lines query the wordpress database and set the ping/comment status to closed for the post you manually linked via the plugin settings. Delete them to disable this feature as well.

    Thanks for your suggestion to add these modifications as options. If more stuff gets requested and I feel in the mood, I'll add it in. The 85 character title limit, is this for all MyBB installations or did you configure your forums like that? If this is the MyBB default, it may cause trouble for other people as well and may indeed need fixing.

  7. acquariusoft
    Member
    Posted 1 year ago #

    tnx for your response, i try!!

    85 character is the default, i haven't change anythink

    tnx to your work!!

  8. a_ahmed
    Member
    Posted 1 year ago #

    Hey do you mind elaborating on the second part of your post above.

    I didn't want the cross posting to disable the comments and pingbacks. So I commented out the two addfilter lines.

    I am not understand what the second part you are asking to edit is for? Is this mandatory/necessary/what does it do? I did not understand your explanation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.