Jump to content

[HELP] Copy SMF login from header to Wordpress header


Recommended Posts

ok this is how my site is setup.

 

wordpress is installed in the public_html

and smf is installed in public_html/forum

 

I want to copy the smf login from its header into my wordpress theme header. So when someone logs in it will take them into the forum. I don't want to use <?php ssi_login(); ?> method.

S2sRZ.png

 

I already know about ssi.php

Link to comment
Share on other sites

  • 4 weeks later...

BUMP

 

Ok, since no one could help... I've started this on my own  :-\

I've accomplished what i wanted, but i ran into another small problem.

 

This is how i "Copied the smf login from the header of my theme into my wordpress header's theme".

 

First, I added this code to the top of my WP's themes header.php

require_once("forum/SSI.php");

 

Then i copied the following code from my smf themes index.template.php

// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
					else
					{
						echo '
							<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
							<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
								<div id="login_username">
									<p class="form_label">', $txt['username'], '</p>
									<input type="text" name="user" class="login_input" />
								</div>
								<div id="login_password">
									<p class="form_label">', $txt['password'], '</p>
									<input type="password" name="passwrd" class="login_input" />
								</div>
								<div class="clr"></div>
									<input id="login_button" type="submit" value="" name="submit" />
								<div id="reminder">
									<a href="', $scripturl, '?action=reminder">', $txt['forgot_pass'], '</a>
									<a href="', $scripturl, '?action=register">', $txt['create_account'], '</a>
								</div>';

						echo '
								<input type="hidden" name="hash_passwrd" value="" />
							</form>';
					}
			echo '
				</div>
			</div>
		</div>

Then i pasted it in my WP themes header.php and edited a bit...now it looks like this:

<div id="top_login">
	<div id="login_form">

					<script type="text/javascript" src="', $settings['forum/Themes/my-smf-theme'], '/scripts/sha1.js"></script>
							<form action="forum/?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
								<div id="login_username">
									<p class="form_label">Username</p>
									<input type="text" name="user" class="login_input" />
								</div>
								<div id="login_password">
									<p class="form_label">Password</p>
									<input type="password" name="passwrd" class="login_input" />
								</div>
								<div class="clr"></div>
									<input id="login_button" type="submit" value="" name="submit" />
								<div id="reminder">
									<a href="forum/?action=reminder">Forgot Password?</a>
									<a href="forum/?action=register">Register Now!</a>
								</div>
								<input type="hidden" name="hash_passwrd" value="" />
							</form>
				        </div>
			        </div>
		      </div>
	    </div>

After that i copied and pasted this code (with edits) from my smf theme's index.css into my wordpress style.css

/* Login Code - Start */
#top_login {	
background: url(images/site_login.png) 0 0 no-repeat;	
float: right;	
height: 105px;	
width: 420px;	
overflow: hidden;	
color: #ffffff;}

#login_form {	
padding: 10px 0 0 75px;}

#top_login p.form_label {	
padding: 0 0 0 2px;	
margin: 0;}

#login_username, #login_password {	
float: left;}

#login_password {	
padding-left: 20px;}input.login_input {	
background: url(images/login_input.png) 0 0 no-repeat;	
color: #eee;	
border: none;	
outline: none;	
font-size: 12px;	
width: 134px;	
height: 16px;	
padding: 8px 8px 4px;}

#login_button {	
background: url(images/loginbutton.png) no-repeat;	
width: 70px;	
height: 26px;	
border: none;	
padding: 0;	
margin: 6px 25px 0 0;	
cursor: pointer;	
float: right;}

#reminder {	
padding: 12px 0 0 2px;}

#reminder a {	
padding-right: 12px;}

#top_login a:link, 
#top_login a:visited {	
color: #eee;	
font-weight: bold;}

#top_login ul, 
#top_login ul li  {	
list-style: none;	
padding: 0;	
margin: 0;}

#header #navigation {
font-size: 14px;
height: 22px;
overflow: hidden;
padding: 18px 0 0 0px;
font-family: "Times New Roman", Verdana, Arial, Helvetica, sans-serif;
margin-bottom: 4px;
}
/* Login Code - End */

