Jump to content

FishSword

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by FishSword

  1. I have the following menu that changes to red if each of the menu items are hovered over. This menu shows on every page of my website. I have the following problem: If a user was to click a menu item (e.g. Menu 2), the page will navigation to the page set in the a tag (i.e page2.html) If the user was to leave there mouse in the same position as it was in before the menu item was clicked (i.e. over the selected menu item), then the menu would automatically change to red again on the new page, as the jQuery hover code below will be activated. Is there a way to stop this behaviour? Ideally I want users to have to mouse off of the menu item and then on it again before the menu item changes to red if the users mouse is still over the selected menu item after clicking one of the menu links. <script type="text/javascript"> $(document).ready(function() { $('li').hover(function() { $(this).css('background', 'red'); }, function() { $(this).css('background', 'none'); }) }) </script> <ul> <li><a href="page1.html">Menu 1</a></li> <li><a href="page2.html">Menu 2</a></li> <li><a href="page3.html">Menu 3</a></li> </ul>
  2. I can convert PSD, JPG plans/mockups etc into valid HTML for a very resonable price. Get in touch for a quote. Contact: PM MSN - fishsword@live.com eMail - fishsword@live.com Skype - fishsword.skype Save Money Per Hour: I Charge Per Project FishSword "Have you been hooked yet?"
  3. These isn't any. The attached file is to demonstrate what I'm trying to do. All the code I have so far has been posted in this thread.
  4. Hi vpros, I have sent you a PM. With the same title as this thread! Cheers, FishSword
  5. I am still stuck with this. I have attach a .zip file containing what I am trying to achieve. Example.zip
  6. Thanks for your response, it's much appreciated. My aim is to create a vertical page menu using <ul>'s. Upon a user clicking a parent menu item, they will taken to a different page where the content of the selected page will be displayed. Any child pages will be displayed as <li>'s of a child <ul> in the menu, underneath the relevent paten in the menu. Child pages need to be visible only when the parent page, or child pages belonging to the parent have been selected. I'm guessing I will need to check if the user is in a parent or child page of the parent, in order to show any relevent child pages?
  7. I have a problem with my code. What is the best way to display all sub pages for a parent page regardless of whether or not you are viewing the parent or child pages? If a different parent is chosen, then the child pages of the previously selected parent should be hidden. All pages have a id vairable in the URL that is available using $_GET['id']. My MYSQL DB looks like this. CREATE TABLE IF NOT EXISTS `pages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `parent` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8; With the code I have currently, the child pages display if you are on the parent page, but as soon as you jump to any of the child pages, the child pages disappear. $gParents = mysql_query('SELECT * FROM db.pages WHERE parent = 0'); while($parents = mysql_fetch_assoc($gParents)) { echo '<a href="?id='.$parents['id'].'">'.$parents['title'].'</a><br />'; $qChilds = mysql_query('SELECT * FROM db.pages WHERE parent = '.$parents['id'].' AND parent = '.$_GET['id']); while($childs = mysql_fetch_assoc($qChilds)) { echo '<a href="?id='.$childs['id'].'">'.$childs['title'].'</a><br />'; } }
  8. Hi Folks, I'm in two minds whether or not to start using proper freelance websites. I have created a simple poll, in order to find out what you think of these websites, and would be extremely interested to hear what you have to say. Please be honest, and post your thoughts. Cheers [[ Due to technical constraints, this thread's poll has been edited to have only one question. Current vote counts: Do you use a freelance website?Yes: 1 No: 2 What annoys you most about these websites?High Fees: 1 Not many suitable jobs: 1 Other (Reply in thread): 1 What feature on these sites would you introduce/improve and how if you had a chance?Better Support: 0 Lower Fees: 2 Other (Reply in thread): 1 --requinix ]]
  9. I have no choice. The databases have already been created.
  10. I have 10 MySQL databases that feature the same table structures/names in each. The table I am partically interested in is the Users I need a way to display/paginate the results from each of the Users tables, and sort the data by category_colour The table fields are: id: INT(11) name: varchar(255) - e.g. Dave, Lisa, Steve category_colour: char(1) - Can be G = Green, O = Orange, B = Blue, O = Orange. If I was to do this without paginate, there would be too many results, and the server would take an age to display them all. I need the results to be categorized and in order of category_colour (1st: Red, 2nd: Green, 3rd: Blue, 4th: Orange) - Displaying the users database id OUTPUT EXAMPLE: Category Colour: Red Dave - 1 Steve - 5 Fred - 4 etc Category Colour: Green Richard - 6 Kelly - 8 etc. Category Colour: Blue Emma - 3 Scott - 2 Louise - 7 etc.
  11. Thanks for this. Would it be possible to post an example on how I would replace the contents of the tags shown in my first post?
  12. Hello there, Using PHP, what's the best way of replacing the contents between different HTML 5 element tags on the fly? Some of the elements I'm looking to change can be found below. I have looked into the possibility of using Regular Expressions, but have found lots of material on the internet that try to prevent you from using such a method for parsing HTML due to speed and other HTML code related issues. Any help, example code, and ideas on this is greatly appreciated. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Some Title</title> </head> <body> <div>Replace contents of div tag.</div> <p class="someClass">Replace contents of p tag.</p> <table> <tr> <th>Static Table Heading 1</th> <th>Static Table Heading 2</th> <th>Static Table Heading 3</th> </tr> <tr> <td>Replace Table Data 1 Contents</td> <td>Replace Table Data 2 Contents</td> <td>Replace Table Data 3 Contents</td> </tr> <tr> <td>Replace Table Data 4 Contents</td> <td>Replace Table Data 5 Contents</td> <td>Replace Table Data 6 Contents</td> </tr> </table> </body> </html>
  13. This information is in it's own table. This table only contains information about the sessions, not user information such as username, and password etc. When I say one table I mean can the total number of users online in the last 15 minutes and today be calculated from the same table, rather than duplicating information? I need to know the total users, total logged in and total guests for both. I'm a little stuck with the guests, as what happens if the users logs out?
  14. I need to know the total users, for both the last 15 minutes, and today, Isn't it best to keep this information in just one table if possible, else aren't you duplicating information?
  15. Hiya! , I'm currently working on a script that will allow me to track the total users on my website, and how many of these user are logged in members, or guests. I need to be able to find out the total users, total logged in, and total guests within the last 15 minutes, and the total users, total logged in, and total guests for today. Ideally, I would like to user only one table for this, and would also like to group together records in the database that have the same users_id and ip_address, as there's not much point in storing this more than once. I currently have a table that contains the following fields. sid - Stores the users session ID. user_id - Stores the user id of a logged in user. 0 is stored if the user is a guest. ip_address - Stores the IP address of the user. last_updated - Stores a timestamp of when the user was last active. I look forward to reading your responses Cheers!
  16. Hiya, What's the best way of finding out and displaying the total number of users currently online, along a breakdown of how many of these users are members or guests? I also wish to find out and display the total number of users who were online today, along with a breakdown of how many of these users are members or guests. I've noticed that users of the same computer could of course use a different browser preference to another user of the same computer. What should happen in this situation? Any help is much appreciated. Cheers!
  17. Hi Crayon Violent, Thanks for your reply. What happens when you create a pagination script for example? You will then be mixing HTML with the PHP? I'm not that keen on using a framework, as I'm afraid this would drastically increase the development time of my project, due to the learning curve involved. After all, am I correct in saying that using a framework is not a requirement, and not all frameworks may suite the project. Due to this, I rather keep things as simple as possible, but I would still like to know the best way of linking files together, as well as outputting error messages to the user if a user incorrectly completes fields that the page requires, whilst separating the presentation code from the logic. Cheers for you help! Many Thanks, FishSword
  18. Hiya! , I've been thinking long and hard about the best way to structure the code for a project I'm currently working on, to allow for easy development and management. Upon carrying out a search on the internet relating to this subject, it has been mentioned more than once, that it is a good idea to separate presentation code from logic (e.g. HTML from PHP) I am keen to obtain a better understanding on how you guys would code a simple page that displays information from a database and requires some sort of user input, whilst allowing for error messages to be displayed, if the user incorrectly completes what was asked of them. Also, I'm currently looking into the best way to link different pages together within my application. I've checked out some forum software (phpBB, myBB and smf) for inspiration and they all tend to link to different pages of the website via a main index.php file, containing a switch statement. Is this the best way, or are there other techniques that could be used? - What are the advantages/disadvantages of this approach? Of course, choosing the best structure to use at the beginning of a project is highly important, as this will then need to be adopted throughout the application. If you could provide examples of code or point me in the right direction, it would be much appreciated. Many Thanks, FishSword
  19. What should the session contain, and what should the session match with to allow the user to be logged. I have research on the internet that session id's can be easily changed if the site is being hosted on shared hosting. is there any way to prevent this. I have also found out that sessions can be hijacked. How do I prevent this?
  20. Hiya! , I'm currently working on a user login script at the moment, but I'm not sure what should happen when the user logs-in? How would the system keep a record of whether the user has already authenticated? Many Thanks, FishSword
  21. Hiya, Is it possible to check and log website content changes, using PHP? If any changes are found, then an alert should be shown. Many Thanks, FishSword
  22. Hiya , Is it possible to store PHP error messages in a MySQL database? Many Thanks, FishSword
  23. Hi, Thanks for your reply. How would you achieve this, using preg_match? I also found out that this can be done using strpos, strlen. Which would you say is the best out of the above two, and how would each solution be achieved? Thanks for your help. FishSword
  24. Hiya! I have a file (see attached) that contains basic HTML for a page with multiple paragraphs. How do I check the length of each paragraph to find out if it is 30 characters or over? If the first paragraph is not equal to 30 characters, then it should move on to the next one, and so on. If a paragraph is found to be the correct length, I then need to extract the text from the <p> tags. If a none of the paragraph match 30 characters in length, then the code will need to choose the best length paragraph. Any help is greatly appreciated. Many Thanks, FishSword [attachment deleted by admin]
×
×
  • 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.