4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: budduke on September 07, 2008, 09:29:36 PM

Title: [MOD] SMF integration
Post by: budduke on September 07, 2008, 09:29:36 PM
OK here we go...
This is a BETA mod that will allow you to log into 4images and automatically log you into the SMF forum.
The version of SMF that I am using is 1.1.5 (not sure if things are the same in other versions or not)
My site is laid out like this
root\gallery is my 4images gallery
root\forums is my smf forum
the 2 sets of files that you will need to install are from another programmer.
Not sure about the copyrights so I am just providing a link to get them
first file...
http://www.simplemachines.org/download/?tools
download the SMF 1.1.x API file and place smf_api.php file in the root of your smf forum (mine is root\forums)
second file...
http://vgb.org.ru/download
download the smf_api2.zip file and unzip it into the root of your smf forum also.

This is just to get everyone started, it does work on my site but some little things have cropped up but I thought if
some better programmers looked over these changes they may have a better way or an easier way to make all this happen.

now for the modified files (BACKUP! FIRST)
on the 4images side...
global.php
member.php
includes\functions.php
includes\sessions.php

on the SMF side...
The main modification on the smf side is to turn off the login,registar,and forgot password buttons anywhere in the user area. the password still works for the administration side of it.
I believe I also had to uncheck the(Show a quick login on every page) in the admin settings.
(BACKUP! FIRST)
sources\profiles.php
sources\themes.php
themes\default\index.template.php
themes\default\profile.template.php
themes\default\language\index.english.php
and based on whever other themes you have installed
mine would be...
themes\pinkblitz\boardindex.template.php
themes\pinkblitz\index.template.php

Now the changes...
Lets start on the 4images side...

in the global.php file

look for
Code: [Select]
$table_prefix = "4images_";
add after
Code: [Select]
// MOD SMF integration
$SMF_user_email = "TTtt";
//END MOD SMF

in the includes/Functions.php file

look for
Code: [Select]
function un_htmlspecialchars($text) {
  $text = str_replace(
    array('<', '>', '"', '&'),
    array('<',    '>',    '"',      '&'),
    $text
  );

  return $text;
}
replace with
Code: [Select]
//MOD SMF integration
if (!function_exists('un_htmlspecialchars')) {
function un_htmlspecialchars($chars) {
  //$chars = preg_replace("/(&#)([0-9]*)(;)/esiU", "chr(intval('\\2'))", $chars);
  $chars = str_replace("&gt;", ">", $chars);
  $chars = str_replace("&lt;", "<", $chars);
  $chars = str_replace("&quot;", "\"", $chars);
  $chars = str_replace("&amp;", "&", $chars);
  return $chars;
}
}
//function un_htmlspecialchars($text) {
//  $text = str_replace(
//    array('&lt;', '&gt;', '&quot;', '&amp;'),
//    array('<',    '>',    '"',      '&'),
//    $text
//  );

//  return $text;
//}
//END SMF

in the includes\sessions.php file

