Jump to content

adambedford

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

adambedford's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm writing a mini social network and I'm having trouble figuring out how to deal with privacy settings. I have established a range of privacy options (level 1-4): 1. Only Facebook friends can see profile (users connect via FB) 2. Only current classmates 3. Past + current classmates 4. All users in given group I am writing a function to return a list of available users based on a given parameter (eg. Find all classmates of a user). Obviously I have to respect users privacy settings, so I thought to query against all users with level 2 permissions, however I realise that I may miss out some classmates who are FB friends but have permission levels set to 1. Secondly, I'm looking to find out the relationship between two users (a function that I can plug in 2 user IDs and return their relationship...classmates, FB friends, past classmates, no relationship) which I can then use to determine whether a user has permission to view another users profile. I don't have much code as of yet, because I spent a long time exploring one avenue which I now realise to be the wrong one! Any suggestions/help would be greatly appreciated!
  2. hi, i have a database that looks something like this: +--------------+-------------------+-------------------+ | ce_id | ce_start_time | ce_cal | +--------------+-------------------+-------------------+ | 9 | 09:00 | 1105 | | 10 | 09:00 | 1105 | | 11 | 10:00 | 1105 | | 12 | 13:00 | 1201 | | 13 | 14:00 | 1201 | +--------------+-------------------+-------------------+ the ce_cal field refers to the year and period (11 = 2011 and 05 = period 5). i need to fetch the latest batch of records out of the table, ie those with the highest 'ce_cal' values. unfortunately, i don't know how to do this! any help would be appreciated, thanks!
  3. thanks for your suggestions. i need to view all days of the week (monday-friday) on the same page at the same time, however.
  4. Thanks for the reply. I have the following code (simple stuff right now): $sql_find_schedule = "SELECT * FROM tbl_ClassEntries WHERE ce_uid = '{$u_info['u_id']}'"; $query_find_schedule = mysql_query($sql_find_schedule) or die(mysql_error()); while($find_schedule = mysql_fetch_array($query_find_schedule)) { $recurrence = explode($find_schedule['ce_recurrence']); } I'm trying to group the records by day of the week, so I need some way of seeing what day they occur on (ie. What the contents of $recurrence is) and then displaying them under that day. Its possible that they'll occur multiple times in one week.
  5. Hi, I have a table (tbl_ClassEntries) that stores appointment information. One of the fields is 'ce_recurrence' which stores what days of the week the appointment occurs. The info is stored as a comma separated string (eg. Monday, Wednesday and Thursday would be 'm,w,th'). I'm querying this table and returning all appointments matching a certain user (field called: ce_uid) however I'd like to show a day by day list of the appointments (there will be multiple each day). I'm thinking that I need to loop through the recordset and then explode the recurrence string but then I'm stuck and don't know where to go from there. Any help would be really appreciated!
  6. With the addition of "==" instead of "=", thats done the trick, thank you!
  7. Thanks for the reply, the problem is that there aren't unique fields for each type of metadata (keywords, description etc). I have a field called met_Type and another called met_Content and there is a record for each type of metadata. Sorry is that doesn't make too much sense. Here is an e.g: | ------------|-------------------|--------------------------|-----------------------------| |met_ID |met_PageID | met_Type | met_Content | | ------------|-------------------|--------------------------|-----------------------------| |1 | 1 | keywords |blah, blah, blah | |2 | 1 | description |description here.... | | ------------|-------------------|--------------------------|-----------------------------| So I have about 7 records in total corresponding to each page, and each record holds one type of metadata.
  8. In my mind this is slightly more tricky than the usual while loop through a recordset, however I may be missing something really simple. I have a table (tbl_Metadata) that stores metadata about every page of my site. Each page has an ID, so there is a field in tbl_metadata called met_ID to associate the metadata with the corresponding page. Obviously, there are lots of types of metadata (keywords, description, language, ROBOTS etc all for SEO purposes) so each type gets a record of its own, which means that each page has about 7 records in tbl_metadata corresponding to it. I'm not sure this is the best way to achieve this, but I couldn't come up with a better solution so I went with it! My problem comes when adding/updating the contents of tbl_Metadata. I have a simple query that retrieves all records associated with a certain page ID. However, I then need to loop through these remaining records and assign the contents of 'met_Content' (where the actual metadata is stored) to local variables. I'm hoping to achieve something like this: $keywords = 'blah, blah, blah', $description = 'this is a description' and so on and so forth. I'm stuck as to how to do this! Please help!
  9. wildteen88: thank you for your suggestion! that looks like it will do the trick nicely! I'll test it out and hopefully I'll be able to report that all is working nicely.
  10. Thanks for your reply! What happens when the region is only 2 words, i.e. costa-blanca-3-bedrooms.html? Because then $details[2] would go from being the last word of the region to the number of bedrooms. Can I somehow discard the last element and extract a number from the array? Therefore leaving the region (with the varying number of words/elements)?
  11. I'm working on a website redesign and I'm under strict instruction to keep the URLs the same (they are static HTML pages) so I've figured out how to use mod_rewrite to redirect to my PHP script to decide what pages to include. My questions/problem is deciphering the original URL and extracting the info in order to make the right query/page include. The website is a villa rental site and the pages are formatted like this: costa-blanca-3-bedrooms.html. 1 problem is that the file names vary from costa-blanca-3-bedrooms.html to costa-del-sol-3-bedrooms.html to barcelona-3-bedrooms.html. As you can see, the region name differs in the number of words and therefore I can't use a strict template to extract the details into an array. My thoughts are that I could work backwards to automatically remove the last element of the array (which would be something like "bedrooms.html" as that info is useless. Then i could split my text/digits or work my way backwards, always knowing that the next element is going to be the number of bedrooms and what remains is going to be the region. How would I go about manipulating the array like this? Or does anyone have a potentially better solution? Any help would be really appreciated!
  12. Thanks for your suggestions! That returns the same server error...which most likely means that mod_rewrite IS enabled, but theres something wrong with it, right?
  13. Yeah it does, i get the same Internal Server Error message. I guess that means theres a problem with the server setup then? I've already contacted the hosting company and I'm awaiting a reply. Is there anything I can do in the meantime do you think? Unfortunately, I don't have access to any of the server config stuff because it's shared hosting.
  14. I'm using shared hosting so I don't get too much access to the server. I have checked, however, and they say that the mod_reqrite module is enabled. Any ideas why this is still not working? :S
  15. Having said that, I'm actually getting an error message using the following code: RewriteEngine on RewriteRule ^(.*)\.html$ url_rewrite.php?original_filename=$1 [L] The error message is: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@ and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.