Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,301 through 30,325 (of 32,431 total)
  • Author
    Search Results
  • #57221
    chrishajer
    Participant

    I have no idea honestly. I am using WP with permalinks and bbP without permalinks and it works fine all over the place (FF and IE, Linux and Windows.)

    I did notice with weirdness in the forum source:

    <script type="text/javascript" src="'. bb_get_option('uri') .'my-plugins/bb-emoticons.php?bb_grins_output=javascript"></script>

    Looks like the bb_get_option wasn’t wrapped in php tags? Maybe there are more things like that?

    #1794
    fel64
    Member

    Wanting to integrate bb and wp more, I hacked up wp’s comments.php template to get replies in the forum to show up below posts in the wp section of the site too.

    This currently requires the bbPress Post plugin.

    Fairly simple job: find the corresponding topic, get the replies, and output them. My solution should work for you, too, if you have bbPress post installed and activated as a wp plugin. Code’s below.

    I want to make it possible to reply to the topic from the wp section of the site if you’re logged in. Obviously I could make queries to insert the post into the database, but I’d like to use the bb API so it can be validated correctly, hooks are called etc. Not sure how I would go about making it accessible. Currently calling any bb functions returns the “undefined function” error; how can I make them available for use?

    Paste this in front of the rest of your wp comments.php template:

    <?php
    function felblogtotopicid( $felpostID ) {
    global $table_prefix, $wpdb;
    $posts_table = $table_prefix . "bbpress_post_posts";
    $topic_id = $wpdb->get_var("SELECT topic_id FROM <code.>$posts_table</.code> WHERE <.code>post_id</.code> = $felpostID LIMIT 1;");
    return $topic_id;
    }
    global $post, $wpdb;
    if( $forumtopic = felblogtotopicid( $post->ID ) ) {
    $bbprefix = get_option( 'wpbb_bbprefix' );
    $replies = $wpdb->get_results( '
    SELECT poster_id, post_text, post_time
    FROM ' . $bbprefix . 'posts
    WHERE topic_id = ' . $forumtopic
    );
    array_shift( $replies ); //takes off first entry, ie. starting post, and moves the rest back one
    //$replies = array of object( poster_id, post_text, post_time ) for each post I think
    echo "<ol>n"; //start of list
    foreach( $replies as $reply ) {
    $poster = get_userdata( $reply->poster_id );
    $poster = $poster->user_login;
    echo '<li class="thread">' . "n"
    . '<div class="reply">' . "n"
    . '<div class="poster">' . "n"
    . "<strong>" . $poster . "</strong>n"
    . "<span> @ " . $reply->post_time . "</span>n"
    . "</div>n"
    . '<div class="post">' . "n"
    . $reply->post_text
    . "</div>n"
    . "</div>n"
    . "</li>n";
    }
    echo "</ol>n"; //end of list
    //$replylink = bb_add_replies_to_topic_link( $forumtopic );
    $replylink = get_option( 'wpbb_path' );
    echo '<h3><a href="' . $replylink . '">Reply!</a></h3>' . "n";

    } else { ?>

    and paste this at the very back:

    <?php } //end else conditional for corresponding topic to blogpost ?>

    Example here

    #55707
    kernow
    Member

    fel64 wrote: How did you make it work?

    Its easy to install really. You have the main tinymce folder which I opened and uploaded the contents to the ‘my-plugins’ folder. This is the mistake I made.

    • Just upload the jscript folder within the tinymce folder to my-plugins
    • Edit header.php in your bbpress template, adding the reference to the javascript

    This is part of the code which I copied, which you put before the </head> closing tag in header.php.

    <script language=”javascript” type=”text/javascript” src=”http://example.com/bbpress/my-plugins/jscripts/tiny_mce/tiny_mce.js”></script&gt;

    Change to:

    <script language=”javascript” type=”text/javascript” src=”my-plugins/jscripts/tiny_mce/tiny_mce.js”></script>

    The FULL code you put in header php is the top of the page, but this bit is important.

    #57215
    fel64
    Member

    Ahh, that’ll teach me to remember the difference between get_bbpress_thing() and bbpress_thing(). >_< Sorry.

    Replace the code in there now with this.

    Set the last parameter to true if you want it to return an array of information. To use this you would use code like this:

    <?php $mytopicnavarray = feltopicnav( '', '', ' ', true, true );
    echo '<a href="' . $mytopicnavarray['next']['link'] . '">Click here to go to the next topic!</a>'; ?>

    Use <?php felforumnav(); ?> to get the forum navigation in a similar way to the topic navigation. It’s just a simple wrapper for what feltopicnav does, but it’s a bit easier to see what it’s supposed to do. Check the code for possible parameters.

    I won’t submit this as a proper plugin because the code is awkward. Maybe sometime I’ll recode it or someone else will. :)

    <?php
    /*
    Plugin Name: Topic Navs;
    Plugin URI:
    Description: Put <?php feltopicnav(); ?> in a topic template to show links to the previous and next topics, and put in <?php felforumnav(); ?> to get basic next/previous forum navigation. More parameters such as $infoonly available.
    Author: fel64
    Version: 0.7
    Author URI: http://www.loinhead.net/
    */

    function feltopicnav( $nexttext = '', $prevtext = '', $betweentext = ' ', $lastpost = true, $infoonly = false, $forumnav = false; )
    {
    global $topic_id;
    $nexttopic = $topic_id + 1;
    $prevtopic = $topic_id - 1;
    global $forum_id;
    $nextforum = $forum_id + 1;
    $prevforum = $forum_id - 1;
    if( !$nexttext )
    if( !$forumnav ) {
    $nexttext = get_topic_title( $nexttopic );
    } else {
    $nexttext = get_forum_name( $nextforum );
    }
    if( !$prevtext )
    if( !$forumnav ) {
    $prevtext = get_topic_title( $prevtopic );
    } else {
    $prevtext = get_forum_name( $prevforum );
    }
    $prevtext = get_topic_title( $prevtopic );
    if( $lastpost ) {
    $nextlink = get_topic_last_post_link( $nexttopic );
    $prevlink = get_topic_last_post_link( $prevtopic );
    } else {
    if( !$forumnav ) {
    $nextlink = get_topic_link( $nexttopic );
    $prevlink = get_topic_link( $prevtopic );
    } else {
    $nextlink = get_forum_link( $nextforum );
    $prevlink = get_forum_link( $prevforum );
    }
    }
    if( $infoonly ) {
    $topicnavinfo['next']['title'] = $nexttext;
    $topicnavinfo['next']['link'] = $nextlink;
    $topicnavinfo['prev']['title'] = $prevtext;
    $topicnavinfo['prev']['link'] = $prevlink;
    return $topicnavinfo;
    } else {
    echo '<a href="' . $prevlink . '"> &laquo; ' . $prevtext . '</a>' . $betweentext . '<a href="' . $nextlink . '">' . $nexttext . ' &raquo; </a>';
    }
    }

    function felforumnav( $nexttext = '', $prevtext = '', $betweentext = ' ', $infoonly = false )
    {
    $fni = feltopicnav( $nexttext, $prevtext, $betweentext, false, true, true );
    if( $infoonly ) {
    return $fni;
    } else
    echo '<a href="' . $fni['prev']['link'] . '"> &laquo; ' . $fni['prev']['title'] . '</a>' . $betweentext . '<a href="' . $fni['next']['link'] . '"> &laquo; ' . $fni['next']['title'] . '</a>';
    }
    }
    ?>

    #57186
    fel64
    Member

    Paste in

    <?php global $post;
    $lalaposttime = date( 'D M Y', strtotime( $post->post_id ) );
    echo $lalaposttime; ?>

    anywhere you like outside other <?php ... ?> tags. So you could put it next to the code snippet you quoted. If you use Notepad 2 or something it makes it a lot easier by colour-coding these things.

    The fact that it’s spread out over several lines doesn’t make a difference when it’s inside the <?php ... ?> tags. :)

    #57213
    Nola1974
    Participant

    you rule. :)

    how about prev / next forums? :) :)

    I plan on doing something kinda neat with this. you’re definitely getting thanks.

    #57184
    fel64
    Member

    I suspect that this will work. Replace get_post_time() or whatever it is with

    global $post;
    echo $post->post_time;

    (Remember to have the <?php?> tags around it!) If you want different formatting on that, I think that $post->post_time is a bit too much detail so you could instead have

    global $post;
    $lalaposttime = date( 'D M Y', strtotime( $post->post_id ) );
    echo $lalaposttime;

    You can change the way the date will appear by changing the first parameter (currently it’s ‘D M Y’) of the date() function. A list of how you can format dates is here.

    #56406

    In reply to: Freshness Linked

    fel64
    Member

    The topic closed thing comes from the pagecount being too high. I think get_topic_last_post_link() must be screwing up – did the latest reply thing stop working immediately after recount? Not sure what the solution is, sorry. Perhaps get the latest version, see if the problem persists?

    I just recounted on my forum (running 1.0-alpha), but it seems to still work.

    #57212
    fel64
    Member

    There is now!

    Save this in a file, call it sumting.php, and drop it into your my-plugins folder. Then put <?php feltopicnav(); ?> somewhere in a topic template. Not tested, so please tell me if it works. :)

    <?php
    /*
    Plugin Name: Topic Navs;
    Plugin URI:
    Description: Put <?php feltopicnav(); ?> in a topic template to show links to the previous and next topics. Optional parameters are $nexttext, $prevtext, $betweentext and $lastpost.
    Author: fel64
    Version: 0.7
    Author URI: http://www.loinhead.net/
    */

    function feltopicnav( $nexttext = '', $prevtext = '', $betweentext = ' ', $lastpost = true )
    {
    global $topic_id;
    $nexttopic = $topic_id + 1;
    $prevtopic = $topic_id - 1;
    if( !$nexttext )
    $nexttext = topic_title( $nexttopic );
    if( !$prevtext )
    $prevtext = topic_title( $prevtopic );
    if( $lastpost ) {
    $nextlink = topic_last_post_link( $nexttopic );
    $prevlink = topic_last_post_link( $prevtopic );
    } else {
    $nextlink = topic_link( $nexttopic );
    $prevlink = topic_link( $prevtopic );
    }
    echo '<a href="' . $prevlink . '">' . $prevtext . '</a>' . $betweentext . '<a href="' . $nextlink . '">' . $nexttext . '</a>';
    }
    ?>

    #54417
    Nicki Faulk
    Member

    “What I ended up doing was removing the forum registration”

    That’s exactly what I did for mine. Instead, I just pointed to the WP register link and that works out beautifully for me. :)

    #57143
    chrishajer
    Participant

    Ryan,

    That is with the command line version? The -r just tells it to run the following code without the <?php ?> tags. Maybe they don’t have a command line version installed for your use.

    Did you try the web php version?

    –Chris

    #52908
    citizenkeith
    Participant

    bump :-)

    #57142
    stuboo
    Member

    @chrishajer

    Thanks for the message. I got this error

    Error in Argument 1, char 2: option not found r

    Thanks,

    Ryan

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

    #57081
    AphelionZ
    Participant

    fel64, thanks :)

    I will try the post plugin

    #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 :(

    #55703
    AphelionZ
    Participant

    Thanks. Yeah I hear where you’re coming from, TinyMCE slows my site down a bit and im having trouble with blockquotes, but you can slim it down and make it tiny, so i’ll stick with it for now… ive already started copying over all my emotions into it :)

    #55559

    In reply to: Hooks & Filters Docu

    fel64
    Member

    so here it is http://bbpulp.org

    Fantastic!

    What’s the pulp thing about, though? :P

    #55702
    Null
    Member

    Like fckEditor…

    But to be honest, these scripts are too big for bbPress. bbPress only supports a blockquote br code em strong ul ol li and not colors, images, tables, font types etc.

    I am thinking of writing a wysiwyg editor that only supports these standard markups and when an extention/plugin is installed (smilies, images) it will support these too. And it will be skinable ofcourse to match the theme installed.

    But I am a busy man, so this will not happen anytime soon :(

    #56377

    In reply to: Plugin: bbMenu 1.1

    Null
    Member

    @ box87, can you give me/sent me what you have changed and where? This error also seems to effect people that use php 5+, so if your changes fixes these errors, I realy would like to have them :D (mauricederegt[at]gmail.com)

    About adding menutabs (not pages); it will be in the next release. You can create new tabs in the admin area and drag&drop them around. Only downside is that the tabs won’t be highlighted when you are on the page where the new tab points too. This has to do with the bb_location and knowing-on-what-page-you-are issue (is_pagename) .

    It already is possible to automaticly add a menu tab to your list when activating a plugin that has a page on its own (like the memberlist plugin). But I need to do some more testing for this and documentation of how to do this will proberly be released when bbPress 1.0 (with plugin activation) is released (cause the way this works can be changed)…

    Also I am thinking of rewriting this plugin after the bbPress 1.0 release to use jQuery. 1.0 uses this libary, so why not make use of this and reduce the extra files needed to drag&drop the tabs around :D

    Well for now, send me your fix so I can put it in the next release. Big things are ahead!

    #57117

    In reply to: BBLD problem

    archasek
    Member

    finally, i added this code to my script and it works perfectly. line 238:

    else {
    get_currentuserinfo();
    global $user_ID, $user_identity;

    if ( $user_ID ) {
    echo '<li>&raquo; <a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '&page&replies=' . '">' . __("$title_text") . '</a>';
    }
    else {
    echo '<li>&raquo; <a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '&page' . '">' . __("$title_text") . '</a>';
    }

    hope that’ll help anybody.

    #55555

    In reply to: Hooks & Filters Docu

    Sam Bauers
    Participant

    I think you started with looking at the wrong plugin.

    I’ve got the code here if you want it, if you want a challenge, then *don’t* read on…:

    <?php
    /*
    Plugin Name: Disable registration
    Plugin URI:
    Description: Disables registration
    Author: Sam Bauers
    Version: 0.0.1
    Author URI:
    */

    add_action('bb_init', 'disable_registration');

    function disable_registration() {
    global $bb;
    if ($_SERVER['PHP_SELF'] == $bb->path . 'register.php') {
    bb_die(__('Registration is temporarily disabled for this forum.'));
    }
    }
    ?>

    Make a new file from this code and drop it into your plugins folder. You may need to add some values in the header part to allow it to be registered in the admin area.

    #57132
    benbeltran
    Member

    @detrom: Claro, en que necesitas ayuda?

    @fel64:

    #thread li {
    padding: 1.5em 1.0em;
    display: block;
    }

    :) that’s about it…

    #57140
    chrishajer
    Participant

    Can you make sure you can still send email from your server? If you have ssh/command line access, you can try this:

    php -r 'mail( 'you@yourdomain.com', "subject: test", "message: test", 'From: you@yourdomain.com');'

    If you have FTP access, put this into a file called mailer.php (or whatever.php you want) and then navigate to it with a browser”

    <html>
    <body>
    <?php
    mail( 'you@yourdomain.com', "subject: test", "message: test", 'From: you@yourdomain.com');
    echo "Mail should have been sent, check your inbox";
    ?>
    </body>
    </html>

    Once you know if you can send email from your server, you can move forward.

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