Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2002, 03:43 PM
leon2u leon2u is offline
 
Join Date: Mar 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Online users counter...

Hai there,

I want to have the online users amount in the right top corner of my forum. The template that arranges that is called forumhome_welcometext . So what I did was a copy of $totonline from the template forumhome_loggedinusers to my forumhome_welcometext but the amount of users does not show.

See snapshot plz...the amount of users online should be mentioned between the words "zijn" en "gebruikers"

What code do I need to assign to index.php so that I can use the $totalonline variable in my template forumhome_welcometext

Plz help...
Attached Images
File Type: jpg snapshot.jpg (7.0 KB, 0 views)
Reply With Quote
  #2  
Old 09-11-2002, 11:41 PM
Webmasta XT's Avatar
Webmasta XT Webmasta XT is offline
 
Join Date: Mar 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, I know the coding, I will contact u back as soon as I get it..
Reply With Quote
  #3  
Old 09-12-2002, 12:11 AM
Webmasta XT's Avatar
Webmasta XT Webmasta XT is offline
 
Join Date: Mar 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// Find this code in index.php

eval("\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\";");
}


// Replace it with this

  
eval("\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\";");
  if (
$bbuserinfo['userid']!=0) {
  
$username=$bbuserinfo['username'];
eval(
"\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");

} else {
  
$welcometext "";
  eval(
"\$unregwelcomemessage = \"".gettemplate('forumhome_unregmessage')."\";");
}
   }

// Place [B][COLOR=red]$totalonline[/COLOR][/B] in your welcometext template it would work for sure without problems. 
Working Demo @ http://www.xtreme-forumz.net/index.php
Reply With Quote
  #4  
Old 09-12-2002, 05:44 AM
leon2u leon2u is offline
 
Join Date: Mar 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works flawlessly....but I have one thing more to ask to you. I worked two hours on it for trying it to get to work. Could you me explain every line of code what it does? Correct me plz if my thoughts of the code are wrong...

eval("\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\"; ");
Here I assum a template get assigned to the
variable $loggedinusers???


if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
!= means???
$username gets assigned to $bbuserinfo['username'] but what does this code $bbuserinfo['username'] do?

eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";") ;
Assigning a template again I assume

} else { Ok, this is a part of the IF then ELSE statement

$welcometext = "";
What does this mean and why did you do it?

eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");

Why do you assign these both eval lines??


Hope you are willing to learn me some code...
Reply With Quote
  #5  
Old 09-12-2002, 01:31 PM
FlyingDutchman's Avatar
FlyingDutchman FlyingDutchman is offline
 
Join Date: Nov 2001
Location: The Netherlands
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

  • 1st line: when '$loggedinusers' is called from a template, it will show the template 'forumhome_loggedinusers' at that place.
  • 2nd line(s): It checks if your a user (actually checks if you are NOT userid 0 - != means 'not equal to'), and if so it will assign your username (which is stored in $bbuserinfo['username']) to $username.
  • 3rd line: Same principe as 1st.
  • 4th line: You're right about the if-else statement stuff .
  • 5th line: It basicly assigns a string of nothing between the "s is nothing. It's because if you would open it and the userid IS EQUAL TO 0, then it would just show '$welcometext' on your page instead of nothing (because it doesn't 'know' the variable).
  • 6th line(s): you assign these both, because they're both for a other variable, you'll need a new eval-line for every variable you want to assign a template to.

I've tried to explain it in easy language - I hope I helped you with this...
I guess you are dutch, but i'm not sure, so if you still need help, then I can also explain in dutch if you want
Reply With Quote
  #6  
Old 09-12-2002, 07:22 PM
leon2u leon2u is offline
 
Join Date: Mar 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am DUTCH indeed, are you DUTCH too???

Thanx for your explaining...
Reply With Quote
  #7  
Old 09-13-2002, 04:30 AM
FlyingDutchman's Avatar
FlyingDutchman FlyingDutchman is offline
 
Join Date: Nov 2001
Location: The Netherlands
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, i am dutch.
Reply With Quote
  #8  
Old 09-14-2002, 11:52 AM
Webmasta XT's Avatar
Webmasta XT Webmasta XT is offline
 
Join Date: Mar 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am sry but somehow, it posted the old coding, I am sure i changed the coding, but it was showing the old coding, I changed the coding again, sry..
Reply With Quote
  #9  
Old 09-14-2002, 11:55 AM
Webmasta XT's Avatar
Webmasta XT Webmasta XT is offline
 
Join Date: Mar 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

These 2 lines shouldn't be there
PHP Code:
eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
eval(
"\$logincode = \"".gettemplate('forumhome_logincode')."\";"); 
Instead it should be
PHP Code:
eval("\$unregwelcomemessage = \"".gettemplate('forumhome_unregmessage')."\";"); 
Reply With Quote
  #10  
Old 09-15-2002, 02:44 PM
leon2u leon2u is offline
 
Join Date: Mar 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why should those 2 lines not be there???

I had those lines there and worked fine...I changed it because you said so but now I am asking why is that? Could you explain it 2 me?

Thanx anyway for your effort...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:08 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.04440 seconds
  • Memory Usage 2,287KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete