Im (still) setting up a site for my university students in Manchester, England. The idea is that it's a site written FOR students, BY students, so that people can ask questions and get answers - keeping it interactive is the idea!
Anyways, your mission, should you choose to accept it is: I need to set up a way of people being able to personalise the way the content is displayed. What I need is, when someone clicks on a category, for example, "going out" all the news articles on "going out" are displayed but the rest are filtered out. I was kind of hoping to use PHP to do this and have looked for scripts (I can't write my own yet, but am trying to learn) but havent been able to find any. What I wanted really was to have a script that let me put something at the top of each report - such as Category="Going Out" and for a script to search for all of these and display them, when the "going out" category is selected.
Please, any ideas AT ALL are welcome. Cheers guys,
Rich
This message will self destruct in, errm... well, it wont really..... but you get the idea
If you stored each report for going out in a directory called, um lets see, 'goingout', then to output all those reports in PHP you'd use something like
<?
$dir=opendir("goingout");
while ($file=readdir($dir)) {
$foo=fopen("$dir/$file","r");
fpassthu($foo);
fclose($foo);
}
?>
Edit: Fixed daft syntax error!
(edited by: sugarkane at 7:07 pm (gmt) on July 17, 2001(edited by: sugarkane at 7:07 pm (gmt) on July 17, 2001
For example, for a report I write it in a txt file called report1.txt and then for another report, it's report2.txt
I would store all these files in a folder "goingout/reports" Each report has a format such as the following...:
Bar Name: Sofa
Rating: 8/10
Report: REPORT GOES HERE
So, what I want, is for a script to be able to pull the bar name out of the report and put in the first row of a table. Then the rating put in the second row of a table and finally the report itself put in the third row of the table. The reason why I want to put them in different rows of tables is to apply different formatting to the text (i.e. the bar name will be bold, whereas the report itself wont be). If you think you can get around this some other way, then please tell me!
Thanks sugar for the script, I haven't tried it yet, but it looks nice and simple!
Is there an adaptation I can make to it to do the above?
Rich
So, you'd have files called report1.html, report2.html etc in the 'goingout' folder, each one containing a snippet of html that would display the report in the way you want it.