The Dark Alliance

  • 26 November, 2024, 06:35:44 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

TS3 server has a new IP, read here for more info (only available to TDA members)

Pages: 1 [2]   Go Down

Author Topic: Guild news etc portal online.. !  (Read 37980 times)

Fenderon

  • Administrator
  • Forum Master
  • *****
  • Karma: 52
  • Offline Offline
  • Posts: 3.618
Re: Guild news etc portal coming online..
« Reply #15 on: 14 August, 2008, 11:11:14 AM »

I know.. you could try classic for now, if thats ok.. but I didn't find a "forum" button :p in the other themes I could just add it manually, there was no picture file
Logged
Proud member of TDA

Fenderon

  • Administrator
  • Forum Master
  • *****
  • Karma: 52
  • Offline Offline
  • Posts: 3.618
Re: Guild news etc portal coming online..
« Reply #16 on: 14 August, 2008, 03:40:44 PM »

next on the todo list is to "move" the entire thing to http://tda.nu/ .. as in remove the "forum/" bit.

Will have to look into that a bit, might break a few links
Logged
Proud member of TDA

Urme

  • The Legend
  • Forum hasbeen
  • *****
  • Karma: 0
  • Offline Offline
  • Posts: 692
  • I heal!
Re: Guild news etc portal coming online..
« Reply #17 on: 14 August, 2008, 03:44:41 PM »

I have written a simple rss parser for WAR news, try to add this code to a php block:
Example 1:
Code: [Select]
$feedurl = "http://feeds.warhammeronline.com/warherald/RSSFeed.war?type=current";

if(!$xml=simplexml_load_file($feedurl)){
echo 'Error reading RSS file';
}

foreach($xml->channel->item as $news) {
echo '<a href="'.$news->link.'" target="_blank">'.$news->title.'</a> - ';
echo '<small>'.strftime("%d %b",strtotime($news->pubDate)).'</small><br />';
}

Not sure if we have to cut number of letters so it's easier to read.

Edit: Changed the code a tiny bit 15:45cet

Edit2: Maybe it's easier to read if it's a list with a dot before the header.
Example 2:
Code: [Select]
$feedurl = "http://feeds.warhammeronline.com/warherald/RSSFeed.war?type=current";

if(!$xml=simplexml_load_file($feedurl)){
echo 'Error reading RSS file';
}

echo '<ul style="list-style-position:inside;margin:0;padding:0;">';
foreach($xml->channel->item as $news) {
echo '<li style="padding-bottom:5px;"><a href="'.$news->link.'" target="_blank">'.$news->title.'</a> - ';
echo '<small>'.strftime("%d %b",strtotime($news->pubDate)).'</small></li>';
}
echo '</ul>';
« Last Edit: 14 August, 2008, 03:55:11 PM by Urme »
Logged
Darkfall Online: Urme TheLegend - Mirdain - A bit of everything.

Urme Thelegend <Shaman> lvl 40, rr 57

Urme

  • The Legend
  • Forum hasbeen
  • *****
  • Karma: 0
  • Offline Offline
  • Posts: 692
  • I heal!
Re: Guild news etc portal coming online..
« Reply #18 on: 14 August, 2008, 04:09:41 PM »

Btw that was the US RSS news feed, we could have two blocks one for US and one for EU :)
Create another block and change the $feedurl like this:

Code: [Select]
$feedurl = "http://www.war-europe.com/syndic_proc/rss/guest/en/rss.xml";

And it will display the EU WAR News.
Logged
Darkfall Online: Urme TheLegend - Mirdain - A bit of everything.

Urme Thelegend <Shaman> lvl 40, rr 57

Urme

  • The Legend
  • Forum hasbeen
  • *****
  • Karma: 0
  • Offline Offline
  • Posts: 692
  • I heal!
Re: Guild news etc portal coming online..
« Reply #19 on: 14 August, 2008, 04:14:25 PM »

Or maybe it's enough to display the four latest news from each feed in the same box:

Code: [Select]
$feedurl1 = "http://feeds.warhammeronline.com/warherald/RSSFeed.war?type=current";
$feedurl2 = "http://www.war-europe.com/syndic_proc/rss/guest/en/rss.xml";
$limit = 4;

function displaynews($title, $xml, $counter = 0) {
$newsdata = '<b>'.$title.'</b>';
$newsdata .= '<ul style="list-style-position:inside;margin:0;padding:0;">';
foreach($xml->channel->item as $news) {
if($counter < 4) {
$newsdata .= '<li style="padding-bottom:5px;"><a href="'.$news->link.'" target="_blank">'.$news->title.'</a> - ';
$newsdata .= '<small>'.strftime("%d %b",strtotime($news->pubDate)).'</small></li>';
}
$counter++;
}
$newsdata .= '</ul>';

return $newsdata;
}

