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
  • Pages:
  • 1
  • 6
  • 10
Latest Posts on external website
Topic Started: Mar 8 2010, 01:21 PM (13,988 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:
Wonder Pie
Member Avatar
Member
[ * ]
Dream Endlessly
Oct 10 2012, 08:44 PM
Is there a way to make it so I can pull the most recent posts from my own forum, and display them in a marquee box? I already ahve the marquee box I want it displayed in. Thank you:)
I too put it in a marquee box (div) on my website. This is the code I used:

Code:
 
<h2>Latest Forums Posts</h2>
<script type="text/javascript">
//<![CDATA[
$(function() {
$.getScript('http://www.tierrahosting.com/latest-post.php?url=http%3A%2F%2Fs14.zetaboards.com%2FSC3_CaS_Forum%2Fsite%2F', function() {
$("div#latest").append(''+latestpost+'');
})
});
//]]>
</script>
<div id="scroll_box"><marquee direction="up" scrollamount="2" onmouseover="this.scrollAmount=1;" onmouseout="this.scrollAmount=2;" height="110"><div id="latest"> </div></marquee></div>


To Skyon Archer: I know it wouldn't work on your server. The revised script is just basically for other hosts/servers so w11 boards do work. I just added the "var latestpost" java bit to the beginning and cleaned up the code so it would return the same data as your generator.
Edited by Wonder Pie, Oct 15 2012, 08:28 PM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
still is it a bit laggy nowadays because of the new server, or is it just me?
Offline Profile Quote Post Goto Top
 
SG2
Member Avatar
Member
[ * ]
I'm trying to get this to work using a page from the forum's Website Maker, which is obviously possible from the example site, but I can't get it to work. I'm getting hung up at step 5:

Quote:
 
Wherever you desire for your Latest Posts to be displayed, simply use the following:
<div id="latest"> </div>

So I made a new page in the website maker called 'feed' and pasted the div in there, but...what's supposed to go inside the div? I thought maybe the same code that I put in the board template, but that doesn't appear to do anything.

I put the script in Below The Board because it didn't specify, is that okay? What might I be missing?

I'm attempting this on my test board: http://w11.zetaboards.com/IGNO_Test_Board/index/
Edited by SG2, Apr 5 2013, 01:54 PM.
Offline Profile Quote Post Goto Top
 
SlyCooperFan1
Member Avatar
Coder
[ *  *  *  * ]
You're not supposed to put anything inside the div. Wherever you put <div id="latest"> </div>, the code will put the Latest Posts in there by itself. You don't need to put anything in it.
Offline Profile Quote Post Goto Top
 
SG2
Member Avatar
Member
[ * ]
I tried that too and the page just doesn't display anything.

This is what I put in Below The Board:

Code:
 
<script type="text/javascript">
//<![CDATA[
$(function() {
$.getScript('http://www.tierrahosting.com/latest-post.php?url=http%3A%2F%2Fw11.zetaboards.com%2FIGNO_Test_Board%2Fsite%2F', function() {
$("div#latest").append(''+latestpost+'');
})
});
//]]>
</script>

And this is the feed page: http://w11.zetaboards.com/IGNO_Test_Board/pages/feed/

Could it be conflicting with another code perhaps?
Edited by SG2, Apr 5 2013, 03:23 PM.
Offline Profile Quote Post Goto Top
 
SlyCooperFan1
Member Avatar
Coder
[ *  *  *  * ]
SG2, you should have read the posts on the previous page. I just took a look - if you have a server that starts in w, this code will not work. Karmine made a new PHP code that will make the code work with w11, but you need your own website that supports PHP in order to host it.
Offline Profile Quote Post Goto Top
 
SG2
Member Avatar
Member
[ * ]
Oh, okay, I must have missed that. Fortunately the w is only my test board - if it works with s servers, then it should work fine on my actual board (s1). I'll give that a try.

Edit: Works perfectly on my s1 board. Thanks for pointing that out to me, SlyCooperFan!!
Edited by SG2, Apr 6 2013, 01:34 PM.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
I'm glad it all worked out for you!
Offline Profile Quote Post Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
I want to have both active topics and latest posts show up on top of my index page. Here is my site address

Right now I have created a box of active topics (which is developed by Cory) which I put it on the right hand side on top of the index page. I want to have a latest posts box next to it (on the left hand side). I have the above codes for the latest posts set up already but can't get it to show on the index page. Help is much appreciated.
Offline Profile Quote Post Goto Top
 
DLynn
Member
[ * ]
I have been looking for these codes for ages as I have seen v Bulletin has both active topics and latest posts. It'll be nice if someone comes up with this new request.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
There seems a serious lagging problem lately. I am using the code in post #4 for my board. I'm wondering whether I can host the javascript on my own host (not zetaboard)?
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
polocolo
Jul 2 2013, 10:40 PM
There seems a serious lagging problem lately. I am using the code in post #4 for my board. I'm wondering whether I can host the javascript on my own host (not zetaboard)?
1. The server hosting this has had no excessive load or downtime this month at all, zero, so the "lagging" your experiencing is not caused by this code.
2. This is a PHP script, basic as it is, and not javascript. It only uses, in post #4, javascript to present the results to the end-user. The actual PHP code is in the very first post of this topic, so if you have a host that you can use PHP with, then by all means, it's there to be used.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
Hi Skyon. thanks for the reply.

Would the code in the first post work for the forum itself? I install the code in the zetaboard forum instead of an outside site.
Offline Profile Quote Post Goto Top
 
arcanezeal
Member
[ * ]
Thank you for the awesome code!
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
arcanezeal
Jan 3 2014, 09:00 AM
Thank you for the awesome code!
Thank you :up:
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
  • Pages:
  • 1
  • 6
  • 10