Skip to:
Content
Pages
Categories
Search
Top
Bottom

modified quote-comments (Make new Plugin?)


  • anandasama
    Member

    @anandasama

    I recently tried the different Bb quote Plugins that exists but neither of them fit my taste in a WYSIWYG environment.

    I wanted a plugin with javascript that can multiquote, and quote small parts without reload, and insert to a Wysiwyg environment.

    Then I remembered that the “quote-comments” plugin in WordPress works even with TinyMCE,

    so I copied it over to bbpress and modified it so it would call the bbpress functions instead of wordpress.

    Needed to change some calls to the post_content instead of comments too..

    It works fine for me now, but the only problem is that I can’t use the quote link from another page than the form itself. So If Im in a thread with 2 pages, the first page won’t redirect me to the form of the last page.

    Somehow I need to make a link with the quote info to get saved (somehow?) and then called into the javascript function.

    As im not the best at PhP / javascript maybe some of you here can help me.

    I managed so the PHP outputs the necessary info for the javascript to grab. But problem is how to call it from another page with a link to the last page with the form.

    1. First I need to make a Php function that outputs a different link if im not on the same page as the form. Alright but how do I send it to the last page and how do I call the javascript from the last page?

    I put the files into the my-plugins folder with a folder called quote-comments

    Here is the PHP file (It gets outputed below the post) :

    quote-comments.php

    http://pastebin.com/f6743a79c

    2. As you can see the javascript gets called from the Link, so I need to call it in another way when it’s redirected to the last page.


    Here is the JS file:

    quote-comments.js

    http://pastebin.com/f74d57ac5

    Mark that the addQuote function ISNT used if you use TinyMCE and I set to use TinyMCE = true in the php file.

    As im not so good at php im kind of lost here. But it would be nice to make it all work and clean it up and make a plugin out of it.

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

  • anandasama
    Member

    @anandasama

    Need to add that the quote seems to come within the post and it becomes a trouble when you are editing. I’d rather like it beside. But I don’t know how to do this.

    I also need an option where Im able to output where the link will go (preferably manually like usual BbPlugins) instead of inside the post_text.


    anandasama
    Member

    @anandasama

    Fixed everything except quoting from another page (Wich is the main issue left).


    anandasama
    Member

    @anandasama

    Yes you can mark parts of a quote, multiquote and it goes directly into tinyMCE.

    It even works with editing posts. I needed to uninstall every kind of bbCode plugins though.

    You can see the quote in action here :

    http://matsuri.moai.se/topic/the-great-off-topic-thread

    Just need to fix the Quote from another page (when multiple pages).


    r-a-y
    Participant

    @r-a-y

    Nice bbPress site, anandasama!

    I was looking over your site and was wondering how you’re pulling in RSS feeds into one of your forums.


    anandasama
    Member

    @anandasama

    R-a-y: Thank you! The theme is a heavily modified version of Scoun.

    Although I am soon to write a new template because of the css/html isnt that great on it. ;)

    Just my way of learning the ropes.

    About the RSS feeds: I use feedwordpress plugin to feed it into my wordpress. In wordpress then, I put in some arguments to filter out the RSS feed so it won’t show up there. Somehow it still shows up in my WordPress RSS so I need to find a way to filter it out from the RSS too.

    The RSS syndication plugin can hold a number of RSS feeds with alot of options and automatically post articles.

    Then I use BBpress WordPress Synchronization plugin and when bbpress finds a new post in WordPress it automatically syncs and creates a post in one of my bbpress subforums.

    Somehow i dont want all my stuff to go into BbPress so when I write some new article in WordPress I can choose manually wether to sync this to BbPress or not.

    One thing I have an issue with is the first page; I want to make an own “Latest Discussions” loop with all forums EXCEPT RSS. And then an own “latest discussions” With only RSS forum.

    Problem is When i used this inside the loop

    //Show latest discussions with all forums except id 17
    <?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
    <?php if( $topic->forum_id != 17 ) { ?>
    codeblock
    <?php } endif;?>
    <?php endforeach; endif; // $topics ?>

    //Show latest discussions but only forum 17
    <?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
    <?php if( $topic->forum_id == 17 ) { ?>
    codeblock
    <?php } endif;?>
    <?php endforeach; endif; // $topics ?>

    The pagination gets an error (Shows me fewer posts than the actual limit), and I cant use the same loop (With different conditions) twice.. Then I get a blank page. :S

    So how should I do? Have any Idea? Im not so used to the bbpress loop yet..


    r-a-y
    Participant

    @r-a-y

    Ahh gotcha about the RSS feed syndication.

    Didn’t know you used FeedWordpress and then another bbPress plugin to sync between the two.

    Definitely not the best way to go about things, but a nice workaround!

    Would be nice if there was a separate RSS syndication plugin that was native to bbPress, but that’s just wishful thinking!

    By the way, I replied to your problem on the thread you opened.

    Not sure I provided the right answer… but hopefully someone else can look at your thread and give a response!


    anandasama
    Member

    @anandasama

    Yeah Its kind of an ugly workaround but its the only way i know that works. :)

    Id also like a native rss syndication. In time it will come i think!

    Thank you very much for your replies.


    anandasama
    Member

    @anandasama

    I might have solved this whole business:

    BbPress MultiQuote (Based on Wp Quote Comments)

    - wysiwyg support (tinyMCE)

    - multiquote (No reloading or other problems)

    - Select area to quote and never be forced to quote the whole message.

    - Quote from previous pages (I got a solution for this. Just need to make the code)

    Might add nested quote support to it later.

    If there is any interest, I will make the code available here once Im done cleaning it up.


    citizenkeith
    Participant

    @citizenkeith

    This sounds really good. Would love to see the code when you’re finished. :)


    anandasama
    Member

    @anandasama

    It works now at least for Firefox. Very ugly code though. I need to structure it and make functions of everything. ^^

    I solved it by putting the formated string output into a form, and then sending to the last page (by using get_topic_last_post_link(), but It echoes a anchor id.. I want to strip the #id in the URL and change it to url+#to-post. Any Idea how I can do that?

    And I needed to make a Js timeout for a few seconds because TinyMCE wouldnt load the new information unless it is loaded itself first.

    Here is the forum:

    http://matsuri.moai.se/


    anandasama
    Member

    @anandasama

    I still have one problem. the TinyMCE seems to strip alot of the p tags in the WYSIWYG environment when editing a post, and everything appears on one line. But after saving the changes, the post looks normal with the tags in correct place. It’s just the editing that looks strange.

    I have no idea how to solve this. I tried to add a class to each P element created but then TinyMCE wanted to create extra <p>&nbsp;</p> elements, spacing everything out in the posted text.

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

You must be logged in to reply to this topic.