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,987 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:
MMASCC
Member
[ *  * ]
Hello, seems like a great code that I would love to use on my site www.mmasportscards.com

Not sure how to get it to work though, am I missing something?

Here is what I am trying to enter.


<?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/');
/'http://w_.zetaboards.com/______/site/');
/http://w11.zetaboards.com/MMASCC/

$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();
?>

Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Use the JavaScript version in Post #4, the PHP version is for you to host on your own web host.
Offline Profile Quote Post Goto Top
 
MMASCC
Member
[ *  * ]
Thanks for fast reply.

I couldnt get the java one to work either.

Do I put the first code in below board for example

and then the div on the site?

Cause thats what I did and it hadnt worked so I tried the php lol
Edited by MMASCC, Apr 15 2014, 09:01 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Post the JavaScript code you tried to use, please.
Offline Profile Quote Post Goto Top
 
MMASCC
Member
[ *  * ]
<script type="text/javascript">
//<![CDATA[
$(function() {
$.getScript('http://www.tierrahosting.com/latest-post.php?url=http%3A%2F%2Fw11.zetaboards.com%2FMMASCC', function() {
$("div#latest").append(''+latestpost+'');
})
});
//]]>
</script>


Then div posted on www.mmasportscards.com in box says Latest Posts
Edited by MMASCC, Apr 15 2014, 09:15 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
The JavaScript version is to work on a ZetaBoards forum. Using it in your Board Template and adding the DIV to your website won't work. You'll have to use the PHP version if you want to add it to your website.
Offline Profile Quote Post Goto Top
 
MMASCC
Member
[ *  * ]
Thats what I figured, so I tried using the php version but it didnt work, so i made my first post here
Edited by MMASCC, Apr 15 2014, 09:31 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Firstly, you're aware PHP is not like HTML, CSS, or JavaScript and it cannot be embedded directly into the webpage source code?
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Cory
Apr 15 2014, 11:00 PM
Firstly, you're aware PHP is not like HTML, CSS, or JavaScript and it cannot be embedded directly into the webpage source code?
See the very first post of this topic where I said:

Quote:
 
Requirement: Your external website must have and run php

If you are uncertain, you can always use the jQuery version I posted here. Your website must have jquery for this to work.

Either way, you must have either PHP or jQuery to use this.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
I have been using this code for my webiste: http://wallacehuoforum.info/index/ for a very long time. However, lately I got this message instead: "Domain registrations as low as $5.95 a year and Web Hosting starting at $1.50 a month at Tierra Hosting." I'm not sure whether it is because the host hosting this code is no long effective.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It appears it was intentional: https://www.tierrahosting.com/latest-post.php
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
Could this be fixed as I don't get the latest 20 posts anymore?
Edited by polocolo, Apr 28 2015, 01:29 AM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
By intentional, I mean the creator of this script turned it into an advertising gimmick to promote their own website. It's unlikely it will be fixed at this time, unless the code creator steps forward and apologizes and rectifies their actions.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
I hope Skyon Archer will visit this thread again and fix it. This is a very useful code.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
This code is still not working. Is there a solution to this? Thanks.
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