Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
custom page view

 

 


ChrisTitchenal
User

Mar 20, 2008, 7:27 AM

Post #1 of 7 (532 views)
Shortcut
custom page view Can't Post

Hello All,

Alright I am close to having this worked out I am sure it is just a matter of formating it correctly. here is my code for the xml file



Code
 <?php 
require_once "/home/ragefoot/public_html/cmsAdmin/lib/viewer_functions.php";
$options = array(); // NOTE: see online documentation for more details on these options
$options['tableName'] = 'player'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
$options['recordNum'] = ''; // (optional) Record number to display. Example: "1"; Defaults to number on end of url, then 1
$options['where'] = "dancer_slide_show = 'name'"; // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
$record = getRecord($options);
?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<trackList>
<?php foreach (getUploads($options['tableName'], 'dancer_slide_show', $record['num']) as $upload): ?>
<track>
</location>http://www.ragefootball.com/cmsAdmin/uploads/Dancers/<?php echo $upload['filename'] ?><location>
</track>
<?php endforeach ?>
</trackList>
</playlist>


I get "Page Viewer (player): MySQL Error: Unknown column 'dancer_slide_show' in 'where clause'"

With that I am sure all I need to do is define the field dancer_slide_show with a value of just one dancer like her name so it shows just the pictures uploaded in her entry. because the xml file is a separate file I am not sure it can look up the url and get the number. Let me know if any of you smart people can shed some light on this.

Thanks
Chris


Dave
Staff / Moderator


Mar 20, 2008, 10:45 AM

Post #2 of 7 (529 views)
Shortcut
Re: [ChrisTitchenal] custom page view [In reply to] Can't Post

Hi Chris,

So 'dancer_slide_show' is an upload field in the 'player' section (or will be a field)? Is that right? Or will there be a separate section for dancers?

Either way you'd probably want to lookup the dancer by player (or dancer name) or record number.

Are the dancers in the same record and section as the players or how will they be stored?

Dave Edis - Senior Developer
interactivetools.com


ChrisTitchenal
User

Mar 20, 2008, 11:09 AM

Post #3 of 7 (524 views)
Shortcut
Re: [Dave] custom page view [In reply to] Can't Post

Hey Dave

Let me try to explain the structure of the CMS better.
I made a Section called player ( now looking back I should have named it staff) That is where everyone is listed dancers,players,coaches, and office personal. It has there name hight weight ect.. all there bio information. Inside that Section is an upload box named dancer_slide_show. That is where I want them to upload only the pictures they want to show in the slide show.

So when they click the read more on a dancer it pulls up the dancerPage.php That contains the flash file slide show on it and with any luck starts displaying the matching girls photos.

So I need in the page view in the xml for it to match the dancers personal entry in the players section so it displays just the pictures uploaded to just her.

If your still thinking English is my second or third language Tongue I will try to rephrase my question again. if you could write the syntactic of how I would define
$options['where'] = to check the field dancer_slide_show = the name field That in my little knowledge of php should be how it can match up the pictures uploaded to the girl.

Thanks
Chris


ChrisTitchenal
User

Mar 20, 2008, 1:46 PM

Post #4 of 7 (516 views)
Shortcut
Re: [ChrisTitchenal] custom page view [In reply to] Can't Post

Alright been messing with the code


Code
 <?php 
require_once "/home/ragefoot/public_html/cmsAdmin/lib/viewer_functions.php";
$options = array();
$options['tableName'] = 'player';
$options['recordNum'] = '90';
$options['where'] = '';
$record = getRecord($options);
?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<trackList>
<?php foreach (getUploads($options['tableName'], 'dancer_slide_show', $record['num']) as $upload): ?>
<track>

<location>http://www.ragefootball.com/cmsAdmin/uploads/Dancers/<?php echo $upload['filename'] ?></location>
</track>
<?php endforeach ?>
</trackList>
</playlist>


Will get me the image to load.

I had to tell it a recordNum to get it to do that. So now I need to figure out how to pass a number to it and have it display the matching ones.

Thanks


(This post was edited by ChrisTitchenal on Mar 20, 2008, 1:51 PM)


Dave
Staff / Moderator


Mar 20, 2008, 1:48 PM

