Skip to:
Content
Pages
Categories
Search
Top
Bottom

Showing more tags on Heatmap.

  • @invtrdr

    Member

    I have <?php bb_tag_heat_map( 9, 38, ‘pt’, 80 ); ?> in my tag.php file. Still I can only see 40 tags max in the heat map. Am I supposed to change “80” somewhere else too? Maybe in the function? Where do I find the function below? Got it from another topic.

    Thanks.

    function bb_tag_heat_map( $args = ” ) {

    $defaults = array( ‘smallest’ => 8, ‘largest’ => 22, ‘unit’ => ‘pt’, ‘limit’ => 45, ‘format’ => ‘flat’ );

Viewing 24 replies - 1 through 24 (of 24 total)
  • @chrishajer

    Participant

    I’m wondering how you know exactly how many tags you have? Maybe it just seems like you have 80?

    Or, is there a CSS overflow property that is blocking the display of more tags? Do you see tags all the way from A to Z (or whatever letter your last tag begins with.)

    @invtrdr

    Member

    Not sure if we are on the same page. I am referring to the tags displayed in the box on the right which I think is also called a heat map? I counted them and see 40 of them to be precise. How do I show more or less? The link is http://www.invictatrader.com/bbpress to see what I am trying to convey.

    Thank you.

    @chrishajer

    Participant

    We’re talking about the same thing. Looks like your heatmap goes from a tag beginning with b to one beginning with w so my guess is that the display is not being hidden in some way by CSS.

    So, I am just wondering how you, or anyone,would know exactly how many tags are in use on a forum, that’s all.

    You need to modify front-page.php NOT tags.php. tags.php creates this:

    http://invictatrader.com/bbpress/tags/

    Looks like there are more tags there, maybe 55 or something like that.

    @kawauso

    Member

    bbPress functions don’t take arguments the same way as normal PHP functions. You pass arguments as an array.

    i.e.

    bb_tag_heat_map( array( 'smallest' => 9, 'largest' => 38, 'limit' => 80 ) );

    @invtrdr

    Member

    That is it. In this link http://invictatrader.com/bbpress/tags/ you see there a total of 54 tags so far on the big test box on the left. On the right only a maximum of 40 are displayed. How do I change the number of tags to be shown in the box on the right? Like say just 20 or 30 or even 50 if need arises.

    Thank you.

    @chrishajer

    Participant

    I think I already mentioned how:

    You need to modify front-page.php, not tags.php. Try using Kawauso’s method.

    @invtrdr

    Member

    Thanks. I did not see that code in the theme’s front-page.php file. Should I add the code below anywhere in the front-page.php file just the way shown below?

    Thanks.

    bb_tag_heat_map( array( ‘smallest’ => 9, ‘largest’ => 38, ‘limit’ => 80 ) );

    @invtrdr

    Member

    Why is it there are still only a max of 40 tags shown in the heat map box on the right even though <?php bb_tag_heat_map( 9, 38, ‘pt’, 80 ); ?> is the setting in the tags.php file?

    Thanks.

    @chrishajer

    Participant

    I have this near the top of my front-page.php:

    <p class="frontpageheatmap"><?php bb_tag_heat_map(); ?></p>

    That’s where you would make the modification.

    front-page.php does not use tags.php. Those two different php files do two different things. tags.php displays this: http://invictatrader.com/bbpress/tags/

    front-page.php displays the front page of your forum:

    http://invictatrader.com/bbpress/

    And the tags are just a small part of the front page, provided by the function bb_tag_heat_map();, called with whatever parameters you want.

    @chrishajer

    Participant

    The 80 you have set in tags.php is completely unrelated to how the tags are being displayed in front-page.php. You can change tags.php and watch the effect on this page:

    http://invictatrader.com/bbpress/tags/

    If you noticed, the same function is being called in both files.

    @invtrdr

    Member

    I did not even see the code in my front-page.php file of the theme. Below is the code. Can I try to add it to it to play around with the heat map?

    Thanks.

    ?php bb_get_header(); ?>

    <?php if($forums) : ?>

    <?php if($topics || $super_stickies) : ?>

    <div class="breadcrumb section">
    <h2 class="section-header"><?php _e('Latest Discussions','rag'); ?></h2>
    </div>

    <table id="latest">
    <tr>
    <th class="topic"><?php _e('Topic','rag'); ?> — <?php new_topic(); ?></th>
    <th class="posts"><?php _e('Posts','rag'); ?></th>
    <th class="last-poster"><?php _e('Last Poster','rag'); ?></th>
    <th class="freshness"><?php _e('Freshness','rag'); ?></th>
    </tr>

    <?php if($super_stickies) : foreach ($super_stickies as $topic) : ?>

    <tr<?php topic_class(); ?>>
    <td><?php bb_topic_labels(); ?> <big><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></big></td>
    <td><?php topic_posts(); ?></td>
    <td><?php topic_last_poster(); ?></td>
    <td><a href="<?php echo str_replace("&", '&', get_topic_last_post_link()); ?>"><?php topic_time(); ?></a></td>
    </tr>

    <?php endforeach; endif;?>

    <?php if($topics) : foreach($topics as $topic) : ?>

    <tr<?php topic_class(); ?>>
    <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
    <td><?php topic_posts(); ?></td>
    <td><?php topic_last_poster(); ?></td>
    <td><a href="<?php echo str_replace("&", '&', get_topic_last_post_link()); ?>"><?php topic_time(); ?></a></td>
    </tr>

    <?php endforeach; endif; ?>

    </table>

    <?php endif; ?>

    <?php if(bb_forums()) : ?>

    <div class="breadcrumb section">
    <h2 class="section-header"><?php _e('Forums','rag'); ?></h2>
    </div>

    <table id="forumlist">

    <tr>
    <th><?php _e('Forum','rag'); ?></th>
    <th><?php _e('Topics','rag'); ?></th>
    <th><?php _e('Posts','rag'); ?></th>
    </tr>

    <?php while(bb_forum()) : ?>

    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad('<div class="nest">'); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><?php forum_description(); ?><?php bb_forum_pad('</div>'); ?></td>
    <td><?php forum_topics(); ?></td>
    <td><?php forum_posts(); ?></td>
    </tr>

    <?php endwhile; ?>

    </table>

    <?php endif; ?>

    <?php else : ?>

    <?php post_form(); ?>

    <?php endif; ?>

    <?php bb_get_footer(); ?>

    @chrishajer

    Participant

    Something in one of your files is creating that tag heat map. Maybe in your theme it’s not included in front-page.php. Look through your other files for calls to that bb_tag_heat_map function. Looking at that theme, it looks like it has a sidebar. So, is the call to that function in sidebar.php?

    @invtrdr

    Member

    I found it. It was in the sidebar.php file. What do I need to change in the code below to control the number of tags shown in the heat map?

    Thank you.

    <div id="sidebar" class="right">

    <div class="menu">
    <?php
    login_form();
    if(is_bb_profile()) profile_menu();
    ?>
    </div>

    <div class="menu">
    <h2 class="section-header"><?php _e('Tags','rag'); ?></h2>
    <p class="frontpageheatmap" style="text-align: center;"><?php bb_tag_heat_map(); ?></p>
    </div>

    <?php if(bb_is_user_logged_in()) : ?>
    <div class="menu">

    <h2 class="section-header"><?php _e('Views','rag'); ?></h2>

    <ul id="views">
    <?php foreach(bb_get_views() as $the_view => $title) : ?>
    <li class="view"><a href="<?php view_link($the_view); ?>"><?php view_name($the_view); ?></a></li>
    <?php endforeach; ?>
    </ul>

    </div>
    <?php endif; ?>

    </div>

    @invtrdr

    Member

    So am I replacing this line in the code above

    <p class="frontpageheatmap" style="text-align: center;"><?php bb_tag_heat_map(); ?></p>

    with this line below?

    <p class="frontpageheatmap" style="text-align: center;"><?php bb_tag_heat_map(array( 'smallest' => 9, 'largest' => 38, 'limit' => 80) ); ?></p>

    Thank you.

    @invtrdr

    Member

    Without the above code where is it getting the 40 from? That is still a mystery to me if it is not called for from anywhere.

    Thanks.

    @kawauso

    Member

    bbPress functions have a set of default values that are overwritten by the arguments passed when it’s called, so if a value isn’t specified for something, it stays with the default.

    @invtrdr

    Member

    Where is the default of “40” seen?

    @kawauso

    Member

    In the first line of function bb_tag_heat_map:

    $defaults = array( ‘smallest’ => 8, ‘largest’ => 22, ‘unit’ => ‘pt’, ‘limit’ => 40, ‘format’ => ‘flat’ );`

    Line 3158 of functions.bb-template.php in my slightly outdated SVN of 1.0.2

    @invtrdr

    Member

    Also is what I would do below be correct?

    So am I replacing this line in the code above

    <p class=”frontpageheatmap” style=”text-align: center;”><?php bb_tag_heat_map(); ?></p>

    with this line below?

    <p class=”frontpageheatmap” style=”text-align: center;”><?php bb_tag_heat_map(array( ‘smallest’ => 9, ‘largest’ => 38, ‘limit’ => 80) ); ?></p>

    Thank you.

    @invtrdr

    Member

    I did find it and it is set at “45” and there is another similar code set to “40”. That is the one it is using. I changed it to 45 and it is showing 45 now. Thanks once again.

    Thanks.

    @kawauso

    Member

    You changed the defaults, instead of just using different parameters when you call the function? Editing core files is really bad practice…

    @invtrdr

    Member

    Yes. Just wanted to see for myself. Will change it back to 40 as I did not know what is below before.

    Also is what I would do below be correct?

    So am I replacing this line in the code above

    <p class=”frontpageheatmap” style=”text-align: center;”><?php bb_tag_heat_map(); ?></p>

    with this line below?

    <p class=”frontpageheatmap” style=”text-align: center;”><?php bb_tag_heat_map(array( ‘smallest’ => 9, ‘largest’ => 38, ‘limit’ => 80) ); ?></p>

    Thank you.

    @kawauso

    Member

    Yep, pretty much. Don’t be afraid to just give it a try and see what happens, it’s how you learn with these things :)

    @invtrdr

    Member

    Thanks. Do not want to mess things up too much either.

Viewing 24 replies - 1 through 24 (of 24 total)
  • You must be logged in to reply to this topic.
Skip to toolbar