ganzua (@ganzua)

Forum Replies Created

Viewing 25 replies - 126 through 150 (of 182 total)
  • @ganzua

    Member

    Hey, fel 64!

    Then this is a bad new because it is not smart at all changing core files.

    However I have a half working “B plan” :)

    You can get rid of that streams.php error by pointing the ‘BBLANG’ to the wordpress .mo file.

    You have to change bbpress config.php like this;

    define('BBLANGDIR', '/wp-includes/languages/es_ES.mo');

    The problem is that when you copy the bbpress .mo to the wordpress .mo it doesn’t translate anything but the wp itself.

    Translation files come in two files; a .mo file and a .po file that I think is the source code.

    Perhaps you need to add anything to this .po file but I didn’t find out yet.

    @ganzua

    Member

    Hi Trent;

    ” the TRAC ticket (development and testing site) shows that this issue with translating dates from the .mo file should work now. Test it out would be the only way to find out for sure.”

    -> Nop, impossible because after wp integration you get the streams.php error whenever you set a .mo file in the config.

    Let me ask just one question; if you manually translate each file, file by file, all translation you need (excluding admin control panel) are located in the template?

    @ganzua

    Member

    “But after what I’ve integrated both of api’s: the wordpress and bbpress; this resulted in the following error:

    Fatal error: Cannot redeclare class streamreader in /var/www/pm/forum/bb-includes/streams.php on line 26″

    -> same error here

    @ganzua

    Member

    Thanks fore the answer, mdawaffe;

    I don’t understand that trac. What does it happen now? dates are translated from .mo file?

    @ganzua

    Member

    Anyway, after wp integration I haven’t been able of translating bbpress because it reports a streams.php error whenever you try to set a BBLANG file

    @ganzua

    Member

    “Very nice, sorry my ‘help’ wasn’t that useful :P

    -> Not at all, without you this integration wouldn’t have been possible!

    @ganzua

    Member

    “I would like to insert the “edit profile” link and some other stuff into my wordpress sidebar.”

    -> I think we have solved this question in the other topic ;-)

    @ganzua

    Member

    got it, it is $current_user->display_name

    so even more elegant; now when an user logs in has his nickname displayed in the sidebar

    :)

    @ganzua

    Member

    This $current_user seems to be quite useful.

    How can you insert $current_user here to replace Profile?;

    . __('Profile') .

    for “UserName’s Profile”, is there any call using $current_user?

    $current_user->NAME didn’t work

    @ganzua

    Member

    It works!!!!!!

    The working whole code is;

    function wp_registro( $before = '<li>', $after = '</li>' ) {

    if ( ! is_user_logged_in() ) {
    if ( get_option('users_can_register') )
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else { if( current_user_can('activate_plugins') ) {
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;}

    else {global $current_user; $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $current_user->ID . '">' . __('Profile') . '</a>' . $after;
    }
    }

    echo apply_filters('register', $link);
    }

    Now when any user logs in, wordpress sidebar displays a link to his profile in bb, but when is the admin the one who logs in he get a link to wp control panel. :)

    Thanks a lot fel64!

    @ganzua

    Member

    Nop but I think I got it;

    global $current_user and then $current_user->ID

    let me test with several users…

    @ganzua

    Member

    These two do not display anyting either;

    /bbpress/profile.php?id=' . ID . '">'

    /bbpress/profile.php?id=' . $user->ID . '">'

    @ganzua

    Member

    Nop, it doesn’t work; this line

    global $user; $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $user . '">' . __('Profile') . '</a>' . $after;

    links to /bbpress/profile.php?id= it is not catching the user id

    @ganzua

    Member

    :)

    I tried “activate_plugins” and it works great! The only thing left is fixing the id number because it is showing “21”.

    is” global $id” ok?

    @ganzua

    Member

    Hi fel64, thanks for the explanation.

    I tested and the function works but there are two errors in the code.

    First, the id user line displays “21” for every user

    global $id; $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $id . '">' . __('Profile') . '</a>' . $after;

    Next, if( current_user_can('administrate') doesn’t seem to work because it display a link to bbpress profile instead to /wp-admin/

    This is the whole function so far;

    function wp_registro( $before = '<li>', $after = '</li>' ) {

    if ( ! is_user_logged_in() ) {
    if ( get_option('users_can_register') )
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else { if( current_user_can('administrate') ) {
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;}

    else {global $id; $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $id . '">' . __('Profile') . '</a>' . $after;
    }
    }

    echo apply_filters('register', $link);
    }

    did I made a mistake in the second “else” ?

    @ganzua

    Member

    “you could just copy all of wp_register() into your theme (everything from function wp_register() { to the final }”

    -> do you mean copying in my theme functions.php file and then calling the fuction in the sidebar?

    “WordPress sets $id to be the user ID. It should be available, so just try it. If it’s not, you will need to put global: $id; in the line of code above it, so it knows you mean the global variable $id and not a new one.”

    -> I didn’t understand this. Do you mean something like this?

    global: $id;

    $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php$id">' . __('Profile') . '</a>' . $after;

    In reply to: En espaƱol

    @ganzua

    Member

    Tenemos una baja!

    Bueno a mi me falta poco ya con el bbpress, lo tendre que traducir a mano porque tras la integracion no hay manera de cargar un .mo pero da igual.

    Gracias por la ayuda y un saludo!

    @ganzua

    Member

    Hey fel64! thanks for the answer;

    “If you’re not comfortable writing a plugin I’d be worried about hacking core files.”

    -> I’m not skilled enough, I’m learning like you, through wordpress, but it is too much for just half month and I’d like to upload the new web by the end of next week.

    Regarding the code, I asked this same question in wp forums and user whooami told me that;

    “youre doing that assbackwards. The smart way to do what you want to do is to use an if/else statement inside your theme.”

    :)

    The original code is like this;

    function wp_register( $before = '<li>', $after = '</li>' ) {

    if ( ! is_user_logged_in() ) {
    if ( get_option('users_can_register') )
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else {
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
    }

    echo apply_filters('register', $link);
    }

    so bearing in mind the code you provided and guessing that I need to generate both links in the same way;

    function wp_register( $before = '<li>', $after = '</li>' ) {

    if ( ! is_user_logged_in() ) {
    if ( get_option('users_can_register') )
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else { if( current_user_can('administrate') ) {
    $link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;}
    else { $redirect_to = $bb_profile_link;
    }
    }

    echo apply_filters('register', $link);
    }

    or replacing that $redirect_to = $bb_profile_link; for;

    $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php<!--call id user here --> ">' . __('Profile') . '</a>' . $after;

    What I don’t know is how to add the id user to the link ??? Since it is the same id user than in wordpress the must be a way

    @ganzua

    Member

    thierryyyyyyy, I visited your page and I still can feel pain after having watched those holes in your feet. :s

    @ganzua

    Member

    Well, I have think in a more elegant solution, but this is for wordpress users that inserted bbpress in their wordpress interface. I have it half working though. First of all, my wp-login and wp-registering forms are integrated in my custom theme because I hacked wb-login.php.

    Whenever you login in wordpress there is a function in the sidebar, that displays two links;

    Site Admin -> link to wp profile.php

    Logout

    This links are defined in /wp-includes/general-template.php -> line 50

    $link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;

    You can change /wp-admin/ for bbpress/profile.php

    The first failure of this theory is that bbpress uses an id to show user profiles; bbpress/profile.php?id=1 and I have no idea how to add this id to the link plus I don’t know if bbpress user id are the same that in wordpress.

    The second failure is that if you are the admin you should get the original link to /wp-admin/

    this should be something like if user = admin then “link to /wp-admin/” else “link to /wp-admin/profile.php?id=n user”

    but since I have no idea of how to code all this I can’t go further

    :)

    @ganzua

    Member

    “You’re the admin, right? You could just bookmark the page.”

    -> Well, this is an option that I have in mind, but then all users that registered through bbpress will appear with “undefined” role in wordpress. And I can’t insert bbpress <?php login_form(); ?> in wordpress sidebar because it doesn’t work :(

    “Otherwise I suggest you write a plugin that uses the WP wp_login hook and changes the hopefully global $redirect_to depending on whether or not the user is admin. That’s for wp. bb default login behaviour is okay?”

    -> Unfortunately, I have no idea of how to write a plugin or a simple function :( I can badly modify already made code.

    @ganzua

    Member

    “I’m not sure what you’re trying to do. “

    -> I’ll try to explain better :) My web will be made with wordpress and bbpress. Only registered users can comment wp blog entries and post topics in the bbpress forum.

    Login tables are integrated and bbpress is inside the wordpress interface. When you go to bbpress you can see there the wordpress header, footer and sidebar.

    So, right now users could log in through two gates; wordpress sidebar or through bbpress frontpage.

    Well, I want to get rid of of these two gates and I want to avoid users can access wordpress dashboard and profile because the interface of these two pages is different. However, admin still needs access to wp control panel.

    In reply to: forum.2diabolos.com

    @ganzua

    Member

    “2) for the “profile” page : I created tabs

    the integration with my wordpress blog works also, but I don’t want to use that a lot.”

    Which tabs did you create and how?

    @ganzua

    Member

    “if you have any problems just ask.”

    -> thanks fel64! . I’ll go step by step. I’m going to solve the login and profile issue first because I’m having an idea :) .

    @ganzua

    Member

    “ganzua, can you post a link to your forum so we can take a look at the html/css?”

    -> I didn’t upload yet, sorry, as soon as I finish I’ll post a link so you can check everything. :) I’m working in my computer yet.

    I integrated wp and bb, and I removed bbpress header, footer and stylesheet. Now I’m using wp header, footer, sidebar and stylesheet for both, wp and bb.

    I still have to find out what to do with login and profile forms because I have two instances of each one, one for bbpress and one for wp.

    Besides I have to find out how to integrate emoticons, toolbar in forms (I have quicktags in bb and tinymce in wordpress) , post count, avatars… In fact I do not even know if all this is possible.

    “to get both IE6 and IE7 on the same Windows machine, check this out:

    * http://tredosoft.com/Multiple_IE&#8221;

    -> Thanks for the tip! I’m checking the link :)

Viewing 25 replies - 126 through 150 (of 182 total)