Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help at making a Plugin: how to replace BP code…

  • Avatar of juanmaguerrero
    juanmaguerrero
    Participant

    @juanmaguerrero

    Hi, everyone! just wanted to make a plugin for “auto-load more activity items when the user reaches the page footer” and since my packed code should do everything “automatically” I was wondering if someone could give me a quick example of how to “replace” a piece of code in the buddypress theme or what is the best way to do this (include a “child theme” instead? or what?).

    What I need to do with the plugin is to automatically replace some code in:
    `
    buddypress/bp-themes/current-theme/activity/activity-loop.php
    `
    For my customized code.

    Can you help me please? I’m giving the plugin away for free if I can manage to pack it :D

    THANKS!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Did you google search, I think someone has already created this plugin/customization

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Plugins only work well if a user does not have to edit code.

    Have you tried using jquery to force the JavaScript function that loads more when the page is scrolled past the load more button?

    Avatar of juanmaguerrero
    juanmaguerrero
    Participant

    @juanmaguerrero

    Hi, @modemlooper I researched a lot and there’s no one who did this, maybe you heard of myself since I wrote a kind-of-tutorial here at the forums explaining how to achieve this, but I would like to make a plugin with it :)

    I have all the work done, you can see a working demo here (scroll down to see it in action) http://www.horizontea.com/ the thing is I do not want the “Load More” button to appear since the user won’t need it and the appended items will have problems with the way that the new instances of the button are created…

    I just want to know how some plugins code manages to “rewrite” some theme parts from backend, not frontend, if such a thing is even possible. For example I want to replace as explained in http://buddypress.org/community/groups/creating-extending/forum/topic/auto-load-more-activity-stream-items-when-scroll-reaches-the-bottom-of-the-page/ (I have poolished and improved the code now loads only when needed and included throttling functionality).

    If it cannot be done it will keep being just a tutorial and never a plugin, sadly :/

    Avatar of juanmaguerrero
    juanmaguerrero
    Participant

    @juanmaguerrero

    For example here in this WPMUorg tutorial the author explains how to replace some piece of code, but it is passed as a variable in the execution time, after it’s assigned with a value http://wpmu.org/how-to-create-your-very-first-wordpress-plugin/

    Will it work if I want to modify the php templating code BEFORE it gets parsed by the PHP engine? I think not…

    Avatar of juanmaguerrero
    juanmaguerrero
    Participant

    @juanmaguerrero

    Hi, maybe someone just can tell me how to programatically set a custom template instead of a given one? I need to change the activity loop template inside the user’s current theme (as a child theme would do) but my “product” would be a plugin, not a theme.

    I can’t use filters since I don’t want to modify the dynamic content but the template php logic.

    Please I hope someone could point me in the right direction… or give me some advice on what is the best practice for doing this if I’m thinking it wrong. Thanks a lot.

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

You must be logged in to reply to this topic.