Jump to content

JustLikeIcarus

Members
  • Posts

    430
  • Joined

  • Last visited

Everything posted by JustLikeIcarus

  1. As kickstart mentioned your 2 best options are having a table specifying the order or another column in that table specifying the order. These would be best when it comes to optimization however you could also do ORDER BY FIELD(school_name, 'USC') desc, school_name school_name would be the name of your column containing... well the school names
  2. Change the code to: $sql = "SELECT COUNT(id) FROM table WHERE column LIKE '%" . implode("%' AND column LIKE '%", str_split($input)) . "%'"; See if that works.
  3. Oh. Well thats normal get functionality. Just change your forms method="get" and change <input type="text" name="email" value="" /> To <input type="text" name="E" value="" /> And <input type="password" name="password" value="" /> To <input type="password" name="P" value="" />
  4. You actually shouldnt even need the urldecode() function. The $_GET['E'] value should have the normal "@" already. $_GET is a php array containing values passed as a query string. So whatever you have that needs to use the submitted email just set <? $email = $_GET['E']; ?> This would be after the form is submitted.
  5. Looks like the function the_permalink() is doing its own echo. So try it like this. <?php $recent = new WP_Query("cat=1&showposts=6"); $i = 0; while($recent->have_posts()) : $recent->the_post(); if($i == 0){ echo '<h1><a href="'; the_permalink(); echo '" rel="bookmark">'.the_title().'</a></h1>'; if (function_exists('the_content_limit')){ the_content_limit(195, "<span class='read-more'>Read more »</span>"); } }else{ echo '<h4><a href="'; the_permalink(); echo '" rel="bookmark">'.the_title().'</a></h4>'; the_content_limit(130, ""); echo '<div class="hppostmeta">'; echo '<p>'.the_time('F j, Y').' | <a href="'; the_permalink(); echo '" rel="bookmark">Read the story »</a></p>'; echo '</div>'; } echo '<div style="clear:both;"></div>'; $i++; endwhile; ?>
  6. Your going to have to look at the source html thats being outputted and that should show you why this is happening. Then just change the echo statements to produce the corrected results. Post the generated html if you need help with that.
  7. That is the correct way an "@" symbol should be passed in the url. Then urldecode($_GET['E']) should return it to an "@".
  8. LOL Grrrr the $i++ is missing its semi. $i++; should be the last woops
  9. The . and ' are backwards here <a href=".'the_permalink().'" should be <a href="'.the_permalink().'"
  10. Try sendmail.exe available at http://glob.com.au/sendmail/
  11. This is easiest to do with lists and css. take a look at http://css.maxdesign.com.au/listamatic2/horizontal04.htm
  12. Yeah mrMarcus beat me to it... Hopefully thats the last error youll have before seeing if it actually produces the results you want. lol
  13. Sorry about that try it now. <?php $recent = new WP_Query("cat=1&showposts=6"); $i = 0; while($recent->have_posts()) : $recent->the_post(); if($i == 0){ echo '<h1><a href="'.the_permalink().'" rel="bookmark">'.the_title().'</a></h1>'; if (function_exists('the_content_limit')){ the_content_limit(195, "<span class='read-more'>Read more »</span>"); } }else{ echo '<h4><a href="'.the_permalink().'" rel="bookmark">'.the_title().'</a></h4>'; the_content_limit(130, "") echo '<div class="hppostmeta">'; echo '<p>'.the_time('F j, Y').' | <a href=".'the_permalink().'" rel="bookmark">Read the story »</a></p>'; echo '</div>'; } echo '<div style="clear:both;"></div>'; $i++ endwhile; ?>
  14. Yeah that would need to be between the php tags
  15. Look into Apache mod_rewrite. I think its the direction you will need to go.
  16. Can you show me what your doing now? I want to see what your rules are checking.
  17. Per the php manual the __FILE__ magic constant returns the path and the file name. Its strange that the way you have been doing it was working correctly since it was going <file>/../ which isnt a valid path. so your better changing it now to save any future headaches. Maybe this way? include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Page.inc.php');
  18. How about this? $recent = new WP_Query("cat=1&showposts=6"); $i = 0; while($recent->have_posts()) : $recent->the_post(); if($i == 0){ echo '<h1><a href="'.php the_permalink().'" rel="bookmark">'.php the_title().'</a></h1>'; if (function_exists('the_content_limit')){ the_content_limit(195, "<span class='read-more'>Read more »</span>"); } }else{ echo '<h4><a href="'.php the_permalink().'" rel="bookmark">'.the_title().'</a></h4>'; the_content_limit(130, "") echo '<div class="hppostmeta">'; echo '<p>'.the_time('F j, Y').' | <a href=".'php the_permalink().'" rel="bookmark">Read the story »</a></p>'; echo '</div>'; } echo '<div style="clear:both;"></div>'; $i++ endwhile;
  19. Try this include_once(__DIR__ . DIRECTORY_SEPERATOR . 'Page.inc.php');
  20. Im so confused now. You may want to clarify a bit more. Unless it's just me not understanding what you need.
  21. Just an idea but why not layout the table like follows: create table jobs ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, description TEXT, startdate DATE, enddate DATE, occurrence VARCHAR2(25), created_by VARCHAR2(50), completed_by VARCHAR2(50), completion_datetime DATETIME, completion_comments DATETIME, completed TINYINT) Then you could just select from the one table and then loop through the results doing something like: $status = ($row[completed] == 1) ? '<img src="img/tick2.gif">' : '<input name="checkbox[]'" type="checkbox" value="'.$jobs_id.'">'; echo "<td class='txt' align='center' height='25'>$status</td>"; Im normally really big on db normalization however im not sure the data your storing warrants it. Just my 2 cents anyway.
  22. Heres an example of what I mean. The below code will show a button on the page and when you click the button a "send message" window will pop up. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <head> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script> <style type="text/css"> body { font-size: 62.5%; } label{ display:block; } textarea { margin-bottom:12px; width:95%; padding: .4em; } .ui-button { outline: 0; margin:0; padding: .4em 1em .5em; text-decoration:none; !important; cursor:pointer; position: relative; text-align: center; } .ui-dialog .ui-state-highlight, .ui-dialog .ui-state-error { padding: .3em; } </style> <script type="text/javascript"> $(function() { $("#dialog").dialog({ bgiframe: true, autoOpen: false, // height: 300, modal: true, buttons: { 'Send': function() { //some function $(this).dialog('close'); } }, Cancel: function() { $(this).dialog('close'); } }); $('#send-message').click(function() { $('#dialog').dialog('open'); }) .hover( function(){ $(this).addClass("ui-state-hover"); }, function(){ $(this).removeClass("ui-state-hover"); } ).mousedown(function(){ $(this).addClass("ui-state-active"); }) .mouseup(function(){ $(this).removeClass("ui-state-active"); }); }); </script> </head> <body> <div class="demo"> <div id="dialog"> <form> <div>Message to: somebody</div> <label for="message">Message</label> <textarea class="ui-widget-content ui-corner-all" ></textarea> </form> </div> <button id="send-message" class="ui-button ui-state-default ui-corner-all">Send A Message</button> </div> </body> </html>
  23. Well I would first try some different doctypes because im thinking that ie is going into quirks mode and thats causing you the issue. However if you cant get one that works. Maybe try <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> Seeing as your code appears correct I checked it against the A List Apart article for that code. You shouldnt have to mess with more of the CSS however if you do then you will just have to compensate by adjusting the padding of the elements with the smaller font. Also take a look at this version of that menu. http://css.maxdesign.com.au/listamatic/vertical10.htm
  24. Ok so it just seems that your ordering the results by both name and revelance which is the incorrect method of producing a list like this. Would it be possible for you to post the php and sql your using for this? Im willing to help if I can.
  25. And for the record. I dont believe your wasting anyones time. We've all been there.
×
×
  • 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.