Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,926 through 6,950 (of 32,505 total)
  • Author
    Search Results
  • #171748

    In reply to: PHP in Topics

    rbarron
    Participant

    <?php bbp_user_profile_url(bbp_get_current_user_id());?>">Complete your profile</a> and upload a profile photo.

    #171747

    Topic: PHP in Topics

    in forum Troubleshooting
    rbarron
    Participant

    How do I create a link in a topic to allow users to edit their profile? Something like:

    Thank you.

    #171739
    _az_
    Participant

    There is a function: bbp_get_super_stickies() which is used inside the function bbp_has_topics(). This function basically returns a list of Post IDs from the wp_options table from a row with the key: “_bbp_super_sticky_topics” or “_bbp_sticky_topics”

    So one approach could be: override default args

    bbp_has_topics(array('show_stickies' => false);

    Extra loop for stickys (not tested, just a sketch)

    $query = new WP_Query(array('inlucde' => bbp_get_super_stickies());

    Though i recommend looking into the function bbp_has_topics to be aware of all possible cases.

    #171728
    Erik Molenaar
    Participant

    Hallo Manuel,

    Just to let you know, I ended up with removing the functionality of a public profile page for my bbpress users by:

    1. Removing the author links (so Google won’t find them anymore):

    
    /*-----------------------------------------------------------------------------------*/
    /* Remove all author links from bbpress pages
    /*-----------------------------------------------------------------------------------*/
    
    add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2);
    add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2);
    add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2);
    
    function remove_author_links($author_link, $args) {
    $author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link);
    return $author_link;
    }

    2. Placing a noindex meta tag in my bbpress user templates (so the already indexed profile links will disappear from Google):

    <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW" />

    Thanks again for your prompt replies and I hope this is of use to you πŸ™‚

    #171726
    Pascal Casier
    Moderator

    On your dashboard, go to ‘Tools > bbP Toolkit’
    Under the ‘bbPress Information’ button you can tick
    Do not show the counters next to the subforums on the forum index page (v1.0.5)
    And then put the
    Change the separator between the subforums on the forum index page to:
    to ‘newline’

    Pascal.

    #171725
    Pascal Casier
    Moderator

    Kalimera,

    Strange, mostly width 100% is needed, but it’s because of the width 100% that you have this issue πŸ™‚

    Try to add the following CSS:

    #bbpress-forums div.reply {
      width: auto;
    }

    Pascal.

    #171712
    DL
    Participant

    Thanks! I appreciate your help, I’m desperate to update these sites on old versions of Zikula. I can’t even update the PHP on the server past 5.3 because because Zikula 1.2x won’t work on anything later.

    The issues you noted.

    Categories
    aren’t used much, so yes, they can be ignored, it doesn’t seem like it’s difficult to assign forums to categories in bbPress if needed.

    Subscriptions
    The table prefix is causing me confusion as I switch between databases. Some of my forums have databases using nuke_ for prefix and some have zk_ , this is an artifact from many years of using Postnuke/Zikula and based on when the original database was created.

    in the dizkus schema the (prefix)_dizkus_subscription table contains which forums a user is subscribed to.

    The (prefix)_dizkus_topic_subscription table contains which topics a user is subscribed to.

    Topic Author IP
    This isn’t necessary to move to bbPress as far as I’m concerned. Only used when I’m investigating a possible spam post. Someone else might need to have it though, so put it on the “nice to have” list.

    Topic Content
    None of the conversion attempts have been successful enough to see yet. So far have always errored out because of failed sql statements.

    I attempted to do a join because the title of a new topic is stored in (prefix)_dizkus_topics along with the topic post time, views, num. replies, last post ID, forum ID, and sticky status (0 or 1). But the content of the first post in a topic is stored in the (prefix)_dizkus_posts table.

    There is no “first post in topic” post ID in either table, as it looks like phpBB had so I tried to adapt this.

    // Topic content.
    		// Note: We join the 'posts' table because 'topics' does not include topic content.
    		$this->field_map[] = array(
    			'from_tablename'  => 'posts',
    			'from_fieldname'  => 'post_text',
    			'join_tablename'  => 'topics',
    			'join_type'       => 'INNER',
    			'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_content',
    			'callback_method' => 'callback_html'
    		);

    Topic Favorites
    Dizkus doesn’t have topic favorites, only forum.

    Passwords
    Since Dizkus doesn’t store passwords, they would have to taken from (prefix)_users table, but thinking about it I’m not sure that this script needs to deal with passwords at all. I will still need to migrate ALL the users from the Zikula installs, not just the ones that have posted in the forums. I’m planning on using WP All Import Pro for that job and migrating other data like converting news items to news and bringing over static pages.

    Worst case, if the passwords get screwed up everyone would have to use the “lost password” system to set a new one.

    Just tried the version of dizkusZK in Github after merging your changes and got this error.

    Repair any missing information: Continue
    WordPress database error: [Unknown column 'zk_users.pn_uname' in 'field list']
    SELECT convert(zk_dizkus_users.user_id USING "utf8mb4") AS user_id,convert(zk_users.pn_uname USING "utf8mb4") AS pn_uname,convert(zk_users.pn_email USING "utf8mb4") AS pn_email,convert(zk_users.pn_url USING "utf8mb4") AS pn_url,convert(zk_users.pn_user_regdate USING "utf8mb4") AS pn_user_regdate,convert(zk_users.pn_user_avatar USING "utf8mb4") AS pn_user_avatar FROM zk_dizkus_users AS zk_dizkus_users LIMIT 0, 100
    No users to convertNo data to cleanStarting Conversion
    #171706
    Stephen Edgar
    Keymaster

    Firstly, awesome job at what you’ve done so far πŸ™‚

    I just sent through a pull request with some basic/minor changes

    These are the things I noticed when comparing the DB schema to the importer:

    Categories:
    β€’ This will be tricky as they are in a different table nuke_dizkus_categories, can you manually create these and add the forums to them later after import etc?

    Forum subscriptions:
    β€’ Your schema suggests nuke_dizkus_subscription rather than this zk_dizkus_forum_subscription

    Topic Author IP:
    β€’ With some juggling of the phpBB query this should be possible I think

    Topic content:
    β€’ This doesn’t quite look right, have you had issues with multiple same topics imported when you run the import at the moment?

    Topic favorites:
    β€’ It looks like there are no topic favorites, though I do see forum favorites in nuke_dizkus_forum_favorites, unless the value stored in user_favorites stored in the nuke_dizkus_users table is for user favorites maybe

    Passwords:
    β€’ Passwords are hard πŸ™

    Password verify class:
    β€’ If password importing works this field should match the importer class name dizkusZK

    #171701
    Stephen Edgar
    Keymaster

    I did spend several hours trying to modify the phpBB converter to work with the Dizkus database tables before coming here. Was able to get it partly working but was losing meta data like poster name, post time, and it seemed the posts (replies) weren’t always assigned to the right topic.

    If you still have the code for what you did here could you also upload that please, will save me some time and help me out quite a bit if you could πŸ™‚

    #171700
    DL
    Participant

    The sites I have using Dizkus are on Zikula 1.2.10 and using Dizkus 3.1.

    The Github you linked is a newer version that was supposed to get ready for the new Bootstrap version of Zikula, schema would be completely different. I doubt if anyone is actually using that version because Zikula 1.2.10 and Dizkus 3.1 were the last backward compatible and widely used versions.

    Because of the break in development I don’t think the code for those versions are online anywhere.

    I’ve uploaded a structure dump from the biggest site to.
    http://linkpro.net/files/zikula-1210-nuke-prefix.sql

    Thanks for any help or tips you can provide. If a full dump of the database would help I can package one up but would need a more secure way to share it with you.

    #171698
    Stephen Edgar
    Keymaster

    Is the latest version of Dizkus v1.3?

    Does this look like the source code? https://github.com/paustian/Dizkus

    The partial work that you did could you post the source code to GitHub please and I’ll take a look https://gist.github.com/

    #171696

    In reply to: Admin Bar Menu Editing

    wafflecloud
    Participant

    That worked beautifully! You totally and completely rock….HARD!
    A huge thank you! I wish there was a button I could click to thank you with or something but all I can think to do is share my code so it can help others / hopefully prevent you from having to answer the same question again.

    Here is what I put to make it work:

    <?php
    function annointed_admin_bar_remove() {
            global $wp_admin_bar, $current_user;
            get_currentuserinfo();
    $myadmins = array(1, 3); // Add all IDs of the admins in this array
    if ( !in_array($current_user->ID, $myadmins) ) {
            $wp_admin_bar->remove_menu('wp-logo');          // Remove the WP Logo Menu
            $wp_admin_bar->remove_menu('site-name');        // Remove the site name menu
            $wp_admin_bar->remove_menu('view-site');        // Remove the view site link
    }
    }
    
    add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove');
    spleen387
    Participant

    Hi, I’m writing a plugin that wraps around most of the bbpress pages using add_action
    for some reason when I try
    add_action('bbp_template_before_search',
    it works, but only with text. when I check the source files in the web inspector it’s missing javascript files for my plugins.

    I’m using wp_enqueue_script to add my script, it works on /forums so I don’t really understand why It wouldn’t for the search page

    #171679
    Robin W
    Moderator

    So yes I’d love to see how you created that great layout, and maybe share the code to allow others to get the same effect.

    Are you up for that?

    #171674

    In reply to: Admin Bar Menu Editing

    Pascal Casier
    Moderator

    Hi,
    No dumb questions here…

    As you might have seen in your database, the ID field is a bigint, so to continue on the IF that you used, you could go for:

    $myadmins = array(1, 2); // Add all IDs of the admins in this array
    if ( !in_array($current_user->ID, $myadmins) ) {

    Pascal.

    #171659
    Robin W
    Moderator

    it’s do-able but I don’t know of anything that already does this.

    Suspect you need to pay someone to cut the code for you.

    try http://jobs.wordpress.net/

    #171653
    Pascal Casier
    Moderator

    If you look for a coder concerning WP/bbPress, don’t forget to post on http://jobs.wordpress.net/

    Pascal.

    #171652
    DL
    Participant

    Thanks for the codex links.

    I did spend several hours trying to modify the phpBB converter to work with the Dizkus database tables before coming here. Was able to get it partly working but was losing meta data like poster name, post time, and it seemed the posts (replies) weren’t always assigned to the right topic. Also, what to do about avatars and signatures.

    I’ll try doing it from scratch based on the codex example.phpj. Was just hoping someone had already done it.

    As far as Dizkus, here is a small basic forum that uses it.
    http://www.deltasailing.com/Dizkus/viewforum/forum/1

    And a larger one
    http://www.thebeachcats.com/forums

    I’ve put this out on Codeable.com to pay to get it done if anyone here does projects there.

    #171648
    Stephen Edgar
    Keymaster

    I’ve never heard of Dizkus πŸ™

    You could try making some more changes to the phpBB importer yourself if it already partially works:

    Custom Import

    Also checkout both of these for SMF and phpBB for the upcoming bbPress 2.6 release.

    https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/phpBB.php
    https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/SMF.php

    #171645

    In reply to: Admin Bar Menu Editing

    Pascal Casier
    Moderator

    Hi,
    Are you sure your $current_user already has data at that moment ?

    Just before your if statement, try to run
    get_currentuserinfo();
    And just to make a quick test, you could always echo the ID just after running the above function to verify
    echo 'User ID: ' . $current_user->ID . "\n";
    Pascal.

    #171637
    Stephen Edgar
    Keymaster

    If you look at the phpBB importer it has the callback_html and parses a bunch or regular expressions to manipulate the previous BBCode or HTML strings, will that work for you?

    https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/phpBB.php#L934

    #171627
    Pascal Casier
    Moderator

    Hi,
    You could do this by copying the bbPress php file needed to a (child) theme and then modify it accordingly.
    More info here: https://codex.bbpress.org/themes/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
    Pascal.

    #171611
    #171610

    In reply to: Notifications Widget

    wafflecloud
    Participant

    Sorry for double posting but I figured the following would be beneficial for anyone who might view this as well.

    I decided to go the latter route and used this code:

    
    function annointed_admin_bar_remove() {
            global $wp_admin_bar,        
            $wp_admin_bar->remove_menu('wp-logo');          // Remove the WP Logo Menu
            $wp_admin_bar->remove_menu('site-name');        // Remove the site name menu
            $wp_admin_bar->remove_menu('view-site');        // Remove the view site link
    
    }
    
    add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove');
    
    #171609

    In reply to: how to remove sidebar?

    Robin W
    Moderator
Viewing 25 results - 6,926 through 6,950 (of 32,505 total)
Skip to toolbar