Hello Seniors,
Here is what i want to do ,
i am running two forums using smf rc2. i want to display one forums latest 10 posts on another forums portal block. is it possible ?
Can somebody please reply its really urgent for me
hey sorry to bounce topic again but please reply seniors its really urgent
Do i accept that its not possible seniors ? give me some idea friends.
I think it's possible via SSI. search for more information.
First up, please DON'T bump 3 times in under a day - we're all volunteers here.
It is possible, but depending on whether the two forums run on the same server or not depends on how you end up doing it.
Can we have plenty more details about what you have and what you're trying to achieve?
sorry for that buddy . actually i have two forums both running on smf version 2.0 RC 2. i have ezportal activated on one forum and it has latest posts block in it. i want to display this block in another forum so that it will display first forums latest posts. both are on same servers.
First of all, please do not bump topics within 24 hours as all of the Support Members are volunteers.
Regarding your issue, take a look at Using SSI.php (http://docs.simplemachines.org/index.php?topic=400.0)
Labradoodle-360
Quote from: Arantor on December 11, 2009, 03:44:30 PM
It is possible, but depending on whether the two forums run on the same server or not depends on how you end up doing it.
Can we have plenty more details about what you have and what you're trying to achieve?
So, are they running on the same server or not?
i have looked at that topic but didnt find anything its for showing posts to webpage or something. sorry sir but i am not very tech savvy please can you explain in detail ?
Quote from: Arantor on December 11, 2009, 04:00:45 PM
Quote from: Arantor on December 11, 2009, 03:44:30 PM
It is possible, but depending on whether the two forums run on the same server or not depends on how you end up doing it.
Can we have plenty more details about what you have and what you're trying to achieve?
So, are they running on the same server or not?
yes sir they both are on same server
i have read the ssi.php introduction. have some confusions. where do i need to put <?php require("/path/to/forum/SSI.php"); ?> and after that how can i use <?php ssi_recentPosts(); ?> function in my another forum ? dont i need to give some path in it ?
i don't know how ezportal works , but try creating a block, pick php block (so that you can enter php code) and in that block enter:
ssi_recentPosts();
if it doesn't work go to your forum directory, open index.php the comments put there:
require("SSI.php");
if i put ssi_recent posts() function in my forum B how can posts from forum A will be fetched. there must be some connection between them
When you require SSI.php, you have to use the path to the other forum's files.
So if forum A is the one with the portal in /home/user_a/public_html and forum B is the other content in /home/user_b/public_html, you have to use require('/home/user_b/public_html/SSI.php'); first to load the details of the other forum.
Quote from: Arantor on December 11, 2009, 04:38:10 PM
When you require SSI.php, you have to use the path to the other forum's files.
So if forum A is the one with the portal in /home/user_a/public_html and forum B is the other content in /home/user_b/public_html, you have to use require('/home/user_b/public_html/SSI.php'); first to load the details of the other forum.
sorry brother i am not very tech savvy can you please explain me step by step if possible ?
Not really without knowing more details, like the full paths of both forums.
Please remove those links. They are not suitable for the family friendly site we are.
I need to know the FULL physical paths, not the domains, nor the subpaths. You may need to ask your host for the full physical path.
Or better than asking the hoster go to your forums - admin - configuration - server settings - database and paths and copy paste the 'smf directory' field. Now go to the other forum and do the same. Paste it here, or put it yourself in the:
require("/path/to/forum/SSI.php"); (change path to forum with the forum you want to get recent posts, and put it in the index of the forum you want to show the recent posts from the other forum).
Thanks shumilica for info on how to get paths
The forum where i want to get recent posts from another forum has following paths,
SMF Directory /homepages/9/d269191381/htdocs/bf
Sources Directory /homepages/9/d269191381/htdocs/bf/Sources
Cache Directory /homepages/9/d269191381/htdocs/bf/cache
and the forum from which i want to get latest posts has paths as follows,
SMF Directory /homepages/9/d269191381/htdocs/ForumBollychilli
Sources Directory /homepages/9/d269191381/htdocs/ForumBollychilli/Sources
Cache Directory /homepages/9/d269191381/htdocs/ForumBollychilli/cache
And can you please explain from where i should download ssi.php file and what to do with that ? i am not yet sure what exactly i need to do. Please sir if you can guide me step by step it will be really great help to me
it displays following error when i added that code to forums index file,
Fatal error: Cannot redeclare cleanrequest() (previously declared in /homepages/9/d269191381/htdocs/ForumBollychilli/Sources/QueryString.php:95) in /homepages/9/d269191381/htdocs/bf/Sources/QueryString.php on line 93
SSI.php is part of your forum.
So, in the portal block for bf forum, you add something like:
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php');
ssi_recentPosts(); ?>
Then it might work. No guarantee of at all that however.
Quote from: Arantor on December 12, 2009, 03:16:28 AM
SSI.php is part of your forum.
So, in the portal block for bf forum, you add something like:
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php');
ssi_recentPosts(); ?>
Then it might work. No guarantee of at all that however.
it displays following in php block after doing that,
ezBlock unable to run PHP syntax error!
dont i need to put something in any index.php ? i dont know which index.php the one in themes default, the one in theme i am using or the one in root folder
No, it's definitely a portal block you will need to change, nothing whatsoever to do with index.php.
Though this makes life more complex, we now get into the fun and games of using iframes :S
You need to create a new file in /homepages/9/d269191381/htdocs/ForumBollychilli/ called recentposts.php and have it contain the above code. Then you can browse to it from www.forumbollychilli.com/recentposts.php, to check it works.
Then you add an iframe to the portal block to show that on the other forum (please do a search for this, it's been covered countless times here, not to mention on numerous other sites)
check at www.forum.bollychilli.com/recentposts.php i can see posts there now can you please me what to do to see it in my another forums block ?
Well, apart from the page being incorrect, due to which I assume is a space in front of the <?php in the file (has a nice big error on it)
You need to add an <iframe> tag into the portal block. As I said this has been covered many times, so a quick forum search should show you plenty of examples of how to do it.
i am able to see posts from forum b to my forum a's portal now. thanks buddy but the issue is its really bad in appearance. how can i make it match to my forum a's theme >?
Quote from: Arantor on December 12, 2009, 04:08:00 AM
Well, apart from the page being incorrect, due to which I assume is a space in front of the <?php in the file (has a nice big error on it)
You need to add an <iframe> tag into the portal block. As I said this has been covered many times, so a quick forum search should show you plenty of examples of how to do it.
hey bro. thanks for all your help but that error message is still there.
So can you attach the file you created here so I can take a look at it then please?
here it is
Your file is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php');
ssi_recentTopics();?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
That is the problem.
As I posted, it should contain ONLY what I posted:
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php');
ssi_recentTopics();?>
Or if you insist on it having an HTML wrapper:
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php ssi_recentTopics();?>
</body>
</html>
thanks bro. that is fine now. but when i add it to my forum A using frame tag it looks really worst than ever. isnt there any other way . means i have recent posts block on forum A which displays forum A's recent posts. It might be also using the ssi.php from forum A. And if so than is there a possiblity to change path to forum B's ssi.php ?
There isn't any other way without doing LOTS of manual coding which I don't have the time to sit and write for you.
You know, you can actually customise its style with a little work. Less work than writing the alternative.
Thing is, you never actually said how you wanted it to look.
i wanted it to match my Forum A's block look i am using curve theme. please let me know how to customise its style ?
Considering I have NO IDEA what that forum looks like, how can I customise it?
sent you link by pm as its not family friendly forum
I would point out that I normally delete unsolicited PMs, it is more polite to ask first. However given that there is no way around this, it's fine in this case only.
sorry buddy but replied to your pm again. i want it to look like recent posts block on forum A
if you can visit forum A now you can see how that block looks like
background and title color are good but no need for topic name "Actresses" and date and time field and also if possible only need 5 recent topics
and sorry sir but one more issue when i am clicking on recent posts it opens in same small window . is it possible to make them links which opens in new browser window ?
So how exactly does it look then?
BEFORE I go any further, please PM me with a link to actually show me the block you've added because right now I'm trying to figure out how to make something look different without seeing the code you have now.
pm sent
This might help.
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="/Themes/default/css/index.css?rc2" />
<title>Untitled Document</title>
</head>
<body>
<?php $posts = ssi_recentTopics(8, null, null, 'array');
echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a target="_blank" href="', $post['href'], '">', $post['subject'], '</a>
', $txt['by'], ' ', $post['poster']['link'], '
', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';
?>
</body>
</html>
This should load the main style code for Curve (the theme in use), then lay it out using the rules therein, plus load it in a new tab as opposed to the frame.
where do i need to add this code sir ? in recenttopics.php file ?
Yes. In place of the code you had before.
Quote from: Arantor on December 12, 2009, 05:15:50 PM
Yes. In place of the code you had before.
yes sir the click problem is solved it opens in new window now. but the background was better before and how to remove board name, date & time and posted by from the list. and it shows large blank space after topic list you can check it at the same link. i have activated the block now.
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="/Themes/default/css/index.css?rc2" />
<title>Untitled Document</title>
</head>
<body style="background:#F0F4F7;">
<?php $posts = ssi_recentTopics(8, null, null, 'array');
echo '
<table border="0" class="ssi_table">
<tr>
<td>';
foreach ($posts as $post)
echo '
<a target="_blank" href="', $post['href'], '">', $post['subject'], '</a>
', $txt['by'], ' ', $post['poster']['link'], '
', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '
<br />
', $post['time'], '
<hr />';
echo '
</td>
</tr>
</table>';
?>
</body>
</html>
thanks a lot sir i really appreciate your efforts . i can't believe its done . i have enabled block now you can see that .
Good to see it's working. You can shorten it by shortening the height in the iframe.
There was a minor typo in the code - the last <td> should have been </td> - I've fixed the above though.
thanks a lot sir i have shortened it also . just last request if its possible to bold those fonts as it looks little thinner than recent posts block
<?php require('/homepages/9/d269191381/htdocs/ForumBollychilli/SSI.php'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="/Themes/default/css/index.css?rc2" />
<title>Untitled Document</title>
</head>
<body style="background:#F0F4F7;">
<?php $posts = ssi_recentTopics(8, null, null, 'array');
echo '
<table border="0" class="ssi_table">
<tr>
<td>';
foreach ($posts as $post)
echo '
<span class="smalltext">
<strong><a target="_blank" href="', $post['href'], '">', $post['subject'], '</a></strong>
', $txt['by'], ' ', $post['poster']['link'], '
', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '
<br />
', $post['time'], '</span>
<hr />';
echo '
</td>
</tr>
</table>';
?>
</body>
</html>
great sir you are a genious. thanks a lot once again