Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,376 through 30,400 (of 32,431 total)
  • Author
    Search Results
  • #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!

    #52346
    gtim
    Member

    Thanks for this great script. Unfortunately I got myself suspended from one of my webhosts since it clogged up the MySQL queue :) But I have only myself to blame, and they did let it pass only giving me a final warning.

    #57015
    Null
    Member

    Well got the bb_get_option working, but not my form. Did take a look at yours and several others, but I can’t seem to see the logic in them. I’ve made some changes but it aint updating at all anymore.

    This is what i have now:

    // 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="submit" type="submit" value="<?php _e('Submit'); ?>" /></p>
    </form>
    <?php
    }

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

    So what do i miss?

    Thx

    #57024
    wmarcy
    Member

    Jim Lynch came to the rescue, here is what is necessary:

    This code gos into the front-page.php file:

    <table id="highest">
    <tr>
    <th>Highest Rating</th>
    <th>Rating</th>

    </tr>

    <?php $topics=bb_top_topics();
    foreach ($topics as $topic) : ?>
    <tr<?php alt_class('forum'); ?>>
    <td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
    </td>
    <td class="num"><div class="rating-holder"><?php bb_rating();?>
    <span class="count"><?php bb_rating_count(); ?>
    </span>
    </div>
    </td></tr>
    <?php endforeach; ?>
    </table>

    Also very important not to forget to include “my-plugins/bb-ratings.css” in your template header file. That should look something like this:

    <link rel='stylesheet' href='http://YOUR_PATH_TO_BBPRESS/my-plugins/bb-ratings.css' type='text/css' />

    #57013
    Sam Bauers
    Participant

    I think you are misunderstanding how PHP is used to process forms. You can’t call a PHP function using an “onclick” event.

    PHP is a server side pre-processor, not a client side scripting language. The form needs to be posted, then you need to somehow trigger the php function on the recipient page. In bbPress, this is done by hooking into the API.

    Read this… http://www.php.net/manual/en/tutorial.forms.php

    Then I suggest you download and copy the methods used in another plugin that does this. No one will mind you copying their methods. You can feel free to adapt from any of my plugins that do this. “LDAP authentication” does it, so does “Restrict registration”. The code for handling admin pages is at the bottom of both plugins. These will also give you a clue as to how to implement the bb_*_option functions.

    #57022
    chrishajer
    Participant

    The stylesheet is found perfectly fine, path is OK and it’s linked properly (in FF on XP anyway) but the problem with the sheet is you didn’t style the items you don’t want to print. So, they are just unstyled but will still print. You need to do a display: none; for the elements you don’t want to print for it to work (I think.)

    http://erraticwisdom.com/2007/01/22/css-printing-guide

    #1752
    wmarcy
    Member

    Here is what I have in my front-page.php:

    <h2><?php _e('Hightest Ratings'); ?></h2>
    <table id="highest">
    <tr>
    <th><?php _e('Highest Rated Topics'); ?></th>
    <th><?php _e('Rating'); ?></th>
    <th><?php _e('#'); ?></th>
    </tr>

    <?php $topics = bb_top_topics(); ?>
    <?php foreach ($topics as $topic); ?>
    <tr<?php alt_class('forum'); ?>>
    <td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>

    <td><div class="rating-holder"><?php bb_rating();?>
    <td class="num"><?php bb_rating_count(); ?>

    </table>

    This code is only showing the first topic it comes across with a rating.

    See what I am talking about at: http://www.wetworx.com/forums/

    Any help would be appreciated.

    #1749
    Null
    Member

    Hi,

    I have a form to update a plugin’s settings. The problem is, it seems to update on it’s own as well. Seems randomly and appears mostly when surfing through the admin pages. Whats wrong with my form and how to fix it?

    The form:

    // Update portal
    function update_bbportal() {
    global $bbdb;

    $bbdb->query("UPDATE <code>$bbdb->portal</code> SET pforum_id = '". $_POST['forum_id'] ."', number_of_topics = '". $_POST['number_of_topics'] ."'");
    }

    // 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 type="submit" onclick="<?php update_bbportal(); ?>" value="Submit" /></p>
    </form>
    <?php
    }

    I also no longer want to use the created and used database table “portal”, but use the “bb_update_option” and “bb_get_option”. How to do this?

    Thx

    #1750
    #57008

    In reply to: like5.com

    LMD
    Participant

    Nice use of my Avatar Upload plugin! I see you’ve modded it a bit too by adding a classname to the image link, which is great.

    I like the “Random Members” on the front page. I wonder if you’d consider sharing code, with full credit of course, so the random image thing can be added to the avatar upload plugin?

    I don’t know how you’ve set-up your random script, but I can see it being made configurable, so users can select the number to display and if they wish to limit it to only people who have uploaded an avatar.

    Let me know what you think.

Viewing 25 results - 30,376 through 30,400 (of 32,431 total)
Skip to toolbar