Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,201 through 30,225 (of 32,431 total)
  • Author
    Search Results
  • #1832
    bruz
    Member

    Hi there,

    nowadays everybody is using twitter for everything – so why don’t use it for something useful? :-)

    I think it would be nice to announce a new topic to a specific twitter-account so that people will know when to visit the forums.

    #51236

    In reply to: Anonymous post

    gh3
    Member

    i had a look at code trying to do something in this way, but i wasn’t able to find the right function to hook… i can find the pre_post_form and post_form, this one allows me to work only after the post form so i think that in this very moment there is no way to do it, or better there is no way using a plugin…

    #57507
    fel64
    Member

    I really do :) This Patrick Ehrlund? He’s great – even if he does have a flash website :P

    I’d argue that the coolness of appearance is worth it, since the login form’s not exactly rocket science. I think it’s still pretty distinguishable anyway. Mockups:

    http://img513.imageshack.us/img513/5090/ochreblackuf9.jpg

    http://img338.imageshack.us/img338/5758/ochrewhiteyh4.jpg

    That’s just suggestions if you’re interested, no need to give it further thought :)

    Test account to see the problem with the HTML, didn’t realise Chris had already fixed it. My bad. :)

    #57506
    csl749
    Member

    Aha – thanks very much chrishajer! I’ve just noticed that there’s a surplus /div in footer.php. I’ve removed it and all is now well, as far as I can tell. Though it’s strange how it only affected that one page (?!). Thanks for pointing me in the right direction.

    Thanks fel64 – glad you like the design of the site! :) The header pic was designed by a friend of mine, Patrick Ehrlund. I’m torn about the login background – it does look much better without the white background, but also more difficult to read. I might play with some font colours to get something that displays nicely over the header pic colours.

    A test account? What do you mean? I’ll help if I can.

    csl749
    Member

    Hmm. I tried the path (it’s thrown up in the error anyway so I assume it’s the correct path!) but it’s still not working, providing me with an error.

    Everything works anyway, as I built the forum theme up around the main site, but it’d be nice to know that I could call BB and WP functions if I wanted, without worrying. Oh well…

    Thanks very much for the kind help though Fel64! :)

    #51234

    In reply to: Anonymous post

    Duchemin
    Member

    Users on my forum posted 1 or 5 messages, they don’t need registration. But in bbpress database there is no field of Name (post linked with user by poster_id). :( How to make ‘Anonymous post’?

    #57505
    fel64
    Member

    It’s a really nice site and I love the header. The login form would fit in more if you remove the background: #FFFFFF property in the CSS. :)

    Could you make a test account please, so we can see the HTML?

    #57394
    fel64
    Member

    Yes. Put the Secondary in Main, get rid of its margin, add the CSS float property to both Secondary and Discussion – one float: right, one float: left. That will make it work.

    #57192
    fel64
    Member

    I see. Sorry, I thought that was just an example for the format.

    How’s this instead?

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

    #57494
    fel64
    Member

    <?php tag_heat_map(); ?> will do that.

    #1827
    abc12345
    Member

    What is the code used to make the list of tags with their fonts different sizes?

    #57190
    fel64
    Member

    What does it show? Something completely crazy or something slightly wrong?

    You can set your timezone in config.php, just change $bb->gmt_offset to whatever you want.

    fel64
    Member

    Ack, I’m sorry but the stupid easy mistake is mine. This will only work for blog posts which have a corresponding topic in bbPress, so for any blog posts you made before installing the bbPress Post plugin it won’t work. Should’ve thought about that before copying you the code. :(

    function forumreplylink() {
    //must be called from within the loop yadda yadda
    global $post;
    $rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
    $tid = felblogtotopicid( $post->ID );
    if( $tid ) {
    echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
    } else {
    comments_number('No Comments','1 comment','% comments');
    }
    }

    Replace the old forumreplylink() with this and it will either show the reply link or a link to the comments. If you only want it to show the reply link but no link to comments, just take that comments line out. :)

    Griffology
    Member

    OK here’s my file

    <?php
    /*
    Plugin Name: HFFIB
    Plugin URI:
    Description: Helper function for integrating bbPress into your theme.
    Version: 0
    Author: fel64
    Author URI: http://www.loinhead.net/
    */

    function felblogtotopicid( $felpostID ) {
    global $table_prefix, $wpdb;
    $posts_table = $table_prefix . "bbpress_post_posts";
    $topic_id = $wpdb->get_var("SELECT topic_id FROM '$posts_table' WHERE 'post_id' = $felpostID LIMIT 1;");
    return $topic_id;
    }

    function forumreplylink() {
    //must be called from within the loop yadda yadda
    global $post;
    if( $post ) {
    $rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
    $tid = felblogtotopicid( $post->ID );
    echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
    } else {
    echo 'ouch!';
    }
    }
    ?>

    I am running a custom theme, but it’s called in the spot as the original wordpress comments were and those worked fine. Here’s how I’m calling the function:

    <div class="details">
    <a>"><?php comments_number('No Comments','1 comment','% comments'); ?></a>
    <span class="tool">Category: <?php the_category(', '); ?></span>
    <span class="tool"><?php akst_share_link(); ?></span>
    <span class="tool"><?php forumreplylink(); ?></span>
    </div>

    Still getting the error, and no ‘ouch’ anywhere… I do have bbpress_post plugin running, is it supposed to or does this replace it? I’m thinking it has to be running, I’m just trying to elimate a stupid easy mistake I’ve made. :)

    fel64
    Member

    That’s strange, it works for me. At a guess the root of it is that $post doesn’t exist, or that $post->ID is nonexistant.

    Can you replace function forumreplylink() { ... } with:

    function forumreplylink() {
    //must be called from within the loop yadda yadda
    global $post;
    if( $post ) {
    $rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
    $tid = felblogtotopicid( $post->ID );
    echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
    } else {
    echo 'ouch!';
    }
    }

    If it outputs ouch we’ll know that a missing global $post is indeed the problem. You are using it inside The Loop, aren’t you?

    Griffology
    Member

    Thanks for the help, but my error is now:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 1’ at line 1]

    SELECT topic_id FROM wp_bbpress_post_posts WHERE post_id = LIMIT 1;

    after the error it adds the reply function but with an empty id: IE: “http://www.website.com/topic.php?id=

    fel64
    Member

    That’s very simple; go to wp-admin > Options > Discussion and set it so comments are off. You can also modify your template by deleting all the code for comments.

    To get the ‘discuss in forums’ link, simply open your template file, and replace the <?php comments_popup_link('&nbsp;make a comment', '1 comment', '% comments','','comments off'); ?> or similar with this:

    <?php forumreplylink(); ?>

    That’ll give you what you want. Note that you’ll need to put felblogtotopicid() into a WP plugin, like so:

    <?php
    /*
    Plugin Name: HFFIB
    Plugin URI:
    Description: Helper function for integrating bbPress into your theme.
    Version: 0
    Author: fel64
    Author URI: http://www.loinhead.net/
    */

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

    function forumreplylink() {
    //must be called from within the loop yadda yadda
    global $post;
    $rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
    $tid = felblogtotopicid( $post->ID );
    echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
    }
    ?>

    If you do that, you have to take it out of the hack should you implement it.

    Griffology
    Member

    Thanks fel64. I’m looking to do away with the wordpress comments completely, just shut them off. However the bbpress post plugin posts the “discus in forms(0)” link at the end of the post. I have a bar at the bottom of each post and would like to format it in there. I’ve opened bbpress_post.php and saw the output of the post gets thrown into 1 variable. I would like to call a function in my wordpress php files, for example index.php, that calls the function from bbpress_post.php to display the “discuss in form” link.

    Hope that makes sense, but after read the thread you linked I don’t think it’s quite what i’m looking for. I’ll read it again thought as I’m tired. :)

    Thanks again.

    #57412
    Vili
    Participant

    The way I have integrated the two over at http://akirakurosawa.info/ is by editing the bbPress template so that it calls the WordPress headers instead of the bbPress ones.

    I presume that you have installed both WordPress and bbPress, and that you have integrated their user databases and installed the required plug-ins as outlined at https://bbpress.org/documentation/integration-with-wordpress/ .

    So, if you now go through the template files for your bbPress installation, you will need to replace all instances of “<?php bb_get_header(); ?>” with the WordPress command “<?php get_header(); ?>”. The same thing goes for the footers, so you change all instances of “<?php bb_get_footer(); ?>” to “<?php get_footer(); ?>”.

    However, in order to get that to work properly, I have also edited my WordPress template so that the (WordPress) header and footer files contain everything except for the actual content that is going to be shown on the page. In other words, all the “container” DIV-elements and such are opened in the header and closed in the footer. While this is perhaps not absolutely necessary, it makes your life easier.

    Finally, I use a boolean check in the WordPress header to see whether I am serving a bbPress page, and modify the header information accordingly. While I currently set the boolean myself by including

    <?php global $forumpage;
    $forumpage = TRUE; ?>

    at the very beginning of each relevant bbPress template page (i.e. those pages that call the header files), fel64 has pointed out that one could simply use a variable that bbPress uses anyway, for example $bbdb.

    I use these checks to modify the title:

    <?php if ($forumpage == TRUE) {
    bb_title();
    echo " :.: AKN&amp;I";
    } else ...

    to add the forum feed:

    <?php if ($forumpage == TRUE) bb_feed_head(); ?>

    as well as do some other things (disable Ultimate Tag Warrior’s meta tags for the page, etc.).

    So, it takes a little bit of playing around with your templates, but in the end it is doable without any actual hackery.

    fel64
    Member

    There are a few things you can do. This WP plugin will, using also the bbPress Post plugin, show replies from the appropriate thread in your forum under your newspost, plus links to the thread to reply to it. You can also transfer existing comments; you need to be careful to only do it once, but that can also be found in that thread. It hasn’t yet been successfully made so that you can reply to the forum from the wordpress part of the site, as far as I know, but I’m sure it’s possible and will be done.

    So it’s perhaps 2/3rds of the way there. :)

    Griffology
    Member

    Matt, have you finished this. I’ve tried to do it myself but with no luck I always end up throwing a sql error. :(

    #55364
    serimu
    Member

    I checked it again, and it is partially working. Forum links are accessible, but topic and others are not. I again tried three combination

    1) just adding multipleviews to htaccess = not working

    2) adding this solution = not working

    # BEGIN BBPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /forum/
    Options +MultiViews
    </IfModule>
    # END BBPress

    3. adding the code generated by rewrite-rules.php. = partially working

    #55363
    serimu
    Member

    +1

    I did also all the things(at least three or more times, and even I create a mirror template for bbpress to match with my wordpress template when I was tired of trying the same things to make permalinks to work),. So, for those people who uses Godaddy;

    It is not working with Godaddy. (Correction: It works for me, read below)

    But it only took a couple of hours to update my wordpress, install and integrate bbpress with wordpress (even, partially, templates). For now, I will not move to another hosting company for permalink option. But it is a bit annoying because rewrite rules are working on Godaddy. I have installed wordpress(10 or more different websites), and drupal(3 or more websites), and no problem with permalinks. When you create your htaccess file for the first time, you need to wait for a couple of hours (in avarage 2-3 hours). After that first initialization, every change in htaccess are applied instantly. Namely you just need to wait only for the first time.

    I also tried a simple redirect to check my htaccess file in forum root directory. And it was working.

    So as the creator team of bbpress is the same for wordpress. And as wordpress is ok with godaddy. The team may suggest an alternative way for rewrite rules. I dont know much about rewrite rules. And I believe the file (bb-admin/rewrite-rules. php) creates correct rules for the most of the servers.

    SOLUTION:

    I wrote all the above information and then I think to add my config.php file to here. So I find out something, that I dont use akismet, so I add // to beginning of that line, namely:

    //$bb->akismet_key = ''; // Example: '0123456789ab'

    and it is working now :)

    #57392
    fel64
    Member

    That’s because you’re using a left-hand margin on your sidebar and your main div to push them to the right.

    <div id="main">
    <div id="discussions">

    <div id="secondary">

    That’s roughly your HTML structure. Main is the full width of the central white bar, so there’s no way you can get Secondary next to it. Discussions is a sub-part of Main, and it’s pushed over to the right by a large margin on the left.

    Secondary is not part of Main, and pushed over to the far right because it has a humoungous 71% margin.

    Firstly you want to put Secondary into your Main div, otherwise there’s no way to do it. Then you need to put either one on the left; the way to do this would be to get rid of its giant margin. That should work.

    Otherwise, if you’re not doing it by the margin property, you could put Secondary into Main again, then give Secondary and Discussions a float: left; and a float: right; property (or the other way around). If there’s enough room, they should now be side by side – otherwise make them narrower.

    You can also get rid of the wrapper‘s border properties, that’s what’s giving you the double-width line.

    That’s a nice theme you made, though. :)

    #57390
    chrishajer
    Participant

    From the looks of your site, it worked. :D

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