News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF-Bridge 3.02 Fixes and Mods Released !!!

Started by cowboy1015, March 21, 2005, 02:39:02 PM

Previous topic - Next topic

cowboy1015

I guess I will properly announce it with the right subject.

I made several mods and fixes of SMF-Bridge 3.02 for my personal use.
I am making it available for those interested through GNU-GPL guideline.
You can all get it from MamboHacks.com.

Major Changes:
1. SEF issues fixed!
2. Easier installation
3. Simplified single component
4. Member can edit account profiles reflecting to both MOS/SMF
5. Revised login module

read more from my website...

NOTE: I did not work with the original author so please use AS-IS. You may want to check my site forum to see if there are no more issues, specially with SEF.

Thank you.

http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

Kindred

Nice job, Cowboy...   I just installed this on someone's site for them. and it works great, from what I can see so far.

Just one note:   Since this site is a multi-lingual site (well, actually it's mostly dutch), I changed all your references in mod_smf_login to call the appropriate SMF strings, rather than have them hardcoded:


<?php

defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$moduleclass_sfx  $params->get'moduleclass_sfx' );
$smf_align  $params->get'smf_align' );
$smf_personal_welcome  $params->get'smf_personal_welcome' );
$smf_profile $params->get'smf_profile' );
$smf_unread  $params->get'smf_unread' );
$smf_new_answers  $params->get'smf_new_answers' );
$smf_new_pms  $params->get'smf_new_pms' );
$smf_loggedin_time  $params->get'smf_loggedin_time' );
$smf_calendar  $params->get'smf_calendar' );
$smf_members $params->get'smf_members' );

if (!
defined('SMF')){
  global 
$mosConfig_absolute_path;

  require(
$mosConfig_absolute_path."/administrator/components/com_smf/config.smf.php");
  require (
$smf_path."/SSI.php");
}

global 
$context$txt$scripturl$settings$mos_prefix$smf_prefix$db_name$smf_date$mosConfig_db;

mysql_select_db($GLOBALS['db_name']);

$sql  "SELECT id FROM ".$mos_prefix."menu WHERE link='index.php?option=com_smf'";
$result mysql_query ($sql);

if (isset(
$result)) {
$row mysql_fetch_array($result);
}

$myurl basename($_SERVER['PHP_SELF'])."?option=com_smf&Itemid=" $row[0]."&";

$scripturl $myurl;

echo 
'
<div class="modules" style="position: relative; margin-right: 5px;">
<table width="100%" cellpadding="0" cellspacing="0" border="0" text-align="'
.$smf_align.'">';

if (!empty($context['user']['avatar'])) {
echo '
<tr>
<td valign="top" align="'
.$smf_align.'">'$context['user']['avatar']['image'], '</td>
</tr>'
;
}

echo '
<tr>
<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;" align="'
.$smf_align.'">';

if ($context['user']['is_logged']) {
if ($smf_personal_welcome) {
echo '
Welcome <b>'
$context['user']['name'], '</b>:<br/>';
        }

if ($smf_new_pms ) {
  if ($context['allow_pm'])
echo $txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>';
        }

if( $smf_unread ){
echo $txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'] . '.';
}

if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>'
$txt[616], '</b>';

if (!empty($context['unapproved_members']))
echo '<br />
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=regcenter">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

        if (
$smf_loggedin_time && !empty($context['user']['total_time_logged_in'])) {
echo '<br />'$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0) {
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
}

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0) {
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
}

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}


echo '
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduletable'
,$moduleclass_sfx,'">';

if ($smf_profile) {
echo '
<tr align="left">
<td><a href="'
sefRelToAbs($scripturl "action=profile") ,'" class="mainlevel">'$txt[79], '</a></td>
</tr>'
;
}

if ($smf_unread) {
echo '
<tr align="left">
<td><a href="'
sefRelToAbs($scripturl "action=unread") ,'" class="mainlevel">'$txt['unread_topics_visit'], '</a></td>
</tr>'
;
}

if ($smf_new_answers) {
echo '
<tr align="left">
<td><a href="'
sefRelToAbs($scripturl "action=unreadreplies") ,'" class="mainlevel">'$txt['unread_replies'], '</a></td>
</tr>'
;
}

if ($smf_members) {
echo '
<tr align="left">
<td><a href="'
sefRelToAbs($scripturl "action=mlist") ,'" class="mainlevel">'$txt[332], '</a></td>
</tr>'
;
}

if ($smf_calendar) {
echo '
<tr align="left">
<td><a href="'
sefRelToAbs($scripturl "action=calendar") ,'" class="mainlevel">'$txt['calendar24'], '</a></td>
</tr>'
;
}

echo '
<tr align="left">
<td><a href="'
sefRelToAbs($scripturl."action=mambo_logout&returnurl=".$params->get('logout')."&sesc=".$context['session_id']),'" class="mainlevel">'$txt[108], '</a></td>
</tr>'
;

echo '
</table>'
;
}

