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
  • 10
Latest Posts on external website
Topic Started: Mar 8 2010, 01:21 PM (13,984 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
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
Hey can you make a new code to work with html or javascript? The site I want to use it on doesn't use php.... (I'm actually going to use it on a Zetaboards webpage to go on the boards mainpage.)
Offline Profile Quote Post Goto Top
 
Nyokou
Member
[ * ]
Yeah it'd be cool to have something like this actually on my forum like maybe displayed at the top. Like the latest topics/posts from my news section. ^^ But anyway, really cool idea.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Okay, here you go . . . a javascript version that you can use on your site.

http://tierrahost.com/scripts/latest.php

You enter your forum's portal URL into the form. The returned URL in your address bar is what you will use to display the latest posts.

Now, you will need to use this:

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

Replace the line with the URL address that http://www.tierrahosting.com/latest-post.php gives you.

and where ever you want the list displayed, use this:

Code:
 
<div id="latest"> </div>


You can use CSS to make the displayed Latest Post display anyway you desire.

Here is an example of the Latest Post placed at the top of a forum: http://s4.zetaboards.com/Latest_Post/index/
Here is an example of it on a Website Maker Page: http://s4.zetaboards.com/Latest_Post/pages/latestpost/

Hope this helps!
Edited by Skyon Archer, Dec 20 2015, 02:08 PM.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
thanks so much for this!!!!!! I will test it right now.

does not work on my blogger. i even made the css with width and height
Edited by paradise.engineering, Apr 21 2011, 06:52 AM.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
"Does not work" doesn't assist in making it work.

Does your blogger have jquery?
Did you put the code exactly as listed above with the complete url from the form?
Did you put the div after the jquery code?

This has been used on multiple sites with no issues. The previews are example enough that it does work.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
sorry for that.
you are truly a web code god.
thank you so much, i added jquery right under the head tag and works perfectly now.
thanks again, you made my day.

my blogger: http://lowpoly-workshop.blogspot.com/


would be very cool if you'd remove that Latest Posts H2 cause maybe people want to add different texts or make it marquee like i do :D
Edited by paradise.engineering, Apr 21 2011, 09:47 AM.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Wow, that looks really nice the way you implemented it into your site like that!

I removed the <h2> as you requested, after seeing it "live" it made sense for it to not be there.
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
wow, you really are an open minded person, thank you.
you're my web coder idol, hehe
Edited by paradise.engineering, Apr 22 2011, 12:53 PM.
Offline Profile Quote Post Goto Top
 
Wonder Pie
Member Avatar
Member
[ * ]
Awesome code!
Edited by Wonder Pie, Apr 26 2011, 06:05 AM.
Offline Profile Quote Post Goto Top
 
phuonghien
Member
[ *  * ]
i can add icon such this code
Quote:
 
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
phuonghien, what icon are you talking about?
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
usng this on the main zeta as well: http://s4.zetaboards.com/Lowpoly_Workshop/index/
as scroolable. the only bad thing about it is it behaves somehow like a guest and can't see forums i only make visible to members
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Great way of implementing the code into your forum. Nice!
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
thanks ! but do you know the issure im talking about? :D
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
  • 10