Forum Replies Created

Viewing 15 replies - 61 through 75 (of 389 total)
  • tapiohuuhaa

    (@tapiohuuhaa)

    If you want to add to single view this functionality, you must have in your template an additional hook. The code I put needs this line added to …/content-single-view.php before the div, which has id=”bbpress-forums”.

    <?php do_action('bbp_template_before_single_view'); ?>

    tapiohuuhaa

    (@tapiohuuhaa)

    see

    https://www.sanaristikkofoorumi.net/wordpress/forums/

    click “Uusi aihe” ( = “New topic”).

    As I explained you can create the menu also by using Add new menu feature.

    Alternatively you might have opportunity to use some hook(s) to put to the end of each link button “Create new”.

    add_action( ‘bbp_theme_after_forum_title’,’your-extra-features’ );

    tapiohuuhaa

    (@tapiohuuhaa)

    In practice the pop-up list is manually made list of forums with the anchor #new-post
    .
    When a visitor choose a forum, the links goes to the form, which the visitor can create a new topic to the selected forum. I assume that you mean that. The links don’t have the forum id but the name of the webpage + #new-post

    For example forum id “30” links to the page “Sanaristikot”:

    https://www.sanaristikkofoorumi.net/wordpress/forums/forum/sanaristikot/#new-post

    You don’t need to know the forum id, because the forum id has not been used on the web-address. You need to use the generated name instead if you use the same web-address structure as I have used.

    If you want that WordPress helps you creating forum list, you can use the Add new menu feature.

    Then you need to have amr shortcode any widget plugin installed.

    Next you need to set a new menu widget to Widgets for shortcodes widget area. Look the shortcode, which has this format [do_widget id=nav_menu-X] ( X = number of the menu).

    Then you put into your own code to a suitable place
    echo do_shortcode(‘[do_widget id=nav_menu-X]’);

    Note that you need anyway use Own link feature, because you must add #new-post to the end of the web-address.

    tapiohuuhaa

    (@tapiohuuhaa)

    Using add_filter the priority setting is not important.

    But it is very important if you use you own function together with your another own function.

    It is important also if you use the same add_action hook in several snippets. because in the final run wrong order means that added code will be put to the template into wrong order. add_action is for adding your own code to templates.

    If you use some other add_action hook the priority setting is not important to change.

    tapiohuuhaa

    (@tapiohuuhaa)

    Some examples:
    This is in a snippet with priority

    function pageLists($list){...}

    this is the function call in a snippet, which has priority 18:

    if(function_exists('pageLists')){
    $address = pageLists($list);
    $y=0;
    foreach ($address as $value) {
    	if($y==0){$blogi=$value;}
    ...
    	$y++;
    	}	
    }

    Well the function pageList exist and in the final run WordPress finds it, but if I try to save the snippet without using the if-statement, Code Snippet wrongly complains that the function doesn’t exist. I just can’t save the snippet without using as such unneeded function_exists function. If I define the function in the same snippet, Code Snippet would accept the usage of the function and it would accept to save the snippet. But after saving the site will be crashed!

    Finding of existing own function succeeds sometimes and sometimes not. I don’t have figured any reason, why finding existing function fails. You can try to save your snippet without using if(function_exists(‘your-function’). If Code Snippet doesn’t allow to save the snippet, use then the function_exist(‘your-function’). But remember newer defining your function twice.

    tapiohuuhaa

    (@tapiohuuhaa)

    If you refer in another snippet your own function, which is in another snippet do this:

    1. Se the priority of the snippet, which you refer lower priority, for example 9 if you refer to it in a snippet, which has priority 10
    2. Use always if(function_exists(‘your-function’){
      // use here you own function, for example echo ‘your-function($argument);

      } in the snippet, where you use you own function, which has been defined in another snippet.

    In principle the function_exists should not be needed, but Code Snippet can’t ever check the existence of function reliable. You can’t in this respect rely on Code Snippet at all. So you must use function_exist in order to ensure, that you can save the snippet.

    WARNING!Be careful defining your own functions. Don’t ever define the same function twice. Code Snippet can’t reliable check if your own function already exists or not. It might accept that you have duplicate function definition. If you save a snippet, which cause duplicate function definition, your site will crash.

    Code Snippet has serious bugs relating with handling priorities and checking if function exists or not.

    tapiohuuhaa

    (@tapiohuuhaa)

    You can create selection box using available hooks:
    This code create Finnish button:
    https://www.sanaristikkofoorumi.net/wordpress/forums/topic/code-snippets-for-this-theme/#post-16559

    I have manually added forum links. Note that this code is replacement for single forum links too. Use just the first if statement!

    if(bbp_is_forum_archive() || bbp_is_single_view()){...}

    in addition you must add these:

    
    add_action( 'bbp_template_before_single_view' , 'topPostLinksEcho');	
    add_action( 'bbp_template_before_forums_index' , 'topPostLinksEcho');

    I have modified some templates and I have used the function differently.

    tapiohuuhaa

    (@tapiohuuhaa)

    If you can’t fix error by editing wp_(prefix_)snippets table, you can try to fix this error by using safe mode. If you can’t in safe mode delete/inactivate the problematic snippet, then you can’t ever use Code Snippet again.

    tapiohuuhaa

    (@tapiohuuhaa)

    With phpMyAdmin you should be able to clear single table without any changes in other existing tables. I have several times edited single Code Snippet records and sometimes I have deleted some Code snippet record.

    Search wp_(prefix_)snippets

    I don’t figure why you couldn’t edit single table. Anyway if you have active invalid snippet, you must get it deleted or marked as inactive in order to use Code Snippet again.

    You might have inssufficient rights for database tables. Look Manage Priviledges with control panel. In my case this can do by clicking the name of the database.

    tapiohuuhaa

    (@tapiohuuhaa)

    If the problem relates with invalid code snippet(s) uninstalling and reinstalling doesn’t help at all.

    If you have possibility to direct database access, you can delete unwanted snippet by using you control panel and there phpMyAdmin. If you don’t have direct database access you can’t fix the problem because the data is in the database. Uninstalling and reinstalling doesn’t change the database. That would need an additional option to the plugin. It might be a good idea to have option “delete database table”/ “clear database table” when installing and uninstalling.

    tapiohuuhaa

    (@tapiohuuhaa)

    403 error is access error. Malformed snippet gaves commonly another error.

    This plugin has serious problem relating with deactivating a problematic snippet. Simply it doesn’t work always.

    If user by accident fails deactivating a snippet and activates a snippet, which has the same function, Code snippet doesn’t allow to deactivate the problematic snippet.

    This is extremely big risks for sites, where the user doesn’t have direct database access. IMO this plugin should newer use with other sites as self-maintained sites, if there is not possibility to use phpMyAdmin.

    As far as I know, this is not possible with wordpress.com sites to have direct database access. Then this plugin should newer user with wordpress.com sites.

    Maybe a problematic snippet could deactivating by using safe mode even if it is not possible to deactivate snippet by using the normal deactivate/activate button, which exists in the snippet list. Activating with combined radio button is problematic, because there is always the risk, that activating/deactivating fails. User should wait some seconds to check, if changing has been happened. I have met situations, where I thought that I deactivated a snippet, but didn’t happen. Then I must open cPanel and then phpMyAdmin. I must seach problematic snippet and deactivate it editing single database record.

    Thread Starter tapiohuuhaa

    (@tapiohuuhaa)

    In practise all “sep” => ‘ | ‘ to “sep” => ”

    ../replies/template.php
    in lines 1172,1959,2199

    ../topic/template.php
    line 1406

    Thread Starter tapiohuuhaa

    (@tapiohuuhaa)

    That seems to relate with sub-forum list, which doesn’t have anymore problems, not topics and replies, which apparently need some other filters.

    Thread Starter tapiohuuhaa

    (@tapiohuuhaa)

    Seems that also separators have gone in forum list and there is instead this class definition :
    class="bbp-forum css-sep"

    For some weird reason listing doesn’t work properly in test forum (only part of sub-forums were visible), where I must used changed file.

    But separator problem still exists in

    1. …/replies/template.php
    2. …/topics/template.php
    Thread Starter tapiohuuhaa

    (@tapiohuuhaa)

    I reinstalled 2.6.1

    —/includes/forums/template.php

    has been changed in 2.6.1. so that there is not fixed separators for sub-forums. I took off the visibility CSS-trick, because it is not anymore needed.

    Because I don’t know how to set filters I must now edit these files:

    …includes/replies/template.php
    …includes/topic/template.php

    All other changed files work using a child-theme.

Viewing 15 replies - 61 through 75 (of 389 total)