Author Topic: [MOD] SMF integration  (Read 137712 times)

0 Members and 1 Guest are viewing this topic.

worldce

  • Guest
Re: [MOD] SMF integration
« Reply #75 on: July 26, 2009, 03:18:20 PM »
when i changed password or email from 4images not changed from smf. Help me pls:( i want to forum is active.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #76 on: July 26, 2009, 03:42:28 PM »
when i changed password or email from 4images not changed from smf. Help me pls:( i want to forum is active.

Look at the last 3 inserts in the Member.php file...
Those are the ones that handle the e-mail and password changes...
Are they in the correct place?
I am not having that issue running on my site. I have changed the e-mail/passwords for accounts without any problems.

let me know if you fin anything...
Buddy Duke
www.budduke.com

worldce

  • Guest
Re: [MOD] SMF integration
« Reply #77 on: July 26, 2009, 06:28:34 PM »
yes, they are in the correct place. when i tryed forgot password ,it changed 4images and smf. but  i havent changed the e-mail/passwords.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #78 on: July 26, 2009, 07:16:46 PM »
yes, they are in the correct place. when i tryed forgot password ,it changed 4images and smf. but  i havent changed the e-mail/passwords.

tested it again on my running site.
If I change my e-mail address on my account on the 4images site, the e-mail changes in the database on the smf side (that works)
If I change my password on my account on the 4images site, the password does not change on the smf side(that does not work)

Is that what is happening to you?
That appears to be bug, I have not touched that code in almost a year, I have allot on my plate right now. it may be awhile till I can come up with something.

I have been looking at the 4images bridge for another bulletin board on this forum to see how they link the two together to see if I should just rewrite my mod to work in that manner instead.

If I find time, I will let you know if I can figure a workaround for the password (I think it is how the passwords are encrypted in the different scripts)
Buddy Duke
www.budduke.com

worldce

  • Guest
Re: [MOD] SMF integration
« Reply #79 on: July 26, 2009, 07:53:04 PM »
thanks for your helps budduke.
i tested
if i changed my e-mail and my password on my account on the 4images, they dont change in the database on the smf.
also if i change  my e-mail on the smf ,e-mail  deleted.

i have updated smf from 1.1.9 to 1.1.10. this may be the problem?

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #80 on: July 26, 2009, 08:45:23 PM »
thanks for your helps budduke.
i tested
if i changed my e-mail and my password on my account on the 4images, they dont change in the database on the smf.
also if i change  my e-mail on the smf ,e-mail  deleted.

i have updated smf from 1.1.9 to 1.1.10. this may be the problem?

I am using 1.1.9, you can not change ANYTHING on the smf side. The changes will not go back to the 4images side. All changes have to be made in the 4images USER control panel, this also does not work if you make changes to user in the admin control panel of 4images.
I did not see an update for 1.1.10, usually it shows up in the admin area of smf, will have to look at their site when I get a chance.
Buddy Duke
www.budduke.com

Offline brez

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [MOD] SMF integration
« Reply #81 on: September 27, 2009, 09:45:53 PM »
I have 3 themes in my smf (Babylon, Classic and Default) but the following code does not appear in any of them!
   

in the themes/pinkblitz/index. template. php file

Quote
      <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' .  $context['session_id'] .  '\');"' : '', '>
         <input type="text" name="user"  size="10" />
         <input type="password" name="passwrd"  size="10" />
         <input type="submit" value="', $txt[34], '" />
         <input type="hidden" name="hash_passwrd" value="" />
      </form>', $context['current_time'],'<br />';

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #82 on: September 27, 2009, 10:30:17 PM »
I have 3 themes in my smf (Babylon, Classic and Default) but the following code does not appear in any of them!
   

in the themes/pinkblitz/index. template. php file

Quote
      <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' .  $context['session_id'] .  '\');"' : '', '>
         <input type="text" name="user"  size="10" />
         <input type="password" name="passwrd"  size="10" />
         <input type="submit" value="', $txt[34], '" />
         <input type="hidden" name="hash_passwrd" value="" />
      </form>', $context['current_time'],'<br />';


Did you read the paragraph above those changes?
Quote
The following changes are in any theme that your end users get to choose.
Mainly you are taking away any logins, registration, or forgot password stuff
Not sure if it is in the same location in each theme but these are the changes I did to mine

You are mainly looking for anything on the SMF side themes that allow a user to login and you need to remove it...
I never looked deep into all the themes to see if they are laid out the same or not...

I have been looking over how someone created a bridge for vbulliten? (I think) I am thinking about trying that route for SMF if it will work in the near future, Have not had much time to deal with anything but my personal problems but hopefully the info above will help you look in the right direction...

Buddy Duke
www.budduke.com

Offline brez

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [MOD] SMF integration
« Reply #83 on: September 27, 2009, 11:10:43 PM »
Yes vbulletin would be a nice addition! blends with most sites too.     

I Have done all your mods for smf but, is this an error on my side when i open my gallery?

Code: [Select]
Warning: require_once(/home2/irishavs/Settings.php) [function.require-once]: failed to open stream: No such file or directory in /home2/irishavs/smf_api_2.php on line 58

Fatal error: require_once() [function.require]: Failed opening required '/home2/irishavs/Settings.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/irishavs/smf_api_2.php on line 58

Forgot to mention i am using a fresh install of smf 1.    1.    10

Edit.   .   .   .   .   

I have fixed the above error.   .   .   .   .    Eventually i had to rename smf_1-1_api.   php to smf_api.   php

PLUS.   .   
Is this mod NOT compatible with smf 1.   1.   10 ?
My new forum is in turmoil plus login is still there
 irishavsites-dot-com/
« Last Edit: October 01, 2009, 02:13:08 AM by brez »

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #84 on: September 29, 2009, 12:38:37 AM »
@ brez,

Not sure if compatable with 1.1.10... I have not added that update to my site yet. I looked through the change files at smf's site and did not see anything that stuck out that looked like it would cause any problems...

Looked at your site quickly, it looks like the smf has something wrong when it is looking for your themes...
the path looked like this when I looked at some of the broken links in the images...
http://irishavsites.com/for/Themes/default/images/
shouldn't the /for/ be /forum/ instead?
that may be your problem there...

the login area, you need to look through the theme files to find where it is to remove it...
Buddy Duke
www.budduke.com

Offline brez

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [MOD] SMF integration
« Reply #85 on: September 29, 2009, 12:56:36 AM »
@ bud

Where exactly did you get the "/for/"?  Yes it should be forum.  Dont know where that came from.  i will search.

1.  1.  10 has its own themes/login_template. php

Code: [Select]
<?php
// Version: 1.1; Login

// This is just the basic "login" form.
function template_login()
{
global $context$settings$options$scripturl$modSettings$txt;

echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" name="frmLogin" id="frmLogin" style="margin-top: 4ex;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<table border="0" width="400" cellspacing="0" cellpadding="4" class="tborder" align="center">
<tr class="titlebg">
<td colspan="2">
<img src="'
$settings['images_url'], '/icons/login_sm.gif" alt="" align="top" /> '$txt[34], '
</td>'
;

// Did they make a mistake last time?
if (isset($context['login_error']))
echo '
</tr><tr class="windowbg">
<td align="center" colspan="2" style="padding: 1ex;">
<b style="color: red;">'
$context['login_error'], '</b>
</td>'
;

// Or perhaps there's some special description for this time?
if (isset($context['description']))
echo '
</tr><tr class="windowbg">
<td align="center" colspan="2">
<b>'
$context['description'], '</b><br />
<br />
</td>'
;

// Now just get the basic information - username, password, etc.
echo '
</tr><tr class="windowbg">
<td width="50%" align="right"><b>'
$txt[35], ':</b></td>
<td><input type="text" name="user" size="20" value="'
$context['default_username'], '" /></td>
</tr><tr class="windowbg">
<td align="right"><b>'
$txt[36], ':</b></td>
<td><input type="password" name="passwrd" value="'
$context['default_password'], '" size="20" /></td>
</tr><tr class="windowbg">
<td align="right"><b>'
$txt[497], ':</b></td>
<td><input type="text" name="cookielength" size="4" maxlength="4" value="'
$modSettings['cookieTime'], '"'$context['never_expire'] ? ' disabled="disabled"' ''' /></td>
</tr><tr class="windowbg">
<td align="right"><b>'
$txt[508], ':</b></td>
<td><input type="checkbox" name="cookieneverexp"'
$context['never_expire'] ? ' checked="checked"' ''' class="check" onclick="this.form.cookielength.disabled = this.checked;" /></td>
</tr><tr class="windowbg">'
;
// If they have deleted their account, give them a chance to change their mind.
if (isset($context['login_show_undelete']))
echo '
<td align="right"><b style="color: red;">'
$txt['undelete_account'], ':</b></td>
<td><input type="checkbox" name="undelete" class="check" /></td>
</tr><tr class="windowbg">'
;
echo '
<td align="center" colspan="2"><input type="submit" value="'
$txt[34], '" style="margin-top: 2ex;" /></td>
</tr><tr class="windowbg">
<td align="center" colspan="2" class="smalltext"><a href="'
$scripturl'?action=reminder">'$txt[315], '</a><br /><br /></td>
</tr>
</table>

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

// Focus on the correct input - username or password.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.frmLogin.'
, isset($context['default_username']) && $context['default_username'] != '' 'passwrd' 'user''.focus();
// ]]></script>'
;
}

// Tell a guest to get lost or login!
function template_kick_guest()
{
global $context$settings$options$scripturl$modSettings$txt;

// This isn't that much... just like normal login but with a message at the top.
echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" name="frmLogin" id="frmLogin"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<table border="0" cellspacing="0" cellpadding="3" class="tborder" align="center">
<tr class="catbg">
<td>'
$txt[633], '</td>
</tr><tr>'
;

// Show the message or default message.
echo '
<td class="windowbg" style="padding-top: 2ex; padding-bottom: 2ex;">
'
, empty($context['kick_message']) ? $txt[634] : $context['kick_message'], '<br />
'
$txt[635], ' <a href="'$scripturl'?action=register">'$txt[636], '</a> '$txt[637], '
</td>'
;

// And now the login information.
echo '
</tr><tr class="titlebg">
<td><img src="'
$settings['images_url'], '/icons/login_sm.gif" alt="" align="top" /> '$txt[34], '</td>
</tr><tr>
<td class="windowbg">
<table border="0" cellpadding="3" cellspacing="0" align="center">
<tr>
<td align="right"><b>'
$txt[35], ':</b></td>
<td><input type="text" name="user" size="20" /></td>
</tr><tr>
<td align="right"><b>'
$txt[36], ':</b></td>
<td><input type="password" name="passwrd" size="20" /></td>
</tr><tr>
<td align="right"><b>'
$txt[497], ':</b></td>
<td><input type="text" name="cookielength" size="4" maxlength="4" value="'
$modSettings['cookieTime'], '" /></td>
</tr><tr>
<td align="right"><b>'
$txt[508], ':</b></td>
<td><input type="checkbox" name="cookieneverexp" class="check" onclick="this.form.cookielength.disabled = this.checked;" /></td>
</tr><tr>
<td align="center" colspan="2"><input type="submit" value="'
$txt[34], '" style="margin-top: 2ex;" /></td>
</tr><tr>
<td align="center" colspan="2" class="smalltext"><a href="'
$scripturl'?action=reminder">'$txt[315], '</a><br /><br /></td>
</tr>
</table>
</td>
</tr>
</table>

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

// Do the focus thing...
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.frmLogin.user.focus();
// ]]></script>'
;
}

// This is for maintenance mode.
function template_maintenance()
{
global $context$settings$options$scripturl$txt$modSettings;

// Display the administrator's message at the top.
echo '
<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '">
<table border="0" width="86%" cellspacing="0" cellpadding="3" class="tborder" align="center">
<tr class="titlebg">
<td colspan="2">'
$context['title'], '</td>
</tr><tr>
<td class="windowbg" width="44" align="center" style="padding: 1ex;">
<img src="'
$settings['images_url'], '/construction.gif" width="40" height="40" alt="'$txt['maintenance3'], '" />
</td>
<td class="windowbg">'
$context['description'], '</td>
</tr><tr class="titlebg">
<td colspan="2">'
$txt[114], '</td>
</tr><tr>'
;

// And now all the same basic login stuff from before.
echo '
<td colspan="2" class="windowbg">
<table border="0" width="90%" align="center">
<tr>
<td><b>'
$txt[35], ':</b></td>
<td><input type="text" name="user" size="15" /></td>
<td><b>'
$txt[36], ':</b></td>
<td><input type="password" name="passwrd" size="10" /> &nbsp;</td>
</tr><tr>
<td><b>'
$txt[497], ':</b></td>
<td><input type="text" name="cookielength" size="4" maxlength="4" value="'
$modSettings['cookieTime'], '" /> &nbsp;</td>
<td><b>'
$txt[508], ':</b></td>
<td><input type="checkbox" name="cookieneverexp" class="check" /></td>
</tr><tr>
<td align="center" colspan="4"><input type="submit" value="'
$txt[34], '" style="margin-top: 1ex; margin-bottom: 1ex;" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>'
;
}

// This is for the security stuff - makes administrators login every so often.
function template_admin_login()
{
global $context$settings$options$scripturl$txt;

// Since this should redirect to whatever they were doing, send all the get data.
echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl$context['get_data'], '" method="post" accept-charset="'$context['character_set'], '" name="frmLogin" id="frmLogin" onsubmit="hashAdminPassword(this, \''$context['user']['username'], '\', \''$context['session_id'], '\');">
<table border="0" width="400" cellspacing="0" cellpadding="3" class="tborder" align="center">
<tr class="titlebg">
<td align="left">
<img src="'
$settings['images_url'], '/icons/login_sm.gif" alt="" align="top" /> '$txt[34], '
</td>
</tr>'
;

// We just need the password.
echo '
<tr class="windowbg">
<td align="center" style="padding: 1ex 0;">
<b>'
$txt[36], ':</b> <input type="password" name="admin_pass" size="24" /> <a href="'$scripturl'?action=helpadmin;help=securityDisable_why" onclick="return reqWin(this.href);" class="help"><img src="'$settings['images_url'], '/helptopics.gif" alt="'$txt[119], '" align="middle" /></a><br />
<input type="submit" value="'
$txt[34], '" style="margin-top: 2ex;" />
</td>
</tr>
</table>'
;

// Make sure to output all the old post data.
echo $context['post_data'], '

<input type="hidden" name="admin_hash_pass" value="" />
</form>'
;

// Focus on the password box.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.frmLogin.admin_pass.focus();
// ]]></script>'
;
}

// Activate your account manually?
function template_retry_activate()
{
global $context$settings$options$txt$scripturl;

// Just ask them for their code so they can try it again...
echo '
<br />
<form action="'
$scripturl'?action=activate;u='$context['member_id'], '" method="post" accept-charset="'$context['character_set'], '">
<table border="0" width="600" cellpadding="4" cellspacing="0" class="tborder" align="center">
<tr class="titlebg">
<td colspan="2">'
$context['page_title'], '</td>';

// You didn't even have an ID?
if (empty($context['member_id']))
echo '
</tr><tr class="windowbg">
<td align="right" width="40%">'
$txt['invalid_activation_username'], ':</td>
<td><input type="text" name="user" size="30" /></td>'
;

echo '
</tr><tr class="windowbg">
<td align="right" width="40%">'
$txt['invalid_activation_retry'], ':</td>
<td><input type="text" name="code" size="30" /></td>
</tr><tr class="windowbg">
<td colspan="2" align="center" style="padding: 1ex;"><input type="submit" value="'
$txt['invalid_activation_submit'], '" /></td>
</tr>
</table>
</form>'
;
}

// Activate your account manually?
function template_resend()
{
global $context$settings$options$txt$scripturl;

// Just ask them for their code so they can try it again...
echo '
<br />
<form action="'
$scripturl'?action=activate;sa=resend" method="post" accept-charset="'$context['character_set'], '">
<table border="0" width="600" cellpadding="4" cellspacing="0" class="tborder" align="center">
<tr class="titlebg">
<td colspan="2">'
$context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="right" width="40%">'
$txt['invalid_activation_username'], ':</td>
<td><input type="text" name="user" size="40" value="'
$context['default_username'], '" /></td>
</tr><tr class="windowbg">
<td colspan="2" style="padding-top: 3ex; padding-left: 3ex;">'
$txt['invalid_activation_new'], '</td>
</tr><tr class="windowbg">
<td align="right" width="40%">'
$txt['invalid_activation_new_email'], ':</td>
<td><input type="text" name="new_email" size="40" /></td>
</tr><tr class="windowbg">
<td align="right" width="40%">'
$txt['invalid_activation_password'], ':</td>
<td><input type="password" name="passwd" size="30" /></td>
</tr><tr class="windowbg">'
;

if ($context['can_activate'])
echo '
<td colspan="2" style="padding-top: 3ex; padding-left: 3ex;">'
$txt['invalid_activation_known'], '</td>
</tr><tr class="windowbg">
<td align="right" width="40%">'
$txt['invalid_activation_retry'], ':</td>
<td><input type="text" name="code" size="30" /></td>
</tr><tr class="windowbg">'
;

echo '
<td colspan="2" align="center" style="padding: 1ex;"><input type="submit" value="'
$txt['invalid_activation_resend'], '" /></td>
</tr>
</table>
</form>'
;
}

?>
« Last Edit: September 29, 2009, 01:07:53 AM by brez »

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #86 on: September 30, 2009, 01:11:33 AM »
@Brez,
I saw the "/for/" when I viewed the source of your webpage the forum was displaying and browsed to where one of the pictures had an X on it and that is where the /for/ showed up in the path to that image.
If I remember right you can change that in the admin settings of the forum, but can not remember where it was.

The file you posted is the actual login functions. You do not touch any of that file. Look at my instructions on the first page.

the login is displayed in the following template files...
themes\default\index.template.php
themes\default\profile.template.php
themes\default\language\index.english.php

and based on whatever other themes you have installed

themes\your theme you are using\boardindex.template.php
themes\your them you are using\index.template.php

Hope that helps, just find anything that looks like it is displaying the login form on the template and remove it.

Buddy Duke
www.budduke.com

Offline brez

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [MOD] SMF integration
« Reply #87 on: September 30, 2009, 03:21:27 AM »
@bud
Because of the /for/ i could not login. 
I used the repair_settings.  php to correct the errors (There seemed to be a lot of them)

I now have it up and running, but must find a way to logout admin. 
Maybe load the smf on a new tab (target="_blank")  with just a logout button on the forum index page!
OR
Would it be easier to set auto logout by time?

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #88 on: September 30, 2009, 04:53:50 PM »
@bud
I now have it up and running, but must find a way to logout admin. 
Maybe load the smf on a new tab (target="_blank")  with just a logout button on the forum index page!
OR
Would it be easier to set auto logout by time?

That is a bug that I found also...
You have to logout on the 4images side where a normal user logout...
If you logout of the admin panel on the 4images side then smf does not get logged out, so what I do is when I am finished in the admin panel of 4images I always click on the "go to gallery home page" instead of the logout and then I logout from the normal login/out screen on the gallery and then it logs me out of the smf side...
Buddy Duke
www.budduke.com

Offline brez

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [MOD] SMF integration
« Reply #89 on: October 01, 2009, 01:23:15 AM »
OUCH!
I have a major problem!

Spam was posted on the smf forum by someone NOT registered on the Gallery site.

I believe every visitor to smf is open to posting