if(!$xml1=simplexml_load_file($feedurl1)){
echo 'Error reading US News file<br />';
}

if($xml1) {
echo displaynews("US News", $xml1);
}

if(!$xml2=simplexml_load_file($feedurl2)){
echo 'Error reading EU News file<br />';
}

if($xml2) {
echo displaynews("EU News", $xml2);
}

Edit: Modified the code, so it's a bit cleaner, I'll stop the spam now :)
« Last Edit: 14 August, 2008, 04:27:55 PM by Urme »
Logged
Darkfall Online: Urme TheLegend - Mirdain - A bit of everything.

Urme Thelegend <Shaman> lvl 40, rr 57

Fenderon

  • Administrator
  • Forum Master
  • *****
  • Karma: 52
  • Offline Offline
  • Posts: 3.618
Re: Guild news etc portal coming online..
« Reply #20 on: 14 August, 2008, 04:38:57 PM »


Fatal error: Call to undefined function: simplexml_load_file() in /web/tda.nu/forum/Sources/SPortal.php(1570) : eval()'d code on line 20
Logged
Proud member of TDA

Urme

  • The Legend
  • Forum hasbeen
  • *****
  • Karma: 0
  • Offline Offline
  • Posts: 692
  • I heal!
Re: Guild news etc portal coming online..
« Reply #21 on: 14 August, 2008, 04:41:42 PM »

Hmm what version of PHP are running on the server? I thought simpleXML was default in php5+
Logged
Darkfall Online: Urme TheLegend - Mirdain - A bit of everything.

Urme Thelegend <Shaman> lvl 40, rr 57

Urme

  • The Legend
  • Forum hasbeen
  • *****
  • Karma: 0
  • Offline Offline
  • Posts: 692
  • I heal!
Re: Guild news etc portal coming online..
« Reply #22 on: 14 August, 2008, 04:44:36 PM »

create a new file called phpinfo.php

and add this code:
Code: [Select]
<?php
phpinfo
();
?>


Then you'll see which version of php and other stuff that's installed on the server.
Logged
Darkfall Online: Urme TheLegend - Mirdain - A bit of everything.

Urme Thelegend <Shaman> lvl 40, rr 57

Dub

  • Officers
  • Forum Master
  • *****
  • Karma: 12
  • Offline Offline
  • Posts: 1.015
Re: Guild news etc portal online.. !
« Reply #23 on: 20 August, 2008, 02:48:12 PM »

SimplePortal up and running ! Any news suggestions you have, just create a thread and PM me about it. :)

Edit: If you can't find the forum again.. click on "Forum" at top, or follow this link: http://tda.nu/forum/index.php?action=forum

still havent this forum button on top , glad the link is still there! :)
Logged

Fenderon

  • Administrator
  • Forum Master
  • *****
  • Karma: 52
  • Offline Offline
  • Posts: 3.618
Re: Guild news etc portal online.. !
« Reply #24 on: 20 August, 2008, 02:56:12 PM »

what theme are you using?
Logged
Proud member of TDA

Fenderon

  • Administrator
  • Forum Master
  • *****
  • Karma: 52
  • Offline Offline
  • Posts: 3.618
Re: Guild news etc portal online.. !
« Reply #25 on: 20 August, 2008, 04:22:46 PM »

added forum-button to the classic theme that a few people are using (including dub)

edit: it doesn't look 100% as the other buttons, but with four people using the theme .. I didn't bother, sorry :)
« Last Edit: 20 August, 2008, 04:26:07 PM by Fenderon »
Logged
Proud member of TDA

Dub

  • Officers
  • Forum Master
  • *****
  • Karma: 12
  • Offline Offline
  • Posts: 1.015
Re: Guild news etc portal online.. !
« Reply #26 on: 20 August, 2008, 10:11:00 PM »

thanks :)

/hug
Logged

Joric

  • TDA member
  • Forum Master
  • *****
  • Karma: 26
  • Offline Offline
  • Posts: 3.360
  • Let me guess... problems.
Re: Guild news etc portal online.. !
« Reply #27 on: 24 August, 2008, 10:48:43 PM »

ah! great Fend, thank you!
Logged
I hum along and make things hum...
Uthgard: Jorunn / Skald
ESO: Yuto / Templar
GW2: Jo Ric / Thief, Irwy / Guardian, Ngumi / Warrior
Pages: 1 [2]   Go Up
 


BlackRain , 2006 by Crip

Page created in 0.17 seconds with 21 queries.

SimplePortal 2.3.5 © 2008-2012, SimplePortal