We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Latest Posts on external website
Topic Started: Mar 8 2010, 01:21 PM (13,986 Views)
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
This is an unofficial code I created to pull the Latest Posts from a Zetaboard forum and have them displayed on an external website.

Requirement: Your external website must have and run php

What's this do? The script goes to your Zetaboard portal and looks at the Latest Posts section. It scrapes all the information that is there and then outputs it at the end of the code. You can use a simple php include to place this where you want it to be displayed.

**** in the code is the URL to your Zetaboard forum portal - you must change this to your portal address! ****
Code:
 

<?php
// Latest Posts from a Zetaboard Forum to your website
// Created by Codes Rock, March 2010
// Brag about me to all your friend :)

$start_text = '<div class="portal_box">
<h2>Latest Posts</h2>';
$end_text = '</div></div><div id="portal_r">';


/*********** this is your forums url to the portal ***********************/
/********** you must change this to your portal URL **********************/

$source = file_get_contents('http://s_.zetaboards.com/______/site/');
/***************************************************************************/

$start_pos = strpos($source, $start_text) + strlen($start_text);
$end_pos = strpos($source, $end_text) - $start_pos;

$found_text = substr($source, $start_pos, $end_pos);

echo'<div class="portal_box">
<h2>Latest Posts</h2>';
echo $found_text;
echo'</div></div>';
clearstatcache();
?>


EDIT: I removed the example page (sorry)

It's simple to use and really cool to boot!

VIEW THIS POST IF YOU DON"T HAVE ACCESS TO A SERVER WITH PHP: http://support.zathyus.com/single/?p=18109239&t=5082198
Edited by Skyon Archer, Jan 17 2016, 11:25 PM.
Offline Profile Quote Post Goto Top
 
Replies:
tobeme
Member Avatar
Member
[ *  * ]
It is back to normal again. Thank you!
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
This isn't working again. Is there a way to put the 20 latest posts on the index page?
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
This isn' working.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Okay, here is a re-do of the script. I have been especially busy with business lately and have had not time for play. Finally I've settled down a bit and now present to you a new version of the Latest Zetaboard Posts on Website script . . .

It's easy to use. Go to your site's Portal and copy the URL (address) of that page. For instance, the Support Board's portal is http://support.zathyus.com/site

Now, go to this URL: http://tierrahost.com/scripts/latest.php

On that page, there is an input box to put your forum's portal address:

Posted Image

Paste the address to your forum's portal in the input box:

Posted Image

After you submit the address, and it was a valid address, you'll see your forum's latest posts in a live example. You'll also be given the code to copy/paste into put in your Admin Control Panel.

Posted Image

How much easier can it get than that?

Summary: copy your portal address, paste it into the input box at http://tierrahost.com/scripts/latest.php , submit the address, get the code to put into your ACP.

Final note; you can modify the look of the latest posts by using the id of "latest" in your stylesheet (CSS). Example:

Code:
 
<style type="text/css">
div#latest{
width: 80%;
height: 150px;
max-height: 150px;
overflow:auto;
border: 1px solid #333333;
padding: 0 5px;
margin:2px auto;
text-align:left;
}
</style>


Good luck!
Attached to this post:
Attachments: 1.png (17.98 KB)
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
Thank you!
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
polocolo
Jan 8 2016, 06:43 PM
Thank you!
You are welcome!
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
The latest 20 posts have also stopped working. I think it is probably due to the move of the site.

Posted Image
Offline Profile Quote Post Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
This hasn't been working for a long while. When will this be back on?
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
This does work, as can be seen here: http://tierrahost.com/scripts/latest.php?url=http%3A%2F%2Fsupport.zathyus.com%2Fsite%2F

Visit http://tierrahost.com/scripts/latest.php and simply follow the directions. Read this post: http://support.zathyus.com/single/?p=18109239&t=5082198 for more information.
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  *  * ]
Didn't work for me when I tried it. Apparently it has errors in the coding; http://support.zathyus.com/topic/7001765/1/#new
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Here's what I'm getting: http://i.imgur.com/WH10H7kh.jpg
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Cory
Oct 28 2016, 03:52 PM
Here's what I'm getting: http://i.imgur.com/WH10H7kh.jpg
What is the URL of the portal you submitted?

That error message comes from either not supplying an address or the script not being able to retrieve any information from the portal.

One thing, this script anticipates that the Latest Posts are being displayed in the left hand column of the portal.
Quote:
 
$start_text = '<h2>Latest Posts</h2>';
$end_text = '</div></div><div id="portal_r">';


It looks for the <h2> and scrapes the data between it and the end of that section. If it is somewhere else, then the script will need to be modified.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
I'm glad that you're back!

Here is my board: http://wallacehuoforum.info/index/

I put the 20 latest posts in the Recent Updates - Reload table.

EDIT: That worked fine until lately..
Edited by polocolo, Oct 28 2016, 09:31 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I found the issue. I had no content in the right sidebar, so the HTML wasn't present and instead returned this:
Code: HTML
 
</div></div><div id="portal_news">
So, you might want to consider $end_text finding what you posted, or the above.
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  *  * ]
http://s15.zetaboards.com/Discussion_Time/pages/updated/

Got it working I think but it shows topics that shouldn't be shown (ones relating to Cory's mention codes and online today code) and it looks very bare. No tables etc.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply