Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
7 registered (smallufo, SteveS, sampsonzurich, Bjab, FordDoctor, Stan, Pilgrim), 27 Guests and 13 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 05/17/12
Posts: 3
Top Posters (30 Days)
Ruben 51
Gizmo 24
DennyP 24
Dunny 15
SteveS 14
AllenAyres 12
SD 10
dbremer 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#210793 - 04/28/08 05:04 AM 7.3.b4 : Custom Island
arentzen Offline
journeyman
Registered: 10/01/06
Posts: 75
Loc: Sunny island, Denmark
Im running 7.2.2 and have some problems with using PHP in custom box.
The script works, but not in a custom box.I get a parse error What am I doing wrong?

Php Code:

/* PHP CODE HERE, IF NECESSARY */

/* DO NOT CHANGE THE LINE BELOW */

$body = <<<EOF

<?
$feed = simplexml_load_file("http://www.dr.dk/nyheder/service/feeds/allenyheder");
$taeller  = 0;
$antal = 5;
foreach($feed->channel->item as $item){
while($taeller<$antal){
if (strlen($item->description) > 35) {
	  $item->description  = substr($item->description , 0, 35);
	  }
print ("<a href='{$item->link}' target='_blank'>{$item->title}</a><br/>");
print ("<i>{$item->pubDate} </i><br/>");
print ("{$item->description}... <br/><br/>");
break;

}
$taeller ++;
}
?>
EOF;


/* DO NOT CHANGE THE LINE ABOVE */
 
_________________________

www.trosfrihed.dk

Custom Ubb 7.5.2
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#210794 - 04/28/08 05:31 AM Re: 7.3.b4 : Custom Island [Re: arentzen]
Ian Offline
Registered: 06/05/06
Posts: 4337
Loc: Essex, UK
You need to put php code beneath

/* PHP CODE HERE, IF NECESSARY */

And without the <? and ?>
Top
#210801 - 04/28/08 07:19 AM Re: 7.3.b4 : Custom Island [Re: Ian]
driv Online   censored

Pooh-Bah
Registered: 01/10/04
Posts: 2377
Hmmm...

I've been using this with no probs.

Php Code:
/* PHP CODE HERE */

/* BODY HERE */
$body = <<<EOF

<?php include("/path/to/headlines/pr-headlines.txt"); ?>


EOF; 
_________________________
Using version :: 7.5.6
Top
#210804 - 04/28/08 07:23 AM Re: 7.3.b4 : Custom Island [Re: driv]
Ian Offline
Registered: 06/05/06
Posts: 4337
Loc: Essex, UK
Fair enough - having thought about it, it should work as this is valid within an html page.

Apologies.
Top
#210805 - 04/28/08 07:29 AM Re: 7.3.b4 : Custom Island [Re: Ian]
driv Online   censored

Pooh-Bah
Registered: 01/10/04
Posts: 2377
Still M25 chums right? wink
_________________________
Using version :: 7.5.6
Top
#210808 - 04/28/08 07:57 AM Re: 7.3.b4 : Custom Island [Re: driv]
Ian Offline
Registered: 06/05/06
Posts: 4337
Loc: Essex, UK
I avoid that car park if I can!
Top
#210818 - 04/28/08 11:27 AM Re: 7.3.b4 : Custom Island [Re: Ian]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
What's the actual parse error that you get?
Top
#210842 - 04/28/08 05:23 PM Re: 7.3.b4 : Custom Island [Re: Rick]
arentzen Offline
journeyman
Registered: 10/01/06
Posts: 75
Loc: Sunny island, Denmark
I can update the custom box, but when I go to the Url I get a parse syntax error:
Code:
Parse error: syntax error, unexpected '=' in /..../.../.../.../trosfrihed.dk/forums/cache/portal_box_2.php on line 12 
_________________________

www.trosfrihed.dk

Custom Ubb 7.5.2
Top



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Due Date Calculator-Calculate When Your Baby is Due
by StewartMyduedate
12:54 AM
Temporary Password email not being received
by
05/24/12 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
Forum Stats
10492 Members
36 Forums
33842 Topics
181709 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image