Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 14,951 through 14,975 (of 32,519 total)
  • Author
    Search Results
  • Lynq
    Participant

    If you want to do it yourself then I would recommend looking here first: https://codex.wordpress.org/Theme_Development – It tells you a bit about getting to grips with wordpress themes in general and then you can move onto bbPress which sits inside your wordpress theme.

    Good luck.

    #123073
    josephmiddleton
    Participant

    Greetings all, I hope everyone is having a safe holiday season.

    When I upgraded to 3.5 and I go to the page that houses bbpress forums, these are the error messages my browser is displaying…

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET4.0C; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET CLR 3.0.4506.2152; BRI/2; BOIE8;ENUS)
    Timestamp: Mon, 17 Dec 2012 01:41:19 UTC

    Message: Object required
    Line: 191
    Char: 1
    Code: 0
    URI: http://joseph.heavenboundministry.com/jjblog/?forum=discussion-forum

    Message: ‘length’ is null or not an object
    Line: 2
    Char: 14331
    Code: 0
    URI: http://joseph.heavenboundministry.com/jjblog/wp-includes/js/jquery/jquery.js?ver=1.8.3

    Message: ‘length’ is null or not an object
    Line: 2
    Char: 14331
    Code: 0
    URI: http://joseph.heavenboundministry.com/jjblog/wp-includes/js/jquery/jquery.js?ver=1.8.3

    Message: ‘length’ is null or not an object
    Line: 2
    Char: 14331
    Code: 0
    URI: http://joseph.heavenboundministry.com/jjblog/wp-includes/js/jquery/jquery.js?ver=1.8.3

    Message: ‘length’ is null or not an object
    Line: 2
    Char: 14331
    Code: 0
    URI: http://joseph.heavenboundministry.com/jjblog/wp-includes/js/jquery/jquery.js?ver=1.8.3

    Message: ‘length’ is null or not an object
    Line: 2
    Char: 14331
    Code: 0
    URI: http://joseph.heavenboundministry.com/jjblog/wp-includes/js/jquery/jquery.js?ver=1.8.3

    Thank you all for helping me fix my web site, Thanks and happy holidays…

    Joseph

    #123064
    Hansaplastique
    Participant

    I have no idea – it seems that this is a tinyMCE plugin?
    I haven’t played with 3rd party tinyMCE plugins yet – but if you tell me how to install it, then I wouldn’t mind testing it for you.

    Bottomline is that you’ll have to look for the “keyword” to get the button to become visible (in this case “preview” according to this link). Add that keyword to the “array_push” list.

    One plugin I use (WP Smileys) requires that I make a few minor modifications;

    In functions.php (in the code above, just below “add_filter(‘mce_buttons_2’, ‘add_tinymce_buttons_2’);”), I had to add:

    // Restore the smileys plugin
    add_filter(“mce_external_plugins”, “s4w_tinymce_addplugin”);
    add_filter(‘mce_buttons’, ‘s4w_tinymce_registerbutton’);

    #123057
    Hansaplastique
    Participant

    I guess the code formatting didn’t work again … wish I could edit.

    #123056
    Hansaplastique
    Participant

    Thanks Stephen – and here I thought the “code” button would do that for me ๐Ÿ˜‰
    I’ll paste the code again, as you can see I removed some buttons (that have no purpose anyway) and added some …


    add_filter('tiny_mce_before_init', 'tinymce_other_css_for_content');

    function bbp_mce_override( $args = array() ) {
    $args['teeny'] = false;
    return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_mce_override' );

    if (!is_super_admin()) // remove/add buttons for non admins
    {
    function add_tinymce_buttons($buttons)
    {
    $arr_size=count($buttons);
    $remove_these=array('blockquote','wp_adv','fullscreen','wp_more');

    for ($counter=$arr_size; $counter>=0; $counter--)
    {
    if ( in_array($buttons[$counter],$remove_these) )
    {
    unset($buttons[$counter]);
    }
    }

    array_push($buttons,'separator','cut','copy','paste','separator','undo','redo','separator','sub','sup','forecolor','backcolor','charmap');

    return $buttons;
    }

    function add_tinymce_buttons_2($buttons)
    {
    unset($buttons);
    return $buttons;
    }

    add_filter('mce_buttons', 'add_tinymce_buttons');
    add_filter('mce_buttons_2', 'add_tinymce_buttons_2');
    }

    For some of these to work I had to expand the allowed_tags in WordPress (be carefull when doing this) using the following code;


    function my_allowed_html_tags_in_comments() {
    define('CUSTOM_TAGS', true);
    global $allowedtags;

    $allowedtags = array(
    'a' => array(
    'href' => array (),
    'title' => array ()),
    'blockquote' => array(
    'cite' => array ()),
    'cite' => array (),
    'code' => array(),
    'em' => array(),
    'strong' => array(),
    'pre' => array(
    'class' => array()),
    'p' => array(
    'style' => array()),
    'span' => array(
    'style' => array()),
    'sup' => array(),
    'sub' => array()
    );
    }

    add_action('init', 'my_allowed_html_tags_in_comments', 10);

    Hope it’s helpful to someone ๐Ÿ™‚

    #123040
    Lynq
    Participant

    I am not sure of any plugins, but you could create one.

    You could use the post_publish action – https://codex.wordpress.org/Plugin_API/Action_Reference/publish_post

    And then check the post type using https://codex.wordpress.org/Function_Reference/is_singular and then the email after grabbing the contents of the topic that was just posted.

    Good luck! ๐Ÿ™‚

    #123038
    Stephen Edgar
    Keymaster

    Wrap the code in <pre><code></code></pre>

    #123037
    Hansaplastique
    Participant

    If anyone can tell me how to properly post code I’ll try again. ๐Ÿ™

    #123036
    Hansaplastique
    Participant

    Sorry that the code looks a little messy, the code-tag didn’t do a very good job at keeping the indentation and there is no edit button …. hmmm.
    I’ll just give it another try.


    function bbp_mce_override( $args = array() ) {
    $args['teeny'] = false;
    return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_mce_override' );

    if (!is_super_admin()) // remove buttons for non admins
    {
    function add_tinymce_buttons($buttons)
    {
    $arr_size=count($buttons);
    $remove_these=array('blockquote','wp_adv','fullscreen','wp_more');

    for ($counter=$arr_size; $counter>=0; $counter--)
    {
    if ( in_array($buttons[$counter],$remove_these) )
    {
    unset($buttons[$counter]);
    }
    }

    array_push($buttons,'image');

    return $buttons;
    }

    function add_tinymce_buttons_2($buttons)
    {
    unset($buttons);
    return $buttons;
    }

    add_filter('mce_buttons', 'add_tinymce_buttons');
    add_filter('mce_buttons_2', 'add_tinymce_buttons_2');
    }

    #123035
    Hansaplastique
    Participant

    I’ve used the following code to remove some buttons for non-admins.
    This will keep your normal editor in the admin pages as they should stay, yet visitors of my bbPress forum can only use a few buttons.
    You can find a list of “standard” buttons in tinyMCE here.

    Place this code in the functions.php file of your theme.
    (ps. I’m no expert and pretty new to bbPress – but this worked like a charm for me)

    function bbp_mce_override( $args = array() ) {
    $args['teeny'] = false;
    return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_mce_override' );

    // *********************** CUSTOMIZE TINYMCE BUTTONS FOR BBPRESS *****************************
    if (!is_super_admin()) // remove buttons for non admins
    {
    function add_tinymce_buttons($buttons)
    {
    $arr_size=count($buttons);
    // remove blockquote, kitchen-sink, full-screen and the more-button
    $remove_these=array('blockquote','wp_adv','fullscreen','wp_more');

    for ($counter=$arr_size; $counter>=0; $counter--)
    {
    if ( in_array($buttons[$counter],$remove_these) )
    {
    unset($buttons[$counter]);
    }
    }

    // add the "image" button
    array_push($buttons,'image');

    return $buttons;
    }

    // Erase the entire 2nd button bar
    function add_tinymce_buttons_2($buttons)
    {
    unset($buttons);
    return $buttons;
    }

    add_filter('mce_buttons', 'add_tinymce_buttons');
    add_filter('mce_buttons_2', 'add_tinymce_buttons_2');
    }

    #123034
    Hansaplastique
    Participant

    I’m no expert (and pretty new to bbPress), but this is how I forced tinyMCE for bbPress 2.2.3 to use my stylesheet for content.

    You’ll need a CCS file with your preferences of course, and add the following code to functions.php found in the root of your theme – in my case I’m using the CSS of my theme.
    This will also apply the selected CSS to the editor in your admin pages (for Posts etc).

    function tinymce_other_css_for_content( $init ) {
    $init['content_css'] = get_bloginfo('stylesheet_url');
    return $init;
    }

    add_filter('tiny_mce_before_init', 'tinymce_other_css_for_content');

    #123019
    rewindcaz
    Participant

    In any theme file (preferably header.php), how can I check if the current page is a bbp-user-page, the pages that show info regarding the bbp-user. Using bbp_is_user_home() I can see if the current user is on his user-page, but I need to check if the user-page is current regardless of who is viewing it. Anyone know how? Thanks

    AllenPayne
    Participant

    @John James Jacoby

    Ultimate TinyMCE buttons show up now after using your code but they don’t work.

    I just created a new bbpress post and used the Ultimate TinyMCE’s buttons to make some text bold, change the font size, color, underline, etc.. and when i submitted the post only the bold text remained unchanged. All my other formatting (font size, color, underline) was not preserved and was lost after submission.

    Please help.

    #122838
    rewindcaz
    Participant

    I’m running into an odd problem, I need to apply some custom changes to the base forums page/index, which would be easy except for this issue: If I try to get the url, title, or any value of the index page, it uses all the values from the last Category in that forum. To further clarify, if my 4 main categories of my forum index are:

    – Forums –
    Basketball
    Football
    Volleyball
    Tennis

    And on this index page wherever I use echo the_title();, it will show “Tennis” instead of “Forums”. It does this for ANY wp variable/function etc. The Forum Index simply uses the values of the last category. If I change the order of the categories, or add a new forum, the forum index values will change to the last descending forum. This is making it impossible for me to print specific information out on the forums index page.

    Anyone have any idea what the issue is that’s causing it? I’ve played around with permalinks, pages, posts etc… it always does the same thing.

    #122836
    rewindcaz
    Participant

    The closest thing I could find is:

    echo get_the_title($post->post_parent);

    However, that only grabs the parent from one step back in the bread crumb. I need to get the “main” or “base” parent of all pages/threads under the parent. Say the forum structure is like this:

    Forum > Tennis > Tutorials > Thread Name 1

    The set “parent” in that is “Tennis” (bolded above). Is there a way I can print that main parent for all bbPress pages?

    #122835
    rewindcaz
    Participant

    All I want is a way to print the name of the parent category for any given bbPress page from the header.php file of my theme.

    I need something as simple as:

    echo forum_name($forum->forum_parent);

    Although that doesn’t work for me. Anyone know how to get the parent name? Thanks!

    #122819
    Destillator
    Participant

    Thanks for the suggestion, but unfortunately changing the permalink-settings didn’t help. I’ve narrowed it down a little bit further; I use a wrapper for the entire forums with a file bbpress.php in my theme. Where a simple the_content statement first rendered the forums, they now fail to do so. If I replace the_content in bbpress.php with the code that’s present in plugins/bbpress/templates/bbp-twentyten/archive-forum.php, the frontpage shows up. But all links lead to 404 not found pages. Am I missing something here?

    ratsoid2
    Participant

    Hey guys,
    I am doing a project needs a forum, so I’m using bbPress 2.0. Since it’s for my company which is multinational and we have more than 1 language spoken, I modified the Recent Replies and Recent Topics widgets to show the parent forum so that people can determine if they can actually understand what is in there. You can add the Show Parent Forum through te widget option and I sticked to the original code format when doing the mod.

    I didn’t create a plugin for this, if someone wants to, they can go ahead and do just that. Maybe add others options that they want. Code is below:

    http://pastebin.ca/2293446

    put it in a .php file, and in functions.php add something like

    include TEMPLATEPATH . '/lib/widgets/widget-bbpress.php';

    of course, replace /lib/widgets/widget-press.php with your location to the file.

    #122745
    Pietro
    Participant

    Hi Guys!
    Please … I found of course the ShortCode Page on http://codex.bbpress.org/shortcodes/ BUT … I do not know if and how insert in a page the EDIT PROFILE code … Any help ??

    For instance, when I go to see my profile, I can use different link …
    Here’s a ScreenShot on http://www.pietrosferrino.com/ScreenShot.png.
    How can I use that links in order to make by myself a page where every single user can use them?
    Thank You.
    Pietro

    #122736
    on3advertising
    Participant

    Just got the whole thing working. Here is the code:

    function restrictForum(){
    $db_name = 'dbname';
    $con = mysql_connect("url","username","password");
    mysql_select_db("$db_name")or die("cannot select DB");
    $cust_id = mysql_real_escape_string($_GET['cid']);
    $sql = "SELECT * FROM customer_data WHERE customer_number = $cust_id";
    $result= mysql_query($sql);
    $cust_id_form = ('
    Enter Your Customer #
    ');
    if ( isset( $_GET['cid'] ) && !empty( $_GET['cid'] ) && mysql_num_rows($result) == 1) {
    // cid (customer ID) is present, show the bbPress login form
    echo ('Please enter your username and password to continue.');
    echo do_shortcode('[bbp-login]');

    } elseif ( $_GET['error'] == true ) {

    // cid entered was not valid
    echo 'The customer ID you entered is not valid.';

    } elseif (!is_user_logged_in()){
    echo $cust_id_form;
    }
    }
    add_shortcode('forum-login-restrict','restrictForum');

    #122734
    AMEtro
    Participant

    Without the fix located at http://mysitemyway.com/docs/index.php/BbPress I get the default blank blog page at /forums/, with it, I get the error Fatal error: Call to undefined function mysite_after_page_content() in /home/content/39/10190339/html/wp-content/themes/twentytwelve/archive-forum.php on line 25
    This only shows up at the bottom, but I can still click on my forum post.
    But when clicking on the forum post, I get the errorFatal error: Call to undefined function mysite_before_entry() in /home/content/39/10190339/html/wp-content/themes/twentytwelve/forum.php on line 26
    And it does NOT display my post, only displays this error. I tried searching the mysite function, but no solution to be found.
    bbPress: 2.2.3
    Wordpress:3.5
    Site: troop121.us

    #122731
    Fee
    Participant

    Hello,

    absolutely happy about the integration of bbPress 2 into BuddyPress groups I tested this out today. BuddyPress was already installed with group forums on, but not used yet. Installed bbPress completely fresh.
    WP 3.5 multisite, bbPress 2.2.3, BuddyPress 1.7-bleeding-#6628, using bp-default theme.
    I followed these steps: http://codex.buddypress.org/buddypress-site-administration/migrating-from-old-forums-to-bbpress-2/
    and this guide: http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/

    Result: I can create everything vom backend: Forums, topics, replies.
    I can add topics in frontend to sitewide forums.
    But I cannot create topics to a group forum, also in new groups from frontend – only from backend.
    I found the bug here that Forum tab doesn’t show up at group creation. I don’t know if that matters – if I turn group forum on after creation in admin panel, the tab is there, with all forum empty messages and new topic form. And these group forums show up in the backend forums view under group forums, so the hierarchy is correct.

    Sure this is a test / dev install, no live site. And there’s no hurry, but I’d like to test more out with your plugin ๐Ÿ™‚
    Is there something I did wrong until here? Or I could try?

    thanks, Fee

    #122728
    Anonymous User
    Inactive

    Alright. Everything fixed. ๐Ÿ˜‰

    To set the post positions newโ€‹โ€‹, I created a curious script using the function ‘bb_update_post_positions’ and an sql-query to get all topics by id. I loop through the topics and make an function call for an modified ‘bb_update_post_positions’.

    I describe here only my approach to solve the problem. My php codeย itself could be dangerous. ๐Ÿ™‚

    But if someone has the same problems importing old data (bbPress 1.x)ย  I’ll help via email.

     

     

     

     

    #122716
    Anonymous User
    Inactive

    Hi JJJ,

    after studying the bbPress 1.1 converter code and an deep look into the mySQL data I know the error. In my installation the field post_position is set for all old post to ‘0’. It’s possible that this is an error form the originally convert from phpBB to bbPress 0.9 some years ago.

    From the import:
    ‘join_expression’ => ‘USING (topic_id) WHERE posts.post_position IN (0,1)’

    So for now – i’m searching for an solution to reset the post_position.

    #122715
    on3advertising
    Participant

    Okay something really strange is happening, I think it’s something to do with the GET method. When I enter the customer ID into the field and hit Submit, my URL blows up! For some reason it’s displaying my connection information for the WordPress db (obviously a big problem). And it keeps growing every time I submit. Not sure if it’s because I’m on a xampp server. Looks something like this


    http://localhost/~homeFolder/Website/forum/?cid=555112&log=myusername&pwd=THEPASSWORD&user-cookie=1&redirect_to=http%3B%2C%Mlocalhost%2F~homeFolder%Website%2F&_wpnonce=a7841878&_wp_http_referer=%2F~homeFolder%Website%2Fforum%2F

Viewing 25 results - 14,951 through 14,975 (of 32,519 total)
Skip to toolbar