Post #5 of 7 (516 views)
Shortcut
Re: [ChrisTitchenal] custom page view [In reply to] Can't Post

Ok, I think I got it. You have a page called dancerPage.php that shows details on specific dancer, but you don't want images shown on that page directly, because you're using a flash slideshow (_on that page_) which needs to load the images from an XML config file. Is that right?

If it is, you'd probably display dancer pages with an url like this: dancerPage.php?dancer-name-3/

If so, just blank out the where option on your XML page (I'm going to pretend it's called dancePageXML.php) and link to it directly the same way: dancerPageXML.php?dancer-name-3/

The part after the ? in the url is called the "query string" and you can link from dancerPage.php to dancerPageXML.php like this to pass it along:


Code
dancerPageXML.php?<?php echo @$_SERVER['QUERY_STRING']; ?>


Let me know if that works. You can test it during development by linking directly to urls like dancerPageXML.php?3 and viewing source and making sure it's creating the right XML.

Hope that helps, if I totally misunderstood let me know! ;)

Dave Edis - Senior Developer
interactivetools.com


ChrisTitchenal
User

Mar 20, 2008, 2:23 PM

Post #6 of 7 (510 views)
Shortcut
Re: [Dave] custom page view [In reply to] Can't Post

Trust me Tom I am the more confused one. You are talking to a guy that has a portfolio full of Illustrator work so yeah my job description has changed a lot. I got your message at the same time as I posted my update. If you go to
http://www.ragefootball.com/dancerPage.php?96/
you will see the slide show in action.
On dancerPage.php I have this code

<script type="text/javascript">
var so = new SWFObject('http://www.ragefootball.com/test/imagerotator.swf','mpl','275','418','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','418');
so.addVariable('width','275');
so.addVariable('file','http://www.ragefootball.com/test/imagelist.php.xml');
so.addVariable('transition','fade');
so.addVariable('enablejs','true');
so.addVariable('linkfromdisplay','true');
so.write('player');
</script>

I could write it like this if you think it would help

Code
<embed 
src="http://www.ragefootball.com/test/imagerotator.swf"
width="275"
height="418"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="height=418&width=275&file=http://www.ragefootball.com/test/imagelist.php.xml&transition=fade"
/>

With the imagelist.php.xml looking like this

Code
 <?php 
require_once "/home/ragefoot/public_html/cmsAdmin/lib/viewer_functions.php";
$options = array();
$options['tableName'] = 'player';
$options['recordNum'] = '90';
$options['where'] = '';
$record = getRecord($options);
?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<trackList>
<?php foreach (getUploads($options['tableName'], 'dancer_slide_show', $record['num']) as $upload): ?>
<track>

<location>http://www.ragefootball.com/cmsAdmin/uploads/Dancers/<?php echo $upload['filename'] ?></location>
</track>
<?php endforeach ?>
</trackList>
</playlist>

So that gets to the point I am at.
you can view the xml file output by going here
http://www.ragefootball.com/test/imagelist.php.xml
I tried to place

Code
dancerPageXML.php?<?php echo @$_SERVER['QUERY_STRING']; ?>

in the xml file at the $options['where'] = ''; and got this error "Parse error: syntax error, unexpected T_STRING in /home/ragefoot/public_html/test/imagelist.php.xml on line 6"

I know we are close Dave I can feel it or I would have told the client not that can't be done LOL.

Thanks for your time
Chris


Dave
Staff / Moderator


Mar 20, 2008, 2:56 PM

Post #7 of 7 (507 views)
Shortcut
Re: [ChrisTitchenal] custom page view [In reply to] Can't Post

Ok, in dancerPage.php change the 'file' line to this:


Code
so.addVariable('file','http://www.ragefootball.com/test/imagelist.php.xml?<?php echo @$_SERVER['QUERY_STRING']; ?>');


So it passes the record number to the php xml file. Next, in imagelist.php.xml change the recordNum option to this:


Code
$options['recordNum'] = '';


So it loads the record number from the url.

If that doesn't do it, feel free to email me FTP and I can get in there and take a look.

Hope that helps! :)

Dave Edis - Senior Developer
interactivetools.com


(This post was edited by Dave on Mar 20, 2008, 3:01 PM)

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4