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

0 Members and 1 Guest are viewing this topic.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #30 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.
Buddy Duke
www.budduke.com

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: [MOD] SMF integration
« Reply #31 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:
« Last Edit: January 18, 2009, 09:44:23 AM by Anarchology »
A personal THANK YOU to all of the great programmers on this site for helping me get my site from something basic to what it is today!

My site: http://taintedpix.com
(warning: some adult content)

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] SMF integration
« Reply #32 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

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #33 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...
Buddy Duke
www.budduke.com

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] SMF integration
« Reply #34 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 :?

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #35 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.
« Last Edit: January 26, 2009, 01:35:18 AM by budduke »
Buddy Duke
www.budduke.com

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] SMF integration
« Reply #36 on: January 26, 2009, 10:23:25 AM »
Hi budduke,

This has worked wonders, thank you very much :D

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] SMF integration
« Reply #37 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

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #38 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.
Buddy Duke
www.budduke.com

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] SMF integration
« Reply #39 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

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Forum Post Integration into my site
« Reply #40 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.
A personal THANK YOU to all of the great programmers on this site for helping me get my site from something basic to what it is today!

My site: http://taintedpix.com
(warning: some adult content)

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: Forum Post Integration into my site
« Reply #41 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...
Buddy Duke
www.budduke.com

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: [MOD] SMF integration
« Reply #42 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. :?
A personal THANK YOU to all of the great programmers on this site for helping me get my site from something basic to what it is today!

My site: http://taintedpix.com
(warning: some adult content)

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] SMF integration
« Reply #43 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 :)

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] SMF integration
« Reply #44 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.
Buddy Duke
www.budduke.com