Switch17
Newbie   Posts: 6 Registered: 3/17/2003 Status: Offline
|
posted on 3/19/2003 at 11:26 PM |
I hope this makes sense to someone here.
I have a file called 'file_definitions.php' that is used to call in all of
my files, and looks something like follows:
<?$query = "SELECT latest_week FROM week_index WHERE season=
2002";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
if (!isset($week)) {
$week=$row[0];
$lastweek = $week;
}
else $lastweek = $row[0];
if (!isset($report)) $report=0;
$SYWC = "02";
if ($week < 10) $SYWC .= "0";
$SYWC .= $week;
$ext = ".php?week=".$week."&report=";
$FL[0] = "_standings".$ext."0";
$FL[1] = "_tiebreaker".$ext."1";
$FL[2] = "_allstars".$ext."2";?>
Is there a simple way that I can include this file and then to link in each
of my pages? I need to try to do this as my file names vary based upon
what week I am in, and I don't want to edit every link each week. |
| |
| |
shawn
Administrator   Posts: 4608 Registered: 10/7/2002 Status: Offline
|
posted on 3/19/2003 at 11:42 PM |
If I'm understanding correctly, you could add the following to the end of
your file and then call the file with PostWrap:
echo "<a href=\"$FL[0]\">standings</a>";
echo "<a href=\"$FL[1]\">tiebreaker</a>";
echo "<a href=\"$FL[2]\">allstars</a>";
Probably needs tweaking as I have no idea what your dirs and stuff are, but
this will print links to your files and when clicked load that file.
HTH
-Shawn
|
| |
Switch17
Newbie   Posts: 6 Registered: 3/17/2003 Status: Offline
|
posted on 3/20/2003 at 12:55 PM |
Thanks Shawn. I'm relatively new to postnuke and php, but I've learned a
ton, and understand what your saying. What I'm trying do is convert an
existing menu system I have to work with postnuke, and using postwrap.
That file above is naming all of the file names, and I have another
menu.php file something like this to for all the current links.
code: <tr><td> <a
href="<? echo($antes.$SYWC.$FL[0].$options); ?><span
class=box2> Scores and
Standings</span></a></td></tr>
<tr><td> <a href="<? echo($antes.$SYWC.$FL[1].$options);
?><span class=box2> Tiebreaker
Summary</span></a></td></tr>
<
/blockquote>
But I'm uncertain of where I need to include the file so that postwrap can
find the file name. I think thats my first step in getting this to work
correctly.
|
| |