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
  • 2
  • 10
Latest Posts on external website
Topic Started: Mar 8 2010, 01:21 PM (13,992 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
[ *  *  *  * ]
If you have a forum that is not viewable by guests, then if they click a posts title, they won't be able to see it. Is that what you mean?
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
no, i mean:
if i have a forum that can't be read by guests, only by members.
the posts in that forum will not appear in the Latest div.
the only posts that appear in the Latest div are those in forums readable by guests
Offline Profile Quote Post Goto Top
 
orchid123
Member
[ * ]
Codes Rock! please tell me why your site :http://www.tierrahosting.com/latest-post.php is not show full list 10 latest post in my portal? although i chose show 10 latest post in portal.
could you help me? please
Edited by orchid123, May 6 2011, 10:50 PM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
it shows 20 for me
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Only thing that stands out to me is the fact that your site is in vietnamese and possible the special characters are effecting the code. I am setting the header as utf-8, but it has rectified your issue.

I'll keep working on it.


paradise.engineering
May 3 2011, 05:54 PM
no, i mean:
if i have a forum that can't be read by guests, only by members.
the posts in that forum will not appear in the Latest div.
the only posts that appear in the Latest div are those in forums readable by guests
That's because the code visits your site as a guest, meaning it's not logged in, and it retrieves the data being displayed on your portal. It then displays the data where you choose it to be shown.

Since guests can't see those forums then they (and the code) can't see those latest posts.

Log out of your forum and visit your portal and you'll see what I'm talking about.
Edited by Skyon Archer, May 5 2011, 12:35 PM.
Offline Profile Quote Post Goto Top
 
Wonder Pie
Member Avatar
Member
[ * ]
The tierrahosting no longer works, my latest forums posts stopped appearing. :(

Edit: Nevermind, I found out it wasn't working because my portal was disabled. Strangely, it was always disabled and the code still worked. Anyways, it's working now. :)
Edited by Wonder Pie, Sep 19 2011, 01:40 AM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
what? i have the same problem but i dont want to activate the portal
I need a solution without activating the portal. This was possible till yesterday

edit: fixed by activating the portal, it did no harm.. :lol:
Edited by paradise.engineering, Sep 19 2011, 03:23 AM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
stopped working today, latest posts no longer appear
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
His host appears to be down at the moment.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
I apologize for the issues yesterday. I had a hard drive failure on that server which caused service disruption for a short while. Even after swapping the hard drive, I had to rebuild the RAID array which then caused intermittent performance issues.

All is well now and the server is functioning as expected.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
Yes, it works great, thanks once again for your free awesome code
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
paradise.engineering
Oct 21 2011, 07:26 AM
Yes, it works great, thanks once again for your free awesome code
Sorry for the delayed response, been really busy lately . . . nonetheless . . . thanks! Glad it's working as intended for you. :)
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
well let us know what you're working on if it's zeta-related. I'm a fan of your work.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
You might be interested in the "Latest Statistics on Website Script" that I completed at a friends request.

It does not work on your Lowploy Workshop, but does work on your Chaos Realm.

Final product:
Posted Image

OOppss, forgot to tell you that you enter your portal URL, just as before, and place that URL with this code (in place of the _____________ line:

Code:
 
<script type="text/javascript">
//<![CDATA[
$(function() {
$.getScript('_______________________________________', function() {
$("div#latest2").append(''+lateststats+'');
})
});
//]]>
</script>

Then where ever you want the Latest Statistics to be displayed, just place this:

Code: HTML
 
<div id="latest2"> </div>
Edited by Skyon Archer, Dec 12 2011, 06:54 PM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
wait, but why not on LPW? and only on Chaos? you made me curious, I will test it tomorrow as soon as I get up!

thanks for the heads'up! I really appreciate it!
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
  • 2
  • 10