look for
Code: [Select]
//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------
add after and look at comment in code
Code: [Select]
//MOD SMF integration
require(ROOT_PATH.'../../forums/smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'../../forums/smf_api.php');     //change paths to your forums directory
global $smf_settings, $smf_user_info;
//END MOD SMF

look for
Code: [Select]
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password")."
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
    $row = $site_db->query_firstrow($sql);
replace with
Code: [Select]
//MOD SMF integration
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email")."
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
    $row = $site_db->query_firstrow($sql);
//    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password")."
//            FROM ".USERS_TABLE."
//            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
//    $row = $site_db->query_firstrow($sql);
$user_name = $row[2];
$user_email = $row[3];
$smf_user_password = $user_password;
//END SMF

look for
Code: [Select]
        $this->start_session($user_id, 1);
add after
Code: [Select]
// MOD SMF integration
if (!smf_api_get_user($user_name,$smf_user_password)){
smf_api_register($user_name, $smf_user_password, $user_email);
}
smf_api_login(7200, $user_name, $smf_user_password, false);
// END MOD SMF

look for
Code: [Select]
    $this->session_info = array();
add after
Code: [Select]
// MOD SMF integration
    smf_api_logout();
smf_sessionDestroy($user_id);
//END MOD SMF

in the member.php file

look for
Code: [Select]
    if ($checkuser = $site_db->query_firstrow($sql)) {
add after
Code: [Select]
//MOD SMF integration
  $smf_user_password = $checkuser[$user_table_fields['user_password']];
// END MOD SMF

look for
Code: [Select]
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_password")." = '".md5($user_password)."'
              WHERE ".get_user_table_field("", "user_id")." = ".$checkuser[$user_table_fields['user_id']];
      $site_db->query($sql);
add after
Code: [Select]
//MOD SMF integration
  $smf_user_name = $checkuser[$user_table_fields['user_name']];
  smf_api_get_user($smf_user_name,$smf_user_password);
  $smf_user_info['id']=$smf_user_info['ID_MEMBER'];
  $smf_user_info['username']=$smf_user_name;
  $smf_user_id = $smf_user_info['ID_MEMBER'];
  smf_api_update_user($smf_user_id, "", $user_password); 
//END MOD SMF

look for
Code: [Select]
    $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
    $site_db->query($sql);
add after
Code: [Select]
//MOD SMF integration
$smf_user_id = $smf_user_info['ID_MEMBER'];
smf_api_update_user($smf_user_id, "", "",$user_email);
//END MOD SMF

look for
Code: [Select]
if ($action == "updatepassword") {
  $txt_clickstream = $lang['control_panel'];
  if ($user_info['user_level'] == GUEST) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $error = 0;
add after
Code: [Select]
//MOD SMF integration
  $smf_user_password = $HTTP_POST_VARS['user_password'];
//END MOD SMF

look for
Code: [Select]
  if (!$error) {
    $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_password")." = '$user_password'
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
    $site_db->query($sql);
add after
Code: [Select]
//MOD SMF integration
$smf_user_id = $smf_user_info['ID_MEMBER'];
smf_api_update_user($smf_user_id, "", $smf_user_password);
//END MOD SMF

Now the SMF side of things...
in the sources\profile.php file

look for
Code: [Select]
elseif ((allowedTo('profile_remove_own') && $context['user']['is_owner']) || allowedTo('profile_remove_any'))
$_REQUEST['sa'] = 'deleteAccount';
replace with
Code: [Select]
//MOD 4images integration
//elseif ((allowedTo('profile_remove_own') && $context['user']['is_owner']) || allowedTo('profile_remove_any'))
// $_REQUEST['sa'] = 'deleteAccount';
//END MOD 4images

look for
Code: [Select]
if (($context['user']['is_owner'] && allowedTo('profile_remove_own')) || allowedTo('profile_remove_any'))
$context['profile_areas']['profile_action']['areas']['deleteAccount'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=deleteAccount">' . $txt['deleteAccount'] . '</a>';
replace with
Code: [Select]
//MOD 4images integration
//if (($context['user']['is_owner'] && allowedTo('profile_remove_own')) || allowedTo('profile_remove_any'))
// $context['profile_areas']['profile_action']['areas']['deleteAccount'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=deleteAccount">' . $txt['deleteAccount'] . '</a>';
//END MOD 4images

look for
Code: [Select]
$profile_vars['emailAddress'] = '\'' . $_POST['emailAddress'] . '\'';
replace with
Code: [Select]
//MOD 4images integration
//$profile_vars['emailAddress'] = '\'' . $_POST['emailAddress'] . '\'';
$profile_vars['emailAddress'] = '\'' . $emailAddress . '\'';
//END MOD 4images

in the sources/themes.php file

look for
Code: [Select]
if ($context[\'user\'][\'is_guest\'])
{
echo \'
<a href="\', $scripturl, \'?action=login">\', ($settings[\'use_image_buttons\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/\' . $context[\'user\'][\'language\'] . \'/login.gif" alt="\' . $txt[34] . \'" border="0" />\' : $txt[34]), \'</a>\', $context[\'menu_separator\'], \'
<a href="\', $scripturl, \'?action=register">\', ($settings[\'use_image_buttons\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/\' . $context[\'user\'][\'language\'] . \'/register.gif" alt="\' . $txt[97] . \'" border="0" />\' : $txt[97]), \'</a>\';
}

Otherwise, they might want to [logout]...
else
echo \'
<a href="\', $scripturl, \'?action=logout;sesc=\', $context[\'session_id\'], \'">\', ($settings[\'use_image_buttons\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/\' . $context[\'user\'][\'language\'] . \'/logout.gif" alt="\' . $txt[108] . \'" border="0" />\' : $txt[108]), \'</a>\';
replace with
Code: [Select]
//MOD 4images integration
//if ($context[\'user\'][\'is_guest\'])
//{
// echo \'
// <a href="\', $scripturl, \'?action=login">\', ($settings[\'use_image_buttons\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/\' . $context[\'user\'][\'language\'] . \'/login.gif" alt="\' . $txt[34] . \'" border="0" />\' : $txt[34]), \'</a>\', $context[\'menu_separator\'], \'
// <a href="\', $scripturl, \'?action=register">\', ($settings[\'use_image_buttons\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/\' . $context[\'user\'][\'language\'] . \'/register.gif" alt="\' . $txt[97] . \'" border="0" />\' : $txt[97]), \'</a>\';
//}
//
// Otherwise, they might want to [logout]...
//else
// echo \'
// <a href="\', $scripturl, \'?action=logout;sesc=\', $context[\'session_id\'], \'">\', ($settings[\'use_image_buttons\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/\' . $context[\'user\'][\'language\'] . \'/logout.gif" alt="\' . $txt[108] . \'" border="0" />\' : $txt[108]), \'</a>\';
//END MOD 4images

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

look for
Code: [Select]
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
replace with
Code: [Select]
//MOD 4images integration
//if ($context['user']['is_guest'])
// echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
// <td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
// <a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
// </td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
//if ($context['user']['is_guest'])
// echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
// <td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
// <a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
// </td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
//if ($context['user']['is_logged'])
// echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
// <td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
// <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
// </td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
//END MOD 4images

in the themes\default\languages\index.english.php file

look for
Code: [Select]
$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
replace with
Code: [Select]
//MOD 4images integration
//$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>.';
//END MOD 4images

in the themes/default/profile.template.php file

look for
Code: [Select]
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr><tr>
<td width="40%"><b', (isset($context['modify_error']['bad_email']) || isset($context['modify_error']['no_email']) || isset($context['modify_error']['email_taken']) ? ' style="color: red;"' : ''), '>', $txt[69], ': </b><div class="smalltext">', $txt[679], '</div></td>
<td><input type="text" name="emailAddress" size="30" value="', $context['member']['email'], '" /></td>
</tr>';
replace with
Code: [Select]
//MOD 4images integration
// echo '
<!-- <tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr><tr>
<td width="40%"><b', (isset($context['modify_error']['bad_email']) || isset($context['modify_error']['no_email']) || isset($context['modify_error']['email_taken']) ? ' style="color: red;"' : ''), '>', $txt[69], ': </b><div class="smalltext">', $txt[679], '</div></td>
<td><input type="text" name="emailAddress" size="30" value="', $context['member']['email'], '" /></td>
</tr>';
-->
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr><tr>
<td width="40%"><b', (isset($context['modify_error']['bad_email']) || isset($context['modify_error']['no_email']) || isset($context['modify_error']['email_taken']) ? ' style="color: red;"' : ''), '>', $txt[69], ': </b><div class="smalltext"></div></td>
<td> '.$context['member']['email']. '</td>
</tr>';
//END MOD 4images

look for
Code: [Select]
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr><tr>
<td width="40%"><b', (isset($context['modify_error']['bad_new_password']) ? ' style="color: red;"' : ''), '>', $txt[81], ': </b><div class="smalltext">', $txt[596], '</div></td>
<td><input type="password" name="passwrd1" size="20" /></td>
</tr><tr>
<td width="40%"><b>', $txt[82], ': </b></td>
<td><input type="password" name="passwrd2" size="20" /></td>
</tr>';

// This section allows the user to enter secret question/answer so they can reset a forgotten password.
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr><tr>
<td width="40%"><b>', $txt['pswd1'], ':</b><div class="smalltext">', $txt['secret_desc'], '</div></td>
<td><input type="text" name="secretQuestion" size="50" value="', $context['member']['secret_question'], '" /></td>
</tr><tr>
<td width="40%"><b>', $txt['pswd2'], ':</b><div class="smalltext">', $txt['secret_desc2'], '</div></td>
<td><input type="text" name="secretAnswer" size="20" /><span class="smalltext" style="margin-left: 4ex;"><a href="', $scripturl, '?action=helpadmin;help=secret_why_blank" onclick="return reqWin(this.href);">', $txt['secret_why_blank'], '</a></span></td>
</tr>';
replace with
Code: [Select]
//MOD 4images integration
//echo '
// <tr>
// <td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
// </tr><tr>
// <td width="40%"><b', (isset($context['modify_error']['bad_new_password']) ? ' style="color: red;"' : ''), '>', $txt[81], ': </b><div class="smalltext">', $txt[596], '</div></td>
// <td><input type="password" name="passwrd1" size="20" /></td>
// </tr><tr>
// <td width="40%"><b>', $txt[82], ': </b></td>
// <td><input type="password" name="passwrd2" size="20" /></td>
// </tr>';

// This section allows the user to enter secret question/answer so they can reset a forgotten password.
//echo '
// <tr>
// <td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
// </tr><tr>
// <td width="40%"><b>', $txt['pswd1'], ':</b><div class="smalltext">', $txt['secret_desc'], '</div></td>
// <td><input type="text" name="secretQuestion" size="50" value="', $context['member']['secret_question'], '" /></td>
// </tr><tr>
// <td width="40%"><b>', $txt['pswd2'], ':</b><div class="smalltext">', $txt['secret_desc2'], '</div></td>
// <td><input type="text" name="secretAnswer" size="20" /><span class="smalltext" style="margin-left: 4ex;"><a href="', $scripturl, '?action=helpadmin;help=secret_why_blank" onclick="return reqWin(this.href);">', $txt['secret_why_blank'], '</a></span></td>
// </tr>';
//END MOD 4images

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

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

look for
Code: [Select]
// Show the login bar. (it's only true if they are logged out anyway.)
if ($context['show_login_bar'])
{
echo '
<tr>
<td class="titlebg" colspan="2">', $txt[34], ' <a href="', $scripturl, '?action=reminder" class="smalltext">(' . $txt[315] . ')</a></td>
</tr>
<tr>
<td class="windowbg" width="20" align="center">
<a href="', $scripturl, '?action=login"><img src="', $settings['images_url'], '/icons/login.gif" alt="', $txt[34], '" /></a>
</td>
<td class="windowbg2" valign="middle">
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<table border="0" cellpadding="2" cellspacing="0" align="center" width="100%"><tr>
<td valign="middle" align="left">
<label for="user"><b>', $txt[35], ':</b><br />
<input type="text" name="user" id="user" size="15" /></label>
</td>
<td valign="middle" align="left">
<label for="passwrd"><b>', $txt[36], ':</b><br />
<input type="password" name="passwrd" id="passwrd" size="15" /></label>
</td>
<td valign="middle" align="left">
<label for="cookielength"><b>', $txt[497], ':</b><br />
<input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
</td>
<td valign="middle" align="left">
<label for="cookieneverexp"><b>', $txt[508], ':</b><br />
<input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
</td>
<td valign="middle" align="left">
<input type="submit" value="', $txt[34], '" />
</td>
</tr></table>
</form>
</td>
</tr>';
}
replace with
Code: [Select]
//MOD 4images integration
// Show the login bar. (it's only true if they are logged out anyway.)
//if ($context['show_login_bar'])
//{
// echo '
// <tr>
// <td class="titlebg" colspan="2">', $txt[34], ' <a href="', $scripturl, '?action=reminder" class="smalltext">(' . $txt[315] . ')</a></td>
// </tr>
// <tr>
// <td class="windowbg" width="20" align="center">
// <a href="', $scripturl, '?action=login"><img src="', $settings['images_url'], '/icons/login.gif" alt="', $txt[34], '" /></a>
// </td>
// <td class="windowbg2" valign="middle">
// <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
// <table border="0" cellpadding="2" cellspacing="0" align="center" width="100%"><tr>
// <td valign="middle" align="left">
// <label for="user"><b>', $txt[35], ':</b><br />
// <input type="text" name="user" id="user" size="15" /></label>
// </td>
// <td valign="middle" align="left">
// <label for="passwrd"><b>', $txt[36], ':</b><br />
// <input type="password" name="passwrd" id="passwrd" size="15" /></label>
// </td>
// <td valign="middle" align="left">
// <label for="cookielength"><b>', $txt[497], ':</b><br />
// <input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
// </td>
// <td valign="middle" align="left">
// <label for="cookieneverexp"><b>', $txt[508], ':</b><br />
// <input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
// </td>
// <td valign="middle" align="left">
// <input type="submit" value="', $txt[34], '" />
// </td>
// </tr></table>
// </form>
// </td>
// </tr>';
//}
//END MOD 4images

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

look for
Code: [Select]
<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 />';
replace with
Code: [Select]
//MOD 4images integration
<!--
<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> --><br />', $context['current_time'],'<br />';
//END MOD 4images

look for
Code: [Select]
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '<li', $current_action == 'login' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=login"><span>' , $txt[34] , '</span></a></li>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '<li', $current_action == 'register' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';

// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<li', $current_action == 'logout' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span>' , $txt[108] , '</span></a></li>';
replace with
Code: [Select]
//MOD 4images integration
// If the user is a guest, show [login] button.
// 4images hack
//if ($context['user']['is_guest'])
//echo '<li', $current_action == 'login' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=login"><span>' , $txt[34] , '</span></a></li>';

// If the user is a guest, also show [register] button.
//4images hack
//if ($context['user']['is_guest'])
//echo '<li', $current_action == 'register' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';

// Otherwise, they might want to [logout]...
//4images hack
//if ($context['user']['is_logged'])
//echo '<li', $current_action == 'logout' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span>' , $txt[108] , '</span></a></li>';
//END MOD 4images

This is posted as a BETA to see how it works for everyone else...
How to get your smf forums to show up inside of 4images?
I used this mod and it worked for my site
http://www.4homepages.de/forum/index.php?topic=19843.0

Curious how it works, and any problems that anyone runs into.
PLEASE only use this on a test site and do not run it on your main site until you are comfortable that it is working the way you like it to.

the one thing is if you delete someone on the 4images side they do not get deleted on the forum side but I just log into the forum and delete them myself right now until I can find a fix.

I posted this because SMF comes up allot over the years on the board and I would like to see it move forward...
Buddy Duke

Title: [MOD] SMF integration
Post by: Sunny C. on September 07, 2008, 10:07:28 PM
WOW! Nice Dude!

Im testing it on a test Site !!!!!
Title: Re: [MOD] SMF integration
Post by: EdwinK on September 08, 2008, 11:22:26 PM
From reading this, it looks great. I just dare not do the needed changes.
Title: Re: [MOD] SMF integration
Post by: Loda on September 10, 2008, 07:14:29 PM
hi,
you really mean
Quote
in the includes/page_header.php file

i think, you mean the session.php ?
Title: Re: [MOD] SMF integration
Post by: budduke on September 10, 2008, 07:51:20 PM
Quote
hi,
you really mean


in the includes/page_header.php file

i think, you mean the session.php ?

Yes, you are correct. I modified the original post.
Thanks for doublchecking my work. I had it in the file list correct
Title: Re: [MOD] SMF integration
Post by: Sunny C. on September 11, 2008, 01:50:26 PM
I Have a Problem:
Code: [Select]
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/web574/html/cbvote/forum/smf_api.php on line 162

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/html/web574/html/cbvote/includes/page_header.php on line 431

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/web574/html/cbvote/includes/functions.php on line 513

functions.php - The COde is to long, show the Attachment

Title: Re: [MOD] SMF integration
Post by: budduke on September 12, 2008, 01:28:42 AM
for Phisker B,
looked over the files you sent me and made the changes that I thought would work...
I did not modify your extra themes because you need to find where to turn off the login options yourself.
I am not using all the different mods that you have in your code but placed my mods in the best places I could find.
I counted quite a few mods 11 or so?

looked over and did not see where there were any conflicts in variables or anything like that, not sure why it is not working.

regarding your recent post with the valid result warnings...
I get the first one all the time and have searched all over the  net regarding it and everyone says the same thing,
nothing to worry about, turn off your logging or flush your logs from time to time. so I have not searched beyound that.
The last 2 results seem to be with another mod and it does not look like any of the variables are crossing each other in any way.

If you completely remove all the SMF integration mods, do the warnings go away on the pageheader and functions?

PS: I see that you removed all remarks at the top of all the files regarding 4images,
I am assuming that you have paid for a license to remove those referrences?

Do not PM me regaring repairing your site for you, that is up for you to do. I will do my best to lead you in the correct direction,
but you may have to start with a fresh install of 4images and apply my mod first and then start adding each of the others untill
we determine when the conflict begins. Are you willing to do that? I do not have the time to install all the mods that you are using
because they would have no use on my site whatsoever.
If you want to pm me any questions or post them here that is fine, and if I need to see one of your files I will ask for it.

sorry for the long winded message but I do this for fun and do not have all the time in the world to be working on other people sites for them.
but I do enjoy learning and working through problems and that is why I posted the integration so all of us that want to use it can get it
to function the best way possible for 4images...


Title: Re: [MOD] SMF integration
Post by: Loda on September 12, 2008, 09:39:33 AM
hi,
i have a problem too:
if i comment an image or edit my profile i get a message called: "No database selected" on a white site.
stupid thing: the comment is done and the profile is edit.
i think it is a little problem but i can't find it..
do you know that problem?
Title: Re: [MOD] SMF integration
Post by: budduke on September 12, 2008, 04:30:38 PM
Quote
if i comment an image or edit my profile i get a message called: "No database selected" on a white site.
stupid thing: the comment is done and the profile is edit.

Interesting, is your SMF forum installed and running correctly before you did this mod?
I am able to change my profiles all the time, big test playing with that.
It sounds like it does not see the SMF part of your site.
You can also try turning on the maintence page on the SMF and see what type of message you get then.

I am currently at work right now so I will look a little deeper when I get home tonight and see what I can see.

Can you PM me your session.php so I can compare it with mine?
Title: Re: [MOD] SMF integration
Post by: budduke on September 13, 2008, 01:06:31 AM
to Loda,

check PM'd you the modified sessions file, see if it fixes the problem or not...
it seems like you put the logout info for SMF in the wrong spot,
will have to recheck my original post to see if there are 2 places that you can place that file.

also, your file said 1.7 version, do you know which one it actually is? Some of the functioned where created differently
but they seemed to aclomplish the same thing...
Title: Re: [MOD] SMF integration
Post by: Loda on September 13, 2008, 02:14:57 PM
hi,
thank you very much for your help.
the problem isn't fixed. i think my problem is the old 4images version. i want to check it on a new actually version.
Title: Re: [MOD] SMF integration
Post by: lesmond on October 14, 2008, 09:51:59 PM
I seem to be having problems with the api files, my forum is in the root, not in its own folder, this is what I am getting when I try the access 4images page, I have 4images in its own folder within the root.
Code: [Select]
Warning: require(./public_html/xxxxxxl.co.uk/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/uk/public_html/xxxxxx.co.uk/4images/includes/sessions.php on line 57

Warning: require(./public_html/xxxxxxl.co.uk/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/uk/public_html/xxxxxx.co.uk/4images/includes/sessions.php on line 57
and in the sessions.php I have this..
Code: [Select]
//MOD SMF integration
require(ROOT_PATH.'public_html/xxxxxx.co.uk/smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'public_html/xxxxxxl.co.uk/smf_api.php');     //change paths to your forums directory
global $smf_settings, $smf_user_info;
//END MOD SMF

I have tried it number of ways, but not having any luck at all  :oops:
Title: Re: [MOD] SMF integration
Post by: budduke on October 15, 2008, 12:14:55 PM
I seem to be having problems with the api files, my forum is in the root, not in its own folder, this is what I am getting when I try the access 4images page, I have 4images in its own folder within the root.
Code: [Select]
Warning: require(./public_html/xxxxxxl.co.uk/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/uk/public_html/xxxxxx.co.uk/4images/includes/sessions.php on line 57

Warning: require(./public_html/xxxxxxl.co.uk/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/uk/public_html/xxxxxx.co.uk/4images/includes/sessions.php on line 57
and in the sessions.php I have this..
Code: [Select]
//MOD SMF integration
require(ROOT_PATH.'public_html/xxxxxx.co.uk/smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'public_html/xxxxxxl.co.uk/smf_api.php');     //change paths to your forums directory
global $smf_settings, $smf_user_info;
//END MOD SMF

I have tried it number of ways, but not having any luck at all  :oops:

If I remember correctly, the root_path is the path to the root of your gallery and not the root of the server.
I would try...
Code: [Select]
require(ROOT_PATH.'../smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'../smf_api.php');     //change paths to your forums directory

I am not where I can test it for you but I think the "../" will take it up one directory level which should take it to the forum directory.
Title: Re: [MOD] SMF integration
Post by: lesmond on October 15, 2008, 05:10:21 PM

If I remember correctly, the root_path is the path to the root of your gallery and not the root of the server.
I would try...
Code: [Select]
require(ROOT_PATH.'../smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'../smf_api.php');     //change paths to your forums directory

I am not where I can test it for you but I think the "../" will take it up one directory level which should take it to the forum directory.

OK that worked, I can see the page, but I am now getting this error at the top of the page...
Code: [Select]
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/xxxxxx/public_html/xxxxxx.co.uk/smf_api.php on line 162
Line 162 in smf_api.php is....
Code: [Select]
156  $request = smf_query("
157 SELECT variable, value
158 FROM {$db_prefix}settings", __FILE__, __LINE__);
159 $smf_settings = array();
160 while ($row = @mysql_fetch_row($request))
161 $smf_settings[$row[0]] = $row[1];
162 mysql_free_result($request);
163  }
Title: Re: [MOD] SMF integration
Post by: budduke on October 16, 2008, 12:18:42 AM
I did not actually make the smf_api code itself so I am not sure about that warning but I do get it also, but not at the top of my pages.
It fills up my log files on my site and I just go in a delete them from time to time.
I wonder if you can just rem out line 162? (see my example in the code)
Code: [Select]
156  $request = smf_query("
157 SELECT variable, value
158 FROM {$db_prefix}settings", __FILE__, __LINE__);
159 $smf_settings = array();
160 while ($row = @mysql_fetch_row($request))
161 $smf_settings[$row[0]] = $row[1];
162 //mysql_free_result($request);
163  }

when I first started seeing the error I googled around and everyone said to just ignore it because it is not a problem...
I think the command is just suppose to release the memory that the sql command was using for the function but I always thought it did that also when the function was finished.

Maybe some other programmer can chime in to explain it any better and wether it needs to be in the code or not?
Title: Re: [MOD] SMF integration
Post by: lesmond on October 17, 2008, 03:56:40 AM
I did rem it out, and the error has gone now, nor do I see any errors in my log, thanks very much budduke  :D
Title: 4images & SMF integration ?
Post by: nguago on November 22, 2008, 10:01:40 PM
I want 4images 1.7.6 & SMF 1.1.7 integration
I read http://www.4homepages.de/forum/index.php?topic=22672.0
But i don't success. Help !
Title: Re: 4images & SMF integration ?
Post by: budduke on November 23, 2008, 12:31:04 AM
I want 4images 1.7.6 & SMF 1.1.7 integration
I read http://www.4homepages.de/forum/index.php?topic=22672.0
But i don't success. Help !


I just upgraded my installation to the SMF 1.1.7 and it still works correctly for me...
You need to be more specific then just it does not work...
Title: Re: [MOD] SMF integration
Post by: nguago on November 23, 2008, 02:10:17 AM
Code: [Select]
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_password")." = '".md5($user_password)."'
              WHERE ".get_user_table_field("", "user_id")." = ".$checkuser[$user_table_fields['user_id']];
      $site_db->query($sql);
Code: [Select]
    $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
    $site_db->query($sql);

In the includes\sessions.php dont have it. help me !
Title: Re: [MOD] SMF integration
Post by: budduke on November 23, 2008, 08:01:11 PM
Both of those codes are in the Member.php file and not the session.php file.
I rechecked my original post and it is listed correctly.
Look for those codes in the member.php and everything should be fine.
Title: Re: [MOD] SMF integration
Post by: nguago on November 23, 2008, 08:23:13 PM
Thanks  :P
Title: Re: [MOD] SMF integration
Post by: nguago on November 23, 2008, 10:21:21 PM
Code: [Select]
if (($context['user']['is_owner'] && allowedTo('profile_remove_own')) || allowedTo('profile_remove_any'))
$context['profile_areas']['profile_action']['areas']['deleteAccount'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=deleteAccount">' . $txt['deleteAccount'] . '</a>';

no have in the sources\profile.php file.
I use SMF 1.1.7

Help :)
Title: Re: [MOD] SMF integration
Post by: Nicky on November 23, 2008, 10:45:54 PM
nguago,

source/Profile.php (unchanged)

line 258 and 259
Title: Re: [MOD] SMF integration
Post by: nguago on November 24, 2008, 03:44:16 AM
Thanks, i'm finished !

copy
smf_api.php
smf_api_2.php
smf_api_2_examples.php
smf_api_subs.php

To /forums

But error:
Warning: require(./../../forums/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in E:\AppServ\www\gallery\includes\sessions.php on line 58

file sessions.php on line 85:
Quote
require(ROOT_PATH.'../../forums/smf_api_2.php'); //change paths to your forums directory


Title: Re: [MOD] SMF integration
Post by: V@no on November 24, 2008, 08:25:57 AM
require(ROOT_PATH.'../../forums/smf_api_2.php'); //change paths to your forums directory
Title: Re: [MOD] SMF integration
Post by: nguago on November 24, 2008, 08:59:13 AM
new error:
Quote
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in E:\AppServ\www\forums\smf_api.php on line 162
Title: Re: [MOD] SMF integration
Post by: budduke on November 24, 2008, 05:09:58 PM
new error:
Quote
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in E:\AppServ\www\forums\smf_api.php on line 162

See reply #13 and #14 on the 1st page of this topic...
It should explain it to you...
Title: Re: [MOD] SMF integration
Post by: Anarchology on January 16, 2009, 11:55:31 AM
Hey guys,

It looks like I'm getting a series of errors here. For some odd reason, one of them is repeated. I checked the corresponding lines in question, and still can't figure out what the issue may be. I'm hoping you guys could point me in the right direction. I don't know if the the Ajax Starrating MOD has any conflict with the SMF integration, but I do have that mod added to my site already in perfect working order.

These are the errors that show up on the HOME page and under clicking on the categories...
Code: [Select]
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/forum/smf_api.php on line 162

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sayyo1/public_html/taintedpix/includes/functions.php on line 524

I have also included my the two files they as they would be on my site when this problem shows up, but put them as "txt" since it says I can't upload a php file

Thanks in advance!!!! :P
Title: Re: [MOD] SMF integration
Post by: budduke on January 16, 2009, 12:21:04 PM
Anarchology,

both files that were attached were blank (0k) in size.
The best thing I found was to zip the original files into one zip file and attach them.

the first error message seems to be normal, read the above replies on how to get rid of it...
the other one, will wait till I see the files...
Title: Re: [MOD] SMF integration
Post by: Anarchology on January 17, 2009, 02:43:03 AM
Anarchology,

both files that were attached were blank (0k) in size.
The best thing I found was to zip the original files into one zip file and attach them.

the first error message seems to be normal, read the above replies on how to get rid of it...
the other one, will wait till I see the files...

Sorry, I'm an idiot, and it was getting late when I made the last post. I didn't transfer the actual PHP files into the text before uploading, since I can't upload a PHP file. I have fixed it, and uploading it again below. I should be messing with it all again tonight. If you can look at them for me, that would be great.  I did look back at posts #13 and #14. I added the "//" in there to ignore the section. I will still have to see if I still run that other code once I mess with it all later.


OK... I just pulled the line from functions.php below. By the looks of it, it almost seems like it might be related to the other error. I know some programming, but not all so maybe just talking out of my rear end here :?:

LINE 524 of functions.php (text file below has the whole thing)
Code: [Select]
$voted=mysql_num_rows(mysql_query("SELECT image_used_ips FROM ".IMAGES_TABLE." WHERE image_used_ips LIKE '%".$ip."%' AND image_id='".$image_id."' "));
Title: Re: [MOD] SMF integration
Post by: budduke on January 17, 2009, 06:10:45 PM
Anarchology,
I glanced through your files and saw nothing out of the ordinary.
I may try installing that [Mod] Ajax Starrating for details + thumbs  to see if there are any problems.
I have had some complaints that people have to go to the details on my site to vote for images...

I am wondering if maybe the sql command is returning a value that shouldn't (like a negative number or something)
You may try to post the question in that thred to see if anyone has seen it.
Title: Re: [MOD] SMF integration
Post by: Anarchology on January 18, 2009, 08:16:05 AM
budduke,

Hey, I'm wondering if you have a little bit of a tutorial on how you used the iFrame mod to get your forum into the website like that? I'm pretty much going for exactly how you have it. I would add a button on the side for the "Forum", and would create a forum.php file, but I don't quite know how to do the rest.

I see you have created a "forum.php". The guy who posted up the iFrame MOD seemed to do it differently. By looking at his link it goes something around the lines of "www.his-site.com/index.php?template=forum" or something like that which gives me the impression there are more than just one way to do it.

I only wish I could have done all of these great MODs before my site started getting traffic! 8)

EDIT: Nevermind. I was able to figure it out!
 :thumbup: :thumbup: :thumbup:
Title: Re: [MOD] SMF integration
Post by: cch on January 25, 2009, 10:35:01 PM
Hi budduke,

I've installed this mod and got this error on my main 4images page

Code: [Select]
Warning: require(forum/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/shareyou/public_html/cdcoverhideout/includes/sessions.php on line 74
Fixed that but it's showing on my Admin panel in 4images and I cannot use any of the Admin tools etc...

Plus do you have to log out then login as I'm logged in 4images gallery but not logged in to smf :)

Also get this error after fixing the 1st error

Code: [Select]
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/shareyou/public_html/cdcoverhideout/forum/smf_api.php on line 162
Title: Re: [MOD] SMF integration
Post by: budduke on January 25, 2009, 11:13:05 PM
Hi budduke,

I've installed this mod and got this error on my main 4images page

Code: [Select]
Warning: require(forum/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/shareyou/public_html/cdcoverhideout/includes/sessions.php on line 74
Fixed that but it's showing on my Admin panel in 4images and I cannot use any of the Admin tools etc...

Plus do you have to log out then login as I'm logged in 4images gallery but not logged in to smf :)

Also get this error after fixing the 1st error

Code: [Select]
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/shareyou/public_html/cdcoverhideout/forum/smf_api.php on line 162

If it is showing on your admin scren then you misplaced some of the code. I know there is allot there, make sure everything is in the correct place.

The free_result error was explained in one of the other replies.

login/logout, it uses the login of 4images to also log you into SMF, so yes, if you were already logged in on 4images before adding the mod you have to log out and log back in and then you should be logged into both areas. If not, then recheck all mods on both side...
Title: Re: [MOD] SMF integration
Post by: cch on January 26, 2009, 12:11:44 AM
Hi budduke,

This is a strange one, I've gone over the code twice now for the 4images side and still have the same problem.

If I use

Code: [Select]
require('./forum/smf_api.php');
require('./forum/smf_api_2.php');

The main site loads fine and when you log out and login you are logged into both. But still cannot use the Admin Panel.

If I change to

Code: [Select]
require('../forum/smf_api.php');
require('../forum/smf_api_2.php');

Both parts of 4images don't work :?
Title: Re: [MOD] SMF integration
Post by: budduke on January 26, 2009, 12:55:24 AM
I think mine did the same thing back when I first was using it and V@no came up with a fix...

try changing them to
Code: [Select]
require(ROOT_PATH.'./forums/smf_api_2.php');
require(ROOT_PATH.'./forums/smf_api.php');

that fixed it on my site

if this does not work for you post the exact path to your forums and the exact path to your gallery and I will see what might be causing it.
Title: Re: [MOD] SMF integration
Post by: cch on January 26, 2009, 10:23:25 AM
Hi budduke,

This has worked wonders, thank you very much :D
Title: Re: [MOD] SMF integration
Post by: cch on January 26, 2009, 11:37:04 AM
Hi budduke,

Me again, when I click Members in the SMF forum I'm only showing. I have 17 members on 4images, how do I import these as they won't be able to log into SMF when they log into 4images.

Hope this is clear :D
Title: Re: [MOD] SMF integration
Post by: budduke on January 26, 2009, 12:11:48 PM
Hi budduke,

Me again, when I click Members in the SMF forum I'm only showing. I have 17 members on 4images, how do I import these as they won't be able to log into SMF when they log into 4images.

Hope this is clear :D

The way the plugin works, when the user logs into 4images, it looks at the smf database, if the username and password are the same then it logs them into smf also. if the username does not exist on the smf side it will create the username in the smf database.
The only downside is if they have the same username but different passwords, it will not log them in. The only way around it that I found was to delete the user from the smf database and let 4images recreate it when they log in. Not sure if you can have your user change thier password for smf before you impliment the mod or not.
That is one downside that I have found, but with my system, I was just starting up smf fresh so there wasn't any users already in the system.
Title: Re: [MOD] SMF integration
Post by: cch on January 26, 2009, 02:03:53 PM
Hi,

I think I will be ok, as my smf is fresh but I have 17 users in 4images, we'll see how it goes

Thanks :D
Title: Forum Post Integration into my site
Post by: Anarchology on January 27, 2009, 02:59:04 AM
Hey budduke,

Maybe you might have a better grasp on doing something like this. I chose to have my SMF forum separate from the site as in I didn't like the iFrame. It kind of annoyed me. Through SMF Forums little MODS and manuals at www.simplemachines.org, they have an integration tutorial where you can have various parts of your forums shown on your site, or other sites of yours.

This is my testing part of my site... http://taintedpix.com/testindex.php

I've been reading through the SSI.php manuals and tutorials off of the Simple Machines, but can't figure out where exactly to put the coding to properly have the newest 5 posts. Pretty much everything I have tried has thrown certain error codes pointing to template.php, sessions.php, and/or functions.php.

Here are some of the manuals I've been looking into...
http://docs.simplemachines.org/index.php?topic=400.msg529#msg529
http://docs.simplemachines.org/index.php?topic=465.msg674#msg674
http://docs.simplemachines.org/index.php?topic=789.msg3680#msg3680

I feel like I'm chasing my tail. Hopefully you or someone has a solution.

Thanks in advance.
Title: Re: Forum Post Integration into my site
Post by: budduke on January 27, 2009, 10:40:43 PM
Hey budduke,

Maybe you might have a better grasp on doing something like this. I chose to have my SMF forum separate from the site as in I didn't like the iFrame. It kind of annoyed me. Through SMF Forums little MODS and manuals at www.simplemachines.org, they have an integration tutorial where you can have various parts of your forums shown on your site, or other sites of yours.

This is my testing part of my site... http://taintedpix.com/testindex.php

I've been reading through the SSI.php manuals and tutorials off of the Simple Machines, but can't figure out where exactly to put the coding to properly have the newest 5 posts. Pretty much everything I have tried has thrown certain error codes pointing to template.php, sessions.php, and/or functions.php.

Here are some of the manuals I've been looking into...
http://docs.simplemachines.org/index.php?topic=400.msg529#msg529
http://docs.simplemachines.org/index.php?topic=465.msg674#msg674
http://docs.simplemachines.org/index.php?topic=789.msg3680#msg3680

I feel like I'm chasing my tail. Hopefully you or someone has a solution.

Thanks in advance.

Give me a little time and I will see what I can figure out. I think that is the reason I did not use the ssi.php method to connect mine to SMF. The other files I am using seem to make sure none of the functions/variable names ect... overlap whereas I think there are a couple of items in the ssi.php file that would be duplicated in 4images and messes with stuff.

If you look at my site, I have the recent posts listed but that is using the functions in the files I used in this mod and not the ssi.php

I will try to play with it, time is tight, family, superbowl, and I have a couple of new customers I have to build sites for...
Title: Re: [MOD] SMF integration
Post by: Anarchology on January 28, 2009, 12:33:26 AM
budduke,

I might be able to figure it out later on tonight. It looks like I got a grasp of the shtml version of it as you can see it below. Now it's all about perfecting for PHP. I'm hoping on getting it tonight.

Here is my quick test..
http://taintedpix.com/betatest.shtml

Since we all need it in PHP and not in SHTML, I'll keep working at integrating this type of info mod into my site. I'll post up any findings. I've also been asking on the SMF forums, which seem to be more dry on answers than over here. :?
Title: Re: [MOD] SMF integration
Post by: cch on January 28, 2009, 11:53:18 AM
Hi buduke,

Could you post your findings on displaying the latest posts on the main page of 4images, I'm looking to display the lastest 5 posts on my home.html page :)
Title: Re: [MOD] SMF integration
Post by: budduke on January 28, 2009, 04:03:04 PM
Hi buduke,

Could you post your findings on displaying the latest posts on the main page of 4images, I'm looking to display the lastest 5 posts on my home.html page :)

It was a little tricky...
I first added this to my page_header.php file
Code: [Select]
//MOD SMF forum recent posts
$smf_posts = $site_template->parse_template('smf_forum_posts');
$site_template->register_vars("smf_recent_posts",$smf_posts);
unset($smf_posts);
place that code above the
Code: [Select]
//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------

I then created a html file in my template folder called smf_forum_posts.html and placed this info in it...
Code: [Select]
<?php 
$test
=smf_api_recent_posts(4null"<ul>"" ""array");
$var=0;
while (
$test[$var]){
if (
$var == || $var == 3){
print '<tr><td align="center" class="imagerow1"><font class="Forum">';
}
else {
print '<tr><td align="center" class="imagerow2"><font class="Forum">';
}
print '<b>'.$test[$var][short_subject].'</b><br> by '.$test[$var][poster][name].'<br>  in '.$test[$var][board][name].'<br>';
$var $var+1;
print '</font></td></tr>';
}
unset(
$test);
flush();
?>


and then anywhere in my templates I wanted to call the recent posts I placed...
Code: [Select]
{smf_recent_posts}
looking at the line $test=smf_api_recent_posts(4, null, "<ul>", " ", "array");
The number 4 is how many posts you want it to return,
the null is catagories that you do not want anyone to see,
the "<ul>" and the " " are seperators in the data,
and the last one can be "array" or "echo".

What I did was place a print_r($test);break; in the above code to print our and see what variables I had to work with...

hope that is enough to get you going...

PS: you need to be using the smf_api_2.zip files in order for this to work.
You can do the same thing with the SSI.php file in the forums but have not tried it to see how well it works.
Title: Re: [MOD] SMF integration
Post by: Anarchology on January 29, 2009, 04:19:15 AM
Very nice budduke.  :D

Its looking pretty good, and easily modified to cater to anyone's specific needs. I'm just wondering if there is a way to allow for the linking to those new threads, user names, and categories. I'm going to keep pushing to see if I could get the SSI.php to work. Maybe I'll play around with your code, and see how it goes from here.

EDIT: Having set "array" to "echo" seemed to crash my site by making the posts show up on the index page with a white background, and an error below shows up. However, the posts, user names, and categories are all linked up! I thought that was a little funny.

Code: [Select]
Fatal error: Cannot use string offset as an array in /home/sayyo1/public_html/taintedpix/includes/template.php(101) : eval()'d code on line 11
EDIT2: Alright, I figured it out, and the look is pretty nice! I'm liking it. I'm sure I'm not as well versed with code budduke, so this is what you meant to probably use in order to use "echo". I shortened the code.

Code: [Select]
<?php 
$test
=smf_api_recent_posts(6null"<ul>"" ""echo");
$var=0;

unset(
$test);
flush();
?>

How it shows up...
http://taintedpix.com/testindex.php

I'm wondering what other streams of code could be used like recent "members", "new threads"? I'm guessing it all has to do with looking through the smf_api file, right?

ANOTHER EDIT/UPDATE: Wow, the code works great, and is almost exactly how I want it! Its a little bunched up, but maybe here are ways to fix all of that. That is probably the only difference between the "smf_api_2.php" seems to be different from the "SSI.php features.

Here are the examples...

http://taintedpix.com/forum/smf_api_2_examples.php
vs.
http://www.simplemachines.org/community/ssi_examples.php

As of right now, my test page I have linked above has just the raw code put directly into where I need it rather than inclusion of the smf_api_posts.html file. I have also removed the code from the page_header.php file with no problems. However, I'm trying to add two other functions... New Topics and Users Online.

Now when I tried the code you have listed above for Posts and tried to convert to "Topics", it seemed to still just show Posts on my page. Very odd. I must be missing something here. I have tried to modify the code above as shown below, but it still just shows Posts.  8O

Code: [Select]
<?php 
$test
=smf_api_recent_topics(6null"<ul>"" ""echo");
$var=0;

unset(
$test);
flush();
?>
Title: Re: [MOD] SMF integration
Post by: budduke on January 29, 2009, 01:43:45 PM

Now when I tried the code you have listed above for Posts and tried to convert to "Topics", it seemed to still just show Posts on my page. Very odd. I must be missing something here. I have tried to modify the code above as shown below, but it still just shows Posts.  8O

Code: [Select]
<?php 
$test
=smf_api_recent_topics(6null"<ul>"" ""echo");
$var=0;

unset(
$test);
flush();
?>

It appears that it is working correctly. I had to look at it twice to figure out the difference between topics and posts.
If you notice when you run the topics routine you do not see and RE: in any of them. It just give you the top level of a thread
But the posts gives you replies and everything so it looks like it works to me...
Title: Re: [MOD] SMF integration
Post by: cch on January 30, 2009, 05:16:20 PM

Now when I tried the code you have listed above for Posts and tried to convert to "Topics", it seemed to still just show Posts on my page. Very odd. I must be missing something here. I have tried to modify the code above as shown below, but it still just shows Posts.  8O

Code: [Select]
<?php 
$test
=smf_api_recent_topics(6null"<ul>"" ""echo");
$var=0;

unset(
$test);
flush();
?>

It appears that it is working correctly. I had to look at it twice to figure out the difference between topics and posts.
If you notice when you run the topics routine you do not see and RE: in any of them. It just give you the top level of a thread
But the posts gives you replies and everything so it looks like it works to me...

I used this code to and is working perfectly, thanks alot budduke & Anarchology
Title: Re: [MOD] SMF integration
Post by: Semi Kolon on February 15, 2009, 09:03:47 PM
(The SMF PMs in Galerie add)
Hey budduke,
thanks for your answer  :) i tried it, but it didn't work for me. i just get a page that tells me i got an error in my templates.php site. do i need to change other files? i use your integration   :)
Title: Re: [MOD] SMF integration
Post by: budduke on February 16, 2009, 12:07:13 AM
the only file that I remeber messing with was the user_logininfo.html file in the templates folder.

make sure you inserted this entire code where you were wanting it to display
Code: [Select]
<?php smf_api_pm2('echo');?>
What template are you using?
Title: Re: [MOD] SMF integration
Post by: Semi Kolon on February 16, 2009, 10:31:03 PM
hmm doesn't really work for me.
i will try to figure something out tomorrow.
i use my own template u can look at it here (http://www.doodling.de)
Title: Re: [MOD] SMF integration
Post by: Sheon on March 06, 2009, 02:17:53 PM
Great mod! But how to convert 4images DB into SMF BD? This mod working only by new users.
Title: Re: [MOD] SMF integration
Post by: Baphomet on March 11, 2009, 10:30:49 AM
How does this mod integrate the 2 separate databases out of curiosity? I did a fresh install of the latest 4images + SMF last night and woud like to give this mod a try when I get home - just wondering how it implements it.
Title: Re: [MOD] SMF integration
Post by: budduke on March 11, 2009, 08:37:10 PM
How does this mod integrate the 2 separate databases out of curiosity? I did a fresh install of the latest 4images + SMF last night and woud like to give this mod a try when I get home - just wondering how it implements it.

The api handles the communcation between the 2 databases. They stay entirely seperate in case you decide to seperate them later. the main thing is that you have to create the user on the 4images side in order for it to create a user on the smf side.
If you already have a user on the smf with that username but with a different password then it will not log into the smf side. (A little confusing)

In my testing, if I had a user on the smf side already created with the same password and I logged into the 4images side with that same password, it seemed to work ok.
That is why I tell people to use a fresh install, at least on the smf side so it can populate the users as they log in on the 4images side.

I hope this helps, that api fle is the main thing that links the two together. I did not create it but it works great for my site.
Title: Re: [MOD] SMF integration
Post by: Baphomet on March 12, 2009, 10:39:11 AM
Yeah that makes sense - just wanted to be sure there would be no issues before I started. Didn't get a chance to do it last night - hopefully over the weekend :) Thanks for getting back to me - and for all the work you've done on this.
Title: Re: [MOD] SMF integration
Post by: AntiNSA2 on May 03, 2009, 04:24:05 PM
Can you guys tell me if this mod is working ok with Best SEO Google MOD? I like to do the VB Bulletin... But SMF Is free.....
Title: Re: [MOD] SMF integration
Post by: AntiNSA2 on May 03, 2009, 11:18:43 PM
Ok, I deleted the line of code for the first error...

However now  I am recieving the error
Code: [Select]
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lifephotography/htdocs/includes/functions.php on line 563which is

Code: [Select]
$voted=mysql_num_rows(mysql_query("SELECT image_used_ips FROM ".IMAGES_TABLE." WHERE image_used_ips LIKE '%".$ip."%' AND image_id='".$image_id."' "));
Which I cant delete as it has to do with voting......

Any idea why this doesnt work together? I am using SEO Best mod.... too if it matters....

(Sorry  I had the wrong error code up....) PLease help this kills the ajax star rating mod... I need ratings ...... and a forum!?!
Title: Re: [MOD] SMF integration
Post by: budduke on May 04, 2009, 12:14:12 AM
Ok, I deleted the line of code for the first error...

However now  I am recieving the error
Code: [Select]
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/lifephotography/htdocs/forums/smf_api.php on line 162which is

Code: [Select]
$voted=mysql_num_rows(mysql_query("SELECT image_used_ips FROM ".IMAGES_TABLE." WHERE image_used_ips LIKE '%".$ip."%' AND image_id='".$image_id."' "));
Which I cant delete as it has to do with voting......

Any idea why this doesnt work together? I am using SEO Best mod.... too if it matters....
See reply #13 and #14 on the 1st page of this topic...
It should explain it to you...
Title: Re: [MOD] SMF integration
Post by: AntiNSA2 on May 04, 2009, 05:29:46 AM
Yes, I understand what you are saying, however I received two errors. The first error was fixed by removing the line of code... however this error is in the functions.php @
Code: [Select]

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lifephotography/htdocs/includes/functions.php on line 563


Sorry I put up the wrong error code... that  was the old one that was corrected by removing the line of code. I will edit the post to correct it. Your help would be greatly appreceated. One more thing.... Is it not possible to enable a login prompt for them on the forum pages? As far as I see I have to put a link or something to the gallery homepage and tell them to go log in there which is not very user friendly since it is not fully integrated.


I JUST REALIZED KURT WROTE THE AJAX STAR MOD NOT V@NO!!!!!!! God I hope  I can get it to work again by unding this mods changes since I can not find the installation info for the star rating mod in googles cache!!!!!!!


Do not do this mod if you are using KURTS [Mod] Ajax Starrating for details + thumbs mod......... Unless someone knows how to fix it is will break.
Title: Re: [MOD] SMF integration
Post by: budduke on May 04, 2009, 02:57:28 PM
Yes, I understand what you are saying, however I received two errors. The first error was fixed by removing the line of code... however this error is in the functions.php @
Code: [Select]

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lifephotography/htdocs/includes/functions.php on line 563


Sorry I put up the wrong error code... that  was the old one that was corrected by removing the line of code. I will edit the post to correct it. Your help would be greatly appreceated. One more thing.... Is it not possible to enable a login prompt for them on the forum pages? As far as I see I have to put a link or something to the gallery homepage and tell them to go log in there which is not very user friendly since it is not fully integrated.


I JUST REALIZED KURT WROTE THE AJAX STAR MOD NOT V@NO!!!!!!! God I hope  I can get it to work again by unding this mods changes since I can not find the installation info for the star rating mod in googles cache!!!!!!!


Do not do this mod if you are using KURTS [Mod] Ajax Starrating for details + thumbs mod......... Unless someone knows how to fix it is will break.

Where can I find that mod? Ajax Starrating for details + thumbs?
I do not see it anywhere...

If you can point me in the right direction, I will see what is conflicting between the two...
Title: Re: [MOD] SMF integration
Post by: AntiNSA2 on May 04, 2009, 04:56:31 PM
Thanks for your help.  I appreciate you trouble shooting this. Unfortunately that mod was one from kurt who is now gone and he took all his mods with him. I can attach my sessions.php amd functions if it helps---


Thanks again-
Title: Re: [MOD] SMF integration
Post by: budduke on May 05, 2009, 01:48:38 AM
Thanks for your help.  I appreciate you trouble shooting this. Unfortunately that mod was one from kurt who is now gone and he took all his mods with him. I can attach my sessions.php amd functions if it helps---


Thanks again-


looked over your files but did not see anything unusual about them. The variables do not seem to overlap...
Can not tell for sure without actually installing the starrating mod  :(
If anyone can get me any info on that mod for me to place on my test site to see what is conflicting, that would be great!
I know that the star ratings seem very important for almost every 4images site. Not sure if Kurt was behind all of them or if there are any left. The one I used was the hover line thing in the details page. Not sure who created it. It has been installed for awhile now. Have not touched that part of the code and it works fine with the SMF mod at my site.
I do not have the ratings for thumbnails, kinda wish I did but not high on my list of things to do....

AntiNSA2,
Sorry I could not help
Title: Re: [MOD] SMF integration
Post by: AntiNSA2 on May 05, 2009, 04:24:35 AM
no problem... It looks as though I am going with the vbulletin forum... Thanks for you help and effort-
Robert
Title: Re: [MOD] SMF integration
Post by: honda2000 on May 14, 2009, 09:01:47 PM
Jetzt hab ich 5 Seiten gelesen, SMF find ich ja eh klasse, sieht man ja an diesem Forum, darum meine Frage:
Öffnet sich SMF immer als externe Seite, oder wird das so eingebunden, wie das Dreamboard??

Gibt es mal paar Links zu Seiten, wo SMF als Brindge von 4images aus, eingebunden ist??
Title: Re: [MOD] SMF integration
Post by: budduke on May 14, 2009, 09:07:23 PM
Jetzt hab ich 5 Seiten gelesen, SMF find ich ja eh klasse, sieht man ja an diesem Forum, darum meine Frage:
Öffnet sich SMF immer als externe Seite, oder wird das so eingebunden, wie das Dreamboard??

Gibt es mal paar Links zu Seiten, wo SMF als Brindge von 4images aus, eingebunden ist??

google translated to this...
Quote
Now I've read 5 pages, SMF find ich ja klasse anyway, so you can see on this forum, so my question:
SMF always open an external site, or is so involved, such as the Dream Board?

Are there times some links to pages where SMF Brindge by 4images than that is involved?
Still not sure what you are actually asking?
Title: Re: [MOD] SMF integration
Post by: honda2000 on May 25, 2009, 02:30:27 PM
hi,
in http://vgb.org.ru/download downloadfolder
are:
smf_api_2.php
smf_api_2_examples.php
smf_api_subs.php


but here > http://www.4homepages.de/forum/index.php?topic=22672.0
Code: [Select]
//MOD SMF integration
require(ROOT_PATH.'../../forums/smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'../../forums/smf_api.php');     //change paths to your forums directory
global $smf_settings, $smf_user_info;
//END MOD SMF


load
smf_api_2.php
 and
smf_api.php

in Root-Folder from the Gallery-Folder
But, where is the smf_api.php??
Title: Re: [MOD] SMF integration
Post by: budduke on May 25, 2009, 03:56:31 PM
in Root-Folder from the Gallery-Folder
But, where is the smf_api.php??

near top of my post it is listed... (not very clear... will modify it better for future)

http://www.simplemachines.org/download/?tools (http://www.simplemachines.org/download/?tools)
download the smf api file and place it in the root of your smf forum (mine is root\forums)
It is called SMF 1.1.x API on their site...


Title: Re: [MOD] SMF integration
Post by: honda2000 on May 25, 2009, 04:02:40 PM
Thanks a lot, i will test it!
Test why i have:
4images Version 1.7.7
and SMF version 1.1.9

In the first installtion, the first login wars perfect. But when in logged out, an logged in, is wars not successfully and possible
We will see... :wink:
Title: Re: [MOD] SMF integration
Post by: budduke on May 25, 2009, 04:38:12 PM
Thanks a lot, i will test it!
Test why i have:
4images Version 1.7.7
and SMF version 1.1.9

In the first installtion, the first login wars perfect. But when in logged out, an logged in, is wars not successfully and possible
We will see... :wink:

I just updated my gallery to 1.7.7 and SMF to 1.1.9 this morning and running a bunch of tests to make sure everything is still working. I logged in/out a few times without any issues...

I do know of one bug with my mod that is you log out of the admin panel it does not log you out of the forum.
I just know not to logout of admin and logout at the main user login/out screen instead....
Title: Re: [MOD] SMF integration
Post by: honda2000 on May 26, 2009, 10:10:13 AM
 :lol: :lol:
lets see, when you will be finished and it functions!
Title: Re: [MOD] SMF integration
Post by: budduke on May 26, 2009, 03:19:23 PM
:lol: :lol:
lets see, when you will be finished and it functions!

Have not heard of anyone saying it does not work...
I did not create the API's that are doing all the work. It has been working fine on my site since my first post in this topic. I only showed everyone how to integrate the API's so they will login-out the forums when you login-out of 4images. The admin panel was an oversight. I seldom logout at that panel anyway so have not seen a reason to find it logout routine but may look into it.
I wish 4images made some kind of API inteface to talk with the rest of the world of products that are out there. I feel 4images is the best and for my taste SMF is the best forum so they should be together in some way.

My big projects are starting to wind down so I may have some extra time this summer to work on it again, My only fear is that 4images would come out with a whole new and better system before I get done and all the work goes down the drain. SMF is still in beta on thier version 2 so will have to look at things deaper.

Sorry for the rant,
Question for everyone, are they wanting the gallery to be inside of SMF or the other way around or is everyone wanting them to be thier own pages just usernames to be the same?
Title: Re: [MOD] SMF integration
Post by: honda2000 on May 26, 2009, 04:44:49 PM
In Version 1.7.7 it is dosn´t wort!
i hav a problen in:
4images:
includes/session.php near line 170 an line 156
SMF:
in Sources/Profile.php or in Themes/default/Profile.template.php

A new user in 4images on CP > Adminstrator is a User (Level 0) in SMF not Level 1 = Administrator
Title: Re: [MOD] SMF integration
Post by: budduke on May 27, 2009, 01:22:10 AM
In Version 1.7.7 it is dosn´t wort!
i hav a problen in:
4images:
includes/session.php near line 170 an line 156
SMF:
in Sources/Profile.php or in Themes/default/Profile.template.php

A new user in 4images on CP > Adminstrator is a User (Level 0) in SMF not Level 1 = Administrator

What is the error in the session.php and profile.php or the profile.template.php files?

The permissions question...
Yes, you are correct. I believe it is in the api that way by design. The permissions are handled independently of just actually creating an account. I liked it that way because I would not necessarally want the admin of the gallery to be an admin on the message boards. I preferred making my own decisions in that area. So yes, you still have to handle permissions on each database.
All it does is make them a normal user in the API using the username/password they created on the 4images side so you do not have to recreate the account on the SMF side. I did not design it that way. All I do is go into the smf admin area and upgrade people that I wish to but I can see where if you have allot of people it would become a bother.

I do not know how the other bridges/connectors handle this information and I have no desire to buy vbulletin to find out.
For being free, I am happy how this mod turned out. Will think about your ideas when I get more time to look into the code more.

Title: Re: [MOD] SMF integration
Post by: honda2000 on May 27, 2009, 11:37:16 AM
I work and get it probably also!
Result become I naturally post.
I do not give up!
Title: Re: [MOD] SMF integration
Post by: worldce on July 13, 2009, 11:14:09 AM
Thanks budduke. it's very good mod. it works. i have problem only login and logout. So i will do iframe like you. But i hope there will be no problem next. Thanks again.
Title: Re: [MOD] SMF integration
Post by: worldce 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.
Title: Re: [MOD] SMF integration
Post by: budduke 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...
Title: Re: [MOD] SMF integration
Post by: worldce 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.
Title: Re: [MOD] SMF integration
Post by: budduke 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)
Title: Re: [MOD] SMF integration
Post by: worldce 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?
Title: Re: [MOD] SMF integration
Post by: budduke 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.
Title: Re: [MOD] SMF integration
Post by: brez 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 />';
Title: Re: [MOD] SMF integration
Post by: budduke 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...

Title: Re: [MOD] SMF integration
Post by: brez 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/
Title: Re: [MOD] SMF integration
Post by: budduke 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...
Title: Re: [MOD] SMF integration
Post by: brez 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>'
;
}

?>
Title: Re: [MOD] SMF integration
Post by: budduke 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.

Title: Re: [MOD] SMF integration
Post by: brez 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?
Title: Re: [MOD] SMF integration
Post by: budduke 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...
Title: Re: [MOD] SMF integration
Post by: brez 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
Title: Re: [MOD] SMF integration
Post by: budduke on October 09, 2009, 10:38:31 PM
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
Did you fix this problem?
I believe that setting is also on the smf side. I believe when you did the repair it may have reset who was allowed to post.
Title: Re: [MOD] SMF integration
Post by: www.salamoz.com on November 20, 2009, 07:41:20 AM
thank u  :roll:
Title: Re: [MOD] SMF integration
Post by: metal_13 on July 12, 2010, 01:23:56 AM
i wanna know...whats the main user database? from smf or 4images?  :o
Title: Re: [MOD] SMF integration
Post by: budduke on July 12, 2010, 11:51:28 AM
i wanna know...whats the main user database? from smf or 4images?  :o
Actually both...
The databases remain seperate and the only link between the two are the username/password accounts
But if you do all the modifications you will see that all login/logouts are removed from the SMF side so I guess
you can say that 4images database is in control because that is the one you login/out in first.
Title: Re: [MOD] SMF integration
Post by: Loda on September 26, 2010, 06:51:55 PM
hy,
i found in error:
if i add a new user via acp, a get an error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.smf_settings' at line 2

any help for me?
Title: Re: [MOD] SMF integration
Post by: budduke on September 26, 2010, 09:27:47 PM
hy,
i found in error:
if i add a new user via acp, a get an error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.smf_settings' at line 2

any help for me?

I never have added users in the ACP and you are right, I never added anything in that area...
give me a few days to look over the code and see what I can do.

I am planning on sitting down a rewriting this MOD to be a little more friendly and less trouble on the SMF side, and interacting without the IFRAME being needed but that will take allot of time to think about that one.
Title: Re: [MOD] SMF integration
Post by: juewei on February 09, 2011, 09:50:21 PM
Problem

Hallo ich habe das Froum in www.xxxx.de/forum

also im selben Verzeichniss wie  4images
www.xxxx.de

jetzt schaffe ich es nicht dieses hier anzupassen

//MOD SMF integration
require(ROOT_PATH.'/forum/smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'/forum/smf_api.php');     //change paths to your forums directory
global $smf_settings, $smf_user_info;
//END MOD SMF

wie muss es sein, damit es geht?

Danke


Title: Re: [MOD] SMF integration
Post by: budduke on February 11, 2011, 12:00:05 AM
@ juewei,
If I google translated correctly, You gallery is in the root of your domain and your forum is in a subfolder on that domain?

If that is correct then this should work...
//MOD SMF integration
require(ROOT_PATH.'../forum/smf_api_2.php'); //change paths to your forums directory
require(ROOT_PATH.'../forum/smf_api.php');     //change paths to your forums directory
global $smf_settings, $smf_user_info;
//END MOD SMF

You needed the ../ at the beginning to get back to the root from the "includes" folder...

Hope that helps!
Title: Re: [MOD] SMF integration
Post by: haider512 on February 17, 2011, 01:21:44 PM
so will it work if i do like this..

www.cusitlibrary.com is my library. and i want to have forum on
www.cusitlibrary.com/forum

it can work like this..and is it working with smf latest version??
Title: Re: [MOD] SMF integration
Post by: budduke on February 18, 2011, 12:32:18 AM
so will it work if i do like this..

www.cusitlibrary.com is my library. and i want to have forum on
www.cusitlibrary.com/forum

it can work like this..and is it working with smf latest version??

Yes, it should.

The version of SMF on my site is 1.1.9
I did not see any reason why it would not work for 1.1.13 but have not tested it myself...
the 2.0 is still in beta but must be getting close. I do not think it will work on that version. I have not researched it as of yet.
I may have to dive back into it again and see if I can make it easier to connect. No ETA on that though
Title: Re: [MOD] SMF integration
Post by: haider512 on February 20, 2011, 08:44:42 PM
Hello sir i just recently checked your website..
i think its on iframe.. is it possible to integrate without iframe..

actually if i click anytopic the link on top dosent change..

http://www.budduke.com/forums.php

is it possibe to integrate 4images with smf..but without iframe thing..

actually like this we have dynamic link thing..like
http://www.budduke.com/forums/index.php?board=2.0

we can point some one to board or anything..
Title: Re: [MOD] SMF integration
Post by: budduke on February 20, 2011, 11:49:22 PM
@ haider512,
I wish I could give you an answer one way or the other, I saw how you links worked on your site.
The iframe worked for my layout.
I did not know how to add the button/tab to my forum layout to get back to the 4images gallery so that is why I decided to go with the iframe.

I would think as long as you are in the same browser window and session, you should be able to bounce back and forth between the two but I have never tried it.

That is why I am planning on looking into this deeper in the future to make it more compatible. When I made this mod, it was to fill the need of my site. I am understanding how the mods work on the smf side better and how to make them so I hope the next version you can have a forum site and a gallery site with links between the two, but that will not be happening very soon,  :(
Title: Re: [MOD] SMF integration
Post by: haider512 on February 21, 2011, 07:29:30 PM
I would think as long as you are in the same browser window and session, you should be able to bounce back and forth between the two but I have never tried it.

That is why I am planning on looking into this deeper in the future to make it more compatible. When I made this mod, it was to fill the need of my site. I am understanding how the mods work on the smf side better and how to make them so I hope the next version you can have a forum site and a gallery site with links between the two, but that will not be happening very soon,  :(

its ok..no problem..its really good to see some one trying and working on integration..and many many thanks for this integration..i guess i will have to work on the template of smf later.. i have been in smf before for year or something like this.. SMF is very good and very user friendly..Its just im stuck in university life so not getting much time.. But sir superb superb thanks for integration you have brought to us.. Will be looking forward to more features soon to your integration MOD..you are doing awesome JOB..