Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-27-2011, 12:19 PM
JerichoLFG's Avatar
JerichoLFG JerichoLFG is offline
 
Join Date: May 2011
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Huge Coding Question, URGENT!

I have this on my forum,



Now, I have it working to where it will log me in but I want it to look like this after I successfully login,



Here is all the code I have for it right now before you login & it works great,

Code:
<div id="loginBox">

		
		
		<h2>Sign In </h2> 
		<form action='login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'>
		<div style='float:left;'>
			<label>Username</label><input type="text" name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' autocomplete="off" /><br clear="left" />
			<label>Password</label><input type="password" name='vb_login_password' size='15' accesskey='p' tabindex='2'  />
		</div>
		<div style='float:left; margin-left: 5px; width: 160px;'>
			<label style="width:85px; float:right; padding-top: 2px;">Remember Me</label>
			<input type="checkbox" style="float:right; width:20px;"  name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked'/><br clear="right" />
			 <input type='hidden' name='do' value='login' /> 
			<input type='hidden' name='forceredirect' value='1' />            
			<input type='hidden' name='vb_login_md5password' /> 
			<input type="submit" value="" />
		</div>
		<br clear="all" />
	   <div style='margin-top: 3px; float:left;'>Not a member? <a href="/register.php" style='text-decoration:none; color:#6299d2'>Register here!</a></div>
	   <div style='margin-top: 3px; float:right;'><a href="/login.php?do=lostpw" style='text-decoration:none; color:#aaaaaa'>Forgotten your details?</a></div>
	   </form>
		
	


</div>
Now, I have the code that is supposed to be there for after you login but I have no clue on how to make it show up after I click the Sign In Button & what to put in the bold areas,

Code:
<div id="loginBox">

	<div id="popUpMessages"><div id="useful"><img src="HERE" border="0" width="60" class="profilepicture" />		
        <div style="padding-top: 10px;">
        
		<a href='HERE'><h3>Welcome, HERE</h3></a>		<br />
		
        
        <a href="/usercp.php">User CP</a>
        <a href="/member.php?u=10723">My Profile</a>
        <a href='login.php?do=logout&logouthash=1317129261-e6221f1b9199161edf89d1186f314b0b0904a487' id='logout'>Logout</a>		</div>
        <br clear="all" />
        </div>
        <div id="social">
        <h3>Notifications</h3>
        <a href='/private.php'>Private Messages</a><BR><a href='HERE'>Visitor Messages</a><BR><a href='/profile.php?do=buddylist'>Friend Requests</a><BR><a href='/album.php?do=unread'>Album Comments</a><BR><a href='/group.php?do=invitations'>Group Invites</a><BR>		</div>
        
        <div id="message">
        
        	<a href="/payments.php">Do you want to help the community? Become a donator!</a>        
        </div>
        
		</div>
		


</div>
If anyone can help me, I can send you $4.50 over paypal. Thanks guys!

--------------- Added [DATE]1317147223[/DATE] at [TIME]1317147223[/TIME] ---------------

bumpskiez for great justice.

--------------- Added [DATE]1317213560[/DATE] at [TIME]1317213560[/TIME] ---------------

bump?
Reply With Quote
  #2  
Old 09-29-2011, 12:08 PM
JerichoLFG's Avatar
JerichoLFG JerichoLFG is offline
 
Join Date: May 2011
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #3  
Old 09-29-2011, 12:15 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is that code in templates? If so, you should just need to check whether the user is logged in, like:

Code:
<if condition="$show[member]">
// user logged in
<else />
// not logged in
</if>
Reply With Quote
  #4  
Old 09-29-2011, 04:49 PM
JerichoLFG's Avatar
JerichoLFG JerichoLFG is offline
 
Join Date: May 2011
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code is in my header template. So I just need to put that code on top of this code?

Also, in the second code, I'm trying to pull information from people when they log in so their information fills the box.

i.e
Code:
<img src="HERE" border="0" width="60" class="profilepicture" />
I'm trying to pull their avatar from their profile so it shows. I need to do that for each place that is bolded in the first post code. I'm not sure how to do that. Think you could help?
Reply With Quote
  #5  
Old 09-29-2011, 05:05 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JerichoLFG View Post
The code is in my header template. So I just need to put that code on top of this code?
Yeah, just replace the comments with the appropriate code.


Quote:
Also, in the second code, I'm trying to pull information from people when they log in so their information fills the box.

i.e
Code:
<img src="HERE" border="0" width="60" class="profilepicture" />
I'm trying to pull their avatar from their profile so it shows. I need to do that for each place that is bolded in the first post code. I'm not sure how to do that. Think you could help?
Some user info will be in $vbulletin->userinfo[], but to get the avatar I believe you'd need to write a plugin to get the info from the database. I don't know offhand exactly how to do it. Maybe the best thing to do is to look at how it's done for the posts - in showthread.php around line 988 is a big piece of sql that gets the posts and other info needed to display them including the avatar, then in includes/class_postbit.php around line 623 you can see how it uses that info to decide how to display it.
Reply With Quote
  #6  
Old 09-29-2011, 06:18 PM
JerichoLFG's Avatar
JerichoLFG JerichoLFG is offline
 
Join Date: May 2011
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I found out how to pull usernames & profiles.

I still need to find out how to pull avatars!
Reply With Quote
  #7  
Old 10-03-2011, 12:55 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is how it's done in the postbit
HTML Code:
<if condition="$show['avatar']">
<td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]">
<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a><
/td>
</if>
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 02:18 AM.


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.03770 seconds
  • Memory Usage 2,241KB
  • Queries Executed 13 (?)
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
  • (5)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete