Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,526 through 29,550 (of 32,432 total)
  • Author
    Search Results
  • #53777
    mazdakam
    Member

    this is my coustom code in search-form:

    <form action="<?php bb_option('uri'); ?>search.php" method="get">
    <p><?php _e('Search:'); ?>
    <input type="text" size="70" maxlength="200" name="q" value="<?php echo attribute_escape( $q ); ?>" />
    <?php if( empty($q) ) : ?>
    <input type="submit" value="<?php echo attribute_escape( __('Search &raquo;') ); ?>" class="inputButton" />
    <?php else : ?>
    <input type="submit" value="<?php echo attribute_escape( __('Search again &raquo;') ); ?>" class="inputButton" />
    <?php endif; ?>
    </p>
    </form>

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

    #2159

    I’d like a link on each listed topic that takes you to the last post in the topic. Any help? :)

    #59392
    mikelothar
    Member

    I’m not sure i’m doing it right. The idea is good, but nothing seems to happen. Here’s what i have:

    In the plugin:

    function fel_indicatenew($title)
    {
    global $topic, $bb_current_user;
    if ( bb_is_user_logged_in() )
    {
    $feluser = bb_get_user($bb_current_user->ID);
    if( ($topic->topic_time > $feluser->last_visit) && ( $topic->topic_last_poster != $feluser->ID ) )
    {
    //$title = '<span style="color: #9d0a0e;">' . $title . '</span>';
    $topic->new = true;
    }
    }
    return($title);
    }

    .. and in the theme’s front-page.php:

    <?php if( $topic->new ) : ?>
    blah
    <?php endif; ?>

    I’ve also tried:

    <?php if( $topic->new ) { ?>
    blah
    <?php } ?>

    .. but none of these seem to do anything.

    #49622

    In reply to: Emoticons For bbPress?

    fel64
    Member

    It’s not a plugin. Add this to the top of the file, after the <?php:

    /*
    Plugin Name: Nerr
    */

    #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

    fel64
    Member

    What do Tom and Jerry have to do with any of this?

    So replace the code that adds the <span class=””> to this:

    $topic->new = true;

    Then when you want to find out if it’s a new topic, you do this:

    if( $topic->new ) {
    //blah
    }

    Should work. Unless I misunderstood your wishes again.

    mikelothar
    Member

    Then i’m Jerry.

    Fel, i think you misunderstood me with the new-post class. I wanted it away from the title, as a new variable of some sort. I guess this plugin is only for the topic text, and can not be modified to my wishes.

    fel64
    Member

    That’s the maxlength property of input fields.

    You can still edit the HTML, though, and submit your crazy username. A serverside check is best.

    #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

    Detective
    Member

    Oh, amazing … i feel like Tom from Tom & Jerry :p

    fel64
    Member

    I don’t know who you have to sleep with to get _that_ plugin. It’s not me. I’m shying away from implementing it because I’m not sure what a good method is.

    Do you know if it would be possible to modify the plugin to differentiate between a .no_new_topic and a .new_topic class, for use in CSS instead?

    Yeah. Change the function fel_indicatenew() to this (note that I’m using classes ‘no-new-topic’ and ‘new-topic’ here):

    function fel_indicatenew($title)
    {
    global $topic, $bb_current_user;
    if ( bb_is_user_logged_in() )
    {
    $feluser = bb_get_user($bb_current_user->ID);
    if( ($topic->topic_time > $feluser->last_visit) && ( $topic->topic_last_poster != $feluser->ID ) )
    {
    $title = '<span class="new-topic">' . $title . '</span>';
    } else {
    $title = '<span class="no-new-topic">' . $title . '</span>';
    }
    }
    return($title);
    }

    #55653

    In reply to: What’s integration?

    mshutch
    Member

    Not sure if you have found the solution, but if you put the absolute path to your wp-blog-header.php, it should work fine.

    Example: /home/yourusername/public_html/wp-blog-header.php.

    #56735

    In reply to: Plugin: Avatar Upload

    outchy
    Member

    i did that and did a diff on all the files and they’re all the same. where do i get the code for avatar.php?

    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

    Detective
    Member

    I think it should not be hard to code such a plugin. It would have to create a new database table, like bb_read, with the following fields:

    – bb_user

    – bb_post

    – bb_last_comment_read

    This way you could modify the posts query, left joining it with this table. If the join is NULL (please correct me if i’m wrong, i haven’t done these things in a lot of time), then the user has never read the post. If bb_last_comment_read is less than the actual number of comments or replies, then he hasn’t read the last post.

    Another interesting alternative is what the folks at wordpress.org are doing … for non-visited links they have a font with a font-weight: bold style. So you can see which topics are new.

    mikelothar
    Member

    Hi fel.

    I already modified the -strong- part, to some <span style=”color: #123456;”>, but i have to admit that i have never heard of the content-before tag for CSS.

    I looked at google, i guess the tag looks like :before (or :after), but i also found this page:

    http://www.quirksmode.org/css/contents.html

    .. which states that it doesn’t work in IE browsers. FreekinĀ“ Microsoft..

    Good idea though, but unfortunately IE is too popular.

    In my theme i have a table, with two columns. First column is the one i would like to be able to modify (even if only with a CSS tag), second column holds the title of the topic.

    Do you know if it would be possible to modify the plugin to differentiate between a .no_new_topic and a .new_topic class, for use in CSS instead?

    #59333

    In reply to: super beginner :)

    fel64
    Member

    I’m sorry, that was maybe a little bit strong.

    (But I see _iframes_ and things just go red … :P)

    fel64
    Member

    Do you want it CSS-driven? It’s trivial to modify the Indicate New plugin. Just look for where it says <strong> and </strong> (near the bottom) and change that to <span class="new"> and </span>. You can then use content-before to add the NEW or do whatever else.

    What’s new and what isn’t isn’t yet implemented. :)

    fel64
    Member

    What would bb be looking up? It knows the link type and it already has $topic->topic_last_poster_name as well as $topic->topic_last_poster.

    #59125
    outchy
    Member

    awesome, just what i was looking for! thanks :)

    #59234
    Sam Bauers
    Participant

    > update: actually this is not directly your fault, though you are trying to use a bb-admin function that was meant for local file access to do remote file access?

    If you check the short “to do” list at the top of the plugin you’ll see that I plan to address that issue in the future. I might just copy and paste the code from that internal function and then hack in my own curl/fopen alternative function.

    > If I am not mistaken, you just found a bbpress security loophole.

    Explain your concerns, how do you think this would be exploited? If it can be we should patch it up.

    > ps. any concerns about eventually 2,000-20,000 bbpress users hammering the svn with so many file downloads to examine all the plugin headers?

    36 downloads so far, let’s start worrying at 1,000

    #59396

    In reply to: Topic Pages

    Andrew
    Member

    Never mind, I found the variable in config.php. Pretty obvious.

    '// The number of topics that show on each page.
    $bb->page_topics = 15;

    #2155
    wiseremuska
    Member

    I encountered with a problem saying that headers were already sent while using slugs with mod_rewrite rules shown in bbpress FAQ.

    And just to let people who was or will be up against this problem; i solved it changing the line 168 in bb-includes/pluggable.php

    Change the line with this code line :

    `?><script>location.href=”<?=$location?>”;

    </script><?php`

Viewing 25 results - 29,526 through 29,550 (of 32,432 total)
Skip to toolbar