Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,326 through 30,350 (of 32,499 total)
  • Author
    Search Results
  • #1807
    andersson
    Participant

    PurposeGames is one of my sites. It’s basically a site for anyone that wants to learn something new in the most efficient way possible; by creating a game around that very subject. It allows for anyone to easily create games and play/rate games by other members. I’ve actionscripted a game engine and a game creation module to allow for anyone to create games via their own pictures and drag and drop.

    I use bbpress for the forum section, and actually liked the user handling so much that I kept the authentication engine for all of the site. I’ve extended it in the following manner:

    – Elaborating on the bozo concept to exclude games created by a bozo, ratings doesn’t count for bozo’s and comments to games by bozos gets treated like forum entries by bozos.

    – Added a vast number of statistics to the dashboard to see what member’s are doing, creating, rating, commenting, forum entries, top lists etc.

    – Extending profile pages to show member’s games, comments to the games created by member etc.

    – Keeping the base of the style of the forum, extending it to fit the way I like my site to look.

    Concepts I like most about bbpress include the sanitize methods (very fast, perfectly implemented in my opinion), the user object; extending it is endless and very easy with the meta-concept, the tags concept, and the bozo concept and of course the table-free layout. The Akismet utilization is very nice also.

    Concepts that I’ve excluded or re-written: Db-connection open/close (not optimized for my type of site), the plugin concept (my extensions are therefore “include”-based i.e. I’m not utilizing the various hooks available). I have not cluttered the code of any standard files with my code, other than adding an include statement where needed. I also had to re-route the “include header”-call of the admin panel to be able to add new parent sections to keep child sections. No biggie really but quite strange.

    I rate bbpress as 4 out of 5 as code architecture goes being able to extend it and to use it as authentication foundation. Near superb. As forums goes, it falls into the category of “less is more, but not enough” ;)

    Check my way of using bbpress at http://www.purposegames.com

    Feel free to comment on what you like and don’t like. Thanks.

    David Andersson

    Creator of purposegames.com

    #57302

    In reply to: Plugin: bb-Topic-Views

    Sam Bauers
    Participant

    Change:

    function get_view_count( $topic_id )
    {
    $view_count = $bbdb->get_var("SELECT meta_value FROM $bbdb->topicmeta WHERE topic_id = $topic_id AND meta_key='views'");

    To:

    function get_view_count( $topic_id )
    {
    global $bbdb, $topic;

    $view_count = $bbdb->get_var("SELECT meta_value FROM $bbdb->topicmeta WHERE topic_id = $topic_id AND meta_key='views'");

    ????

    #57300

    In reply to: Plugin: bb-Topic-Views

    fel64
    Member

    All I did was split display_view_count() into two functions, display_view_count() and get_view_count(). If for example you wanted the views in a seperate column, you’d add the column HTML and then add

    <?php $view_count = get_view_count(); echo $view_count; ?>

    This is what I replaced display_view_count( $title ) with, here for Smurf’s convenience. You’re about to get mail.

    Oh, before I forget – hopefully now that plugins need activation in 1.0-alpha, there’s also an activation hook or the like. That would let you do a lot of preparation first, making the code much easier. :)

    Edit: there is! bb_activate_plugin_XXX. Maybe you can use that – if you want to and figure it out, tell us/make an entry on the wiki. :)

    function display_view_count ($title)
    {
    global $bbdb, $topic;
    $topic_id = $topic->topic_id;

    $view_count = get_view_count( $topic_id );

    //Builds the text to be appended to the title
    $count_display = " <em>($view_count views)</em>"; //This sets the view count var to the existing number of views, if greater than 0
    //Makes this plugin play nice with the Page Links plugin by putting the pages (if they exist) on a new line
    if (function_exists('page_links_add_links')) {
    $count_display .= "n";
    }
    $title .= $count_display;

    return $title;
    }

    function get_view_count( $topic_id )
    {
    $view_count = $bbdb->get_var("SELECT meta_value FROM $bbdb->topicmeta WHERE topic_id = $topic_id AND meta_key='views'");

    if ( $view_count <= 0 ) {
    //If the view count hasn't been initialized...
    if ($topic->topic_posts >= 1) {
    /* Sets the new record to the number of posts that have been made in a topic */
    $view_count = $topic->topic_posts; //sets the view_count number
    } else {
    $view_count = 0; //can't think of a time when this would be necessary (phantom topics???)
    }

    //Adds the record to the DB so it isn't zero any longer
    $bbdb->query("INSERT INTO $bbdb->topicmeta ( meta_id, topic_id, meta_key, meta_value) VALUES ( NULL , $topic_id, 'views', $view_count )");
    }

    return $view_count;
    }

    #57299

    In reply to: Plugin: bb-Topic-Views

    wittmania
    Member

    @fel, Hack away… I’d be interested in seeing the code so I could incorporate it in the next version of the plugin. If you’re willing, please e-mail it to me at mike at wittmania dot com.

    Thanks!

    #57298

    In reply to: Plugin: bb-Topic-Views

    fel64
    Member

    Wittmania, it’s a really easy hack – in fact, if you simply take the code that gets the pageviews and seperate it into a different function, you could call that both from the current function you have to automatically append it and use it as a template tag. If you don’t fancy doing it, is it alright if I quickly hack it for Smurf?

    #57297

    In reply to: Plugin: bb-Topic-Views

    wittmania
    Member

    @Sam, I use your excellent Page Links plugin, and I wrote mine specifically to be compatible with yours. In fact, I wouldn’t have known what filter to use if it weren’t for your plugin.

    I set the priority of my filter as 99 (yours is set to 100), so it fires directly before yours. Also, my plugin checks to see if the page_links_add_links function exists, and if it does it automatically drops the page links to a new line below the title in order to make things a little more sightly.

    @smurfdude, I thought about that, too. I initially decided against that route so I could have it function without having to edit any template files. The way it works right now is that it is inserted with a filter that is triggered when (and where) the topic title is fed to the page. If you’re feeling really ambitious, you can go into bb-topic-views.php to see how the mechanics of the plugin work. From there, you could change some things around so you could put the views count in its own column. Eventually I may add that functionality within the plugin, but that’s not a high priority right now.

    Speaking of priorities, the next to-do on my list is to add functionality where a user can add a template tag that will display the top 5 (or 10, or whatever) most viewed posts, either as <li> items so you can use it anywhere, or in a format similar to the way the Latest Discussion area is laid out. Stay tuned…

    #57273

    In reply to: Profile Tabs

    fel64
    Member

    Should really have been more familiar with the code – there’s a check to see if it’s the correct file, otherwise it simply redirects to the front page. Getting rid of that made it work.

    Thanks for all your help, Sam! :D

    #57272

    In reply to: Profile Tabs

    Sam Bauers
    Participant

    I tested the second method on the latest build and it passes the bb_repermalink tests and loads.

    I tried using standard URLs and both types of permalinks.

    I didn’t try to load a template. I used a file called avatar-upload.php containing the following:

    <?php
    require_once('./bb-load.php');

    bb_repermalink(); // The magic happens here.

    echo 'test';
    ?>

    My test plugin contained:

    <?php
    /*
    Plugin Name: Test for fel64
    Plugin URI:
    Description: Test profile tab addition
    Author: Scooby Doo
    Version: 0.0.1
    Author URI:
    */

    $bb->debug = 1;

    function felavatartab()
    {
    add_profile_tab(__('Avatar'), 'edit_profile', 'moderate', 'avatar-upload.php');
    }

    add_action( 'bb_profile_menu', 'felavatartab' );
    ?>

    #56963
    Vili
    Participant

    Indeed, would save some work. :)

    #57271

    In reply to: Profile Tabs

    fel64
    Member

    Cheers Sam, that’s definitely the way to do it, but I can’t quite make it work. Adding the tab is easy, but following the link dumps you on the front page (if using add_profile_tab()) or in your profile (if adding the tab manually).

    function felavatartab()
    {
    global $profile_menu, $profile_hooks;
    $profile_tab = array(__('Avatar'), 'edit_profile', 'moderate', 'avatar-upload.php', 'avatar');
    $profile_menu[] = $profile_tab;
    if ( can_access_tab( $profile_tab, bb_get_current_user_info( 'id' ), $user_id ) )
    $profile_hooks[bb_tag_sanitize($profile_tab[4])] = $profile_tab[3];
    }
    add_action( 'bb_profile_menu', 'felavatartab' );

    OR

    function felavatartab()
    {
    add_profile_tab(__('Avatar'), 'edit_profile', 'moderate', 'avatar-upload.php');
    }
    add_action( 'bb_profile_menu', 'felavatartab' );

    I’ve got the file avatar-upload.php in my root directory, which loads the template avatar.php. If instead you give avatar.php as your argument the tab doesn’t show up at all.

    See it here. Any idea?

    #57294
    fel64
    Member

    Depending on if you’ve set up bbPress so that it’s not only integrated but also uses WordPress’s functions when available, I think you can just call the WP function. If it doesn’t work, you need to make a database query along the lines of:

    global $bbdb;
    $profiledata = $bbdb->get_row( "SELECT meta_value FROM $bbdb->usermeta WHERE meta_key = $theprofiledetail AND user_id = $theuserid");

    Where $theuserid and $theprofiledetail are set to whatever you want. Note that $profiledata is worth examining by using print_r($profiledata); or the like, because its format can be confusing. The code might not work, but it’s an idea.

    #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>';
    }

    ?>

    #1805
    wittmania
    Member

    bb-Topic-Views keeps track of how many times each topic has been viewed, and then displays the count alongside the title of the topic on the front page, on forums pages, and on tags pages.

    The plugin is written in such a way that it does not double-count views when a visitor browses to a different page in the same topic. If no view count record exists for a specific topic, the plugin will create a record for it. Rather than setting the initial view count to zero, the plugin sets it to the number of posts in the topic, because it has obviously been viewed at least as many times as people have posted in it! This is especially nice for adding the plugin to existing bbpress forums so the view count isn’t zero for every single topic.

    You can download it here: http://blog.wittmania.com/bb-topic-views

    You can see it in action here: http://blog.wittmania.com/bbpress

    By the way, I’ve only tested this plugin in browser environments where cookies were enabled. This plugin doesn’t set any cookies (directly, anyway), but it does use session variables which are usually passed as cookies. So, if anyone runs into any bugs, please let me know!

    I’m also very open to suggestions as to how I could streamline or improve the code. Thanks!

    #1793
    wittmania
    Member

    I am working on a “Topic Views Count” plugin, and I’m just about finished with it. You can see a working version of it here: http://blog.wittmania.com/bbpress/, and see the source code as it is right now here: http://blog.wittmania.com/files/bb-topic-views.txt

    The only thing holding me up is this; I can’t figure out a way to keep the views count from including page views. For example, when page one of a topic loads, the view count will go up by one. But, when page two loads it will also go up by one. So, a visitor has only viewed the topic once (albeit they’ve viewed more than one page), but the counter has registered two views).

    I know this isn’t a huge deal, and a counter that over-counts is better than no counter at all. Still, I was wondering if anyone would have any ideas. I’d like to avoid using cookies, if possible, because I have no experience with them at all to even know where to start.

    Any ideas? I’m also open to any other ideas or suggestions for the rest of the code.

    Thanks!

    #57228
    fel64
    Member

    Cheers!

    Further hack here, to migrate any comments made to WP posts that have a corresponding bb topic (via the bbPress Post plugin again) as replies to the thread. Unfortunately the date/time won’t be right, it’ll be like a new post just made.

    This needs to be installed/activated as a plugin to work, and to prevent it somehow accidentally happening again I suggest you immediately uninstall it. To run it, simply append “?lulz=p” to a URL and it’ll get to work – make sure you only do this once! An interface would be a lot neater, but, well, meh.

    At your own risk.

    <?php
    /*
    Plugin Name: Comments migrate
    Plugin URI:
    Description: moves wp comments into bb posts.
    Author: fel64
    Version: 0.7
    Author URI: http://www.loinhead.net/
    */
    function felmigrate()
    {
    global $bbdb, $bb_table_prefix;
    //foreach blogpost/topic in wp_bbpress_post_posts
    $bridge = $bbdb->get_results( ' SELECT post_id, topic_id
    FROM wp_bbpress_post_posts', ARRAY_A );
    foreach( $bridge as $sumthing => $link )
    {
    //foreach comment
    $wppost = $link['post_id'];
    $bbtopic = $link['topic_id'];
    $felcoms = $bbdb->get_results( " SELECT comment_author, comment_date, comment_content, comment_author_IP
    FROM wp_comments
    WHERE comment_post_ID = $wppost" );
    if( $felcoms )
    {
    foreach( $felcoms as $sumthing => $felcom )
    {
    //if valid user
    $felu = bb_get_user_by_name( $felcom->comment_author );
    if( $felu )
    {
    //create new post in that thread with said details
    fel_new_post( $bbtopic, $felcom, $felu->ID );
    }
    }
    }
    }
    //party
    }
    function fel_new_post( $topic_id, $post_details, $felID ) {
    global $bbdb, $bb_cache, $bb_table_prefix, $thread_ids_cache;
    $topic_id = (int) $topic_id;

    $bb_post = $post_details->comment_content;
    //$bb_post = apply_filters('pre_post', $bb_post, false, $topic_id);
    $bb_post = htmlspecialchars( $bb_post, ENT_QUOTES );
    $post_status = 0;
    $now = bb_current_time('mysql');
    //$now = $post_details->comment_date;
    $uid = $felID;
    $uname = $post_details->comment_author;
    $ip = $post_details->comment_author_IP;

    $topic = get_topic( $topic_id );
    $forum_id = $topic->forum_id;

    if ( $bb_post && $topic ) {
    $topic_posts = ( 0 == $post_status ) ? $topic->topic_posts + 1 : $topic->topic_posts;
    $bbdb->query("INSERT INTO $bbdb->posts
    (forum_id, topic_id, poster_id, post_text, post_time, poster_ip, post_status, post_position)
    VALUES
    ('$forum_id', '$topic_id', '$uid', '$bb_post','$now', '$ip', '$post_status', $topic_posts)");
    $post_id = $bbdb->insert_id;
    if ( 0 == $post_status ) {
    $bbdb->query("UPDATE $bbdb->forums SET posts = posts + 1 WHERE forum_id = $topic->forum_id");

    /* if( $now < $topic->topic_time )
    {
    $now = $topic->topic_time;
    $uid = $topic->topic_last_poster;
    $uname = $topic->topic_last_poster_name;
    $post_id = $topic->topic_last_post_id;
    }
    */ $bbdb->query("UPDATE $bbdb->topics SET topic_time = '$now', topic_last_poster = '$uid', topic_last_poster_name = '$uname',
    topic_last_post_id = '$post_id', topic_posts = '$topic_posts' WHERE topic_id = '$topic_id'");
    if ( isset($thread_ids_cache[$topic_id]) ) {
    $thread_ids_cache[$topic_id]['post'][] = $post_id;
    $thread_ids_cache[$topic_id]['poster'][] = $uid;
    }
    $post_ids = get_thread_post_ids( $topic_id );
    if ( !in_array($uid, array_slice($post_ids['poster'], 0, -1)) )
    bb_update_usermeta( $uid, $bb_table_prefix . 'topics_replied', $bb_current_user->data->topics_replied + 1 );
    } else
    bb_update_topicmeta( $topic->topic_id, 'deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts + 1 : 1 );
    if ( !bb_current_user_can('throttle') )
    bb_update_usermeta( $uid, 'last_posted', time() );
    $bb_cache->flush_one( 'topic', $topic_id );
    $bb_cache->flush_many( 'thread', $topic_id );
    $bb_cache->flush_many( 'forum', $forum_id );
    do_action('bb_new_post', $post_id);
    return $post_id;
    } else {
    return false;
    }
    }

    //plunge
    if( $_GET['lulz'] = 'p' )
    felmigrate();
    ?>

    #57283
    Trent Adams
    Member

    Sorry, I was just trigger happy….force of habit….;)

    Trent

    #57282
    fel64
    Member

    I’m glad these still are a pretty place. :)

    I don’t know, closing it isn’t going to save his feelings; although closing it would be appropriate if it looks like a fight. It’s a matter of opinion I guess. Yup, clear as mud!

    #57227
    Trent Adams
    Member

    I just noticed this thread fel64! Brilliant! The code above should be edited correctly now!

    Trent

    #57281
    Trent Adams
    Member

    I don’t mind if you go into this, no. A topic with a username referenced as a bozo is asking for problems if that user is not indeed a spammer. Forums sometimes are not a ‘pretty’ place and this is definetely the case over at wordpress.com. Ultimately, it is mdawaffe, Matt or I that has to deal with the issues in these forums and we all look at the modlook tag, so it is easier for us to be alerted to these disucssions when we don’t have a chance to read “all” threads.

    It seems that you and Sam were most likely 100% right that the user may be at fault here, but realize that if you are not right on this one it can cause someone hard feelings. Discussion is obviously a great thing and encouraged and closing the thread, while premature, is damage control. Clear as mud? :)

    #57279
    Trent Adams
    Member

    Sam I never read the entire blog and didn’t realize that is was a link farm site. There is no bot that posts personal replies even if they sometimes seem out of place and in my experience there are sometimes comments that are made that are irrelevant, but not in vain. This might not be that case though if they were trolling for links.

    @fel64, I locked the thread because if the user is not a bozo, there is no need for further flaming and the disucssion should be over. In this case they most likely were a bozo and I appreciate you and Sam for bringing this up and using the modlook tag ;)

    Trent

    #1803

    Topic: MathML and BBpress

    in forum Plugins
    dprice
    Member

    Ok, I’ve been poking around the forums, found out how to get new allowed tags (thanks to Louise Dade + others) and now want to add MathML tag support, so users can post MathML.

    A big problem is that the editor box seems to add line break <br /> tags to every line – how do you turn this off?

    The array I’m using in the plugin is:

    `$tags = array(

    // XHTML elements:

    'a' => array(

    'href' => array(),

    'hreflang' => array(),

    'title' => array(),

    'rel' => array(),

    'xml:lang' => array()),

    'abbr' => array('title' => array()),

    'acronym' => array('title' => array()),

    'b' => array(),

    'bdo' => array(

    'dir' => array(),

    'xml:lang' => array()),

    'blockquote' => array('cite' => array()),

    'br' => array(),

    'code' => array(),

    // 'del' => array('datetime' => array()),

    'dd' => array(),

    'dl' => array(),

    'div' => array(

    'dir' => array(),

    'xml:lang' => array()),

    'dt' => array(),

    'em' => array(),

    'i' => array(

    'dir' => array(),

    'xml:lang' => array()),

    // 'ins' => array('datetime' => array(), 'cite' => array()),

    'li' => array(),

    'ol' => array(),

    'p' => array(),

    'pre' => array(),

    // 'q' => array(),

    // 'strike' => array(),

    'span' => array(

    'dir' => array(),

    'xml:lang' => array()),

    'strong' => array(),

    'sub' => array(),

    'sup' => array(),

    'u' => array(),

    'ul' => array(),

    // MathML elements:

    'math' => array(

    'xmlns' => array(),

    'mode' => array()),

    'mo' => array(

    'lspace' => array(),

    'rspace' => array(),

    'fence' => array(),

    'separator' => array()),

    'mi' => array('mathvariant' => array()),

    'msub' => array(),

    'msup' => array(),

    'msubsup' => array(),

    'mfrac' => array('linethickness' => array()),

    'mn' => array(),

    'mstyle' => array(

    'scriptlevel' => array(),

    'fontstyle' => array(),

    'fontweight' => array(),

    'mathvariant' => array(),

    'displaystyle' => array()),

    'mtext' => array(),

    'mspace' => array(

    'width' => array(),

    'height' => array(),

    'depth' => array()),

    'msqrt' => array(),

    'mmultiscripts' => array(),

    'mprescripts' => array(),

    'none' => array(),

    'mroot' => array(),

    'mphantom' => array(),

    'merror' => array(),

    'mover' => array(),

    'munder' => array(),

    'munderover' => array(),

    'maction' => array(

    'actiontype' => array(),

    'other' => array(),

    'selection' => array()),

    'mtable' => array(

    'align' => array(),

    'columnalign' => array(),

    'rowalign' => array(),

    'equalrows' => array(),

    'equalcolumns' => array(),

    'columnspacing' => array(),

    'rowspacing' => array(),

    'columnlines' => array(),

    'rowlines' => array(),

    'frame' => array()),

    'mrow' => array(

    'xlink:type' => array(),

    'xlink:show' => array(),

    'xlink:href' => array()),

    'mtr' => array(

    'rowalign' => array(),

    'columnalign' => array()),

    'mtd' => array(

    'rowspan' => array(),

    'columnspan' => array(),

    'rowalign' => array(),

    'columnalign' => array()),

    'mpadded' => array('width' => array())

    );

    return $tags;

    }`

    If anyone’s interested, you can find install at http://www.thetelegraphic.com/bbpress/bbpress/ (for now, once it’s fully working it’ll go to a dedicated domain).

    #57285

    In reply to: LaTex support

    fel64
    Member

    No idea. My advice would be to find a wordpress plugin and just modify it – there probably won’t be much to do – into a bb plugin. It’s worth a try. :)

    #57278
    fel64
    Member

    Yeah. The way I see it, bozo is anyone you don’t want posting – spammer, serial troll or bot – anyway, so I wouldn’t mind marking him that way.

    Trent, do you have to lock the thread? Either the discussion is over, in which case no-one will post anyway, or it’s not and you just stopped it. :/

    #57253
    lokem001
    Member

    Thanks Trent, but that link gave me nothing :(

    Fel64, I don’t really get what you mean with “live Windows server”… anyhow it’s a WindowsXP server, Apache 2.2, PHP5, latest MySQL – all installed on a personal LAN server.

    And the Apache/PHP installation works fine with some other simple PHP applications.

    I also tried to copy an older installation of bbpress that worked fine on a previous WinXP/Apache server, but due to a disk failure I had to format the drive and re-install everything.

    However, that older bbpress turned out with the exact problem (blank page) and the same line Apache’s error.log…

    My guess is something’s wrong with my Apache/PHP installation.

    Thx,

    lokem

    #55003
    spencerp
    Member

    YES! Awesome! Thanks a million Trent! :D You’re awesome! ;) :D I gotta find it now, I think it’s on a CD some where LOL. When I find it, I’ll send it your way. :) ;)

    Side note: It was coded with the Forum Category hack/adjustments made though.. so.. just a for-warning. ;) It shouldn’t be that hard to start on fresh bbPress code though. :) I just don’t have the time to do it sigh. :(

    And maybe even some “plugin code” are in it as well lol! I think your’s and Josh’s. Hmm.. You’ll see what I mean then. ;)

    spencerp

Viewing 25 results - 30,326 through 30,350 (of 32,499 total)
Skip to toolbar