Here is the result:

NomaTqY.png

I know it's not the cleanest, but it works  O:)  i had no 1 to help me...  :-[

 

Anyways, when i log in it takes me into the forum, and everything works fine... I'm logged into the forum.

But when i go back into the "front page", it still shows the login box... username and password.

 

ok, now here's the thing.

before i edited the WP header.php there was a banner at the top:

width=600 height=108http://i.imgur.com/G2qQzCM.png[/img]

What I'm trying to do now, is make it so when someone is logged in, that banner comes back up... and when they logout... it goes back to the login code i edited.

 

 

Hopefully i didn't make this too confusing, and someone could help me please.

Here is part of the original header.php from my wordpress theme:

<div id="wrapper">

<div id="container-wrap">

<div id="container" class="container">

	<div id="header" class="span-24">

		<?php 

        if(wpthemes_options('header_code') != '') {

        echo wpthemes_options("header_code")  . "\n"; 

        }

        ?>

		<div id="navigation" class="span-24">

				<ul id="nav">

                    	<?php if(wpthemes_options('show_dropdown') != '') { ?>

                            <li <?php if(is_home()) { echo ' class="current-cat" '; } ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>

                            <?php custom_cat_menu('exclude_hor_cat'); ?>

                            <?php custom_page_menu('exclude_hor_pages'); ?>

						<?php custom_link_menu('exclude_hor_links'); ?>

                        <?php } ?>

				</ul>

		</div>

		<div id="logo_wrap" >

			<div class="logo">

			<?php if(wpthemes_options('logo') != '') {?>

<div class="blog-name">

<a href="<?php bloginfo('url'); ?>"><img src="<?php echo wpthemes_options('logo'); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" /></a>

</div>

<?php

} else { ?>

  <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>

      <<?php echo $heading_tag; ?> class="blog-name"><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></<?php echo $heading_tag; ?>>

  <?php } ?>

		</div>

		<div class="ad-wrap">

				<?php if(wpthemes_options('ad468_googleads') != '') {

                 		echo wpthemes_options('ad468_googleads');

				} elseif ( wpthemes_options('ad468_location') != '') { ?>

					<a href="<?php echo wpthemes_options('ad468_url'); ?>"><img src="<?php echo wpthemes_options('ad468_location'); ?>" /></a>

             		<?php } ?>

			</div>

		</div>

	</div>

Link to comment
Share on other sites

  • 3 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Posts

    • I am selling the essence project which includes versions 388 and 439 that have been running for over 2 years or (447 as custom PVP like Pride). I have a test server for you to test them out. If you are really interested in it then contact my seller at discord: kiwi7106. Price: 4000 Euro P/s: This is a project that I have spent a lot of money and time developing, so if you are not interested in it, please get out of this topic, thank you. P/s 2: If you find the price too expensive, it's best to skip this article and find another project and don't comment negatively on my topic, thank you.
    • Someone ask me for this, it should work on any client that has Kamael race, preview:     Installation - there are two ways to install depending on how you want to use it:   Method 1: If you want to completely replace the original, do:   Copy all lines from your armorgrp to Notepad++, press Ctrl+H, check the "match whole word" option and replace:   kamael.Mkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_MKamael_m001_w_ad00   Then replace:   MKamael.Mkamael_m000_t00_w   by:   AvengersKamaelWings.MKamael_m001_t00_w   Now repeat the same process with the female, replace:   kamael.Fkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_FKamael_m001_w_ad00   Then replace:   FKamael.Fkamael_m000_t00_w   by:   AvengersKamaelWings.FKamael_m001_t00_w   You're done, paste everything back into File Edit and save!   Method 2: If you only want to replace in specific sets, execute the above process only on the armorgrp of those sets.   Repack by: AvengersTeamBr Password: LadrãoDeFrango      
    • 用于解密、加密和编辑 .u 文件的工具。
    • It's always awesome when you find someone who not only delivers great quality but also does it way ahead of schedule. Makes you feel like you hit the jackpot, right? I'm new around here, just stumbled upon this forum, and seeing posts like yours really gives me hope that there are some real pros hanging out in this community.
  • Topics

×
×
  • Create New...