Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,476 through 29,500 (of 32,436 total)
  • Author
    Search Results
  • #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>

    #59432
    _ck_
    Participant

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

    Look at forum.php template to remind yourself

    <?php while ( bb_forum() ) : ?>
    <tr<?php bb_forum_class(); ?>>

    $forum is being treated as a global and not reset back.

    I could remember and reset $forum I guess before and after the while-loop $temp=$forum; loop-here; $forum=$temp; but that’s an ugly hack. It’s got to be fixed in the core and that’s beyond my knowledge of bbpress.

    #59516

    In reply to: subforums and markup

    _ck_
    Participant

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

    Look at forum.php template to remind yourself

    <?php while ( bb_forum() ) : ?>
    <tr<?php bb_forum_class(); ?>>

    $forum is being treated as a global and not reset back.

    I could remember and reset $forum I guess before and after the while-loop $temp=$forum; loop-here; $forum=$temp; but that’s an ugly hack. It’s got to be fixed in the core and that’s beyond my knowledge of bbpress.

    #59513

    In reply to: subforums and markup

    fel64
    Member

    Yup. Just don’t display the forum if $forum->forum_parent is true. Change the bit in your templates that goes like this:

    <?php foreach( $forums as $forum ) : ?>
    //blaaaaah HTML
    <?php endforeach; ?>

    to this sort of thing:

    <?php foreach( $forums as $forum ) :
    if( !$forum->forum_parent ) { ?>
    //blaaaaaah HTML
    <?php }
    enforeach; ?>

    (ugh colon syntax)

    [Edit] Beat me to it ck (by the way, blockquote is already allowed and you’re overwriting it. Doesn’t really matter but could add conflict problems if someone wants to allow it to have attributes). Claire, worth mentioning that this method means it will ignore any subforums without you having to tell it it’s a subforum.

    Claire, markup is like this:

    <anytag> your text here </anytag>

    so actually HTML tags go between < and >. Actual code, like php code, will be shown as code if you put backticks around it. :)

    You can also use a simplified markup like http://www.loinhead.net/files/felise (just copy that into a plugin file and activate), which means that *this* is bold, _this_ italic and this@someurl turns into <a href="someurl">this</a>, etc. More on that https://bbpress.org/forums/topic/markdown?replies=10

    #59512

    In reply to: subforums and markup

    _ck_
    Participant

    If you are trying to use <b> instead of “strong” it won’t work because it’s not the “leet” xhtml standard that bbpress wants to enforce. But you can trick bbpress to allow it with this tweak:

    function allow_extra_tags( $tags ) {
    $tags['del'] = array();
    $tags['strike'] = array();
    $tags['s'] = array();
    $tags['b'] = array();
    $tags['i'] = array();
    $tags['u'] = array();
    $tags['bq'] = array();
    $tags['blockquote'] = array();
    $tags['pre'] = array();
    $tags['hr'] = array();
    return $tags;
    }
    add_filter( 'bb_allowed_tags', 'allow_extra_tags' );

    note as you can see I allow other tags too

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

    #59498
    moopress
    Member

    this is nice. good job. keep working ;)

    Dont have any suggestion sorry :P

    #59468
    fel64
    Member

    No-one knows anything about writing plugins when they start writing them. :) You said you were learning PHP, this is your chance to put it into practice/get better. This might not work but it’s the basic way you’d go about it I think.

    add_action('register_user', 'myfunctiontochangeuserstatuswhentheyregisterheh');

    function myfunctiontochangeuserstatuswhentheyregisterheh( $user_id ) {
    //I suspect somethin' like this:
    $user = get_user( $user_id );
    $user->set_role('inactive');
    }

    #54848

    In reply to: file attachments….

    mazdakam
    Member

    :) Listen!

    i know the way of bbpress minimalistic design and minimalistic develop so

    we need attachment feature for our support to wp users sometimes they need to upload their file to show and share them it comes form my experience now lets gather to make attachment plugin :) something like wp attachment any ideas?

    #58906
    mazdakam
    Member

    ha ha i agree with _ck_ i also trasnlated favorite to subscribe (peygiri – پیگیری) :) it is much better

    #51565
    fel64
    Member

    $topic->topic_last_poster is the ID of the last poster to the topic. user_profile_link( $user_id ) echoes the url of the user’s profile. You’d do something like this I think:

    <a href="<?php user_profile_link( $topic->topic_last_poster ); ?>"><?php echo $topic->topic_last_poster_name; ?></a>

    #52655
    ganzua
    Member

    “or there is a large demand.”

    well, I’m not large but I do demand :)

    “It’s very easy to apply filters to the signature just like the post text, smiles, auto-close tags and a whole bunch of other tweaks and security could be easily added.”

    and all these too

    #59485
    skipdaddyo
    Member

    You’re spot on – the flag approach it must be…

    Topic Count (and probably Post Count) is driven by a hard coded sql value that is incremented each time a topic is added a decremented when one is deleted…

    #59484
    _ck_
    Participant

    See that’s the thing, you won’t be able to pre-guess everywhere it will show up. Any future plugins will not know to obey your time logic.

    However most code should know to check for topic_status==0

    If you set it higher and then set it back when the time is right, then you should be able to get around all functions. Just don’t use 1 or 2 as a marker.

    Then every few minutes do a mysql check for any topics that have that unique number set in topic_status and if their time has past, set topic_status to zero.

    That reminds me, bbpress will need a pseudo-cron that can be hooked with a real cron job if so desired.

    #59480
    skipdaddyo
    Member

    Thanks _ck_

    After a day of hacking around (my php handicap is 27 afterall), it has been done :o)

    To cut a long story short…

    I added time and date fields to the post form (visible to moderators only)

    Told functions php to carry on as usual unless it sees a year value – otherwise it uses the value it’s given.

    The sql query that spits out the posts now only returns a row if the topic_start_time is lower than the time the request was made.

    I can supply (very fugly) code if anyone wants to do the same thing.

    The reason I wanted this is so I could start a topic or topics – and walk away. As you can with future posts in WP.

    #59242
    _ck_
    Participant

    >For a lark I pointed the plugin to the WordPress Plugin SVN. It got about 1/4 of the way through retrieving the list of plugins and died (script timeout).

    With many people accessing it, yeah it will necessary to pre-compile a default list of a full revision weekly.

    Or to be sneaky for now you can set a flag in options after each curl fetch and restart bbpress if you calculate approaching 30 seconds.

    Both ways sound like headaches.

    I wonder if the trac cache is faster/more efficent?

    ie.

    https://plugins-svn.bbpress.org/plugin-browser-for-bbpress/trunk/plugin-browser.php

    vs.

    https://plugins-dev.bbpress.org/browser/plugin-browser-for-bbpress/trunk/plugin-browser.php?format=raw

    I wonder if trac can be tricked to pre-gzip it all to download beforehand as a bundled revision? It’s got to compress wonderfully as it’s entirely plain text and repeating php functions.

    ps. be sure to take advantage of gzip support in curl / fsockopen – I have some code I wrote somewhere to do this if you need ideas

    #59325
    berniesteak
    Member

    Did you get anywhere with this either oledole? I can’t figure it, and it doesn’t look like we’re going to get any help! :(

    #51563
    outchy
    Member

    i hear what you’re saying but believe me, i tried my damndest to figure it out myself before i posted (as i do before all my questions). the problem is i don’t really understand the syntax of php code just yet so i don’t know how to use the get_user_profile_link(); function in this particular example (getting the profile link of the last poster from the entire messageboard onto the front page, it’s a little confusing). if you can give me some help on this one, i’d appreciate it.

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

    #59456
    mazdakam
    Member

    No! it is not nessecary to merge all files into one file!

    just we need to name the mo files into our main mo file for example fa_IR

    and put each mo file into plugin or template folder and it will be work :)

    #59455
    mazdakam
    Member

    oh :( this is bad news for me but i will try it

    i think it was much better that each plugin and template had separate and independent language like joomla components

    #59448
    _ck_
    Participant

    Actually, forget that way.

    I just checked the source and it’s right there for us:

    <? if (bb_is_user_logged_in()) { echo '<a href="'.get_profile_tab_link(bb_get_current_user_info( 'id' ), 'favorites' ).'">favorites</a>'; } ?>

    much better

    #59446
    _ck_
    Participant

    one quick & dirty way:

    <? if (bb_is_user_logged_in()) { ?><a href="<? echo $bb->uri.'profile.php?id='.bb_get_current_user_info( 'id' ); ?>&tab=favorites">favorites</a><? } ?>

    #2174
    mazdakam
    Member

    every one knows that tags are important but we know that writing tags for users are not easy sometimes so we need auto complete tags features

    to show and suggest tags when user type letters it would be 4 advantages

    1) fast taginig

    2) user friendly gui

    3) saving user time

    4) waiting for number 4.. no more finished :P

Viewing 25 results - 29,476 through 29,500 (of 32,436 total)
Skip to toolbar