1
technigrafa
PHP and theme.html

Hello,

I am trying to figure out how I can pull in XOOPS block content into a Flash Dynamic Text block. If I can get this to work, it would open up all kinds of design possibilities.

Flash can import variables that PHP creates with the print command, like this:
print "¢erblock=block content here";

But when I try this in my theme file with blocks:
<{php}>
print 
"&centerblock=<{foreach item=block from=$xoops_ccblocks}> 
<TABLE CELLSPACING=1 CELLPADDING=5 WIDTH=100%>
<TR> 
<TD CLASS=blockTitle><
{$block.title}></TD>
</TR>
<TR> 
<TD CLASS=blockContent><
{$block.content}></TD>
</TR>
</TABLE>
<{/foreach}>"
;
<{/
php}>

I get:
Parse error: parse error, unexpected '.', expecting '}'


I also tried the fwrite command to write the block info to a text file on the server that Flash can read:

<{php}>
$centerblock="<{foreach item=block from=$xoops_ccblocks}> 
<TABLE CELLSPACING=1 CELLPADDING=5 WIDTH=100%>
<TR> 
<TD CLASS=blockTitle><
{$block.title}></TD>
</TR>
<TR> 
<TD CLASS=blockContent><
{$block.content}></TD>
</TR>
</TABLE>
<{/foreach}>"

$myFile "centerblock.txt";
$fh fopen($myFile'w+') or die("can't open file");
$stringData $centerblock;
fwrite($fh$stringData);
fclose($fh);
<{/
php}>


But that doesn't seem to work. I don't see the centerblock.txt file anywhere, although I am not sure where it would put it--in the theme directory, or the root dir where index.php is?

Anyway, maybe I am going about this all wrong and should be pulling data directly from the database.

Can anyone help me out?

2
adrock
Re: PHP and theme.html
  • 2005/9/2 22:22

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


it may have to do with the fact that in order for the XOOPS code to be interpreted correctly, the includes from the header file need to be there.

Look at a regular theme and the php files included with the modules you intend to incorporate into flash to see which files will need to be included (defined) for the XOOPS codes to work.

I haven't tried using the codes in flash yet, but that would be where I would start!

Let us know how it goes!

Happy Xoopsing!
Affordable Web Hosting - Family - Fun!...and not always in that order!

3
Lance_
Re: PHP and theme.html
  • 2005/9/2 22:38

  • Lance_

  • Home away from home

  • Posts: 983

  • Since: 2004/1/12


I have a .txt file with my flash banners text in it, in order to have the text appear in the flash I had to put (from pod's suggestion) the text file in the XOOPS root and in the folder of each module for it to appear all the time.

I have not found another way of doing it since.

Cheers.
GDL-Web.com :: Website development.
Xoopslance.com::Freelancing and Projects
thelionsden-arena.net:: Clan/League/Ladder Hosting

4
technigrafa
Re: PHP and theme.html

Thanks guys. Yeah, I am wrapping the flash file inside of the XOOPS header and footer. I found some tutorials that explain how to pull in variables that PHP makes into Flash. I can get it to work with a simple PHP script, but not from within the XOOPS template. It doesn't help that I am not much of a programmer, but I am trying!

Here's the info I've found out about doing these things:

Calling PHP functions from Flash:
http://www.flashkit.com/tutorials/Dynamic_Content/calling_-Mirza_Ha-837/index.php

Integrating Flash and MySQL:
http://www.flashkit.com/tutorials/Dynamic_Content/Integrat-Vin-916/index.php

Importing text files into Flash:
http://www.flashkit.com/tutorials/Dynamic_Content/Importin-Iain_Bla-1020/index.php

Using loadvariables to import PHP infor without test files:
http://www.actionscripts.org/tutorials/intermediate/loadVariables_script_interaction/index.shtml

Using Flash with PHP and MySQL:
http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm


I hope that these tutorials are helpful to others. I am not having a lot of luck making them work with Xoops.

I am thinking I may have to just pull info directly from the database. I will keep experimenting and post here if I come across anything cool.

Thanks!

Login

Who's Online

167 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 167


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits