vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   include the $loggedinusers on a non VB page? (https://vborg.vbsupport.ru/showthread.php?t=6196)

01-05-2001 04:46 AM

Thanks bmurray ! Your method works.
Do you think this would cause an big extra load on my NT server by doing this on the home page?

01-05-2001 04:52 AM

It displays fine:

(look to the lower right for a ruff test)

http://www.clubfreestyle.com/newdefault.php

the problem is...when you click on a user..The url os a dead link because it tries to go to:

http://www.clubfreestyle.com/member....tinfo&userid=2

instead of the correct link:

http://www.clubfreestyle.com/forum/m...tinfo&userid=2

01-05-2001 05:51 AM

how did you get that?

01-05-2001 12:38 PM

Bmurray..I just realized that if you are not logged into the system..and you go to that page..

It actually gives an error. Please check.

How can we avoid that?

01-05-2001 12:44 PM

To get correct links, you will have to use a different template in the code on the main page. Create a template called "loggedin_new" (or anyname you prefer), and change the link so that it puts a forum/ in it.

Add template - loggedin_new
Code:

<a href="forum/member.php3?action=getinfo&userid=$userid">$username</a>
Then change any reference to the template "loggedinuser" to "loggedin_new" in your code. Just make sure you don't confuse it with the other template "loggedinusers" that has an "s" at the end.


Let me know how that works


[edit]
Hmm...I'll have to check that out regarding the not logged in error...I'll get back to you
[/edit]

01-05-2001 02:21 PM

I think it is trying to create cookies, but the code is being executed in the incorrect order in relation to the rest of the page.

I'm not sure how you have the PHP page set up currently, but try putting this part:

Code:

<?php
chdir ("forum/");
require("testwho.php");
chdir("../");
/>

at the very beginning of your newdefault.php file. Then go into the "testwho.php" file and remove the statement

Code:

echo $loggedinusers;
and instead place

Code:

<?php
echo $loggedinusers;
?>

in the newdefault.php file where you want it displayed.

Unfortunately I'm at work and have no way to test to see if this works before posting.

Let me know what happens

01-05-2001 02:57 PM

Good Job! I can now see whos online without being loged in!

Next i will try to fix the hyerlink problem. i will keep you posted. Many Many Thanks!

01-05-2001 03:39 PM

Ben,

Everything you suggested works fine! Check it:

http://www.clubfreestyle.com/newdefault.php

(keep in mind that you might see some broken images, etc.. That page is just a test page so please disreguard it's appearance.)

You Da Man!

Please keep in touch.

01-05-2001 04:04 PM

please look at:
http://www.halflifeworld.net and tell me what im doing wrong.
The Red and yellow table sholdnt be there, and the $loggedin_new is not showing up.

01-05-2001 05:38 PM

MonkeyManx - it appears you need to move the code to the beginning of your index file. To make it simpler and because this has changed since my first post with info, I redid the instructions for getting this to work and put it in a text file:

loggedin.txt

After some trial and error, this should contain what is needed to get it work properly. Keep in mind this isn't a "hack" so to speak, and at some point when I have time I am going to try to refine it a little bit to work more efficiently.


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

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01170 seconds
  • Memory Usage 1,738KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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