Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,576 through 29,600 (of 32,491 total)
  • Author
    Search Results
  • ganzua
    Member

    I just installed 0.8.2.1 and it seems functions.php have changed a lot.

    Where is get_profile_info_keys() function now? Signature plugin doesn’t work because you need to insert code in that line.

    #2164
    _ck_
    Participant

    Ruh roh, I think I broke something.

    No pagination links on forum pages even though <?php forum_pages(); ?> is there – pagination shows up and works just fine on topic pages however.

    Seems to work here, any ideas how to debug this other than turning off two dozen plugins?

    ps. also someone has to tell me oneday how to change the pagination number count and formatting without hacking the core – how do I alter that default settings array?

    #59418
    _ck_
    Participant

    Coming soon:

    don't allow reports on moderators
    don't allow reports from members less than x days old
    security check if user is in the right topic for the post being reported

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

    ?>

    #59401

    In reply to: forum.wp-persian.com

    Trent Adams
    Member

    Great job! Will it have bbPress support as well! I hope so, or this is not the place to post it ;)

    http://forum.wp-persian.com

    Trent

    #59383

    In reply to: css help

    outchy
    Member

    awesome :D

    #59152
    kjted
    Member

    I’ve not forgotten about this. I will post up some code when i’ve finished. I’ve just written an insertion class too.

    #56739

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    Oh! I see, the sub-sub folders are empty, I just downloaded it from here myself to check.

    When I browsed bbPress’ Subversion repository, the files ARE there — I didn’t forget to commit them! — so somehow the bbPress Plugin Browser (the one on this site, NOT Sam’s plugin) has messed up the ZIP download.

    The question is, whether it is a one-off or a systematic problem? Admins? Coders? Any ideas?

    To solve your problem outchy (and yes, somehow the identicon section got deleted in your avatar.php file), you can download files directly from the Trac browser.

    Here is the avatar.php file (long url, sorry):

    https://plugins-dev.bbpress.org/browser/avatar-upload/trunk/additional-files/my-templates/avatar.php

    You can not save that page itself, but scroll right to the bottom of it and you’ll see “Download in other formats” – just click on “Original Format” and you’ll be prompted to save a PHP file.

    You can do it for any other files you’re missing.

    #2160
    mousehunter
    Member

    I would like to display the “tag” field in the widget, however, I’m not sure how to do it. I know where to put the code to make it display, but how do I actually get the value from the DB (which table/field). I thought $bbTopic might contain it, but i was wrong. Any help would be appreciated. Thanks.

    #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

Viewing 25 results - 29,576 through 29,600 (of 32,491 total)
Skip to toolbar