else {
//$txt['welcome_guest'] = str_replace ($scripturl.'&action=register', $mosConfig_live_site.'/'.basename($_SERVER['PHP_SELF']).'&option=com_smf_registration&task=register' , $txt['welcome_guest']);
$txt['welcome_guest'] = $txt['hello_guest'] . " " $txt[28] . ",";
$txt['welcome_guest'] .= "<br>" $txt[249]. " " $txt[34];


if (!isset($message_login)) {
$message_login '';
}

echo '
'
$txt['welcome_guest'], '<br />

<form action="'
$scripturl'?action=mambo_login" method="post" style="margin: 3px 1ex 1px 0; text-align:'.$smf_align.';">
$txt[35] . '<br/>
<input type="text" name="user" size="10" /><br />
$txt[36] . '<br/>
<input type="password" name="passwrd" size="10" /><br />
$txt[497] . '<br />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select><br />
<input type="submit" value="'
$txt[34], '" /><br />
<input type="hidden" name="op2" value="login" />
<input type="hidden" name="returnurl" value="'
$params->get('login'),'" />
<input type="hidden" name="lang" value="'
,$mosConfig_lang,'" />
<input type="hidden" name="return" value="'
,$mosConfig_live_site,'/',basename($_SERVER['PHP_SELF']),'?',$_SERVER['QUERY_STRING'],'" />
<input type="hidden" name="message" value="'
,$message_login,'" />
</form><br />

<table class="moduletable'
,$moduleclass_sfx,'" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<td><a href="'
,sefRelToAbs($scripturl."option=com_smf&task=lostPassword"),'" class="mainlevel" >'$txt[315], '</a></td>
</tr>
<tr align="left">
<td><a href="'
,sefRelToAbs($scripturl."option=com_smf&task=register"),'" class="mainlevel" >'$txt[97], '</a></td>
</tr>
</table>'
;
}

echo '</td></tr></table>
</div>'
;

mysql_select_db ($GLOBALS['mosConfig_db']);

?>

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

cowboy1015

Thanks.

I'm glad to hear that it's working for most users.
Language is another update that i'm planning to work on. Becuase right now some english text labels are embedded in the code.
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

Kindred

Well, what I did (above) should handle all the text labels in the mod_smf_login. :)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

fermachine


ziggie

Nice contribution cowboy1015,

Just having one problem installing the SMF package. In SMF package manager, there are 6 items listed to process, the only one not showing Success is '/Sources/MOS_SMF.php', so when I click proceed I get this error,

2: copy(/home/hsphere/local/home/mysysacc/ziggiepix.ziggiesoft.com/forums/index.php~): failed to open stream: Permission denied
File: /home/hsphere/local/home/mysysacc/ziggiepix.ziggiesoft.com/forums/Sources/Subs-Package.php
Line: 1285


I have all folders and files mentioned permissions set to 777, and did try and process again after moving the original files back in there respective folders.

Can you help with this one?!
Thanks,
-ziggie

ziggie

Oh yeah, here is line 1285,

copy($working_file, $working_file . '~');

Thanks again, ziggie

cowboy1015

Quote from: fermachine on March 21, 2005, 09:45:24 PM
Does your mod support smf mosbot?

My release still uses the same "com_smf" name, so it should work with all the other existing module and mosbot.
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

cowboy1015

#8
Quote from: ziggie on March 22, 2005, 12:25:01 AM
Nice contribution cowboy1015,

Just having one problem installing the SMF package. In SMF package manager, there are 6 items listed to process, the only one not showing Success is '/Sources/MOS_SMF.php', so when I click proceed I get this error,

2: copy(/home/hsphere/local/home/mysysacc/ziggiepix.ziggiesoft.com/forums/index.php~): failed to open stream: Permission denied
File: /home/hsphere/local/home/mysysacc/ziggiepix.ziggiesoft.com/forums/Sources/Subs-Package.php
Line: 1285


I have all folders and files mentioned permissions set to 777, and did try and process again after moving the original files back in there respective folders.

Can you help with this one?!
Thanks,
-ziggie

You do not have permission set to index.php or the main SMF directory.

Note: Do not install the mod multiple times without having to do uninstall. If you encounter an error during the install, those marked success already moded the target file. So installing it again w/out uninstall will result to a duplication of mod to a target file. If this happened to you, I suggest you get the original 5 files from SMF installation and re-apply the mod.
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

fermachine

#9
Hi, your mo of the bridge is great! Tks. However when I click register here I get a blank page with the warning:

You are not authorized to view this resource.
You need to login.

Other bugs is when I clck discuss I got this tags:

"[div style=text-align: center;][div style=text-align: left;][span style=font-weight: bold;/]
[span style=font-weight: bold;/][/div][span style=font-weight: bold;]10 passos para colocar notícias e artigos no site[/span]

[div style=text-align: justify;]"

What is happening???

Puc conDoin

Will this be integrated in future versions of the bridge?

cowboy1015

Quote from: fermachine on March 22, 2005, 05:17:22 AM
However when I click register here I get a blank page with the warning:
You are not authorized to view this resource.
You need to login.

