Author Topic: Topic Info from my Forum on my 4images Home Page...  (Read 13647 times)

0 Members and 1 Guest are viewing this topic.

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Topic Info from my Forum on my 4images Home Page...
« on: January 21, 2009, 05:58:34 AM »
Hi,

I couldn't think of a good title, but here is what I'm trying to do. I successfully integrated the SMF Forum into 4images. In order to get my members to migrate over to the forum and spend more time on the site, I'm trying to add the "Newest Posts" in the place of "New Images" on my main page. I'm sure I can figure some of it out, but I'm running into a problem.

On the SMF side, this is their manual on how to do this, but I can't figure out where to properly add the code below.

The code:
Code: [Select]
<?php require("/path/to/forum/SSI.php"); ?>
http://docs.simplemachines.org/index.php?topic=400.msg529#msg529

I tried putting it at the top of the "header.html", but threw these error codes below. Maybe a stupid question, but does this code belong in template.php. If so, where?

Code: [Select]
Warning: require() [function.require]: URL file-access is disabled in the server configuration in /home/xxxxx/public_html/taintedpix/includes/template.php(101) : eval()'d code on line 1

Warning: require(http://taintedpix.com/forum/SSI.php) [function.require]: failed to open stream: no suitable wrapper could be found in /home/xxxx/public_html/taintedpix/includes/template.php(101) : eval()'d code on line 1

Fatal error: require() [function.require]: Failed opening required 'http://taintedpix.com/forum/SSI.php' (include_path='.:/usr/local/php5/lib/php') in /home/xxxxx/public_html/taintedpix/includes/template.php(101) : eval()'d code on line 1

Any help would be great. Thanks in advance, guys!
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 V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #1 on: January 21, 2009, 08:20:02 AM »
If your SMF and 4images on the same physical machine (same server), you must use either relative or full path local path in the require(), not internet path as you tried to.

Try relative path:
Code: [Select]
<?php
require("../forum/SSI.php");
?>


or full local path:
Code: [Select]
<?php
require("/home/xxxxx/public_html/taintedpix/forum/SSI.php");
?>


P.S.
not topic not related to 4images itself, moving to chit-chat.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #2 on: January 24, 2009, 09:44:40 AM »
Hi,

Sorry about posting it in the wrong section. I didn't know where it should go.

Well, I'm still having problems adding the "new posts" program using the SSI.php file within the SMF Forums filing. It seems like I have been able to add the code in my first post to the right file (I think). Still, I am getting errors with everything I try... along with my main page all messed up. I am hoping someone on this forum could help me through this.

I have created a page not visible my members for testing purposes. Below is it, and where I am currently stuck. Well, I have played around with some coding, but still getting errors at one point or another...

http://taintedpix.com/testhome.php
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 V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #3 on: January 24, 2009, 10:02:49 AM »
Without knowing exactly what you did it's hard to help ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #4 on: January 24, 2009, 12:30:34 PM »
Without knowing exactly what you did it's hard to help ;)

Between the time when I posted the last post and now, I have completely destroyed my site, and trying to get it back to normal. I am about to throw my laptop out he window and burn it. I know I started to frantically try to install the backup files only to find myself in another problem.

Current error on my main page...
Code: [Select]
Warning: require(./home/sayyo1/public_html/taintedpix/forum/smf_api_2.php) [function.require]: failed to open stream: No such file or directory in /home/sayyo1/public_html/taintedpix/includes/sessions.php on line 58
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 Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #5 on: January 24, 2009, 02:58:54 PM »
i think here is the error.

Code: [Select]
require(./home/sayyo1/public_html/taintedpix/forum/smf_api_2.php)
there is a DOT after (
i think it does not belongs there if you use FULL PATH

[EDIT]
but where is this "smf_api_2.php" comming from?

you should use
<?php require("/home/sayyo1/public_html/taintedpix/forum/SSI.php"); ?>
in your template
« Last Edit: January 24, 2009, 08:04:06 PM by V@no »
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #6 on: January 25, 2009, 08:17:14 AM »
As of right now, I completely went back and uploaded the backup files to set everything back to BEFORE I even integrated the site. One of the files, sections.php was a good backup file long before everything went crazy.

After back-tracking to before the SMF Integration MOD, I then upload the files for the Integration MOD. Everything seems back to normal, and currently not throwing any errors or warnings. I am going to try to integrate this whole thing again. I will be much more careful this time around, since I have noticed these errors drastically hurt the hits I was getting over tonight by about 50% less.

Though this might not have any connection to the problems about forum posts inclusion, directly after I did the SMF Integration MOD, it shows I have a database error (clearly within the SMF database). I have taken screen captures of both my 4images cPanel, and also in phpMyAdmin. It's a long shot, but I figured maybe this may be part of some problem??? To be honest, I haven't seen any kind of errors related to it.

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 Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #7 on: January 25, 2009, 01:32:56 PM »
Sorry for the double post, but wanted to separate the above from a possible new way of properly adding this to my site.

Other than the .PHP integration of the forum information, they also offer a .SHTML alternative. Now, from looking at the most of our 4images sites. Is there a way to create maybe a. SHTML page that can be put in a certain area of my home page. As above, I am trying to put the "new posts" to my forum "taintedpix.com/forum/" in place of the "New Images:" section on my main page.

When it comes to the PHP version I have posted in the beginning of this thread, they also allow for a .SHTML alternative. I'm wondering if this would be more beneficial when it comes to ease of use, and hopefully able to get rid of the errors and oddly destruction of the certain page.

I really need help properly doing this, and seem to keep hitting road blocks at every try. :evil: If there is a possible way of using/creating a .shtml file rather than chasing my tail around trying to perfect the php version that did destroy my site for about 24 hours until I went through it all over again.

http://docs.simplemachines.org/index.php?topic=400.msg529#msg529
Quote
Requirements
Your website pages must use the extension *.php or *.shtml to pull the information successfully from your SMF forum. Other variations like *.html are not compatible.

Examples of .shtml code...
http://www.simplemachines.org/community/ssi_examples.shtml

Please help me out guys! I am running into one roadblock after another. I'm currently blindly trying to integrate the codes into any certain file. I can't figure out where the code goes whether it is to be in index.php, global.php, template/custom/home.html, template/custom/header.html, files within the INCLUDES folder, etc.

Please help me out guys, and I sincerely appreciate all of the help I have already gotten from all of you!
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 V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #8 on: January 25, 2009, 08:23:25 PM »
What error messages where you talking about? Since you do the changes on the site and every time you change something, the error messages can be different, quote the error messages, not just link to the site.

as of SHTML, you can't have both PHP and SHTML at the same time

P.S.
Keep in mind that templates processed in a function, so if a script needs access some variables that set outside the function, you'll need add them into the global list. (you should ask about using SMF SSI from a function at the SMF forum, I have no idea how it works)
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: Topic Info from my Forum on my 4images Home Page...
« Reply #9 on: January 27, 2009, 08:29:48 AM »
Alright, I have now gotten one step closer to figuring all of this out... well sort of.

I know that 4Images has PHP and HTML files, and I guess that SHTML doesn't work (sure some of you know how to change it over). Well, I created a CONTROL PAGE that has nothing to do with either sites, but just to prove to myself the integration is possible... its in .SHTML, but hey, its a start and works.

Here it is...
http://taintedpix.com/betatest.shtml

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> << :: SMF SSI.php 2.0 Beta 2.1 :: >> </title>
</head>
<body style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;">
<h1>SMF SSI.php Functions</h1>
Current Version 2.0 Beta 2.1<br />
<br />
This file is used to demonstrate the capabilities of SSI.php using SHTML include functions.<br />
The examples the include tag, then the results of it. Examples are separated by horizontal rules.<br />

<hr />

<h3>Recent Topics Function: &lt;!--#include virtual="./forum/SSI.php?ssi_function=recentTopics" --&gt;</h3>
<!--#include virtual="./forum/SSI.php?ssi_function=recentTopics" -->

<hr />

<h3>Recent Posts Function: &lt;!--#include virtual="./forum/SSI.php?ssi_function=recentPosts" --&gt;</h3>
<!--#include virtual="./forum/SSI.php?ssi_function=recentPosts" -->

</body>
</html>

It properly shows the most recent posts and topics created in my forum, but is located in the root directory under my main page (the forum is in mysite.com/forum/). Now with that milestone in this ongoing problem I have had for the last 3 nights (vodka helps :wink:), now I am trying to figure out exactly where the certain codes for PHP would go, since I'm starting to think of how to do this.
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)