Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
2 registered (SteveS, Stephen G), 27 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 03/22/07
Posts: 466
Top Posters (30 Days)
Ruben 27
Gizmo 23
Bert 18
sb 5
hema0359 4
After the Rose 4
gladiator 3
skicomau 3
matrixinfologic 2
UbbLegacyUser 2
Latest Photos
Uhm...
Mayan End of World
Gas Station Disco Video Shoot
Test Pictures
Audrey Kate
Page 1 of 2 1 2 >
Topic Options
#1414 - 07/19/06 11:48 AM [FIXED in b2] Problem with custom Portal boxes
d-talk Offline
journeyman
Registered: 06/06/06
Posts: 95
Loc: Germany
I took some html code at my custom portal box and get the following error:

Parse error: syntax error, unexpected '<' in /var/www/web10/html/cache_builders/custom/portal_box_1.php on line 2


Edited by Rick (07/20/06 02:21 PM)
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."
#1415 - 07/19/06 11:53 AM Re: Problem with custom Portal boxes [Re: d-talk]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10177
Loc: Aberdeen, WA
Can you open up your cache_builder/custom/portal_box_1.php file and paste the contents in here?
Top
#1416 - 07/19/06 11:55 AM Re: Problem with custom Portal boxes [Re: Rick]
d-talk Offline
journeyman
Registered: 06/06/06
Posts: 95
Loc: Germany
Php Code:

<?php
<a href="http://www.ubbcentral.com">UBBCentral Webseite</a>

<br>

<a href="http://www.ubbcentral.com/order.php?product=UBB.threads">Preise / Bestellen</a>

<br>

<a href="http://www.infopop.com/members/members.php">UBB-Central Members Area</a>
?> 
Top
#1417 - 07/19/06 12:00 PM Re: Problem with custom Portal boxes [Re: d-talk]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10177
Loc: Aberdeen, WA
Ok, the custom islands are going to be the hardest thing for people to get used to I think. These are just blocks of php code, so it will take a bit of knowledge with PHP in order for these to work properly. If you wanted that exact same bit you would put this into the custom island editor

Php Code:

$body = <<<EOF
<a href="http://www.ubbcentral.com">UBBCentral Webseite</a>
<br>
<a href="http://www.ubbcentral.com/order.php?product=UBB.threads">Preise / Bestellen</a>
<br>
<a href="http://www.infopop.com/members/members.php">UBB-Central Members Area</a>
EOF;
 
Top
#1423 - 07/19/06 12:34 PM Re: Problem with custom Portal boxes [Re: Rick]
d-talk Offline
journeyman
Registered: 06/06/06
Posts: 95
Loc: Germany
ahhh... thank you Rick, it works now cool
Top
#1490 - 07/20/06 02:54 AM Re: Problem with custom Portal boxes [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1145
Loc: Berlin, Germany
I try to convert a old pal box from threads6 IIP to UBB7 but encounter some trouble. The Box should pull pictures from my PhotoPost gallery and look like this:

Php Code:

require_once("/home/.../photopost.inc.php");
$pp_db_prefix = "pp_";

function pp_get_ext( $filename ) {
	return substr($filename, strrpos($filename,"."));
}

function pp_is_image( $filename ) {
	$retval = 0;

	$mediatypes = array( ".jpg", ".gif", ".png", ".bmp" );
	$ext = pp_get_ext( $filename );

	if ( in_array(strtolower($ext), $mediatypes) )
		$retval = 1;

	return( $retval );
}

//
// Featured Photos Code
// Follow down to End Feature Photos Code
//

// which type of images do you want to show
$q_switch = "random";

switch ($q_switch) {
	case "most_view":
		$query = "SELECT p.id,p.user,p.userid,p.cat,p.title,p.bigimage,p.views 
			FROM {$pp_db_prefix}photos p 
			LEFT JOIN {$pp_db_prefix}categories c ON c.id=p.cat 
			WHERE c.password = '' 
			ORDER BY c.views DESC";
		break;
	case "lastest":
		$query = "SELECT p.id,p.user,p.userid,p.cat,p.title,p.bigimage,p.views 
			FROM {$pp_db_prefix}photos p 
			LEFT JOIN {$pp_db_prefix}categories c ON c.id=p.cat 
			WHERE c.password = '' 
			ORDER BY date DESC";
		break;
	case "random":
		$query = "SELECT p.id,p.user,p.userid,p.cat,p.title,p.bigimage,p.views 
			FROM {$pp_db_prefix}photos p 
			LEFT JOIN {$pp_db_prefix}categories c ON c.id=p.cat 
			WHERE c.password = '' 
			ORDER BY RAND()";
		break;
}
$result = mysql_query($query);

