Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'test'

Viewing 25 results - 10,751 through 10,775 (of 11,584 total)
  • Author
    Search Results
  • #59531
    Sam Bauers
    Participant

    You should be aware that views are registered differently in the latest versions in trunk. Views are now constructed using the BB_Query class.

    See the latest Support Forum plugin for a way to use both the new and old, although it is wrapped in a Class in there so the basic idea is:

    if (is_callable('bb_register_view')) { // Build 876+
    $query = <SOME ARRAY ACCEPTABLE TO BB_QUERY>;
    bb_register_view('myview', __('My view name'), $query);
    } else { // Build 214-875
    add_filter('bb_views', 'my_addView');
    add_action('bb_custom_view', 'my_processView');
    }

    #59030
    _ck_
    Participant

    Oh figured out how to fix the moderator’s profile, very easy to do when using my additional function – just attached more “where filters”:

    function private_forums_filter_private($where,$prefix=''){
    if (function_exists("private_forums_custom_get_options")) {
    $private_forums = private_forums_custom_get_options('private_forums');
    foreach($private_forums as $forum => $role) {
    if(!private_forums_check_user_access_to_forum($role)) {
    $where.=" AND ".$prefix."forum_id != ".$forum." ";
    }
    }
    }
    return $where;
    }
    add_filter( 'get_latest_topics_where', 'private_forums_filter_private');
    add_filter( 'get_latest_posts_where', 'private_forums_filter_private');
    add_filter( 'get_recent_user_replies_where', 'private_forums_filter_private');
    add_filter( 'get_recent_user_threads_where', 'private_forums_filter_private');

    #59528
    _ck_
    Participant

    I haven’t seen them (doesn’t mean it doesnt exist) but I’ve figured out the framework on how to build and attach a view if you’d like to copy my homework :D

    This is the code I whipped up for “most-views” and “least-views” (which requires the view count plugin to be installed (and inserting the views column in view.php)

    function most_views_views( $views ) {
    global $views;
    $views['most-views'] = 'Topics with the most views';
    return $views;
    }
    add_filter('bb_views', 'most_views_views');

    function least_views_views( $views ) {
    global $views;
    $views['least-views'] = 'Topics with the least views';
    return $views;
    }
    add_filter('bb_views', 'least_views_views');

    function most_views( $view ) {
    global $bbdb, $topics, $view_count;
    if ($view=='most-views') {$sort="DESC";}
    if ($view=='least-views') {$sort="ASC";}
    if ($view=='least-views' || $view=='most-views') {
    $limit = bb_get_option('page_topics');
    $where = apply_filters('get_latest_topics_where','');
    $most_views = $bbdb->get_results("SELECT topic_id FROM $bbdb->topicmeta WHERE meta_key='views' ORDER BY cast(meta_value as UNSIGNED) $sort LIMIT $limit");
    foreach (array_keys($most_views) as $i) {$trans[$most_views[$i]->topic_id] =& $most_views[$i];} $ids = join(',', array_keys($trans));
    $topics ="SELECT * FROM $bbdb->topics WHERE topic_status=0 AND topic_id IN ($ids) $where ORDER BY FIELD(topic_id, $ids)";
    $topics = $bbdb->get_results($topics);
    $view_count = count($topics);
    $topics = bb_append_meta( $topics, 'topic' );
    }
    else {do_action( 'bb_custom_view', $view );}
    }
    add_action( 'bb_custom_view', 'most_views' );

    As you can see a new view requires both 1. an action 2. a filter

    Easy once you’ve seen it, but try figuring it out from scratch!

    This bit adds the title to view pages (missing by default in bbpress)

    function bb_get_view_title($title) {
    if (is_view()) {$title = get_view_name(). ' &laquo; ' . bb_get_option( 'name' ); }
    return $title;
    }
    add_filter( 'bb_get_title', 'bb_get_view_title' );

    #59475
    Sam Bauers
    Participant

    This is fixed in the latest trunk. I believe, the WordPress tag closing function has been moved across to bbPress.

    #51572
    outchy
    Member

    ok cool, thank you. it’s doing something so that’s good :)

    this is what i’m using:

    <?php
    $latestpost = $bbdb->get_row("
    SELECT *
    FROM $bbdb->posts
    WHERE post_status = 0
    LIMIT 1
    ");
    ?>

    <?php echo $latestpost->post_text; ?>

    it’s displaying the first post from forum 3 for some reason, not the most recent post. i’ve posted a few new posts since then in other forums and it never changes on the front page, it still shows that first post from that forum 3. any idea how come?

    (thanks for your help on this)

    #51571
    fel64
    Member

    Sure that’s possible. :)

    You want a query that gives you the last post. Forget anything messing around with the forum or the topic. You want the last post, right?

    There’s no API function to do this AFAIK, so you will have to use a query. I think the structure could go something like this:

    $latestpost = $bbdb->get_row("
    SELECT *
    FROM $bbdb->posts
    WHERE post_status = 0
    LIMIT 1
    ");

    And then $latestpost has $latestpost->post_text, poster_id and so on. But unfortunately not filtered, so you’d need to apply all those. Which is a bit nasty.

    But this is all unchecked and unresearched, you’ll need to play around with it. :P All this is is a bare start.

    #51569
    fel64
    Member

    $forum_one_topics is not an array which is why it’s failing (although I’m surprised it’s not).

    Do you actually want the 1 latest topic from forum 1? Then use $bbdb->get_row() instead of get_results() and stop treating it as an array (basically, just take out the foreach part since you don’t have several, and replace $topic with $forum_one_topics).

    If you want all the topics from forum one, then take out the LIMIT 0, 1 bit from the query which as I understand it would give you only one result.

    Also, you have some malformed HTML just under span gray.

    #59520

    In reply to: subforums and markup

    fel64
    Member

    fel64, the string is internal to bbpress, not the template loop.

    Fair enough, shoulda checked that. So I went and looked through the code, you know, to find the problem. bb has quite an interesting structure there. Couldn’t find the problem, though, so I looked at the code in the .8.2.1 version and it’s missing a bit.

    It’s fixed in trunk. Claire, upgrade to the latest version and it’ll work just fine.

    #51568
    outchy
    Member

    sure, here is line 13:

    foreach($forum_one_topics as $topic) :

    and here is the surrounding stuff:

    <h2><?php _e('Latest Post'); ?></h2>

    <?php
    $forum_id = 1;
    $forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,1") ?>
    <?php
    foreach($forum_one_topics as $topic) :
    $forum_one_topic_posts = get_thread( $topic->topic_id); ?>
    Re: <a>"><?php topic_title(); ?></a>

    <span class="gray">
    <a>">
    <?php echo $topic->topic_last_poster_name; ?></a> said:</span> <span class="justify"><?php echo $forum_one_topic_posts[0]->post_text;
    endforeach;
    ?></span>

    #59511

    In reply to: subforums and markup

    _ck_
    Participant

    If you mean so topics in sub-forums do not show up on “latest discussions” I whipped this up to solve that:

    function filter_front_page_topics($where){
    // $exclude_forums=array ("8"); // enable this to manually specify specific forums by id #
    $forums = get_forums(); foreach ($forums as $forum) {if ($forum->forum_parent) {$exclude_forums[]=$forum->forum_id;}} // exclude ALL sub-forums
    if ( is_front()) {foreach($exclude_forums as $forum) { $where.=" AND forum_id != ".$forum." "; }}
    return $where;
    }
    add_filter( 'get_latest_topics_where', 'filter_front_page_topics');
    add_filter( 'get_latest_posts_where', 'filter_front_page_topics');

    #2178
    refueled
    Member

    I am working on a new theme and would like your opinions/suggestions:

    http://test.refueled.net/forum/

    Once its done I will be releasing it.

    Thanks in advanced.

    nate.

    #52657
    _ck_
    Participant

    Okay I have a working prototype.

    Who wants to beta test?

    http://ckon.wordpress.com/2007/07/28/new-plugin-bbpress-signatures/

    Okee well just let me know.

    Not responsible for any melted servers or sudden calls from the voyager probe.

    #51562
    fel64
    Member

    I don’t know off the top of my head. What I’d do in this case, as for pretty much every question that’s asked, is open my copy of bbPress and look around in the files. So that sort of thing sounds like a template tag, so I’d look at bb-includes/template-functions.php, then search for “profile_link” or a couple other similar terms if I couldn’t find it.

    This time I tested it and searching for “profile_link” will pretty quickly get you the function you want. But finding out what you need is something you can pretty easily do yourself most of the time. :)

    (Not that there’s a problem with you asking anything, this is just teach-a-man-to-fish thinkin’.)

    #2170
    LMD
    Participant

    There appears to be a problem with the SVN for plugins.

    I’ve had a user who downloaded the latest version of Avatar Upload, only to find the contents of sub-folders to be empty — even though the files are present in the repository when I browsed source in Trac (in both the Trunk AND latest Tag). Somehow they are missing in the automated ZIP download.

    The file structure is:

    trunk/ (and also 'tags/0.7/')
    additional-files/
    avatars/ (contents missing in the ZIP)
    my-templates/ (ditto)
    .

    Is this a one-off blip or is it a bug? Either way, can it be fixed?

    #49631

    In reply to: Emoticons For bbPress?

    mazdakam
    Member

    Please stop pasting huge chunks of code on the forums. Use something like http://pastebin.ca/.

    ok i will do

    listen i want to tell you somthing important :) i downloaded bbEmoticons-0.72 and unpacked it and then send it to my plugin then i go to my admin and try to active it but it show fattal error my bbpress is .8.2.1

    so i tried to download 6th and every time it didnt active!

    now i come and copy the code form here and open new file in php and save it then try to upload it and active it :O

    it get active and work! what is wrong?

    do you test bbEmoticons-0.72 from the original download address i think there is somthing wrong in the original file

    please try it once for me :)

    #2166
    ericender
    Member

    The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    Hi all, I’m not able to get bbPress working. [Firefox, IE, Safari, Opera] can’t show the pages linked from the index page. I’m testing bbPress for use in a University setting.

    The site is here: http://www2.csulb.edu/misc/sandbox/board/

    A test installation.

    Things you might need to know before giving me a solution:

    PHP 4.4.1, MySQL 5

    Apache 1.3.3.7

    The directory it is residing in is a virtual directory.

    mod_rewrite is enabled

    I tried both true/false for $bb->mod_rewrite

    What else do you need to know? Please help.

    #59417
    _ck_
    Participant

    And a report post plugin is born – tested working!

    Needs a few features but gets the job done for now:

    <?php
    /*
    Plugin Name: report post
    Description: allows members to report a post to admin/moderators
    Plugin URI: http://CKon.wordpress.com
    Author: _ck_
    Author URI: http://CKon.wordpress.com
    Version: 0.1
    */

    /*
    instructions: install, activate and put <? report_post_link(); ?> in your post.php template where you want the link to be seen
    optional in stylesheet: a.report_post {color:red;}

    todo:
    1. don't let them report more than once on a post - or more than too many times per minute/hour
    2. auto-delete post if more than x reports from different members
    3. auto-post report into a specified moderator's forum #
    4. maybe ajax xmlhttp call instead of real form post so there's no page movement
    5. it's technically possible to alert a browing mod with a popup directing to the reported post, no email needed
    */

    function report_post_link($post_id=0) {
    if (bb_current_user_can('participate') ) :
    $post_id= get_post_id( $post_id );
    if (get_post_author_id($post_id) != bb_get_current_user_info( 'id' )) {
    echo '<a class=report_post title="report post to moderator" href="#post-'.$post_id.'" onClick="report_post('.$post_id.');return false;">Report</a>';
    }
    endif;
    }

    function report_post_form() {
    if (bb_current_user_can('participate')) :
    if (isset($_POST['report_post_id']) && isset($_POST['report_post_reason'])) {
    echo '<scr'.'ipt type="text/javascript">alert("Thank you for the report. A moderator has been notified.");</scr'.'ipt>';
    $post_id=intval($_POST['report_post_id']);
    // todo: custom response if invalid id, problem sending email - maybe flush output buffer so member gets alert faster
    $to = bb_get_option('admin_email');
    $subject = " reported post by member for moderation";
    $headers = "From: ".bb_get_option('admin_email');
    $message ="report by: ".bb_get_current_user_info( 'name' )." (".bb_get_current_user_info( 'id' ).") email: ".bb_get_current_user_info( 'email' )."rnrn";
    $message.="report: ".wordwrap(strip_tags(substr($_POST['report_post_reason'],0,255)),70)."rnrn".get_post_link($post_id)."rn";
    $message.="post by: ". get_post_author($post_id)."rn"; // add "member since", total posts, blah blah
    $message.="rnrnReport Trace:rn";
    $message.="IP: ".$_SERVER['REMOTE_ADDR']."rn";
    $message.="Host: ".gethostbyaddr($_SERVER['REMOTE_ADDR'])."rn"; // useful but can add a few seconds
    $message.="Agent: ".$_SERVER['HTTP_USER_AGENT']."rn";
    $message.="Refer: ". $_REQUEST['refer']."rn";
    $message.="URL: http://".$_SERVER['HTTP_HOST'].$GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]."rn";
    mail( $to, $subject, $message,$headers);
    }
    echo '<form method="POST" name="report_post_form" id="report_post_form" style="display:none;visibility:hidden"><input type=hidden name="report_post_id"><input type=hidden name="report_post_reason"></form>';
    echo '<scr'.'ipt type="text/javascript">
    function report_post(post_id) {
    var report_post_reason = prompt("Please enter a short but descriptive reason why a moderator needs to review this post:", "");
    if (report_post_reason && report_post_reason.length>9) {
    document.report_post_form.report_post_id.value=post_id;
    document.report_post_form.action="#post-"+post_id;
    document.report_post_form.report_post_reason.value=report_post_reason;
    document.report_post_form.submit();
    } else {alert("report cancelled, incomplete description"); }
    }
    </scr'.'ipt>';
    endif;
    }
    add_action('bb_foot', 'report_post_form');

    ?>

    #2162
    yulaw
    Member

    Hello,

    I have this nifty USB Webserver (which I can run on the computer too from hard disk), to try out forums, blogs, and more.

    Now I stumbled across this BBPRESS, and this looked exactly like the thing I need!

    However! for some reason I can’t install it, and I have been searching through the forums allready, but i don’t have a lot of time today to search through the forums for hours.

    So here’s my problem, I get the dreafull “can’t select DB” error.

    I have no password on my mysql, as its just an standallone webserver which only I, the one behind this laptop, can access, and so it does not require a password.

    To access my webserver by a browser, I type in “http://localhost:8080&#8221;, it uses port 8080 to make sure it doesn’t conflict with 80.

    Anyways, i’ve read a lot of sollutions on how to correct the problem, but for some reason I just can’t seem to solve this! maybe i’m wanting to go too fast, or perhaps I just overlook one tiny thing.

    But its getting a little annoying after a few hours.

    So that’s why I need help.

    This is the first part of config.php which I needed to fill in.

    <?php

    // ** MySQL settings ** //

    define(‘BBDB_NAME’, ‘bbpress’); // The name of the database

    define(‘BBDB_USER’, ‘root’); // Your MySQL username

    define(‘BBDB_PASSWORD’, ”); // …and password

    define(‘BBDB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    // Change the prefix if you want to have multiple forums in a single database.

    $bb_table_prefix = ‘bb_’; // Only letters, numbers and underscores please!

    // The full URL of your bbPress install

    $bb->uri = ‘http://localhost:8080/bbpress&#8217;;

    // What are you going to call me?

    $bb->name = ‘Test website’;

    // This must be set before you run the install script.

    $bb->admin_email = ‘enigmatic@live.nl’;

    // Set to true if you want pretty permalinks, set to ‘slugs’ if you want to use slug based pretty permalinks.

    $bb->mod_rewrite = false;

    // The number of topics that show on each page.

    $bb->page_topics = 30;

    // A user can edit a post for this many minutes after submitting.

    $bb->edit_lock = 60;

    // Your timezone offset. Example: -7 for Pacific Daylight Time.

    $bb->gmt_offset = 0;

    So with “define(‘BBDB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value”, I allready changed it a few times to “bbpress.localhost” or “localost.bbpress” as said in another topic, I tried a lot of things, but to no avail.

    I seriously need help, before i’m going to cry :'(

    I kid I kid, but help is apreciated.

    #56738

    In reply to: Plugin: Avatar Upload

    Sam Bauers
    Participant

    > Using the latest version of your plugin, I tried installing the new version of Avatar Uplaod, but it still wouldn’t read the additional-files directory.

    If you don’t have the CURL library functions installed it falls back to fopen. fopen was failing to retrieve sub-directories.

    I’m fixing it now.

    #59393
    fel64
    Member

    In the right place in front-page.php? It has to be inside the loops that go foreach( $sumthin AS $topic ) { ... }

    I’ve just tried it myself and it seems to work. Comment _in_ that line about the span colour so you can test if it’s working at all.

    #59409
    fel64
    Member
    <?php
    /*
    Plugin Name: Page &raquo;
    Description: Adds &raquo; to the end of topic titles, linking to latest post.
    Author: fel64
    Version: 0.7
    */

    if (!function_exists('is_tags')) {
    function is_tags()
    {
    return is_tag();
    }
    }

    if (is_front() || is_forum() || is_tags()) {
    add_filter('topic_title', 'fel_addlatestlink', 101);
    }

    function fel_addlatestlink($title)
    {
    global $topic;
    $felgtlpl = get_topic_last_post_link($topic->topic_id);
    $title = $title . ' <a href="' . $felgtlpl . '">&nbsp;&raquo;&nbsp;</a>';

    return $title;
    }
    ?>

    That’ll add a little double arrow to the name of each topic which goes to the latest. :)

    #56736

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    How are you installing the plugin? Are you downloading it directly or are you using the ‘Plugin browser for bbPress’ plugin? If the latter, then I think it’s not downloading properly, you need to do it manually by downloading the current ZIP file, unzipping it and follow the instructions in the readme.txt file.

    Here is the Avatar Upload plugin in the bbPRess Plugin Browser, the newest version of the code is always to be found on that page:

    https://bbpress.org/plugins/topic/46

    Click on the link “Download latest version” — or just click the following download link for now:

    https://bbpress.org/plugins/download/avatar-upload.0.7.zip

    #58597
    fel64
    Member

    Like so? http://192.168.1.29/blogs/bb-admin

    I think $bb_path should be /blogs/test/forums/ and $bb_domain should be http://192.168.1.29

    #1991
    longtex
    Member

    Just installed, forum linked w/WP. Seems okay.

    From the forum I can login and get ADmin link. It works, taking me to Dashboard.

    However, on Dashboard main page, the menu links for Dashboard, Users, Presentation, etc. have incorrect address.

    Blog is at http://192.168.1.29/blogs.test

    Forum is at http://192.168.1.29/blogs/test/forums

    config.php has $bb_domain = “http://192.168.1.29/blogs/test/forums&#8221;

    and $bb_path=”/forums/”

    On the forum the “Admin” link is “http://192.168.1.29/blogs/test/forums/bb-admin&#8221; and works properly. Once there, its “self-link” has been changed to “http://192.168.1.29/blogs/test/forums/bb-admin&#8221; and, of course, doesn’t work. The other links have also removed the “/blogs/test” part of the $bbdomain variable content.

    Any ideas?

    mikelothar
    Member

    I have never coded sql, but i agree for some unknown reason that i don’t think it’s difficult to code. I’m just curious as to why noone ever did so before. In my opinion, this is the only obstacle in bbPress.

    If anyone should decide to give this a go and try to make the plugin, i just have one (more?) request.. and that is that the plugin also indicates a new topic in the forums part, and not only in the latest discussions. The Indicate New Posts plugin fails to do this.

    Who do i have to sleep with to get this plugin? :D

Viewing 25 results - 10,751 through 10,775 (of 11,584 total)
Skip to toolbar