there has to be a better way...
Posted: Fri Mar 06, 2009 11:12 pm
Currently my code is defined as follows:
BUT to read this I have as of right now the bottom of the file doing this...
Is there a better way to shorten up the code or make it smaller so I don't have to retype with filename1, filename2..etc... and not to have so many entries..
because what happens in the frontend is that if there's NO information added into the admin backend then I have just empty fields that are still clickable but of course no file will load because it's not configured... I hope I'm explaining this correctly...
Basically a code that would enable to pick up the multiple params and if nothing is entered it shows nothing... see what I mean?
Many thanks in advance!~!!
John

Code: Select all
<?php
$fileone = $params->get('fileone');
$filetwo = $params->get('filetwo');
$filethree = $params->get('filethree');
$filefour = $params->get('filefour');
$filefive = $params->get('filefive');
$filesix = $params->get('filesix');
$fileseven = $params->get('fileseven');
$fileeight = $params->get('fileeight');
$name1 = $params->get('name1');
$name2 = $params->get('name2');
$name3 = $params->get('name3');
$name4 = $params->get('name4');
$name5 = $params->get('name5');
$name6 = $params->get('name6');
$name7 = $params->get('name7');
$name8 = $params->get('name8');
$time1 = $params->get('time1');
$time2 = $params->get('time2');
$time3 = $params->get('time3');
$time4 = $params->get('time4');
$time5 = $params->get('time5');
$time6 = $params->get('time6');
$time7 = $params->get('time7');
$time8 = $params->get('time8');
?>
Code: Select all
<a class="prevPage"></a>
<div id="pl">
<div class="entries">
<a href="modules/mod_flowplay/clips/<?php echo "$fileone" ?>">
<?php echo "$name1" ?> <br />
<em><font color="red"><?php echo "$time1" ?> min</font></em>
</a>
<a href="modules/mod_flowplay/clips/<?php echo "$filetwo" ?>">
<?php echo "$name2" ?> <br />
<em><font color="red"><?php echo "$time2" ?> min</font></em>
</a>
<a href="modules/mod_flowplay/clips/<?php echo "$filethree" ?>">
<?php echo "$name3" ?> <br />
<em><font color="red"><?php echo "$time3" ?> min</font></em>
</a>
<a href="modules/mod_flowplay/clips/<?php echo "$filefour" ?>">
<?php echo "$name4" ?> <br />
<em><font color="red"><?php echo "$time4" ?> min</font></em>
</a>
<a href="modules/mod_flowplay/clips/<?php echo "$filefive" ?>">
<?php echo "$name5" ?> <br />
<em><font color="red"><?php echo "$time5" ?> min</font></em>
</a>
<a href="modules/mod_flowplay/clips/<?php echo "$filesix" ?>">
<?php echo "$name6" ?> <br />
<em><font color="red"><?php echo "$time6" ?> min</font></em>
</a>
</div>
because what happens in the frontend is that if there's NO information added into the admin backend then I have just empty fields that are still clickable but of course no file will load because it's not configured... I hope I'm explaining this correctly...
Basically a code that would enable to pick up the multiple params and if nothing is entered it shows nothing... see what I mean?
Many thanks in advance!~!!
John