Other bugs is when I clck discuss I got this tags:

"[div style=text-align: center;][div style=text-align: left;][span style=font-weight: bold;/]
[span style=font-weight: bold;/][/div][span style=font-weight: bold;]10 passos para colocar notícias e artigos no site[/span]

[div style=text-align: justify;]"

What is happening???

Check if the component is published with "Public" permission.

I don't know about discuss bot but can you tell me your site url?
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

cowboy1015

Quote from: Puc conDoin on March 22, 2005, 05:48:03 AM
Will this be integrated in future versions of the bridge?

I don't know. But I assure you, I'm gonna fix bugs myself for my own website forum. So far, I think this version is pretty much it. Only some minor issues that are easy to patch.
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

ziggie

QuoteYou do not have permission set to index.php or the main SMF directory.

Note: Do not install the mod multiple times without having to do uninstall. If you encounter an error during the install, those marked success already moded the target file. So installing it again w/out uninstall will result to a duplication of mod to a target file. If this happened to you, I suggest you get the original 5 files from SMF installation and re-apply the mod.

Thanks cowboy1015, I changed their permissions of main folder and the package was installed!

Now I'm having the same problem I had after installing the SMF-Bridge (3.02).

Check out www.ziggiepix.ziggiesoft.com/mambo [nofollow], can't show all the contents of the cms, home, mambo license, blog, etc. The forum link works and I can login just fine, but I cant access anything else.  Here is a pic -

I found that when the default module 'mod_login' is published with the bridge mod 'mod_smf_login' unpublished, I can access the site content fine with the exception of the login interfacing with SMF, and vice versa.

I can go into my mambo administration page>modules>site modules>mod_smf_login and change the 'menu item link page' from 'all' to 'forum' and what-ah-ya know it works!! But how do I get it to to work in all the page links or just in the forum page link??

Any suggestions?
Thank you, ziggie

cowboy1015

Quote from: ziggie on March 22, 2005, 07:14:16 AM
Now I'm having the same problem I had after installing the SMF-Bridge (3.02).

Check out www.ziggiepix.ziggiesoft.com/mambo, can't show all the contents of the cms, home, mambo license, blog, etc. The forum link works and I can login just fine, but I cant access anything else.

I found that when the default module 'mod_login' is published with the bridge mod 'mod_smf_login' unpublished, I can access the site content fine with the exception of the login interfacing with SMF, and vice versa.

I can go into my mambo administration page>modules>site modules>mod_smf_login and change the 'menu item link page' from 'all' to 'forum' and what-ah-ya know it works!! But how do I get it to to work in all the page links or just in the forum page link??

Any suggestions?
Thank you, ziggie


You set it in "Menu Item Links" where you want a module to be displayed. So choosing "all" should have your smf_login displayed in all pages.
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

Kindred

cowboy...

fyi... the update link does not appear to work in your revision...   I clicked Update on a site with the arcade mod installed and it was still not usable. I had to go into functions.smf.php to manually add the arcade action calls.


Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

cowboy1015

Quote from: kindred on March 22, 2005, 03:24:00 PM
fyi... the update link does not appear to work in your revision...   I clicked Update on a site with the arcade mod installed and it was still not usable. I had to go into functions.smf.php to manually add the arcade action calls.

I did not touch that part of the code from the original SMF-Bridge.
But, I will take a look at it. Thanks for letting me know.

http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

Kindred

Ah... if you dind't touch it, that would be why it doesn't work...


You moved the action array over to mambo/administrator/components/com_smf/functions.smf.php... but the original bridge looks for the action array in mambo/components/com_smf.smf.php.

So, clicking that link will attempt to update smf.php, and will not find the text for its task....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ziggie

quote]You set it in "Menu Item Links" where you want a module to be displayed. So choosing "all" should have your smf_login displayed in all pages.
Quote

Thanks cowboy, but I have done this and this is the result, www.ziggiepix.ziggiesoft.com/mambo [nofollow]

I found when I have Menu Item Links set to just 'forum' the sites comes up fine but only on the fourm page, it does'nt show an any other page.

When I get home I will double check all my paths, I see that the link above redirects to ziggiepix.ziggiesoft.com/mambo [nofollow], I don't know if that makes a difference or not???

Any more suggestions??

Thanks,
-ziggie

cowboy1015

#19
Quote from: kindred on March 22, 2005, 04:23:42 PM
Ah... if you dind't touch it, that would be why it doesn't work...


You moved the action array over to mambo/administrator/components/com_smf/functions.smf.php... but the original bridge looks for the action array in mambo/components/com_smf.smf.php.

So, clicking that link will attempt to update smf.php, and will not find the text for its task....

Ok, I found what you are saying! Thanks for letting me know!
http://www.i-vibe.com - The Internet Vibe (Personal)
http://www.mambohacks.com - All hacks for Mambo! now Integrated w/ SMF almost flawlessly!
http://www.mamboserve.com - MamboHacks preferred hosting

Advertisement: