TinyPortal

Development => Support => Topic started by: Mavn on September 17, 2006, 06:12:57 PM

Title: SSI functions from different forum
Post by: Mavn on September 17, 2006, 06:12:57 PM
I have two forums 1st http://site/ (smf+tp) 2nd http://site/community (smf only)
How I can use SSI in 1st from 2nd forum??

I am trying change
Tportal.php

// include the necessary files.
require_once($boarddir.'/SSI.php');

to

// include the necessary files.
require_once($boarddir.'/community/SSI.php');


but it's doesn't work  :(. I can't found where calling this file for TP.
I am trying change this too
Admin.php

// Find the version in SSI.php's file header.
$fp = fopen($boarddir . '/SSI.php', 'rb');

to

// Find the version in SSI.php's file header.
$fp = fopen($boarddir . '/community/SSI.php', 'rb');


but it's doesn't work again  :(  ???
How I can calling SSI functions from second forum?
Title: Re: SSI functions from different forum
Post by: G6Cad on September 17, 2006, 09:38:17 PM
I have read some threads on SMF forums on how to get this to work.
I think you are more lucky in getting it right if you searches the SMF forums or ask the question there.
I think it was in the database forum i read about it.
Title: Re: SSI functions from different forum
Post by: akulion on September 17, 2006, 10:47:10 PM
hey not to go off topic - but while we are discussing SSI

does anyone know how I can include SSI.php from SMF in another PHP page (not part of SMF) on the same server so that it shows how many people are online?

Something like Users Online Block

thanks
Title: Re: SSI functions from different forum
Post by: Mavn on September 17, 2006, 11:01:02 PM
I am search in database too, no results. it's realy funy how it's working :)
In smf I find information about it. I am reading all docs about SSI(basic, expert, etc...) but I don't know how I can use it in this situation  ... :(. I am enteresting do it 1-2 calling SSI.php not any more, but where ? I am find another place where calling this file

File Subs-Package.php

function package_create_backup($id = 'backup')
{
global $db_prefix, $sourcedir, $boarddir;

$files = array();

$base_files = array('index.php', 'SSI.php', 'agreement.txt', 'ssi_examples.php', 'ssi_examples.shtml');
foreach ($base_files as $file)
{
if (file_exists($boarddir . '/' . $file))
$files[realpath($boarddir . '/' . $file)] = array(
empty($_REQUEST['use_full_paths']) ? $file : $boarddir . '/' . $file,
stat($boarddir . '/' . $file)
);
}

$dirs = array(
$sourcedir => empty($_REQUEST['use_full_paths']) ? 'Sources/' : strtr($sourcedir . '/', '\\', '/')
);


but I don't know php realy good for do it this changes :(  

akulion
Something like this

<?php
require(dirname(__FILE__) . '/SSI.php');
ssi_whosOnline(); flush();
?>


but maybe I am wrong
Title: Re: SSI functions from different forum
Post by: eldacar on September 18, 2006, 12:37:59 AM
You can't use SSI.php from one forum in another, the naming conflicts would be massive! You could possibly use smf_api..

Quote from: akulion on September 17, 2006, 10:47:10 PMhey not to go off topic - but while we are discussing SSI

does anyone know how I can include SSI.php from SMF in another PHP page (not part of SMF) on the same server so that it shows how many people are online?

Something like Users Online Block
ssi_whosOnline(); or ssi_logOnline();
Title: Re: SSI functions from different forum
Post by: akulion on September 18, 2006, 12:48:40 AM
thanks eldÊÅ'ka - did that and working great except for one issue

the ssi_logOnline(); dosent seem to work as advertized (well atleast in my case)

no matter how many friends i send over to the custom pages the user stats for ssi_logOnline(); and ssi_whosOnline(); stay EXACTLY the same

which is really weird since the logOnline function is supposed to count ALL visitors/users anywhere

while the whosOnline is ONLY supposed to show visitors/users browsing the forums

any ideas?

Title: Re: SSI functions from different forum
Post by: Mavn on September 18, 2006, 08:13:16 AM
eldÊÅ'kaː
Thanks, I am trying use smf_api
Title: Re: SSI functions from different forum
Post by: Mavn on September 18, 2006, 08:19:57 AM
If I am renaming SSI.php to SSI2.php and do it changes for working in second forum can I use this method?

ADD It's working wihtout problem :)
Title: Re: SSI functions from different forum
Post by: eldacar on September 18, 2006, 10:57:56 AM
I don't know how it could possibly be working, because what would $user_info refer to? What does $scripturl refer to? Plus there would be a hundred function name conflicts.
Title: Re: SSI functions from different forum
Post by: Xarcell on September 19, 2006, 06:56:53 AM
renaming that file will make many other things break.
Title: Re: SSI functions from different forum
Post by: Mavn on September 19, 2006, 04:44:10 PM
When I am testing more time really I have many problems.
Thanks, I'll be using smf api.