Forum Replies Created

Viewing 15 replies - 1 through 15 (of 34 total)
  • Thread Starter Hamlet_PL

    (@hamlet_pl)

    Resolved & Top stars.

    see ya!

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    ok, thats was error from bbstyle-pack.
    Sorry for off-top

    regards.

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    Roger that 🙂

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    bdbrown you deserve a beer! Great Support! Now everything is clear. Topic has been resolved 🙂
    BTW. Why dont use css/bbpress.css ? I added in the same way another js folder.

    If after resolve you’ll cannot answer, thats my mail: [moderated]

    Best regards!
    Hamlet

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    I i found error html.. now i see all sidebar.
    So I have 2 last question:
    1) If everythin work then I not need to restart sidebar?
    2) Below files placed in child folder are good or i should peaste another files?
    file: header.php
    file: footer.php
    file: function.php
    Directory css/bbpress.css

    After answer I make this topic on resolved.

    regards

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    Here is my site:
    I added it:
    https://kovshenin.com/2014/child-themes-import/ in fuction.php and after removed @include in style.css but still not working..

    Exactly i dont see <div id=”wpadminbar” class=””></div>
    and
    I have problem with footer:
    Parse error: syntax error, unexpected end of file in /home/users/wm-marsa/public_html/wm-marsa.pl/wp-content/themes/hueman-child-master/footer.php on line 103

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    Note: since each theme identifies sidebars and menus using unique IDs you may need to reset your sidebars and menus.

    Ok If I everything well done, now I haven’t see admin bar and pop-up. So how can I restart this sidebars?

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    Great and exact answer bdbrown. Step by step.
    Ok, I Activate it. Below ifno about activated theme:

    Hueman ChildWersja 1.0.0
    
    Autor: You
    
    Sample child theme for customization.

    Next when I am in child theme folder via FTP on my webserver then I paste below files?

    file: header.php
    file: footer.php
    file: function.php
    Directory css/bbpress.css

    After copy/paste above files I have to remove my custom code from the parent theme file or delete this parent file?
    regards

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    I’ll try to test more tomorrow.

    Big Thanks for help 🙂

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    OK, one genereal question.
    In first point: when I am in admin panel Do I upload master.zip from: https://github.com/presscustomizr/hueman-child/archive/master.zip
    or another file?
    Second. How activate it?

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    yes.
    I dowload from:
    https://github.com/presscustomizr/hueman-child/archive/master.zip

    After unzip I have this file: hueman-child-master.

    In this directory I have the following files:
    function.php
    screenshot
    style.css

    so If I understood correctly we edit this file and where paste those files?

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    Where is child theme folder?

    Page-templates?

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    Nope. I used parent Hueaman file. Now I see child file but I dont know how use it. I paste part of my code to the child but what next? where move this child file (place where should be this childs file) and how import child to the parent (oryginal) File?

    Thread Starter Hamlet_PL

    (@hamlet_pl)

    OK,

    My modified files are:
    directory: css/bbpress.css (bbpress that is file with style forum)
    file: header.php
    file: footer.php
    file: function.php

    Directory css/bbpress.css has to be not moving/deleting.

    Header (belowe my add code):

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Dancing+Script" />
    
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    
      <style type="text/css">
      #idletimeout { font-weight:bold }
      </style>
    
      <?php
      $mystring = "$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
      $findme   = 'HELLO WORLD';
      $pos = strpos($mystring, $findme);
      if ($pos === false) { } // Note our use of ===.  Simply == would not work as expected
      else {
        $user = wp_get_current_user();
        $allowed_roles = array('subskrybent2', 'subskrybent3', 'administrator');
        if( array_intersect($allowed_roles, $user->roles ) ) { }
        else {
          wp_redirect( home_url() ); exit;
        }
      }
    
      if( is_user_logged_in() ) {
        print('
        <style>
        #countdown { font-style: normal; }
        </style>');
      }
      if ( is_page( 'login' ) ) {
        print('hello world');
      }?>
    
    NEXT IN HEADER:
    <div class="countdown"><?php if( is_user_logged_in() ) { echo "GREAT"; } ?></div>
    
    NEXT AFTER HEADER:
    <div id="idletimeout">
              <p>Hello user</p>
            </div>
    
    ITS ORYGINAL Hueaman CODE:
    <?php $_header_img_src = hu_get_img_src('header-image'); ?>
            <?php if ( ! $_header_img_src || empty( $_header_img_src ) ): //@fromfull to keep ?>
    
              <div class="group pad">
                <div style="float: left; display: block;">
                  <?php echo hu_site_title(); ?>
                </div>
                <?php if ( hu_is_checked('site-description') ): ?>
                  <div>
                    <p style="line-height: 28px; font-family: Dancing Script;">Regon:</p>
                  </div>

    Footer (belowe my add code):

    <section class="container" id="footer-widgets" style="background-color: #eaeaea;">
    
    NEXT IN FOOTER:
    <div id="credit" style="<?php echo ! hu_is_checked( 'credit' ) ? 'display:none' : ''; ?>"> <p><?php _e('Wszystkie prawa zastrzeżone.'); ?></p> </div><!--/#credit-->

    Function (belowe my add ALL code):

    <?php
    //do not remove this
    
    /*
     * Get the most recently replied-to topics, and their most recent reply
     */
      function custom_bbpress_recent_replies_by_topic($atts){
      $short_array = shortcode_atts(array('show' => 5, 'forum' => false, 'include_empty_topics' => false), $atts);
      extract($short_array);
    
      // default values
      $post_types = array('reply');
      $meta_key = '_bbp_last_reply_id';
    
      // allow for topics with no replies
      if ($include_empty_topics) {
        $meta_key = '_bbp_last_active_id';
        $post_types[] = 'topic';
      }
    
      // get the 5 topics with the most recent replie
      $args = array(
        'posts_per_page' => $show,
        'post_type' => array('topic'),
        'post_status' => array('publish'),
        'orderby' => 'meta_value_num',
        'order' => 'DESC',
        'meta_key' => $meta_key,
      );
      // allow for specific forum limit
      if ($forum){
        $args['post_parent'] = $forum;
      }
    
      $query = new WP_Query($args);
      $reply_ids = array();  
    
      // get the reply post->IDs for these most-recently-replied-to-topics
      while($query->have_posts()){
        $query->the_post();
        if ($reply_post_id = get_post_meta(get_the_ID(), $meta_key, true)){
          $reply_ids[] = $reply_post_id;
        }
      }
    
      // get the actual replies themselves
      $args = array(
        'posts_per_page' => $show,
        'post_type' => $post_types,
        'post__in' => $reply_ids,
        'orderby' => 'date',
        'order' => 'DESC'
      );
    
      $query = new WP_Query($args);
      ob_start();
        // loop through results and output our rows
        while($query->have_posts()){
          $query->the_post();
    
          // custom function for a single reply row
          custom_bbpress_recent_reply_row_template( $query->current_post + 1 );
        }
      $output = ob_get_clean();
      return $output;
    }
    add_shortcode('bbpress_recent_replies_by_topic', 'custom_bbpress_recent_replies_by_topic');
    /*
     * Executed during our custom loop
     *  - this should be the only thing you need to edit
     */
    function custom_bbpress_recent_reply_row_template( $row_number ){
      // get the reply title
      $title = get_the_title();
    
      // trim title to specific number of characters (55 characters)
      $title = substr( $title, 0, 55);
    
      // trim title to specific number of words (5 words)...
      $title = wp_trim_words( $title, 5, '...');
    
      // determine if odd of even row
      $row_class = ($row_number % 2) ? 'odd' : 'even';
      ?>
        <div class="bbpress-recent-reply-row <?php print $row_class; ?>">
          <div><a href="<?php bbp_reply_url( get_the_ID() ); ?>"><?php print $title; ?></a></div>
          <div><?php print human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' temu'; ?></div>
        </div>
      <?php
    
      // Refs
      // http://codex.wordpress.org/Template_Tags#Post_tags
      // http://codex.wordpress.org/Function_Reference/get_avatar
      // http://codex.wordpress.org/Function_Reference/human_time_diff
      // (template tags for bbpress)
      // https://bbpress.trac.wordpress.org/browser/trunk/src/includes/users/template.php
      // https://bbpress.trac.wordpress.org/browser/trunk/src/includes/replies/template.php
    }
    // allow shortcodes to run in widgets
    add_filter( 'widget_text', 'do_shortcode');
    // don't auto-wrap shortcode that appears on a line of it's own
    add_filter( 'widget_text', 'shortcode_unautop');
    
    // Add logout popup
    function popup_js() {
    	 if ( is_page( 'login' ) ) {
    	 	if ( !is_admin() ) {
    	 		wp_register_script('popup_logout',get_template_directory_uri().'/js/popup_logout.js', false);
    	 		wp_enqueue_script('popup_logout');
    	 	}
    	}
    }
    add_action( 'wp_enqueue_scripts', 'popup_js' );
    
    // ShowPrivateFile
    function ShowPrivateFile() {
    	$user = wp_get_current_user();
    	$output='';
    	$allowed_roles = array('subskrybent2', 'subskrybent3', 'administrator');
    	if( array_intersect($allowed_roles, $user->roles ) ) {
    		$output = 'Pliki dostępne tylko po zalogowaniu:</br>'.'</br><a href="https:/XXXXXXXX.pl/wp-content/uploads/Document/abcd.docx">Protocol.docx</a></br>'.
    	}
    	return $output;
    }
    add_shortcode("pokaz_prywatne_pliki", "ShowPrivateFile");
    ORYGINAL CODE FROM HUEMAN:
    load_template( get_template_directory() . '/functions/init-core.php' );
    
    /**
    * The best and safest way to extend the Humean WordPress theme with your own custom code is to create a child theme.
    * You can add temporary code snippets and hacks to the current functions.php file, but unlike with a child theme, they will be lost on upgrade.
    *
    * If you don't know what a child theme is, you really want to spend 5 minutes learning how to use child themes in WordPress, you won't regret it :) !
    * https://codex.wordpress.org/Child_Themes
    *
    */

    So could u Tell me what I shoild do with it if I dont want to paste code always after update?

    Thread Starter Hamlet_PL

    (@hamlet_pl)

Viewing 15 replies - 1 through 15 (of 34 total)