vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Adding Currently Active Users to your own vB page (https://vborg.vbsupport.ru/showthread.php?t=187388)

Lynne 08-21-2008 04:54 PM

What does your template look like? It needs to look something like the one shown in the first post in this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. Notice how it calls the $header and $navbar, etc. You need to have that template working in your page first. Then you add this code into that template.

Triky 08-22-2008 08:50 AM

Oh, ok, I understand. Then, what could be the best solution to do this:

My example.com/index.php page:

http://img398.imageshack.us/img398/5156/38181099fi1.jpg

What I would like to do:

http://img253.imageshack.us/img253/830/11540346fo9.jpg

Lynne 08-22-2008 04:44 PM

Quote:

Originally Posted by Triky (Post 1604316)
Oh, ok, I understand. Then, what could be the best solution to do this:

My example.com/index.php page:

http://img398.imageshack.us/img398/5156/38181099fi1.jpg

What I would like to do:

http://img253.imageshack.us/img253/830/11540346fo9.jpg

The best solution would be to use a template for your page - to follow one of those articles I linked to. If you are going to just make a basic php page instead of using a template, then you need to do something like this in your php page when you use any vb variables:

HTML Code:

<!-- logged-in users -->
            <h1>Logged in Users</h1>
            <a href="online.php<?php
            echo $session[sessionurl_q];
            ?>"
rel="nofollow">
<?php
            echo $vbphrase[currently_active_users];
            ?>
</a>:&nbsp;<?php
            echo $totalonline;
            ?>

            <div><?php
            echo $activeusers;
            ?>
</div>
<!-- end logged-in users -->


Triky 08-25-2008 04:30 PM

Thanks for your replies, Lynne. That works correctly.

TheInsaneManiac 09-04-2008 05:01 PM

I've tried this tutorial and only want $activeusers to show up in the mini profile block, however it is not working. Help?

Lynne 09-04-2008 10:38 PM

You want to show the whole list of active users on each person's profile page? I think you would have to either a) add this code to the member.php page and templates or b) write plugins to add it to the page. I'd opt for plugins, but it's not something I can help with since I don't run 3.7 on my board yet.

TheInsaneManiac 09-05-2008 04:57 PM

Quote:

Originally Posted by Lynne (Post 1614704)
You want to show the whole list of active users on each person's profile page? I think you would have to either a) add this code to the member.php page and templates or b) write plugins to add it to the page. I'd opt for plugins, but it's not something I can help with since I don't run 3.7 on my board yet.

I have a test board you can use if you wish.

However I like the A option better. However I tried adding all of your code to the member.php and it did not work.

Lynne 09-05-2008 07:48 PM

I just don't feel up to learning about the specifics of adding a mini-profile block which is the hard part with what you want to do (adding my own tabs and code was 'fun' enough!). Your best bet is to probably post in the appropriate forums for help doing this sort of modification. Make sure you post exactly what code you wrote to write to the template - that is going to be the challenge.

TheInsaneManiac 09-06-2008 05:57 PM

Quote:

Originally Posted by Lynne (Post 1615374)
I just don't feel up to learning about the specifics of adding a mini-profile block which is the hard part with what you want to do (adding my own tabs and code was 'fun' enough!). Your best bet is to probably post in the appropriate forums for help doing this sort of modification. Make sure you post exactly what code you wrote to write to the template - that is going to be the challenge.

There should not be any changes? The template and php files are already there. I just don't understand why your tutorial is not working.

Lynne 09-06-2008 08:57 PM

Quote:

Originally Posted by TheInsaneManiac (Post 1616026)
There should not be any changes? The template and php files are already there. I just don't understand why your tutorial is not working.

This article was made to use existing templates. If you didn't put your information into a template, then it's not going to work.

This is down and dirty so you will have to caress it to look how you want. Add all the stuff to the member.php page that it said in the article (make sure you add it *before* the "member_build_blocks_start" hook gets called or the information won't be available to be displayed!), then when you get to the part about adding to the template, do this:

Create a new template called "memberinfo_block_curactive" with this:
HTML Code:

<!-- Currently Active Users -->
<div id="users_mini" class="tborder content_block">
    <h4 class="thead block_title">
        <a href="#top" class="collapse_gadget" onclick="return toggle_collapse('users_mini')"><img id="collapseimg_users_mini" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_users_mini']}.gif" alt="" border="0" /></a>
        <a name="users_mini"></a>
        <span class="block_name">Currently Active Users</span>
    </h4>
    <div class="block_content" id="collapseobj_users_mini" style="{$vbcollapse['collapseobj_users_mini']}"><span class="alt1 smallfont block_row"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase><br>$activeusers</span></div>
</div>
<!-- / Currently Active Users -->

Create a plugin at hook location "member_build_blocks_start" with this:
PHP Code:

eval('$template_hook[profile_right_first] .= "' fetch_template('memberinfo_block_curactive') . '";'); 


I have NOT tested it on a live site. Use at your own risk!!!!!


All times are GMT. The time now is 07:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01483 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete