Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,551 through 4,575 (of 32,577 total)
  • Author
    Search Results
  • #189895
    Robin W
    Moderator

    ok, just posting for anyone searching in future

    THIS IS A WORKING VERSION

    This code allows a standard gravity form lets it be saved as a gravity forum, but on saving also creates a new topic form for a specific forum

    add_action( 'gform_after_submission', 'set_post_content', 10, 2 );
    
    function set_post_content( $entry, $form ) {
    	//set the forum ID that the topic will be saved to
    	$forum_ID = '31086' ;
    	
    	if (!function_exists('bbp_insert_topic')) {
                require_once '/includes/topics/functions.php';
            }
    		
    		//getting post
    		$post_form = get_post($entry['post_id']) ;
    		$title = $post_form->post_title;
    		$content = $post_form->post_content;
    
            // The topic data.
            $topic_data = array(
            'post_parent'       => $forum_ID, // forum ID of Projects  hard coded
            'post_status'       => bbp_get_public_status_id(),   // Subscribed users can see this
            'post_content'      => $content,
            'post_title'        => $title,
            'comment_status'    => 'open',
            'menu_order'        => 0
            );
    
            // The topic meta.
            $topic_meta = array(
            'forum_id'    =>  $forum_ID,
            'reply_count' => 0
    		);
    
            $post_id = bbp_insert_topic($topic_data, $topic_meta);
               
    }
    #189891
    Robin W
    Moderator

    @jkw217 if you can confirm my post above – ie

    can you confirm that

    “5 random reply posts that arent working:
    – all have ‘0’ for post_parent.
    – all have a postmeta _bbp_topic_id #

    I need to know that you

    a) have EXACTLY the same problem and
    b) have the postmeta as above

    then I can give you some code

    #189885
    Robin W
    Moderator

    can you confirm that

    5 random reply posts that arent working:
    – all have ‘0’ for post_parent.
    – all have a postmeta _bbp_topic_id #

    and I can give you some code

    #189883
    carriercarrier
    Participant

    Hi again
    I tried the forum-class, but it only added “text” to my forum see http://prntscr.com/i9yywx.
    I have added the abpve CSS code to my theme.

    Its this tag-cloud widget http://prntscr.com/i9z0m6 that I would like to show above the “forum title, if possible.

    Is there something Im missing here?

    #189880
    Robin W
    Moderator

    or you could link to the ‘forum’ class as it is just before the title

    eg

    .forum::before { 
         content: "Read this: ";
    } 
    #189879
    Robin W
    Moderator

    As it’s above the title, then it’s before bbpress kicks in.

    you could try

    if (is_bbpress) {
    echo 'hello' ;
    }

    but may not work

    Or try to add something to your theme page.php or equivalent before the title
    Something like (this won’t work it’s just to start you off!)

    $array = (2925, 3567,4567) ;
    if (in_array ($page_id, $array)) {
    echo 'hello' ;
    }

    where 2925 etc are forum ID’s

    #189863

    In reply to: # Postname concept

    Robin W
    Moderator

    try this

    a.bbp-reply-permalink {
    display : none !important;
    }
    #189862

    In reply to: # Postname concept

    keshabee
    Participant

    sorry but the style code did not work.
    what i want to hide is those things post numbers like #456, #4654

    hope to hear from you soon, Thank you

    #189861

    In reply to: # Postname concept

    Robin W
    Moderator

    put this in your custom css area

    .bbp-reply-permalink {
    display : none ;
    }
    #189857

    In reply to: User Registration

    Robin W
    Moderator

    when they first log on they are allocated the default role that you set in dashboard>settings>forums.

    you can use the bbpress logon widget in a sidebar, use the shortcode [bbp-login] on a page or post, use any wordpress logion plugin or technique, or add a login to your menu using

    https://wordpress.org/plugins/bbp-style-pack/

    #189826

    In reply to: This forum is empty

    Robin W
    Moderator

    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/content-single-forum.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/content-single-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    so change line 26 from

    <?php bbp_single_forum_description(); ?>

    to

    <?php if (bbp_get_single_forum_description != 'This forum is empty.') bbp_single_forum_description(); ?>

    #189823
    Robin W
    Moderator

    This is not as easy as I thought.

    As a widget it can be shortcoded, but the version I currently have does need to do the calculation each time, which on a site with lots of forums and users could make the site slow.

    Whereabouts on the site were you thinking of – eg in sidebar, at top of each forum, within the forum list etc.

    #189822
    Robin W
    Moderator

    hmm…

    not sure what to suggest next.

    I could code a quick ‘close topic’ shortcode, but that would be beyond free – contact me via my website if interested

    http://www.rewweb.co.uk

    #189821

    In reply to: Quicktags

    Robin W
    Moderator

    bis bold
    I is italic
    B-quote puts a wordpress block around the text – exactly what is set by your theme
    Del – is delete quotes
    img is an image
    ul is an unordered list
    ol is an ordered list
    li is a list item
    code is code – stops the display from executing, just displays it
    close tags – closes all open tags

    #189815

    In reply to: Login Widget problem!

    Robin W
    Moderator

    that should work, but the code is not showing up in the browser, so it is not getting loaded.

    #189806

    In reply to: Login Widget problem!

    Robin W
    Moderator

    where are you putting this code ?

    #189796
    Robin W
    Moderator

    don’t know what is happening

    I’ve just looked at the core close topic code, and it just changes post_status to closed, although it goes via a whole bunch of code in a topic hander function which I haven’t been through line by line.

    Suggest you try just changing the status directly in the db, and see if that fixes. You can always change it back !

    #189786

    In reply to: Login Widget problem!

    Robin W
    Moderator

    try

    input[type=”text”] {
    width: 50% !important;
    }
    .bbp-login-form .bbp-password input {
    width: 50% !important;
    }
    #189772
    Robin W
    Moderator

    having a button at the top which goes to the form at the bottom can be achieved by

    bbp style pack

    dashboard>settings>bbp style pack>buttons

    Having the from hidden is quite possible, but I don’t know of any already written code to do that

    #189762
    urphy73
    Participant

    Hello everybody

    How can I delete or hide the “Create a new topic” form and replace it by a button ?

    The button will open or dropdown the “new topic for”m

    Do you know a plugin or a bit of code to do that properly ?

    Thanks in advance

    #189756

    In reply to: This forum is empty

    Robin W
    Moderator

    great

    than add this

    //This function changes the text wherever it is quoted
    function rew_change_translate_text( $translated_text ) {
    	if ( $translated_text == 'This forum is empty.' ) {
    	$translated_text = 'new text';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'rew_change_translate_text', 20 );

    Instead of ‘This forum is empty.’ you will get ‘new text’, so just change new text to what you want

    eg change the line

    $translated_text = 'new text';

    to

    $translated_text = 'Categories listed below';

    – if you want it blank then have that line say

    $translated_text = '';

    #189755

    In reply to: This forum is empty

    chrtravels
    Participant

    Hi Robin,

    In functions.php? I do know how to enter code there, via ftp or cPanel. I just don’t know what code to enter to solve for this. 🙂

    Chris

    #189730
    Robin W
    Moderator

    Nothing I know of to do that – it could be coded but beyond free help.

    #189727
    Pascal Casier
    Moderator

    Hi @process_of_illumination ,
    I see you have found the functions that you need.

    Try to avoid adding 5 functions if you can do it in 1, so at least change it to:

    add_action( 'wp_head', 'casiepa_add_noindex' );
    function casiepa_add_noindex() {
      if ( bbp_is_favorites() ) {
        wp_no_robots();
      }
      if ( bbp_is_topic_tag() ) {
        wp_no_robots();
      }
      if ( bbp_is_single_user_replies() ) {
        wp_no_robots();
      }
      if ( bbp_is_single_user_profile() ) {
        wp_no_robots();
      }
      if ( bbp_is_single_user_topics() ) {
        wp_no_robots();
      }
    }

    Of course the shortest way would be:

    add_action( 'wp_head', 'casiepa_add_noindex' );
    function casiepa_add_noindex() {
      if ( bbp_is_favorites() || bbp_is_topic_tag() || bbp_is_single_user_replies() || bbp_is_single_user_profile() || bbp_is_single_user_topics() ) {
        wp_no_robots();
      }
    }

    PS image removed.

    #189724
    chumtarou
    Participant

    Thanks very much Robin, great plugin and look forward to your future updates.

    One of the reasons we are hoping to show how many subscribers each forum has is to help market the popularity to entice more subscribers. It would be great to have the option to add the shortcode in the main forum page.

    Thanks very much!

Viewing 25 results - 4,551 through 4,575 (of 32,577 total)
Skip to toolbar