$counted = 0; $featured = "";

while ( list($pid, $puser, $puserid, $pcat, $ptitle, $photo, $pviews) = mysql_fetch_array($result)) {	
	if ( pp_is_image($photo) ) {
		$photolen = strlen($photo);
		$theext = pp_get_ext($photo);
		$photo_name = str_replace( $theext, "", $photo );
	
		$temp_user = $line['userid'];
		$thumbtag = "{$full_path}{$pcat}/thumbs/{$photo}";
		$mthumb = "<img border=\"0\" src=\"{$data_dir}{$pcat}/thumbs/{$photo}\" alt=\"$thumbtag\" />";
	
// One box for each feature
$featured .= <<<PPPRINT

	<tr align="center"><td align="center" class="alt-1">
		<a href="{$url_path}showphoto.php?photo={$pid}">$mthumb</a>
		<br />by {$puser}
	</td></tr>
	
PPPRINT;

		$counted++;
	}
	
	if ( $counted == 5 ) break;
}
mysql_free_result($result);


echo <<<PPPRINT
$tbopen
<tr>
<td class="tdheader" colspan="5" align="center">
Featured Photos
</td>
</tr>
$featured
$tbclose<br />
PPPRINT;

mysql_select_db ("name of uub7 database")or die("Could not select database");
 


This script generate the output itself and I don't know how to split it to a php part and a output part. While playing with it I get some results but not as it should. The main problem seems to me, that I hafe to switch back to the ubb7 database after I do the selects from the photo database. This doesn't work as it should.
Can you try to explain how this works in ubb7 as example for complex pal boxes?
_________________________
my board: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
#1513 - 07/20/06 10:45 AM Re: Problem with custom Portal boxes [Re: Zarzal]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10177
Loc: Aberdeen, WA
The first problem I see is at the bottom. This portion:

Php Code:

echo <<<PPPRINT
$tbopen
<tr>
<td class="tdheader" colspan="5" align="center">
Featured Photos
</td>
</tr>
$featured
$tbclose<br />
PPPRINT;
 


That should be:

Php Code:

$body = <<<PPPRINT
$tbopen
<tr>
<td class="tdheader" colspan="5" align="center">
Featured Photos
</td>
</tr>
$featured
$tbclose<br />
PPPRINT;
 


Anything that is going to be actually displayed in the portal box needs to be stored in the $body variable. If there are errors beyond that, I'll look more today.
Top
#1517 - 07/20/06 11:04 AM Re: Problem with custom Portal boxes [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1145
Loc: Berlin, Germany
thanks, but this seems to be a little bit beyond my abilities. I get:
Fatal error: Cannot redeclare pp_get_ext() (previously declared in /home/.../ubb7/cache_builders/custom/portal_box_4.php:7) in /home/.../ubb7/cache_builders/custom/portal_box_4.php on line 9

There must be more to do to bring this to work.
_________________________
my board: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
#1521 - 07/20/06 11:41 AM Re: Problem with custom Portal boxes [Re: Zarzal]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10177
Loc: Aberdeen, WA
Ok, there is a bug that is rebuilding the cache twice and it's redeclaring your functions. Here's the fix.

Edit admin/doeditcustomisland.php

Remove line 125 which is this:

rebuild_islands(1);
Top
#1533 - 07/20/06 01:25 PM Re: Problem with custom Portal boxes [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1145
Loc: Berlin, Germany
very well, it beginn to work. Great. Now I go to finish the layout. One step closer. When its done I post the whole code.
_________________________
my board: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
Page 1 of 2 1 2 >



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

Today's Birthdays
No Birthdays
Recent Topics
Marking a topic as 'read' manually
by sw55
Yesterday at 04:29 PM
How to add AD island?
by Conrad
Yesterday at 01:19 PM
Need to update from 6 to latest: can't until server checked
by Digilady
06/17/13 08:17 AM
Shout Box
by Bert
06/15/13 04:15 PM
Calendar
by Bert
06/15/13 04:11 PM
Forum Stats
11000 Members
36 Forums
33988 Topics
183528 Posts

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