Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2008, 01:30 AM
Panorado Panorado is offline
Member
 
Join Date: Sep 2007
Posts: 72
Downloads: 0
Uploads: 0
Default Dynamically load text from .txt file

Title pretty much says it all... have a delimited .txt file and would like to dynamically load the text fields from it... should be simple enouph... no? Anybody done this before?
Reply With Quote
  #2  
Old 05-04-2008, 01:52 AM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

Hey Panorado:

Hmmm -- dynamically load the text into what? How is it delimited? Sounds like something needing to have an XML format wrapped around it...
__________________
Patrick
http://patrickcheatham.com
Reply With Quote
  #3  
Old 05-05-2008, 06:09 PM
Panorado Panorado is offline
Member
 
Join Date: Sep 2007
Posts: 72
Downloads: 0
Uploads: 0
Default Hi Patrick

"dynamically load the text into what?"
Strait onto the screen of the Pano Window. For Example... If I have thumbnails of the next tour, I would like to have 'text' labels ontop of them that comes from the .txt file.

"How is it delimited?"
Well, could be anything... commas... whatever but I use '&' because that's what works with SwishMax

File is pretty simple... just regular old .txt
Smith,Brown,702-111-1111,sb@yahoo.com

like that.

Actually... I prefer not to use .xml I love .xml but the database I use (Alpha 5) does not have a good .xml exporter.

The file would have to be 'loaded' separately from the .xml I think... with a 'plugin' maybe... OR... if the pano .xml could support dynamically loaded text at hotspots that would be great! I guess I could write a little program to swap in out my .txt data in the .xml file.

Oh man... I have to learn PHP and MySQL... enough with this local stuff... everthing is dynamic online these days!
Reply With Quote
  #4  
Old 12-03-2008, 04:10 PM
Captain Canary Captain Canary is offline
Junior Member
 
Join Date: Apr 2008
Posts: 4
Downloads: 0
Uploads: 0
Default Dynamically load text from .txt file

Hi

I have been asked by a client if it is possible to dynamically load text from a database.

The idea is to have all hotspots show different text taken from the database.

Is this possible. If so could I see a sample and the code?

Many thanks
Reply With Quote
  #5  
Old 12-07-2008, 12:19 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default Re: Dynamically load text from .txt file

Panorado,

with the help of Trevor White, I have been testing a couple of solutions for providing a text box in FPP. I can't say I've come all the way yet, but at least they are working.

First, there is a plain text box plugin. The text in this box can be provided in two ways:
  1. Directly in the XML file in the text="..." attribute of the <spot> tag.
  2. From a separate file containing any number of texts, in which case you simply write text="#nn" in the XML file.

Both are handled with the same textbox.swf plugin, but if you want to use option 2 you also have to load the texts.swf plugin which handles the text collection file.

Of course you can set options as font, size, color, bgcolor, border and a few other things.


Secondly, I wrote a HTML plugin, htmlbox.swf, which can show a box containing the (pretty limited) HTML supported by the Adobe textField component. Here you also have two choices when providing the box content:
  1. Directly in the html="..." attribute. Not very practical for more complex messages, because you have to encode all < > " ' characters as entities (ie. &lt;...) in a XML file.
  2. By using the htmlfile="..." attribute. In this case, all HTML is read from the file specified - and it doesn't have to be entity encoded .

I have some test pages here:
simple text box, texts loaded from file and a HTML box

Zip files (with plugin and documentation):
textbox.swf, texts.swf, htmlbox.swf

XML files:
simple text box, texts loaded from file, HTML box

Text file

HTML file


Any form of constructive critizism would be received gratefully!

Regards,
Tommy

Last edited by allSaints; 12-07-2008 at 01:08 PM.
Reply With Quote
  #6  
Old 12-07-2008, 03:56 PM
phberlin's Avatar
phberlin phberlin is offline
Senior Member
 
Join Date: Aug 2007
Location: Berlin, Germany
Posts: 300
Downloads: 1
Uploads: 0
Default

Hey allSaints,

wow, this really looks very promising! Thanks so much for sharing! Unfortunately, I don't have the time to give it a try and investigate all of its possibilities, but I surely will as soon as I have a chance to do so...

Thanks again! Philipp
Reply With Quote
  #7  
Old 12-07-2008, 07:05 PM
Virtualguide's Avatar
Virtualguide Virtualguide is offline
Senior Member
 
Join Date: Sep 2007
Posts: 224
Downloads: 2
Uploads: 0
Default

aS,
just GREAT GREAT GREAT!
Thanks for sharing too!!!
Igor
Reply With Quote
  #8  
Old 12-08-2008, 02:15 PM
broma broma is offline
Member
 
Join Date: Dec 2007
Location: Italy - Calabria -
Posts: 52
Downloads: 0
Uploads: 0
Default

Hi Tommy,
first of all thanks for sharing. I am asking you, is possible use <box> instead of <spot>? If yes please can make basic example.

Thanks for interest.
Bruno Napoli
Reply With Quote
  #9  
Old 12-08-2008, 02:19 PM
phberlin's Avatar
phberlin phberlin is offline
Senior Member
 
Join Date: Aug 2007
Location: Berlin, Germany
Posts: 300
Downloads: 1
Uploads: 0
Default

@allSaints: I gave it a short go now and want to thank you again! It's really simple and straight forward.

The only problem I've realised is: If one uses either a comma (",") or a semicolon (";") in the texts, the text cuts up at the very position the character is used. Is there a way to have it also parse commas? Also, it simply does not parse special characters like the German umlauts ("?,?,?,?") for example, although I tried setting "utf-8".

EDIT: Setting "charSet=iso-8859-1", "?,?,? and ?" are parsed perfectly :-) But I still could find no solution for commas and semicolons...

And I have a second suggestion/question: Could it be possible to use percentage values instead of absolute pixel values for width and height? This would be awesome for fluid design panos like in lightboxes and so on where you don't know the pano's dimensions...

Again, thanks a lot for sharing!
Philipp

Last edited by phberlin; 12-08-2008 at 05:16 PM.
Reply With Quote
  #10  
Old 12-08-2008, 06:27 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Thank you guys for your being so quick to respond!

Some bugs that you can't find yourself always sneak into the code, so I might as well let you find them.

Philipp:
The texts from the text file always pass thru FPP, so that's why the comma and semicolon characters acts as delimiters. I should have thought of that! Well, it's fixed now - new zip files are uploaded.

Regarding the "????" problem - I noticed your EDIT - fine, because I couldn't find any problems myself. Here is a link to a test page with utf-8 characters.

I'm not sure how you imagine setting width and height with a percentage. Maybe it's possible to get a resize event to wake up the plugin, get the pano size and resize the text box accordingly, but that would not change the size of the text font. Please tell me if I misunderstood your suggestion.

Bruno:
A <box> works just as well with the plugin. Here is a test page. I included the "editor.swf" plugin so you can play with the settings. Just choose the "mytext" object in the editor.


Regards,
Tommy
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 04:27 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.