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,991 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:
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Check it now, I believe I have rectified the issue with the code posted here
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Latest Post on Website

Latest Statistics on Website

Example of both in use: http://s4.zetaboards.com/Latest_Post/index/
Edited by Skyon Archer, Dec 20 2015, 02:11 PM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
Thanks a lot for your effort mate, I think I will find a way to implement this stats feature!
Offline Profile Quote Post Goto Top
 
toofx-ZNR (P)
Member Avatar
Who is The Coon?
[ * ]
Hay Guys i can't seem to get this to work
i can Use some Help. if any One has the time.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
toofx
Dec 23 2011, 10:48 AM
Hay Guys i can't seem to get this to work
i can Use some Help. if any One has the time.
1. Choose what you want to display and visit that contents site:
Latest Post on Website
Latest Statistics on Website
Example of both in use: http://s4.zetaboards.com/Latest_Post/index/

2. Enter your Zetaboards Portal URL in your choice from above (step one):
Example: http://s4.zetaboards.com/GFX_and_GAMEING/site/

3. For example, to display Latest Post on Website, you will need to add the following to your website you are wanting to display this option:

Code:
 
<script type="text/javascript">
$(function() {
$.getScript('___________________________', function() {
$("div#latest").append(''+latestpost+'');
})
});
</script>


4. Replace the long blank line above with the URL that is in your browsers address bar (step two from above).
Then place the following where you want it to be displayed:
Code:
 
<div id="latest"> </div>


Common issue is trying to use these on a site that doesn't have jquery.

Zetaboards jquery file is located here:
Code:
 
<script type="text/javascript" src="http://z1.ifrm.com/static/jq142.js?z=4"></script>


--------- hope that helps!
Edited by Skyon Archer, Dec 20 2015, 02:13 PM.
Offline Profile Quote Post Goto Top
 
JJY
Member Avatar
Member
[ * ]
Can I know how to remove "poster name & replies" that row?
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Really simple.

If you are using the javascript to display on your site, modify the code by adding this:
Code:
 
$('.portal_content').remove();


The modified javascript looks like this:
Code:
 
<script type="text/javascript">
//<![CDATA[
$(function() {
$.getScript('________________________________', function() {
$("div#latest").append(''+latestpost+'');
$('.portal_content').remove();
})
});
//]]>
</script>
Offline Profile Quote Post Goto Top
 
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
First of all, I love your script. It works amazing

One question:

http://www.tierrahosting.com/latest-post.php?url=http%3A%2F%2Fs3.zetaboards.com%2Fkazilion%2Fsite

It shows the 5 latest posts first, and then it shows the 'Show posts from' posts. These are long posts.

Ive used your script for my sidebar, and the sidebar is now showing the latest five posts great with no problems. But below that it shows a small width-like bar with the 'show posts from' posts. It is hard to explain so try to see it yourself: http://kazilion.nl.am/index/ or http://s3.zetaboards.com/kazilion/index

I have tried to disable the 'show posts from' option, but then the tierrahosting feed does not show anything anymore (not even the last 5 posts.)

Do you know how to fix this? Thank you :)
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
This is something unique to your site, evidently.

On my test board for this script, I have it displaying posts and everything is working as expected. Example: http://s4.zetaboards.com/Latest_Post/site

If you look at the portal, the script is working as intended perfectly.

I honestly don't have an answer . . . sorry. Maybe Reid or Cory can save the day on this one.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<style type="text/css">
#latest #portal_news {
display: none;
}
</style>
Add that to the Javascripts wrapper of your Board Template to get rid of it.
Offline Profile Quote Post Goto Top
 
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
Thank you very much for your reply Skyon Archer! This means our site is so amazing that its unique to everything else!! :$

Thank you so much for the code, Cory! It works perfectly now!
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
That's why Cory is my hero. Thanks, boss man!
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Just as a heads up, the main_url variable returns the board's URL such as http://sx.zetaboards.com/boardname/ :) .
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
the code currently doesnt work, hope its not a server issue and this is only temporarily cause my sites depend on this script
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
paradise.engineering
Mar 6 2012, 12:00 PM
the code currently doesnt work, hope its not a server issue and this is only temporarily cause my sites depend on this script
It's working properly on the example site: http://s4.zetaboards.com/Latest_Post/index/

Are you still having issues?
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