Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,401 through 30,425 (of 32,465 total)
  • Author
    Search Results
  • #56685

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    @Trent and ardentfrost: Thank you!

    Trent, feel free to use the upload code for whatever! I stole it from myself anyway… it is adapted from a photo gallery application I wrote.

    My previous message hinted at expanding the number of images that can be uploaded, although I only mean it within the context of multiple avatars. But somebody else is welcome to expand the code to a general image/file uploader.

    #56684

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    Ok, I’ve now looked at the code and can see how it can be included without needing to branch the plugin too much (and all the maintenance issues involved with that!).

    First of all I removed the identicon functions from the bb-avatar-upload.php file and placed them at the bottom of the identicon.php file, to keep them all together.

    Secondly, I moved the if($_POST['identicon']){...} code from the avatar-upload.php file to the bottom of identicon.php and made it a function called by the ‘bb_head’ hook (I might eventually do this for the main upload functions too). Note: Is there a pre-head hook that fires before any headers are sent?

    function useidenticon()
    {
    global $user;
    //fel identicon
    if( $_POST['identicon'] )
    {
    felapplyidenticon( $user->ID );
    }
    }

    add_action( 'bb_head', 'useidenticon' );

    You then only need to supply and maintain two files for the “branch”.

    - my-plugins/identicon.php
    - my-templates/avatar.php

    The avatar.php template is the least likely file to change (it’s been modified slightly since version 0.1).

    I’ve made the modifications and zipped them up for you to examine:

    Identar Modified (this is minus my files, except the template file)

    You will also need the updated version of Avatar Upload: Avatar Upload (version 0.2)

    By keeping the Identicon and Avatar parts of the code separate, it should be easier to use Subversion to merge in – or simply replace – changes I make to the trunk code.

    Regarding filename storage in the database – there are two reasons for this. The first is that I prefer to store the image dimensions along with the current avatar. The maximum width and height of the avatar is just that, maximums; the actual dimensions could be any size and any aspect ratio within that limit. I then include the height and width attributes in the <img> tag – it’s good practise because the browser makes space for the image when loading the page, instead of shifting everything after the page has loaded.

    The second reason is more exciting – future proofing. A future version of this plugin will allow multiple file uploads, allowing users to upload more than one avatar image and select which one to use.

    Since releasing version 0.1 of the plugin, I have reduced the number of DB calls in the profile pages and in the avatar-upload.php file by making use of the $user object and calling $user->avatar_file when I need to access the avatar info.

    Although, when adding avatars to a user’s posts you still have to do a DB query. If I used your suggested method, it is still going to involve at least one call to the DB, either to get the user_login from the get_post_author_id() (and then grab the avatar file), or to get the avatar itself from the get_post_author_id().

    #49619

    In reply to: Emoticons For bbPress?

    smurfdude
    Member

    I used this plugin and the row of smilies show beneath the edit form, but they are unclickable. An even when I just type in :) :( etc, they don’t appear in the post.

    #56683

    In reply to: Plugin: Avatar Upload

    smurfdude
    Member

    Ah i was hoping it would be something simple like inserting a bit of code in the comments page rather than needing a plugin to call stuff from the database. Being rubbish at php that kind of thing just confuses me, so will have to cross my fingers that someone else does it :)

    #55531

    In reply to: Hooks & Filters Docu

    Trent Adams
    Member

    Fair enough ;)

    Trent

    #56947
    Trent Adams
    Member

    Sorry, wrong syntax, but it does work with:

    https://bbpress.org/forums/rss/

    http://onvertigo.com/rss/

    fel64, you must think I am crazy today eh as I can’t seem to get anything straight the first time!! ;)

    Trent

    #57040
    Calitoe
    Member

    I have visited your site, Trent, and I do appreciate the effort, but some of the ones listed don’t work with my installation. The “four” themes that I mentioned in my first post that worked for me were all taken from your site!

    I guess now I have a strong reason to develop another skill: “bbPress themes” ;)

    Thanks for your answers.

    #55529

    In reply to: Hooks & Filters Docu

    fel64
    Member

    It’s not actually meant to be instructions, more like a list of hooks and filters Trent. I just included that as an aside for someone starting out.

    I’m sure you two have seen some more filters or hooks yourself, so help out and add them please. The point is, rather than waiting around for documentation, start getting some makeshift documentation up ourselves.

    post_text is a filter called on the text leaving the database I think, it’s what the emoticons use.

    #56677

    In reply to: Plugin: Avatar Upload

    fel64
    Member

    Strange – what is the error?

    Besides, the code should be this instead I think!

    href="<?php bb_get_option( 'uri' ); ?>/avatar-upload.php?id=<?php echo $user->ID; ?>"

    Small error in the documentation. If you’re feeling lazy, feel free to hard-code your forum’s URL in instead.

    #56676

    In reply to: Plugin: Avatar Upload

    wmarcy
    Member

    Arggh, I think my webhost has to upgrade to php5, as I am getting errors in the <a href="avatar-upload.php?id=<?php echo $user->ID; ?>">Upload Avatar</a> include.

    #57018
    Trent Adams
    Member

    I see you resolved this. Just for others, I found the login code for WordPress and put that in the sidebar as it doesn’t matter if you login at bbPress or WordPress when you are integrated.

    Trent

    #57071
    Trent Adams
    Member

    For adding custom profile additions, I use Macwise’s Custom Profile Plugin. You have to edit the actual plugin code to get your profile additions you want, but the ‘extra’ ones in it are ‘number of kids’ and you will figure out how to add more and change that one. As well, if they are marked as ‘1’ they are required and ‘0’ means not required.

    As for avatars, you can have your users add their own URL to their avatar using Ardentfrost’s Avatar Plugin but it doesn’t have an interface yet for uploading avatars, just putting in the URL. If most of your users use Gravatar or MyBlogLog, you can try the other Avatar Plugin as it just uses the avatar from those services. There is a new plugin that allows uploading of avatars as well available here

    That should get you going!

    Trent

    #1761

    Topic: Plugin: bbPortal 1.2

    in forum Plugins
    Null
    Member

    bbPortal 1.2 is ready to download. You can download it here: http://www.bbportal.org/bb-downloads/bbportal1.2.zip

    Changelog:

    – Made bbPortal compatible with bbPress 8.0 +

    – Rewritten most part of the code and fixed some small bugs

    – Now using the bb_get_option API instead of creating a new database table

    – Moved the plugin options in the admin area from “Content” to “Portal Management” in the main admin menubar

    – bbPortal now uses the bbMenu plugin for its menu’s. This plugin is added into the .zip file

    – Fixed the form processing bug (thanks to Sam Bauers)

    Still to do:

    – Fix the hyperlink bug

    – Better CSS for the left and rightbars

    – Widgets

    – Being able to create new pages

    – Being able to create new link tabs

    _Null

    #56673

    In reply to: Plugin: Avatar Upload

    wmarcy
    Member

    Fel, want to shoot the code over to me, I would love to integrate it into my bbPress sites.

    #1759
    Calitoe
    Member

    Hello,

    Sorry if this has been resolved already, but I haven’t found the answer :-/

    Is there a directory, viewer, site, post, whatever that lists bbPress themes available round there (similar to WordPress themes viewers-showcases)? I’ve only found like 4 bbPress themes that really work with my current installation (0.8.1) after searching virtually everywhere.

    Of course, I can always try and make my own template, but if anyone else is developing and releasing themes, I would like to know and they deserve to be promoted.

    Thanks in advance.

    #56672

    In reply to: Plugin: Avatar Upload

    fel64
    Member

    A really useful plugin, it works very nicely. :) I’ve had my eye on Identicons for a while and wanted to integrate them, the result being that I hacked up Scott’s identicon plugin to only contain the class, wrote a function to make identicons for users and integrated it with your plugin (so, changes made to all three files). It assigns users identicons when they register, and they’re kept in the same way as you do things now. I personally love identicons. :D It’s running now at http://forums.loinhead.net/ – just look in any thread.

    I was wondering, is there a reason for storing the metavalues in the database? An alternative is to go to the folder directly and look for all possible variants in turn (considering the standard naming, you’re just checking extensions), saving on the database read and writes – but I’m not sure which would be faster. You’d have to delete the old avatar of course in case you don’t overwrite it because of different filetypes.

    There’s a final modification I want to make, purely aesthetic. Any idea how to get the avatar link into one of the profile tabs (like Edit or Favourites)?

    #57035

    In reply to: Template integration

    fel64
    Member

    Most of us using bbpress are using wordpress as well.

    Are you sure?

    I would like a great degree of integration too, mainly blogpost/topics and comments/replies, but we may be in the minority. :)

    #1758
    maxbear
    Member

    Most of us using bbpress are using wordpress as well. All we want is add the forum feature to our blog easily. If bbpress can just embed in a wordpress page, it will be much easier for us to work with both script. Just my thought :-)

    #57027
    fel64
    Member

    There’s probably a filter similar to latest_topics, where you could check if the forum name is the same as the one you want to get rid of. :)

    #57029
    Null
    Member

    PHP5 only :(

    I for one still run PHP4.x (well my host company does), don’t know what the majority runs, but I don’t think that is PHP5…

    Like this plugin though! What was fixed, changed?

    #57017
    Null
    Member

    Ah going to try that tonight. Don’t know why, but I never understood forms :S (perhaps cause there are many different ways to do this…) I am going to print this one and mine and compare them. Thx for the help, learned something today :)

    Quote:

    and you have to be a bit more specific about your forms submit name to distinguish it from other plugins

    Well that could explain why it updated on its own :D

    Thx

    #57016
    Sam Bauers
    Participant

    You are missing the API hooks, and you have to be a bit more specific about your forms submit name to distinguish it from other plugins.

    The code below is at least a step closer, notice the change to the name of the submit button and to the if conditional in the update_bbportal function. The specified action allows that function to be called when the admin header is loaded.

    You will also have to pull the values you insert into the options back out again to re-populate the form on the same page.

    // Add action for the admin area to process the form
    add_action('bb_admin-header.php','update_bbportal');

    // Show form
    function bbportal_form() {
    ?>
    <h2><?php _e('Portal Management'); ?></h2>
    <h3><?php _e('Portal settings'); ?></h3>
    <form action="" method="post">
    <table>
    <tr><th scope="row"><label for="forum_id"><?php _e('Where do you want to pull the topics from?'); ?></th>
    <td><?php forum_dropdown(); ?></label></td>
    </tr>
    <tr><th scope="row"><?php _e('Number of topics on the portal:'); ?></th>
    <td><input type="text" name="number_of_topics" id="number_of_topics" /></td>
    </tr>
    </table>
    <p class="submit alignleft"><input name="submitPortal" type="submit" value="<?php _e('Submit'); ?>" />

    </form>
    <?php
    }

    // Update portal
    function update_bbportal() {
    if (isset($_POST['submitPortal'])) {
    bb_update_option( 'pforum_id', $_POST['forum_id'] );
    bb_update_option( 'number_of_topics', $_POST['number_of_topics'] );
    }
    }

    Well, at least that is one way to do it.

    #54301
    Calitoe
    Member

    Gracias por la traducción, lonemadm, yo he cambiado la traducción de “bozo” a “petardo” en lugar de “tonto”. También valen “pesado”, “plasta”, “incordio”… Lo que se diga más en vuestras tierras :)

    #55527

    In reply to: Hooks & Filters Docu

    Null
    Member

    Nice we also need a list of available APIs :)

    #1557

    Topic: Hooks & Filters Docu

    in forum Plugins
    fel64
    Member

    Rather than just keeping private notes on the hooks and filters I found, I thought it best to maybe start a list here with everyone, just as a rough working documentation of the hooks and filters.

    For future ref/for people that don’t know, a hook is a means of bbPress making your plugin run every time a certain thing happens. To get that to work, put this code at the very bottom of your plugin:

    add_action( 'hook_name', 'functionname' );

    Filters are very similar to hooks, only it gives your plugin some data, you can then do something with the data (filter it), and then pass it back. To register for filters, put this code at the bottom of your application; remember to accept the parameters in your function and return them as appropriate.

    add_filter( 'filter_name', 'functionname' );

    Note that in both cases you want the name as a string and the function’s name as a string, no brackets or parameters at the end of it! An optional third parameter is the priority of your function; default is 10, so set this higher if you want it to execute last or lower if you want it to execute earlier.

    Some Filters

    topic_title – this passes the topic title to your function when the threads are being listed, like on the (default) front page.

    bb_allowed_tags – this is the array of HTML tags you can use in your posts. Hang a filter on this and add elements to the array if you want to allow more tags.

    Some Hooks

    bb_head – this is called when the HTML <head> element is being filled, so you can add stylesheets or javascript and the like.

    bb_user_logout obviously gets called when someone logs out.

    bb_init when someone logs in?

    bb_new_user when someone registers; passes the ID along I think

    bb_profile_menu – haven’t figured out how it works; I think it’s to do with the tabs at the top of the profile.

    If you know any more hooks or filters, or find ’em, please post them here with a quick description if necessary!

Viewing 25 results - 30,401 through 30,425 (of 32,465 total)
Skip to toolbar