Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,076 through 9,100 (of 32,505 total)
  • Author
    Search Results
  • #160481

    In reply to: Request: Voting

    Lars Henriksen
    Participant

    Thank you very much Chad for taking your time to explain this.

    It works – almost like I wanted.

    The only thing that bugs me, is that you can’t vote for a single reply – it is by topic.

    If you can only vote for an entire topic/thread, it would be more logical to place the buttons next to the subscribe/favorite links in the top.

    I tried to add the code to the ‘content-single-topic-lead.php’ but to no avail.

    You can see it here.

    Anyways, I’m happy with my set up now, thanks again.

    #160473

    In reply to: Request: Voting

    Chad R. Schulz
    Participant

    Sorry, I just noticed a typo in my post. The php file you need to alter is loop-single-reply.php and it’s going to be in your plugins/bbpress/templates/default/bbpress folder. But it may also be in your theme’s folder if your theme has custom bbpress template files. If your theme has a bbpress folder in it themes/{your theme}/bbpress than that’s the file your need to make your adjustments to.

    Make your simple addition: put <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?> inbetween <?php do_action( 'bbp_theme_before_reply_content' ); ?> and <?php do_action( 'bbp_theme_after_reply_content' ); ?> either before the content <?php bbp_reply_content(); ?> or after it. It all depends on what you prefer.

    And then put it in your theme’s child folder: themes/{child-theme}/bbpress/loop-single-reply.php.

    If you aren’t using a child theme (highly recommended, BTW) you’ll will have to modify this file directly and replace it in the default folder. And, every time you update your theme and/or bbpress you may need to recreate this modification.

    And for css modifications you’ll have to insert the appropriate css mods (use Google Chrome to identify the css selectors and properties/values) into a custom.css file/plugin–I either use the one in Jetpack or in a stand alone plugin. You can also add the css modifications into your child theme’s .css file.

    –Refer to the plugin author’s support page on wordpress.org. There are a lot of valuable css tips and suggestions. Also, the author had proven to be very helpful in getting his plugin up and running for most people.

    Oh, and my website is currently in the development stage and won’t be made public for awhile. I’m building it at my leisure, “The joy of hobby sites.”

    Hopefully this clears up a few things. It’s kinda hard to describe everything in detail. I just end up muddling through until it looks/acts OK. As a suggestion make sure you keep a default/unmodded .php file handy to switch back and forth with until everything works. Wouldn’t want to have to bother reupping a new file from a theme/bbpress .zip file every time you screw something up.

    Good luck, Chad

    #160470
    Stephen Edgar
    Keymaster

    Hmmm…. I’m assuming in that case then you have no other parts (or major parts at least) missing from the DB schema you posted in the original post? e.g. No topic_title table listing the topics separately.

    If that is the case you’d now want to ignore those mappings I posted, rather remap them to the the topic and reply sections instead of the forums section.

    This is now where we add some limiting SQL expressions to separate your topics from replies.

    In the Example.php file at the end of the topics section you’ll see:

    
    // Setup any table joins needed for the topic section
    $this->field_map[] = array(
    	'from_tablename'  => 'replies_table',
    	'from_fieldname'  => 'the_topic_id',
    	'join_tablename'  => 'topics_table',
    	'join_type'       => 'INNER',
    	'join_expression' => 'USING replies_table.the_topic_id = topics_table.the_topic_id',
    	'from_expression' => 'WHERE forums_table.the_topic_id = 0',
    	'to_type'         => 'topic'
    );
    

    We’ll modify that to the following:

    
    // Setup any table joins needed for the topic section
    $this->field_map[] = array(
    	'from_tablename'  => 'forum_table',
    	'from_expression' => 'WHERE forums_table.Forum_Parent = 0',
    	'to_type'         => 'topic'
    );
    

    Similarly at the end of the replies section, we change that join expression to:

    
    // Setup any table joins needed for the topic section
    $this->field_map[] = array(
    	'from_tablename'  => 'forum_table',
    	'from_expression' => 'WHERE forums_table.Forum_Parent != 0',
    	'to_type'         => 'reply'
    );
    

    Now assuming I’ve got the logic correct in understanding your Forum_Parent/Forum_Ancestor what equals 0 and what does not equal 0 then we should be good to go 🙂

    So the topics join expression is limiting the queries for your ‘thread starter’ topics, then in the reply section expression we ignore those previously ignored topics already imported and are assuming the remaining entries in the table are replies to those topics. The Forum_Ancestor of each reply should then point to the “parent topic ID’ mapping.

    I think that’s it, one thing you’ll notice is that we also are not actually creating any forums to import the topics into, all the topics will import without being allocated to a forum, this can be bulk updated later, actually we can set a default forum for topics and relies, I’ll get back to you on that bit of code that I can’t remember of the top of my head right this second 😉

    Robkk
    Moderator

    Is this the same code that bbpress is using on this forum?

    i dont think so, i think its something else, maybe just BuddyPress but i think they took out the notifications for each @mention.

    if you use what i am talking about you type @ then after that a bunch of users names show up that are in the topic for you to put their name in.

    You are also talking about a plugin functionality

    i mean a plugin that you can paste code snippets llke the one i put above into ,

    https://wordpress.org/plugins/functionality/

    Is there also a plugin who can do this?

    For @mention notifications , BuddyPress. For placing code snippets you can use the plugin i mentioned above.

    BBC
    Participant

    @robkk
    Thank for reaction.
    Is this the same code that bbpress is using on this forum?
    You are also talking about a plugin functionality
    Is there also a plugin who can do this?
    If not then I will ask my web builder to implement your code.

    Again thanx

    Greetings
    Conrad

    @bbc

    #160450

    In reply to: Request: Voting

    Chad R. Schulz
    Participant

    I’m trying Thumbs Rating. It doesn’t tie into any user meta, so you can’t restrict the voting to only registered/logged-in users. However, it works very well and very fast. It only adds post meta so it shouldn’t noticeably slow-down your site even with thousands of topics/replies.

    After activation, per the plugin developers instructions I put the following code into my loop-single-relay.php:
    <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?>
    goes somewhere between <div class="bbp-reply-content"> and </div>
    –this is theme specific and has to be modified based on your needs. I found that placing the vote before or after and not inside the content works best as the “quote” function in the forum(s) gets screwed up with the added voting content.

    That means before/after the <?php do_action( 'bbp_theme_before/after_reply_content' ); ?>

    Of course, as a lightweight plugin some serious css work is required. And it would be best to place this modified .php file into a bbpress child theme folder to ensure it continues to work after updates.

    Good luck, Chad

    #160434
    Chad R. Schulz
    Participant

    I’m building a discussion board site that won’t use the standard bbpress forum interface. Forums will be embedded in individual post/pages with shortcodes. And all forum-type URLs will redirect to the appropriate post/page.

    So no one will have access to the normal forum structure/hierarchy. Will I still need to create categories/sub-categories/forums for the individual forums?

    This site may eventually have hundreds of forums and I’m looking to provide the best possible performance.

    Any help welcome, Thanks.
    Chad

    #160422
    jaydd
    Participant

    Hello!
    I have a forum being diplayed with forum index shortcode on a wp page. I would like to ask if there is a way to display the title of the parent of the sub-forum or the topic on the sub-forum’s or topic’s page, so always the titles of parents that one above the sub-forum or topic in the hierarchy.

    So the the point of all this would be to let the user know which forum he’s in.
    Thanks,
    Daniel

    #160413
    Robkk
    Moderator
    #160407
    tummybos
    Participant

    Thanks very much @robkk. The link on wp user query is a great tool to solve my problem.
    Concerning the use of BuddyPress, i think the link will be a problem in the sense that the links to the profiles that will be displayed will not link to the users forum profile. I want the links to go to user’s bbPress profile page, not the default wordpress user page nor the buddypress profile.
    So I have decided to go by the Wp user query way, but please how am I going to create the php code. Am i supposed to wrote it in a page? or where should I put the code and how will i create the page?
    Thanks.

    #160405
    Robkk
    Moderator

    @screenwavemedia

    create a copy of page.php rename it to bbpress.php and put a conditional tag into the code.

    i think use bbp_is_search()

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    bbPress Conditional Tags

    Robkk
    Moderator

    @mentions is not part of bbPress yet.

    but for now you can use the @mentions feature from BuddyPress and use on forums with this code.

    copy this into your child themes functions.php or use a functionality plugin.

    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
     
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );

    and i think you would get an email notification from BuddyPress anytime you get @mentioned

    for multiple users you can just separate it with a space.

    #160389
    Robkk
    Moderator

    There is a way using the wp user query

    https://codex.wordpress.org/Class_Reference/WP_User_Query

    plugins like BuddyPress have this type of feature too.

    bbPress does not have a feature/shortcode like this, but if you use BuddyPress , bbPress is compatible with it.

    #160384
    Lisa
    Participant

    Thank you, Stephen, for taking the time to create a mapping graphic. Much appreciated!

    One question: In my Forum code, the Forum_Parent, which is “0” (zero) identifies it as a thread starter, and because the Forum_Ancestor is not “0” (zero), lists it as a reply, underneath the parent, and multiples are ordered by date DESC. How does bbPress handle this? If I understand the methodology, I’ll do better at the mapping. Do I simply use the Forum_Parent for ALL?

    Hope I am clear in my question…

    Lisa

    #160381
    tummybos
    Participant

    I have a bbPress driven forum on http://ictgiants.com/questions/category/all and I want to create a page that will display the registered users on my website similar to http://stackoverflow.com/users.

    Please if there is a plugin or shortcode that does this, that is what I need
    Any idea and links will be appreciated.
    Thanks in advance

    #160377
    mvasicm
    Participant

    Hi there,
    I have bbp-register shortcode, but I need to implement next step in the registration. Im using Paid Membership Pro to make membership levels. For now, I have only registration into bbpress, but the user is not redirected on the page where he can choose his membership level…Every new member is registered without any membership.

    Is it possible to add this feature into registration process?

    Thanks!!

    #160372
    Robin W
    Moderator

    ok, undo that previous change by deleting that file, it was rubbish !

    Then in your function file add

    function default_reply_subscribed() {
    
    		// Get _POST data  IE is this a first post of a topic?
    		if ( bbp_is_post_request() && isset( $_POST['bbp_topic_subscription'] ) ) {
    			$topic_subscribed = (bool) $_POST['bbp_topic_subscription'];
    
    		// Get edit data  IE either the author or someone else is editing a topic or reply
    		} elseif ( bbp_is_topic_edit() || bbp_is_reply_edit() ) {
    
    			// Get current posts author
    			$post_author = bbp_get_global_post_field( 'post_author', 'raw' );
    
    			// Post author is not the current user EG a moderator is altering this. In this case we'll leave the default to blank, 
    			//as much of the time mods are correcting or moderating, their not interested in the topic itself !
    			if ( bbp_get_current_user_id() !== $post_author ) {
    				$topic_subscribed = bbp_is_user_subscribed_to_topic( $post_author );
    
    			// Post author is the current user  IE you're editing your own post, so default should be to see any replies
    			} else {
    				$topic_subscribed = true ;
    				//the next line is what it used to say instead of true
    				//bbp_is_user_subscribed_to_topic( bbp_get_current_user_id() );
    			}
    
    		// Get current status
    		} elseif ( bbp_is_single_topic() ) {
    			//the user is writing a new reply ?
    			$topic_subscribed = true ;
    			//the next line is what it used to say instead of true
    			//bbp_is_user_subscribed_to_topic( bbp_get_current_user_id() );
    
    		// No data
    		} else {
    			$topic_subscribed = true;
    			//used to say false !
    		}
    
    		// Get checked output
    		$checked = checked( $topic_subscribed, true, false );
    
    		return apply_filters( 'default_reply_subscribed', $checked, $topic_subscribed );
    	}
    	
    add_filter ('bbp_get_form_topic_subscribed', 'default_reply_subscribed') ;
    
    function default_log_edit_false() {
    
    		// Get _POST data
    		if ( bbp_is_post_request() && isset( $_POST['bbp_log_reply_edit'] ) ) {
    			$reply_revision = $_POST['bbp_log_reply_edit'];
    
    		// No data
    		} else {
    			$reply_revision = 0;
    		}
    
    		return apply_filters( 'default_log_edit_false', checked( $reply_revision, true, false ) );
    	}
    
    add_filter ('bbp_get_form_reply_log_edit', 'default_log_edit_false' ) ;

    Functions files and child themes – explained !

    that should do both topic edit and reply subscribed.

    #160368
    WutHirsch
    Participant

    O.K. Guys, i find the problem by my own.
    Typing Error, the right code is:

    #bbpress-forums, .article, div#content_box.sidebar_layout {
    	width: 100%;
    }

    But now my Start Page got a full width too, again.
    Hmm, ok so i have to try to fix it again.
    It would be easier if i would find the Page id from the forum root.

    But i dont know, where can i find it.
    Normaly i can see the page id in the urls.
    Its not possible here.

    #160366
    WutHirsch
    Participant

    Hello everyone,

    i am very new to CSS & HTMl, i tried to solve my problem by my own, but i didn’t get it.
    Maybe someone has a idea how i can fix my new bbpressforum.

    Only half of the site is used by BBpress. BBpress should use all the remaining free space.

    Thats why i tried yet.
    The widget area dissapeard and bbpress should fill out the empty space.
    But yeah, how you can see its not working. (http://www.forest-game.de)

    My Code:

    #bbpress-forums .article, div#content_box.sidebar_layout {
    	width: 100%;
    }
    #bbpress-forums .article, .sidebar.c-4-12 {
    	display: none;
    }

    Edit:, oh i did something wrong. The widgets areas on the other sites dissapeared too ^-^

    Kindly regards

    #160362
    Stephen Edgar
    Keymaster

    You may need to extract the users out to a separate table, or you may be able to treat these users as “anonymous users”, I’d suggest first though I’d look at mapping some of the fields for the content only as that should not take much time to get up and running.

    First you want to do this with bbPress 2.6 ‘alpha’ rather than the current 2.5.6 release as there are significant improvements to the importers in the upcoming version.

    You can get your hands on 2.6 alpha via https://wordpress.org/plugins/bbpress/developers/ and it is listed under “Other Versions” as “Development Version”
    Or the direct download link https://downloads.wordpress.org/plugin/bbpress.zip

    Next you want to make a copy of Example.php from the includes/admin/converters folder of the plugin to MyConverter.php and in that file replace any instance of Example with MyConverter (this is case sensitive to be mindful of that)

    Next up start mapping the fields from your schema to the fields in MyConverter.php

    In the following screenshot I’ve mapped drawn lines to the easily concluded fields, any field mappings that you do not use you can simply delete, ideally using as many as you can will ensure the best bbPress experience for your data though.

    Take a stab at doing the above for the rest of your database, topics, replies etc and get back to us.

    If you need a place to host code snippets, use GitHub Gists: http://gist.github.com

    #160361
    David13_13
    Participant

    I have changed this code too:

    `<input name=”bbp_log_reply_edit” id=”bbp_log_reply_edit” type=”checkbox” value=”0″ <?php bbp_form_reply_log_edit(); ?> tabindex=”<?php bbp_tab_index(); ?>” />

    in the form-reply.php, but the checkbox is still checked by default

    #160358
    Robin W
    Moderator

    ok thanks I can see it now.

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-topic.php
    bbPress will now use this template instead of the original

    then edit this file to change line 183

    <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" 
    

    etc.

    to

    <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="0" 
    

    etc.

    It will then be unchecked by default

    #160344
    Robin W
    Moderator

    writing an entire forum code for wordpress as a solo project seems to be a significant challenge, so using bbpress and amending that would seem to be a good strategy.

    ok, since you seem to be very php savvy, suggest you go to

    https://codex.bbpress.org/import-forums/

    and simply amend one of the templates there for your forum.

    #160343
    Lisa
    Participant

    I’ve made the decision to develop my new websites using WordPress. My goal is to eventually re-write my PHP code as a WordPress plugin, but, until then I need to use what’s available, and bbPress seems like a good option. I need to import/map my current tables to work with bbPRess, but not sure how?

    Here is the existing schema along with one parent record, and one child record:

    Forum_1962 (
    Forum mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
    Forum_Title varchar(200) NOT NULL DEFAULT ”,
    Forum_Author varchar(100) NOT NULL DEFAULT ”,
    Forum_Author_Email varchar(100) NOT NULL DEFAULT ”,
    Forum_Text text NOT NULL,
    Forum_Parent mediumint(8) unsigned NOT NULL DEFAULT ‘0’,
    Forum_Ancestor mediumint(8) unsigned NOT NULL DEFAULT ‘0’,
    Forum_Category smallint(5) unsigned NOT NULL DEFAULT ‘0’,
    Forum_Approved enum(‘0′,’1’) NOT NULL DEFAULT ‘1’,
    Forum_Entered_by varchar(10) NOT NULL DEFAULT ‘0’,
    Forum_Date_Created datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    Forum_Last_Changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (Forum),
    KEY Forum_Parent (Forum_Parent),
    KEY Forum_Category (Forum_Category),
    KEY Forum_Approved (Forum_Approved),
    FULLTEXT KEY Forum_Title (Forum_Title),
    FULLTEXT KEY Forum_Text (Forum_Text)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

    Parent thread
    =============
    (19261, ‘Can I rent an RV?’, ‘BillB’, ‘bill@web-crafter.net’, ‘I\’d like to give RVing a try, but there\’s no way I\’m going to plunk down thousands of $$ to buy an RV. Is it possible to rent an RV like you\’d a car?’, 0, 19261, 1962, ‘1’, ‘rvcn’, ‘2002-12-12 13:52:29’, ‘2002-12-12 13:53:25’);

    Ancestor thread
    ===============
    (19262, ‘Re: Can I rent an RV?’, ‘Mark’, ‘mark@ittelligent.com’, ‘No problem. Just check your yellow pages for a rental agency in your area. I know there are a few national outfits too. Cruise America and El Monte come to mind off the top of my head.’, 19261, 19261, 1962, ‘1’, ”, ‘2002-12-12 13:59:42’, ‘2002-12-12 13:59:42’);

    You’ll notice that there are fields for both parent and ancestor, which allows for infinite sub-topic threads (those replies to replies under one parent). Also, I the author name and email are also stored in this table, and not tied to a separate user table (so will need to address that). Each MySQL dump is between 1MB and 3MB.

    Need any more information? Please advise.

    My goal is one of two options:

    1. Import/Map existing table dumps in several websites to WordPress and bbPress using above forum schema as source, OR
    2. Convert my existing PHP forum code to be compatible with WordPress and forget about bbPress altogether if I can’t easily map the table (I don’t know WordPress enough to even think about doing this myself, even though the code is simple and fast, and will ne advice on someone who can)

    I am doing this so I can better control the mobile templates and have a more robust way of controlling my websites. I need to do this for about 6 websites, and would like the method to do this myself after the first time.

    Thanks in advance,

    Lisa

    #160332

    In reply to: Not the heading I want

    Robin W
    Moderator
Viewing 25 results - 9,076 through 9,100 (of 32,505 total)
Skip to toolbar