Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for '+.+default+.+'

Viewing 25 results - 6,526 through 6,550 (of 6,778 total)
  • Author
    Search Results
  • #1810
    dprice
    Member

    Being both a web nerd and Physics student, I decided it was time for BBpress to meet up with MathML.

    Here’s the steps I took to get it crankin’:

    1. Made a copy of the default ‘kakumei’ template, then renamed the folder ‘physics’, my new template name. I then put a copy of ASCIImath.js in there. This does all the hard work.
    2. Changed the physics/header.php from:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" <?php bb_language_attributes( '1.1' ); ?>>

      to:

      <?xml version='1.0' encoding='iso-8859-1'?>
      <?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >

      <html xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en"
      xmlns:pref="http://www.w3.org/2002/Math/preference"
      pref:renderer="css">

      It’d probably still work if you didn’t bother with this step, but seeing as BBpress is making XML we may as well.

    3. Added <script type="text/javascript" src="<?php echo bb_path_to_url( dirname(__FILE__) . '/ASCIIMathML.js'); ?>"> to physics/header.php – this loads the ASCIIMathML.js javascript and does a majority of the MathML magic.
    4. Opened bb-includes/formattingfunctions.php and edited this:
      function code_trick( $text ) {
      $text = str_replace(array("rn", "r"), "n", $text);
      // $text = preg_replace("|<code>(.*?)</code>|e", "'<code>' . encodeit('$1') . '</code>'", $text);
      // $text = preg_replace("|n<code>(.*?)</code>|se", "'<pre><code>' . encodeit('$1') . '</code></pre>'", $text);
      return $text;
      }

      To turn off the backtick code replacement – this is what ASCIIMath.js does!

    That was it. I’ll zip it all up then post it up here. Ideally, it’d be better to not comment out any of the bb-include/ files – if anyone has any suggestions, let me know.

    #56961
    Vili
    Participant

    Ok, here’s what I have, commented. The comments that start with “VILI” are mine.

    Please keep in mind two things:

    a) This is strictly speaking a WordPress plugin, not a bbPress one. The functionality is simply extended to also cover an integrated bbPress installation. (And yes, this means that you need to install this in your WordPress, not your bbPress.)

    b) I hacked this for my own purposes, so it may not be pretty, and it certainly won’t be ready for use without you reading through the code. If someone is interested in working to make it functional as an “out of the box” solution, then by all means go ahead.

    Finally, the original Dan’s Avatar Thingy can be found here.

    <?php
    /*
    Plugin Name: Vili's Avatar Thingy
    Plugin URI: http://www.vertebratesilence.com/
    Description: Displays an avatar next to posts or comments based on username. Based on Dan's Avatar Thingy (http://www.cheesemasterdan.com/).
    Version: 0.1
    Author: Vili Maunula
    Author URI: http://www.vertebratesilence.com/
    */

    // Variable declarations
    // VILI: These were changed from Dan's Avatar Thingy, in which you only had default
    // size settings into which all avatars were resized.

    $avatar_max_width = 100; // Max avatar width
    $avatar_max_height = 100; // Max avatar height
    $avatar_max_upload_size = 15360; // Max file size in bytes
    $avatars_path = ABSPATH."wp-content/avatars";

    function cmd_show_avatar()
    {
    global $wpdb;
    global $avatars_path;

    // VILI: The following is a boolean setting I use to detect whether the page
    // being served is a forum page. In practice, I have
    // <?php global $forumpage;
    // $forumpage = TRUE; ?>
    // at the beginning of each forum page (I use WordPress headers in my integrated
    // setup, but if your bbPress uses its own headers, just stick it there). If
    // anyone knows a more cost-efficient way of detecting whether a page shown is
    // a forum page, let me know.
    global $forumpage;

    if ($forumpage == FALSE) {
    $the_author_name = get_comment_author();
    if($the_author_name == "" or $the_author_name == __('Anonymous'))
    { // Avatar for posts
    $the_author = get_the_author_id();
    $the_author_name = get_the_author();
    } else { // Avatar for comments - only for registered users
    $the_comment_ID = get_comment_ID();
    $the_author = $wpdb->get_var("SELECT user_ID FROM $wpdb->comments WHERE comment_ID='$the_comment_ID'");
    }
    } else {
    $the_author_name = get_post_author();
    $the_author = get_post_author_id();
    }

    $image_path = get_bloginfo('wpurl')."/wp-content/avatars/";
    $the_avatar = $image_path.$the_author.".jpg";
    if(file_exists("$avatars_path/$the_author.jpg"))
    {
    echo '<img src="' . $the_avatar. '" alt="' . $the_author_name . '" class="cmd-avatar" />';
    } elseif(file_exists("$avatars_path/default.jpg")) {
    echo '<img src="' . $image_path . 'default.jpg" alt="Unregistered" class="cmd-avatar" />';
    }
    // If the file doesn't exist then return nothing...
    }

    add_action ('admin_menu', 'cmd_avatar_menu');

    function cmd_avatar_menu()
    {
    add_submenu_page('profile.php', '', 'Your Avatar', 0, __FILE__, 'cmd_avatar_profile');
    }

    function cmd_avatar_profile()
    {
    global $userdata;
    global $avatar_max_width;
    global $avatar_max_height;
    global $avatar_max_upload_size;
    global $avatars_path;
    get_currentuserinfo();

    if(!file_exists($avatars_path))
    {
    $mkdir_result = @mkdir($avatars_path, "0755");
    if(!$mkdir_result)
    {
    echo '<div id="message" class="error fade">The folder' . $avatars_path . ' does not exist and could not be created automatically. Please create it and assign 0755 permissions then try using this plugin again.
    </div>';
    die();
    }
    }

    if ($_POST['cmd_action'] == 'upload_avatar')
    {
    if ($_FILES['cmd_avatar_file']['size'] > 0 && $_FILES['cmd_avatar_file']['size'] < $_POST['MAX_FILE_SIZE'])
    {
    $uploaddir = ABSPATH."wp-content/avatars/";
    $uploadfile = $uploaddir . $userdata->ID . '.jpg';
    list($width, $height, $type, $attr) = getimagesize($_FILES['cmd_avatar_file']['tmp_name']);

    // VILI: The following calculates the size into which the
    // image needs to be put. If it's under the MAX limits, nothing
    // is done, otherwise resizing takes place. This probably
    // could be written more elegantly.

    $widthratio = $width / $avatar_max_width;
    $heightratio = $height / $avatar_max_height;
    if ($widthratio > 1 && $heightratio > 1 && $widthratio > $heightratio) {
    $usewidth = $width / $widthratio;
    $useheight = $height / $widthratio;
    } elseif ($widthratio > 1 && $heightratio > 1 && $widthratio < $heightratio) {
    $useheight = $height / $heightratio;
    $usewidth = $width / $heightratio;
    } elseif ($widthratio > 1) {
    $usewidth = $width / $widthratio;
    $useheight = $height / $widthratio;
    } elseif ($heightratio > 1) {
    $useheight = $height / $heightratio;
    $usewidth = $width / $heightratio;
    } else {
    $usewidth = $width;
    $useheight = $height;
    }

    $cmd_avatar_image = imagecreatetruecolor ($usewidth, $useheight);
    switch ($type)
    {
    case 1: // GIF
    $image = imagecreatefromgif($_FILES['cmd_avatar_file']['tmp_name']);
    imagecopyresampled($cmd_avatar_image, $image, 0, 0, 0, 0, $usewidth, $useheight, $width, $height);
    $avatar_created = (imagejpeg($cmd_avatar_image, $uploadfile, 100) ? TRUE : FALSE);
    imagedestroy($image);
    imagedestroy($cmd_avatar_image);
    break;
    case 2: // JPEG
    $image = imagecreatefromjpeg($_FILES['cmd_avatar_file']['tmp_name']);
    imagecopyresampled($cmd_avatar_image, $image, 0, 0, 0, 0, $usewidth, $useheight, $width, $height);
    $avatar_created = (imagejpeg($cmd_avatar_image, $uploadfile, 100) ? TRUE : FALSE);
    imagedestroy($image);
    imagedestroy($cmd_avatar_image);
    break;
    case 3: // PNG
    $image = imagecreatefrompng($_FILES['cmd_avatar_file']['tmp_name']);
    imagecopyresampled($cmd_avatar_image, $image, 0, 0, 0, 0, $usewidth, $useheight, $width, $height);
    $avatar_created = (imagejpeg($cmd_avatar_image, $uploadfile, 100) ? TRUE : FALSE);
    imagedestroy($image);
    imagedestroy($cmd_avatar_image);
    break;
    default:
    $avatar_created = FALSE;
    break;
    }
    if ($avatar_created) {
    echo '<div id="message" class="updated fade">File uploaded successfully.
    </div>';
    } else {
    echo '<div id="message" class="error fade">File upload failed.
    </div>';
    }
    }
    }
    echo '
    <div class="wrap">
    <h2>Your Avatar</h2>
    <form name="cmd_avatar" id="your-profile" action="' . $PHP_SELF . '" method="post" enctype="multipart/form-data">
    <fieldset>
    <legend>Avatar</legend>';

    $the_user = $userdata->ID;

    $avatars_path = ABSPATH."wp-content/avatars";
    $image_path = get_bloginfo('wpurl')."/wp-content/avatars/";
    $the_avatar = $image_path.$the_user.".jpg";

    if(file_exists("$avatars_path/$the_user.jpg")){
    echo '
    <img src="' . $the_avatar . '" alt="' . $userdata->user_login . '" class="cmd-avatar">';
    } else {
    echo 'No avatar found...';
    }
    echo '

    <label>Filename: </label>
    <input type="file" accept="Pictures" name="cmd_avatar_file" />

    <input type="hidden" name="MAX_FILE_SIZE" value="' . $avatar_max_upload_size . '" />
    <input type="hidden" name="cmd_action" value="upload_avatar" />
    Click browse to find your avatar image. It can be JPG, GIF or PNG and should be ' . $avatar_max_width . ' x ' . $avatar_max_height . ' pixels or less (if bigger, it will be resized).Images should also be no larger than ' . $avatar_max_upload_size / 1024 . 'KBCurrently animated GIFs are not supported.
    </fieldset>
    <br clear="all" />
    <p class="submit">
    <input type="submit" name="cmd_avatar_update" value="Update Profile &raquo;" />

    </form>
    </div>';
    }

    ?>

    #55004
    Trent Adams
    Member

    I will take a look and play around to have it working with the default install again, np!

    Trent

    #1785
    wittmania
    Member

    Version 1.0

    This plugin automatically turns scripture references into links that will take the visitor to BibleGateway.com, where they can view the verse(s). The administrator can set the default version to one of more than a dozen available versions, including ESV, NIV, KJV, NASB, The Message, and so on.

    The links are created dynamically each time a topic is loaded, so the actual text of the post is left alone. This is nice because it allows you to disable/delete the plugin without having to go back through and edit your posts to remove the extra markup.

    This plugin is ideal for forums that are religious/spiritual in nature, as it will save your users a lot of time from having to hard-code links to passages they reference in their posts.

    This plugin is almost entirely based on a similar WordPress plugin that does the same thing to WP posts. You can view the WP plugin here:

    http://dev.wp-plugins.org/wiki/Scripturizer

    You can read more about the plugin, or download the latest version of bb-Scripture-Links, here:

    http://blog.wittmania.com/bb-scripture-links

    You can see a working demo here:

    http://blog.wittmania.com/bbpress/topic/2

    #57219
    cpjolicoeur
    Member

    so, I looked in the bb-templates/kakumei/post-form.php file and it is completely blank???

    is this correct or should there be an edit form in this file?? This is the default theme included in the bbpress installation and i havent edited the file at all

    #57181

    In reply to: custom roles?

    fel64
    Member

    No problem. Are you using the default theme? That should certainly show a changed user title. Have you checked the database to see if it’s there? You would use phpMyAdmin to look into the usermeta table (look for the ID of that particular user).

    #57136
    benbeltran
    Member

    yeah :O it should … li uses display:list-item and uses different properties … like line-height instead of height and it behaves differently in some contexts.

    In some cases using the default display mode it would overlap with other items, but with display:block; it stretches properly

    #56881

    In reply to: Outlet

    fel64
    Member

    In MCE it always assumes the next paragraph to be b-quoted too, unless you specify otherwise. I think it’s default behaviour.

    You could probably modify the Quote plugin so that instead of returning <blockquote> quoted stuff </blockquote> it attached a newline character or two. Something like <blockquote> quoted stuff </blockquote>nn might be enough as a modification, I’m not sure. MCE should interpret the two new lines as a new paragraph, hopefully without blockquotage.

    #56880

    In reply to: Outlet

    AphelionZ
    Participant

    It’s a hard problem to explain – if you go into a thread and quote somebody, it shows up in the MCE as <blockquote> quote </blockquote>

    In the editor, it kind of locks you into blockquote mode – first, the quote is indented, which isnt so much of a problem as it is just a display discrepancy as the quotes aren’t indented in posts..

    however, when you hit return, the next paragraph shows up as a new blockquote and doesnt default back to plain text inside the editor, and you have to hit tinyMCE’s ‘outdent’ button.

    More or less a pain, but one that might get people to stop posting :(

    #57176

    In reply to: Display Username

    fel64
    Member

    <?php echo bb_get_current_user_info( 'name' ); ?>

    Drop that into HTML wherever you want it. :)

    The default theme puts a “Welcome, USER! View your profile (Log out)” at the top left of every page, right where the login box would be otherwise.

    Edit: strange, is the overflow: hidden property gone again?

    #56151
    eddd54
    Member

    Hi,

    i’m having the same problem with my WordPress and bbPress integrated install – (href tags getting stripped and extra slashes getting added)

    See here: https://bbpress.org/forums/topic/641 and here: https://bbpress.org/forums/topic/670

    I’m running:

    WordPress 2.1.3

    bbPress 1.0-alpha

    The 2 fixes worked for me but rather than editing the bb-includes/default-filters.php file.. i put the temporary fixes in a quick bbPress Plugin so that i don’t end up forgetting about the modifications after an upgrade and can now easily deactivate the plugin should this issue get permenantly resolved.

    I put the plugin up online. If you’re interested, you can download it here: http://indyish.googlepages.com/fix-href-slashes.php

    Sam Bauers
    Participant

    Can you create a ticket for this here. You can login with the same user/pass you use on this forum.

    Sjon
    Member

    Hope this is the right place. I just installed the latest svn version on my local pc, and got the forementioned error twice (also with topic_slug field). Running mysql 5.0.

    Patch:

    Index: upgrade-schema.php
    ===================================================================
    --- upgrade-schema.php (revision 805)
    +++ upgrade-schema.php (working copy)
    @@ -4,7 +4,7 @@
    $bb_queries = "CREATE TABLE $bbdb->forums (
    forum_id int(10) NOT NULL auto_increment,
    forum_name varchar(150) NOT NULL default '',
    - forum_slug text NOT NULL default '',
    + forum_slug text NOT NULL,
    forum_desc text NOT NULL,
    forum_parent int(10) NOT NULL default '0',
    forum_order int(10) NOT NULL default '0',
    @@ -31,7 +31,7 @@
    CREATE TABLE $bbdb->topics (
    topic_id bigint(20) NOT NULL auto_increment,
    topic_title varchar(100) NOT NULL default '',
    - topic_slug text NOT NULL default '',
    + topic_slug text NOT NULL,
    topic_poster bigint(20) NOT NULL default '0',
    topic_poster_name varchar(40) NOT NULL default 'Anonymous',
    topic_last_poster bigint(20) NOT NULL default '0',

    Regards,

    #56689

    In reply to: Plugin: Avatar Upload

    fel64
    Member

    Now if only there was a way to display a default image if the user hasn’t uploaded one.

    That’s the point of the identicon jobbie, it assigns everyone a unique and easily distinguishable image when they sign up. :)

    Louisedade, bb_init is called before bb_head I think. In your avatar.php template file it should also be class="bbcrumb" rather than id="breadcrumb", at least if you want the same styling as everything else.

    #56686

    In reply to: Plugin: Avatar Upload

    smurfdude
    Member

    W00t! I’ve figured out how to display the avatar next to comments in wordpress. Though the way I have done it i’m worried it’s going to cause problems.

    Now if only there was a way to display a default image if the user hasn’t uploaded one. Not that it’s a big deal. Thanks :D

    #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!

    #56887
    gtim
    Member

    I doubt that this is the most efficient way, but it seems to work. Add the following code in post.php in the default theme (/bb-templates/kakumei/post.php), you probably want it within the .threadauthor div.

    <?php
    $puser = bb_get_user( get_post_author_id() );
    if ( isset( $puser->from ) ) {
    echo $puser->from;
    }
    ?>

    It is not possible to do this with a plugin yet because there is no hook there, but there is a Trac ticket for it.

    Also, I compiled a list of all template functions.

    #56912
    chrishajer
    Participant

    I’m not worried about fixing it for me. I’m worried about fixing it for every new person who comes along and installs it and has a problem immediately. If the above works, that should be the default and that should be released. Anyone who downloads the latest.tar.gz should not have to edit out anything to fix the bozo problem. The default doesn’t work, so it should be changed until it’s fixed. No patches: a new release.

    #56866
    Trent Adams
    Member

    Have you taken a look at this thread? As well, http://kaespace.com/bbpress/ doesn’t show up for me at all. Is that the correct address? As for the link just having “style.css” in the address, it is because it is referenced off the theme folder and not the root directory. I can’t access your site, so what is your theme as well? The default one?

    Trent

    #56848
    slozano
    Member

    Thank you for the help. I tried the plug in proposed by Tren

    and the solution at https://bbpress.org/forums/topic/988?replies=4#post-6373. Only Charly54’s solution worked (Thank you Charly54), but only partially. The solution works with the default theme (Kakumei). I downloaded Bloody Gray 1.1 by Aditya Naik, removed Tren’s patch-to-URL plugin, Kakumei still works, I can see the preview of “Bloody Gray” in the Admin/presentation page. Once “Bloody Gray” is selected as the theme Firefox 2.0 show nothing and no code. When looking at the same page in IE 7.0 I get `<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>

    <HTML><HEAD>

    <META http-equiv=Content-Type content=”text/html; charset=utf-8″></HEAD>

    <BODY></BODY></HTML>`

    An empty page!. Thank you for you help, I will get another theme and try to understand what is happening, looks like many have struggle with this issue.

    #56865
    minkuei
    Member

    Actually I know I have to make my-templates folder and I do have it.

    But before I put css file in the root, the forum don’t even read the default theme.

    I do try to change it in admin panel, but somwhow it just don’t work.

    #56857

    In reply to: login form wordpress

    fel64
    Member

    To change where the user is redirected, add a hidden field to the login form called redirect_to, with a value of where-ever you want the user to end up (default is in the dashboard).

    #56864
    fel64
    Member

    You have to do it differently. To apply a css file, make a new folder in /bbpress/ called my-templates, open it, make a new folder for your “theme”, and put in your css file called style.css. Now go to the Admin Panel > Presentation and pick your theme.

    Note that you can change the HTML output of files as well. If you do not have a file for a particular page (such as forum.php) bbpress will look for the default file (located in /bbpress/bb-templates/kakumei) and use that instead. If you wish to use a modified file, copy the default into your theme’s folder and change it there.

    #56641

    In reply to: Plugin: BB-Ads

    wittmania
    Member

    UPDATE: The sample ad file now includes the code necessary to display different ads based on the context. For example, if it is a topics page, it will display one ad and if it is a forum page, it will display a different one.

    The code is something like this:

    <?php
    if ( strpos($_SERVER['REQUEST_URI'], 'topic.php') ) { ?>
    <div>An ad for a topics/posts page</div>
    <?php
    } elseif { another specific page;
    } else { default ad;
    } ?>

    The sample file includes elseif checks for topic.php, forum.php, profile.php, and a “default” if none of the above pages are detected.

    This would allow you to have one file per sponsor/advertiser, with a different context-based ad for each situation.

    #56838

    In reply to: Candy!

    fel64
    Member

    I can’t find the Category Patch plugin, sorry. That plugin browser is annoying. >_<

    The statistics are included by default, but not linked to in the default theme. Just go to www.example.com/forums/statistics.php and it’s there. The file for it is in your root forum folder.

Viewing 25 results - 6,526 through 6,550 (of 6,778 total)
Skip to toolbar