Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-26-2008, 07:37 AM
Menalto Menalto is offline
 
Join Date: Sep 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Members info outside vbulletin?

I have a Vbulletin forum installed in a subdomain and home page is a joomla site, i wonder if its possible to show logged in users the Welcome User you have 2 unread messages.
This info should be shown after the user is logged in ofcourse....
When not logged in a log in field is shown, when logged in the members info and a log out button. This would be nice to have
on the frontpage(which is joomla). I tried this here:
Code:
<?php
// Version 1.10
// Released April 24th, 2007
// Edit the line below to show path to your forums
$forumpath = "http://www.yoursite.com/forums/";

// You dont have to edit anything underneath here,
// but you can if you wish to style the login box
// to match the style of your site.
// ---------------
// COPYRIGHT STUFF
// ---------------
// You are free to use and modify this script in anyway you like.
// However,
// - Do not remove copyright notice
// - Dont pass it off as your own work.
// 
// This script is provided free of charges, however If you use this on a commercial
// venture a small paypal donation to cwp@cwp.id.au would be apprecieated.

// We check if user is logged in
if ($vbulletin->userinfo['userid']!=0) {
// If Logged in display welcome back message
echo "Welcome Back, <b>";
echo $vbulletin->userinfo['username'];
echo " !</b>
";
// If logged in display logout link
echo "<a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&logouthash=$logouthash";
echo $vbulletin->userinfo['logouthash'];
echo "\">";
echo "<font size=\"1\" face=\"verdana\">Log Out</font></a>
";
} else { // If user is not logged in, we do this stuff
// Display text and link to register.
echo "
 You have to <a href=\"".$forumpath."register.php?s=$session[sessionhash]\"
 target=\"_parent\"><b>register</b></a>  before you can post on our forums or use our advanced features.
 ";
// Display login boxes + button
// You can style this with html or CSS as normal if desired.
echo"
 <form action=\"".$forumpath."login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
 <script type=text/javascript src=\"".$forumpath."clientscript/vbulletin_md5.js\"></script>
 User Name:

 <input name=vb_login_username type=text id=navbar_username onfocus=\"if (this.value == '$vbphrase[username]') this.value = '';\" size=10 />
   
 
Password:

 <input name=vb_login_password type=password size=10 />
 </br>
  
 <label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
 Remember Me?
</label>
 
  
 <input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
  
 <input type=hidden name=s value=$session[sessionhash] />
 <input type=hidden name=do value=login />  
 <input type=hidden name=vb_login_md5password />
 <input type=hidden name=vb_login_md5password_utf />
 </form>
";
}
?>
But it did not work. When i pressed log in i got transfered to the forum logged in,but when i entered frontpage it still showed the log in field.
Btw, this forum is not bridged with joomla.
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:14 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.08427 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete